31 lines
1.5 MiB
31 lines
1.5 MiB
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=175)}([function(t,e,n){"use strict";n.r(e),n.d(e,"contains",(function(){return i})),n.d(e,"includes",(function(){return i})),n.d(e,"difference",(function(){return a})),n.d(e,"find",(function(){return y})),n.d(e,"findIndex",(function(){return b})),n.d(e,"firstValue",(function(){return x})),n.d(e,"flatten",(function(){return w})),n.d(e,"flattenDeep",(function(){return S})),n.d(e,"getRange",(function(){return O})),n.d(e,"pull",(function(){return I})),n.d(e,"pullAt",(function(){return P})),n.d(e,"reduce",(function(){return N})),n.d(e,"remove",(function(){return j})),n.d(e,"sortBy",(function(){return L})),n.d(e,"union",(function(){return B})),n.d(e,"uniq",(function(){return R})),n.d(e,"valuesOfKey",(function(){return G})),n.d(e,"head",(function(){return F})),n.d(e,"last",(function(){return z})),n.d(e,"startsWith",(function(){return U})),n.d(e,"endsWith",(function(){return V})),n.d(e,"filter",(function(){return o})),n.d(e,"every",(function(){return W})),n.d(e,"some",(function(){return Y})),n.d(e,"group",(function(){return K})),n.d(e,"groupBy",(function(){return H})),n.d(e,"groupToMap",(function(){return q})),n.d(e,"getWrapBehavior",(function(){return Z})),n.d(e,"wrapBehavior",(function(){return $})),n.d(e,"number2color",(function(){return J})),n.d(e,"parseRadius",(function(){return tt})),n.d(e,"clamp",(function(){return et})),n.d(e,"fixedBase",(function(){return nt})),n.d(e,"isDecimal",(function(){return it})),n.d(e,"isEven",(function(){return ot})),n.d(e,"isInteger",(function(){return at})),n.d(e,"isNegative",(function(){return st})),n.d(e,"isNumberEqual",(function(){return ut})),n.d(e,"isOdd",(function(){return ct})),n.d(e,"isPositive",(function(){return lt})),n.d(e,"max",(function(){return E})),n.d(e,"maxBy",(function(){return ht})),n.d(e,"min",(function(){return M})),n.d(e,"minBy",(function(){return ft})),n.d(e,"mod",(function(){return dt})),n.d(e,"toDegree",(function(){return gt})),n.d(e,"toInteger",(function(){return vt})),n.d(e,"toRadian",(function(){return yt})),n.d(e,"forIn",(function(){return bt})),n.d(e,"has",(function(){return xt})),n.d(e,"hasKey",(function(){return wt})),n.d(e,"hasValue",(function(){return St})),n.d(e,"keys",(function(){return p})),n.d(e,"isMatch",(function(){return g})),n.d(e,"values",(function(){return _t})),n.d(e,"lowerCase",(function(){return Mt})),n.d(e,"lowerFirst",(function(){return Ot})),n.d(e,"substitute",(function(){return At})),n.d(e,"upperCase",(function(){return kt})),n.d(e,"upperFirst",(function(){return Ct})),n.d(e,"getType",(function(){return Tt})),n.d(e,"isArguments",(function(){return Pt})),n.d(e,"isArray",(function(){return h})),n.d(e,"isArrayLike",(function(){return r})),n.d(e,"isBoolean",(function(){return Nt})),n.d(e,"isDate",(function(){return jt})),n.d(e,"isError",(function(){return Dt})),n.d(e,"isFunction",(function(){return c})),n.d(e,"isFinite",(function(){return Lt})),n.d(e,"isNil",(function(){return l})),n.d(e,"isNull",(function(){return Rt})),n.d(e,"isNumber",(function(){return rt})),n.d(e,"isObject",(function(){return f})),n.d(e,"isObjectLike",(function(){return v})),n.d(e,"isPlainObject",(function(){return m})),n.d(e,"isPrototype",(function(){return Gt})),n.d(e,"isRegExp",(function(){return Ft})),n.d(e,"isString",(function(){return D})),n.d(e,"isType",(function(){return u})),n.d(e,"isUndefined",(function(){return zt})),n.d(e,"isElement",(function(){return Ut})),n.d(e,"requestAnimationFrame",(function(){return Vt})),n.d(e,"clearAnimationFrame",(function(){return Wt})),n.d(e,"augment",(function(){return Ht})),n.d(e,"clone",(function(){return Kt})),n.d(e,"debounce",(function(){return Zt})),n.d(e,"memoize",(function(){return $t})),n.d(e,"deepMix",(function(){return Jt})),n.d(e,"each",(function(){return d})),n.d(e,"extend",(function(){return te})),n.d(e,"indexOf",(function(){return ee})),n.d(e,"isEmpty",(function(){return re})),n.d(e,"isEqual",(function(){return oe})),n.d(e,"isEqualWith",(function(){return ae})),n.d(e,"map",(function(){return se})),n.d(e,"mapValues",(function(){return ce})),n.d(e,"mix",(function(){return Xt})),n.d(e,"assign",(function(){return Xt})),n.d(e,"get",(function(){return le})),n.d(e,"set",(function(){return he})),n.d(e,"pick",(function(){return de})),n.d(e,"omit",(function(){return pe})),n.d(e,"throttle",(function(){return ge})),n.d(e,"toArray",(function(){return ve})),n.d(e,"toString",(function(){return Et})),n.d(e,"uniqueId",(function(){return ye})),n.d(e,"noop",(function(){return be})),n.d(e,"identity",(function(){return xe})),n.d(e,"size",(function(){return we})),n.d(e,"measureTextWidth",(function(){return Ee})),n.d(e,"getEllipsisText",(function(){return Me})),n.d(e,"Cache",(function(){return Oe}));var r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i=function(t,e){return!!r(t)&&t.indexOf(e)>-1},o=function(t,e){if(!r(t))return t;for(var n=[],i=0;i<t.length;i++){var o=t[i];e(o,i)&&n.push(o)}return n},a=function(t,e){return void 0===e&&(e=[]),o(t,(function(t){return!i(e,t)}))},s={}.toString,u=function(t,e){return s.call(t)==="[object "+e+"]"},c=function(t){return u(t,"Function")},l=function(t){return null==t},h=function(t){return Array.isArray?Array.isArray(t):u(t,"Array")},f=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};var d=function(t,e){if(t)if(h(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(f(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break},p=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return d(t,(function(n,r){c(t)&&"prototype"===r||e.push(r)})),e};var g=function(t,e){var n=p(e),r=n.length;if(l(t))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0},v=function(t){return"object"==typeof t&&null!==t},m=function(t){if(!v(t)||!u(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var y=function(t,e){if(!h(t))return null;var n;if(c(e)&&(n=e),m(e)&&(n=function(t){return g(t,e)}),n)for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r];return null};var b=function(t,e,n){void 0===n&&(n=0);for(var r=n;r<t.length;r++)if(e(t[r],r))return r;return-1},x=function(t,e){for(var n=null,r=0;r<t.length;r++){var i=t[r][e];if(!l(i)){n=h(i)?i[0]:i;break}}return n},w=function(t){if(!h(t))return[];for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e},_=function(t,e){if(void 0===e&&(e=[]),h(t))for(var n=0;n<t.length;n+=1)_(t[n],e);else e.push(t);return e},S=_,E=function(t){if(h(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},M=function(t){if(h(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},O=function(t){var e=t.filter((function(t){return!isNaN(t)}));if(!e.length)return{min:0,max:0};if(h(t[0])){for(var n=[],r=0;r<t.length;r++)n=n.concat(t[r]);e=n}var i=E(e);return{min:M(e),max:i}},A=Array.prototype,k=A.splice,C=A.indexOf,I=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)for(var i=e[r],o=-1;(o=C.call(t,i))>-1;)k.call(t,o,1);return t},T=Array.prototype.splice,P=function(t,e){if(!r(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var o=void 0,a=e[n];n!==i&&a===o||(o=a,T.call(t,a,1))}return t},N=function(t,e,n){if(!h(t)&&!m(t))return t;var r=n;return d(t,(function(t,n){r=e(r,t,n)})),r},j=function(t,e){var n=[];if(!r(t))return n;for(var i=-1,o=[],a=t.length;++i<a;){var s=t[i];e(s,i,t)&&(n.push(s),o.push(i))}return P(t,o),n},D=function(t){return u(t,"String")};var L=function(t,e){var n;if(c(e))n=function(t,n){return e(t)-e(n)};else{var r=[];D(e)?r.push(e):h(e)&&(r=e),n=function(t,e){for(var n=0;n<r.length;n+=1){var i=r[n];if(t[i]>e[i])return 1;if(t[i]<e[i])return-1}return 0}}return t.sort(n),t};function R(t,e){void 0===e&&(e=new Map);var n=[];if(Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var o=t[r];e.has(o)||(n.push(o),e.set(o,!0))}return n}var B=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return R([].concat.apply([],t))},G=function(t,e){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i][e];if(!l(o)){h(o)||(o=[o]);for(var a=0;a<o.length;a++){var s=o[a];r[s]||(n.push(s),r[s]=!0)}}}return n};function F(t){if(r(t))return t[0]}function z(t){if(r(t)){return t[t.length-1]}}var U=function(t,e){return!(!h(t)&&!D(t))&&t[0]===e};var V=function(t,e){return!(!h(t)&&!D(t))&&t[t.length-1]===e},W=function(t,e){for(var n=0;n<t.length;n++)if(!e(t[n],n))return!1;return!0},Y=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n],n))return!0;return!1},X=Object.prototype.hasOwnProperty;var H=function(t,e){if(!e||!h(t))return{};for(var n,r={},i=c(e)?e:function(t){return t[e]},o=0;o<t.length;o++){var a=t[o];n=i(a),X.call(r,n)?r[n].push(a):r[n]=[a]}return r};function q(t,e){if(!e)return{0:t};if(!c(e)){var n=h(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,i=n.length;r<i;r++)e+=t[n[r]]&&t[n[r]].toString();return e}}return H(t,e)}var K=function(t,e){if(!e)return[t];var n=q(t,e),r=[];for(var i in n)r.push(n[i]);return r};var Z=function(t,e){return t["_wrap_"+e]};var $=function(t,e){if(t["_wrap_"+e])return t["_wrap_"+e];var n=function(n){t[e](n)};return t["_wrap_"+e]=n,n},Q={};var J=function(t){var e=Q[t];if(!e){for(var n=t.toString(16),r=n.length;r<6;r++)n="0"+n;e="#"+n,Q[t]=e}return e};var tt=function(t){var e=0,n=0,r=0,i=0;return h(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,{r1:e,r2:n,r3:r,r4:i}},et=function(t,e,n){return t<e?e:t>n?n:t},nt=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},rt=function(t){return u(t,"Number")},it=function(t){return rt(t)&&t%1!=0},ot=function(t){return rt(t)&&t%2==0},at=Number.isInteger?Number.isInteger:function(t){return rt(t)&&t%1==0},st=function(t){return rt(t)&&t<0};function ut(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}var ct=function(t){return rt(t)&&t%2!=0},lt=function(t){return rt(t)&&t>0},ht=function(t,e){if(h(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=c(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},ft=function(t,e){if(h(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=c(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},dt=function(t,e){return(t%e+e)%e},pt=180/Math.PI,gt=function(t){return pt*t},vt=parseInt,mt=Math.PI/180,yt=function(t){return mt*t},bt=d,xt=function(t,e){return t.hasOwnProperty(e)},wt=xt,_t=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return d(t,(function(n,r){c(t)&&"prototype"===r||e.push(n)})),e},St=function(t,e){return i(_t(t),e)},Et=function(t){return l(t)?"":t.toString()},Mt=function(t){return Et(t).toLowerCase()},Ot=function(t){var e=Et(t);return e.charAt(0).toLowerCase()+e.substring(1)};var At=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t},kt=function(t){return Et(t).toUpperCase()},Ct=function(t){var e=Et(t);return e.charAt(0).toUpperCase()+e.substring(1)},It={}.toString,Tt=function(t){return It.call(t).replace(/^\[object /,"").replace(/]$/,"")},Pt=function(t){return u(t,"Arguments")},Nt=function(t){return u(t,"Boolean")},jt=function(t){return u(t,"Date")},Dt=function(t){return u(t,"Error")},Lt=function(t){return rt(t)&&isFinite(t)},Rt=function(t){return null===t},Bt=Object.prototype,Gt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Bt)},Ft=function(t){return u(t,"RegExp")},zt=function(t){return void 0===t},Ut=function(t){return t instanceof Element||t instanceof HTMLDocument};function Vt(t){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)})(t)}function Wt(t){(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout)(t)}function Yt(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function Xt(t,e,n,r){return e&&Yt(t,e),n&&Yt(t,n),r&&Yt(t,r),t}var Ht=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=t[0],r=1;r<t.length;r++){var i=t[r];c(i)&&(i=i.prototype),Xt(n.prototype,i)}},qt=function(t){if("object"!=typeof t||null===t)return t;var e;if(h(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=qt(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=qt(t[i]):e[i]=t[i];return e},Kt=qt;var Zt=function(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}},$t=function(t,e){if(!c(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n};function Qt(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&m(o)?(m(t[i])||(t[i]={}),n<r?Qt(t[i],o,n+1,r):t[i]=e[i]):h(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var Jt=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)Qt(t,e[r]);return t},te=function(t,e,n,r){c(e)||(n=e,e=t,t=function(){});var i=Object.create?function(t,e){return Object.create(t,{constructor:{value:e}})}:function(t,e){function n(){}n.prototype=t;var r=new n;return r.constructor=e,r},o=i(e.prototype,t);return t.prototype=Xt(o,t.prototype),t.superclass=i(e.prototype,e),Xt(o,n),Xt(t,r),t},ee=function(t,e){if(!r(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var i=-1,o=0;o<t.length;o++)if(t[o]===e){i=o;break}return i},ne=Object.prototype.hasOwnProperty;var re=function(t){if(l(t))return!0;if(r(t))return!t.length;var e=Tt(t);if("Map"===e||"Set"===e)return!t.size;if(Gt(t))return!Object.keys(t).length;for(var n in t)if(ne.call(t,n))return!1;return!0},ie=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(D(t)||D(e))return!1;if(r(t)||r(e)){if(t.length!==e.length)return!1;for(var n=!0,i=0;i<t.length&&(n=ie(t[i],e[i]));i++);return n}if(v(t)||v(e)){var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(n=!0,i=0;i<o.length&&(n=ie(t[o[i]],e[o[i]]));i++);return n}return!1},oe=ie,ae=function(t,e,n){return c(n)?!!n(t,e):oe(t,e)},se=function(t,e){if(!r(t))return t;for(var n=[],i=0;i<t.length;i++){var o=t[i];n.push(e(o,i))}return n},ue=function(t){return t},ce=function(t,e){void 0===e&&(e=ue);var n={};return f(t)&&!l(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n},le=function(t,e,n){for(var r=0,i=D(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},he=function(t,e,n){var r=t,i=D(e)?e.split("."):e;return i.forEach((function(t,e){e<i.length-1?(f(r[t])||(r[t]=rt(i[e+1])?[]:{}),r=r[t]):r[t]=n})),t},fe=Object.prototype.hasOwnProperty,de=function(t,e){if(null===t||!m(t))return{};var n={};return d(e,(function(e){fe.call(t,e)&&(n[e]=t[e])})),n},pe=function(t,e){return N(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},ge=function(t,e,n){var r,i,o,a,s=0;n||(n={});var u=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var c=Date.now();s||!1!==n.leading||(s=c);var l=e-(c-s);return i=this,o=arguments,l<=0||l>e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,l)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c},ve=function(t){return r(t)?Array.prototype.slice.call(t):[]},me={},ye=function(t){return me[t=t||"g"]?me[t]+=1:me[t]=1,t+me[t]},be=function(){},xe=function(t){return t};function we(t){return l(t)?0:r(t)?t.length:Object.keys(t).length}var _e,Se=n(1),Ee=$t((function(t,e){void 0===e&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return _e||(_e=document.createElement("canvas").getContext("2d")),_e.font=[o,a,i,n+"px",r].join(" "),_e.measureText(D(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),Object(Se.__spreadArrays)([t],_t(e)).join("")})),Me=function(t,e,n,r){void 0===r&&(r="...");var i,o,a=Ee(r,n),s=D(t)?t:Et(t),u=e,c=[];if(Ee(t,n)<=e)return t;for(;i=s.substr(0,16),!((o=Ee(i,n))+a>u&&o>u);)if(c.push(i),u-=o,!(s=s.substr(16)))return c.join("");for(;i=s.substr(0,1),!((o=Ee(i,n))+a>u);)if(c.push(i),u-=o,!(s=s.substr(1)))return c.join("");return""+c.join("")+r},Oe=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return d})),n.d(e,"__values",(function(){return p})),n.d(e,"__read",(function(){return g})),n.d(e,"__spread",(function(){return v})),n.d(e,"__spreadArrays",(function(){return m})),n.d(e,"__spreadArray",(function(){return y})),n.d(e,"__await",(function(){return b})),n.d(e,"__asyncGenerator",(function(){return x})),n.d(e,"__asyncDelegator",(function(){return w})),n.d(e,"__asyncValues",(function(){return _})),n.d(e,"__makeTemplateObject",(function(){return S})),n.d(e,"__importStar",(function(){return M})),n.d(e,"__importDefault",(function(){return O})),n.d(e,"__classPrivateFieldGet",(function(){return A})),n.d(e,"__classPrivateFieldSet",(function(){return k}));
|
||
/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation.
|
||
|
||
Permission to use, copy, modify, and/or distribute this software for any
|
||
purpose with or without fee is hereby granted.
|
||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
PERFORMANCE OF THIS SOFTWARE.
|
||
***************************************************************************** */
|
||
var r=function(t,e){return(r=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)};function i(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}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var f=Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function d(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||f(e,t,n)}function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function v(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(g(arguments[e]));return t}function m(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function y(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function b(t){return this instanceof b?(this.v=t,this):new b(t)}function x(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof b?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(t){l(o[0][3],t)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function w(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:b(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=p(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function S(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var E=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function M(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&f(e,t,n);return E(e,t),e}function O(t){return t&&t.__esModule?t:{default:t}}function A(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function k(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return yn})),n.d(e,"e",(function(){return Rt})),n.d(e,"f",(function(){return o}));var r={};n.r(r),n.d(r,"create",(function(){return u})),n.d(r,"fromMat4",(function(){return c})),n.d(r,"clone",(function(){return l})),n.d(r,"copy",(function(){return h})),n.d(r,"fromValues",(function(){return f})),n.d(r,"set",(function(){return d})),n.d(r,"identity",(function(){return p})),n.d(r,"transpose",(function(){return g})),n.d(r,"invert",(function(){return v})),n.d(r,"adjoint",(function(){return m})),n.d(r,"determinant",(function(){return y})),n.d(r,"multiply",(function(){return b})),n.d(r,"translate",(function(){return x})),n.d(r,"rotate",(function(){return w})),n.d(r,"scale",(function(){return _})),n.d(r,"fromTranslation",(function(){return S})),n.d(r,"fromRotation",(function(){return E})),n.d(r,"fromScaling",(function(){return M})),n.d(r,"fromMat2d",(function(){return O})),n.d(r,"fromQuat",(function(){return A})),n.d(r,"normalFromMat4",(function(){return k})),n.d(r,"projection",(function(){return C})),n.d(r,"str",(function(){return I})),n.d(r,"frob",(function(){return T})),n.d(r,"add",(function(){return P})),n.d(r,"subtract",(function(){return N})),n.d(r,"multiplyScalar",(function(){return j})),n.d(r,"multiplyScalarAndAdd",(function(){return D})),n.d(r,"exactEquals",(function(){return L})),n.d(r,"equals",(function(){return R})),n.d(r,"mul",(function(){return B})),n.d(r,"sub",(function(){return G}));var i={};n.r(i),n.d(i,"create",(function(){return F})),n.d(i,"clone",(function(){return z})),n.d(i,"copy",(function(){return U})),n.d(i,"fromValues",(function(){return V})),n.d(i,"set",(function(){return W})),n.d(i,"identity",(function(){return Y})),n.d(i,"transpose",(function(){return X})),n.d(i,"invert",(function(){return H})),n.d(i,"adjoint",(function(){return q})),n.d(i,"determinant",(function(){return K})),n.d(i,"multiply",(function(){return Z})),n.d(i,"translate",(function(){return $})),n.d(i,"scale",(function(){return Q})),n.d(i,"rotate",(function(){return J})),n.d(i,"rotateX",(function(){return tt})),n.d(i,"rotateY",(function(){return et})),n.d(i,"rotateZ",(function(){return nt})),n.d(i,"fromTranslation",(function(){return rt})),n.d(i,"fromScaling",(function(){return it})),n.d(i,"fromRotation",(function(){return ot})),n.d(i,"fromXRotation",(function(){return at})),n.d(i,"fromYRotation",(function(){return st})),n.d(i,"fromZRotation",(function(){return ut})),n.d(i,"fromRotationTranslation",(function(){return ct})),n.d(i,"fromQuat2",(function(){return lt})),n.d(i,"getTranslation",(function(){return ht})),n.d(i,"getScaling",(function(){return ft})),n.d(i,"getRotation",(function(){return dt})),n.d(i,"fromRotationTranslationScale",(function(){return pt})),n.d(i,"fromRotationTranslationScaleOrigin",(function(){return gt})),n.d(i,"fromQuat",(function(){return vt})),n.d(i,"frustum",(function(){return mt})),n.d(i,"perspectiveNO",(function(){return yt})),n.d(i,"perspective",(function(){return bt})),n.d(i,"perspectiveZO",(function(){return xt})),n.d(i,"perspectiveFromFieldOfView",(function(){return wt})),n.d(i,"orthoNO",(function(){return _t})),n.d(i,"ortho",(function(){return St})),n.d(i,"orthoZO",(function(){return Et})),n.d(i,"lookAt",(function(){return Mt})),n.d(i,"targetTo",(function(){return Ot})),n.d(i,"str",(function(){return At})),n.d(i,"frob",(function(){return kt})),n.d(i,"add",(function(){return Ct})),n.d(i,"subtract",(function(){return It})),n.d(i,"multiplyScalar",(function(){return Tt})),n.d(i,"multiplyScalarAndAdd",(function(){return Pt})),n.d(i,"exactEquals",(function(){return Nt})),n.d(i,"equals",(function(){return jt})),n.d(i,"mul",(function(){return Dt})),n.d(i,"sub",(function(){return Lt}));var o={};n.r(o),n.d(o,"create",(function(){return Bt})),n.d(o,"clone",(function(){return Gt})),n.d(o,"fromValues",(function(){return Ft})),n.d(o,"copy",(function(){return zt})),n.d(o,"set",(function(){return Ut})),n.d(o,"add",(function(){return Vt})),n.d(o,"subtract",(function(){return Wt})),n.d(o,"multiply",(function(){return Yt})),n.d(o,"divide",(function(){return Xt})),n.d(o,"ceil",(function(){return Ht})),n.d(o,"floor",(function(){return qt})),n.d(o,"min",(function(){return Kt})),n.d(o,"max",(function(){return Zt})),n.d(o,"round",(function(){return $t})),n.d(o,"scale",(function(){return Qt})),n.d(o,"scaleAndAdd",(function(){return Jt})),n.d(o,"distance",(function(){return te})),n.d(o,"squaredDistance",(function(){return ee})),n.d(o,"length",(function(){return ne})),n.d(o,"squaredLength",(function(){return re})),n.d(o,"negate",(function(){return ie})),n.d(o,"inverse",(function(){return oe})),n.d(o,"normalize",(function(){return ae})),n.d(o,"dot",(function(){return se})),n.d(o,"cross",(function(){return ue})),n.d(o,"lerp",(function(){return ce})),n.d(o,"random",(function(){return le})),n.d(o,"transformMat4",(function(){return he})),n.d(o,"transformQuat",(function(){return fe})),n.d(o,"zero",(function(){return de})),n.d(o,"str",(function(){return pe})),n.d(o,"exactEquals",(function(){return ge})),n.d(o,"equals",(function(){return ve})),n.d(o,"sub",(function(){return ye})),n.d(o,"mul",(function(){return be})),n.d(o,"div",(function(){return xe})),n.d(o,"dist",(function(){return we})),n.d(o,"sqrDist",(function(){return _e})),n.d(o,"len",(function(){return Se})),n.d(o,"sqrLen",(function(){return Ee})),n.d(o,"forEach",(function(){return Me}));var a={};n.r(a),n.d(a,"create",(function(){return Oe})),n.d(a,"identity",(function(){return Ae})),n.d(a,"setAxisAngle",(function(){return ke})),n.d(a,"getAxisAngle",(function(){return Ce})),n.d(a,"getAngle",(function(){return Ie})),n.d(a,"multiply",(function(){return Te})),n.d(a,"rotateX",(function(){return Pe})),n.d(a,"rotateY",(function(){return Ne})),n.d(a,"rotateZ",(function(){return je})),n.d(a,"calculateW",(function(){return De})),n.d(a,"exp",(function(){return Le})),n.d(a,"ln",(function(){return Re})),n.d(a,"pow",(function(){return Be})),n.d(a,"slerp",(function(){return Ge})),n.d(a,"random",(function(){return Fe})),n.d(a,"invert",(function(){return ze})),n.d(a,"conjugate",(function(){return Ue})),n.d(a,"fromMat3",(function(){return Ve})),n.d(a,"fromEuler",(function(){return We})),n.d(a,"str",(function(){return Ye})),n.d(a,"clone",(function(){return Qe})),n.d(a,"fromValues",(function(){return Je})),n.d(a,"copy",(function(){return tn})),n.d(a,"set",(function(){return en})),n.d(a,"add",(function(){return nn})),n.d(a,"mul",(function(){return rn})),n.d(a,"scale",(function(){return on})),n.d(a,"dot",(function(){return an})),n.d(a,"lerp",(function(){return sn})),n.d(a,"length",(function(){return un})),n.d(a,"len",(function(){return cn})),n.d(a,"squaredLength",(function(){return ln})),n.d(a,"sqrLen",(function(){return hn})),n.d(a,"normalize",(function(){return fn})),n.d(a,"exactEquals",(function(){return dn})),n.d(a,"equals",(function(){return pn})),n.d(a,"rotationTo",(function(){return gn})),n.d(a,"sqlerp",(function(){return vn})),n.d(a,"setAxes",(function(){return mn}));var s=n(13);function u(){var t=new s.a(9);return s.a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function l(t){var e=new s.a(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function f(t,e,n,r,i,o,a,u,c){var l=new s.a(9);return l[0]=t,l[1]=e,l[2]=n,l[3]=r,l[4]=i,l[5]=o,l[6]=a,l[7]=u,l[8]=c,l}function d(t,e,n,r,i,o,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t}function p(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function g(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function v(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=l*a-s*c,f=-l*o+s*u,d=c*o-a*u,p=n*h+r*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-l*r+i*c)*p,t[2]=(s*r-i*a)*p,t[3]=f*p,t[4]=(l*n-i*u)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-c*n+r*u)*p,t[8]=(a*n-r*o)*p,t):null}function m(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8];return t[0]=a*l-s*c,t[1]=i*c-r*l,t[2]=r*s-i*a,t[3]=s*u-o*l,t[4]=n*l-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t}function y(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)}function b(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=n[0],d=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=n[6],b=n[7],x=n[8];return t[0]=f*r+d*a+p*c,t[1]=f*i+d*s+p*l,t[2]=f*o+d*u+p*h,t[3]=g*r+v*a+m*c,t[4]=g*i+v*s+m*l,t[5]=g*o+v*u+m*h,t[6]=y*r+b*a+x*c,t[7]=y*i+b*s+x*l,t[8]=y*o+b*u+x*h,t}function x(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=f*r+d*a+c,t[7]=f*i+d*s+l,t[8]=f*o+d*u+h,t}function w(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=Math.sin(n),d=Math.cos(n);return t[0]=d*r+f*a,t[1]=d*i+f*s,t[2]=d*o+f*u,t[3]=d*a-f*r,t[4]=d*s-f*i,t[5]=d*u-f*o,t[6]=c,t[7]=l,t[8]=h,t}function _(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function S(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function E(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function O(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function A(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,f=i*a,d=i*s,p=i*u,g=o*a,v=o*s,m=o*u;return t[0]=1-h-p,t[3]=l-m,t[6]=f+v,t[1]=l+m,t[4]=1-c-p,t[7]=d-g,t[2]=f-v,t[5]=d+g,t[8]=1-c-h,t}function k(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*u-i*a,x=n*c-o*a,w=r*u-i*s,_=r*c-o*s,S=i*c-o*u,E=l*g-h*p,M=l*v-f*p,O=l*m-d*p,A=h*v-f*g,k=h*m-d*g,C=f*m-d*v,I=y*C-b*k+x*A+w*O-_*M+S*E;return I?(I=1/I,t[0]=(s*C-u*k+c*A)*I,t[1]=(u*O-a*C-c*M)*I,t[2]=(a*k-s*O+c*E)*I,t[3]=(i*k-r*C-o*A)*I,t[4]=(n*C-i*O+o*M)*I,t[5]=(r*O-n*k-o*E)*I,t[6]=(g*S-v*_+m*w)*I,t[7]=(v*x-p*S-m*b)*I,t[8]=(p*_-g*x+m*y)*I,t):null}function C(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function I(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function T(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function P(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function N(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function j(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function D(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function L(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function R(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=e[0],d=e[1],p=e[2],g=e[3],v=e[4],m=e[5],y=e[6],b=e[7],x=e[8];return Math.abs(n-f)<=s.b*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-d)<=s.b*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(i-p)<=s.b*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-g)<=s.b*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-v)<=s.b*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(u-m)<=s.b*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(c-y)<=s.b*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(l-b)<=s.b*Math.max(1,Math.abs(l),Math.abs(b))&&Math.abs(h-x)<=s.b*Math.max(1,Math.abs(h),Math.abs(x))}var B=b,G=N;function F(){var t=new s.a(16);return s.a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function z(t){var e=new s.a(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function U(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function V(t,e,n,r,i,o,a,u,c,l,h,f,d,p,g,v){var m=new s.a(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=a,m[7]=u,m[8]=c,m[9]=l,m[10]=h,m[11]=f,m[12]=d,m[13]=p,m[14]=g,m[15]=v,m}function W(t,e,n,r,i,o,a,s,u,c,l,h,f,d,p,g,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=v,t}function Y(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function X(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function H(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*u-i*a,x=n*c-o*a,w=r*u-i*s,_=r*c-o*s,S=i*c-o*u,E=l*g-h*p,M=l*v-f*p,O=l*m-d*p,A=h*v-f*g,k=h*m-d*g,C=f*m-d*v,I=y*C-b*k+x*A+w*O-_*M+S*E;return I?(I=1/I,t[0]=(s*C-u*k+c*A)*I,t[1]=(i*k-r*C-o*A)*I,t[2]=(g*S-v*_+m*w)*I,t[3]=(f*_-h*S-d*w)*I,t[4]=(u*O-a*C-c*M)*I,t[5]=(n*C-i*O+o*M)*I,t[6]=(v*x-p*S-m*b)*I,t[7]=(l*S-f*x+d*b)*I,t[8]=(a*k-s*O+c*E)*I,t[9]=(r*O-n*k-o*E)*I,t[10]=(p*_-g*x+m*y)*I,t[11]=(h*x-l*_-d*y)*I,t[12]=(s*M-a*A-u*E)*I,t[13]=(n*A-r*M+i*E)*I,t[14]=(g*b-p*w-v*y)*I,t[15]=(l*w-h*b+f*y)*I,t):null}function q(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15];return t[0]=s*(f*m-d*v)-h*(u*m-c*v)+g*(u*d-c*f),t[1]=-(r*(f*m-d*v)-h*(i*m-o*v)+g*(i*d-o*f)),t[2]=r*(u*m-c*v)-s*(i*m-o*v)+g*(i*c-o*u),t[3]=-(r*(u*d-c*f)-s*(i*d-o*f)+h*(i*c-o*u)),t[4]=-(a*(f*m-d*v)-l*(u*m-c*v)+p*(u*d-c*f)),t[5]=n*(f*m-d*v)-l*(i*m-o*v)+p*(i*d-o*f),t[6]=-(n*(u*m-c*v)-a*(i*m-o*v)+p*(i*c-o*u)),t[7]=n*(u*d-c*f)-a*(i*d-o*f)+l*(i*c-o*u),t[8]=a*(h*m-d*g)-l*(s*m-c*g)+p*(s*d-c*h),t[9]=-(n*(h*m-d*g)-l*(r*m-o*g)+p*(r*d-o*h)),t[10]=n*(s*m-c*g)-a*(r*m-o*g)+p*(r*c-o*s),t[11]=-(n*(s*d-c*h)-a*(r*d-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*v-f*g)-l*(s*v-u*g)+p*(s*f-u*h)),t[13]=n*(h*v-f*g)-l*(r*v-i*g)+p*(r*f-i*h),t[14]=-(n*(s*v-u*g)-a*(r*v-i*g)+p*(r*u-i*s)),t[15]=n*(s*f-u*h)-a*(r*f-i*h)+l*(r*u-i*s),t}function K(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],v=t[15];return(e*a-n*o)*(h*v-f*g)-(e*s-r*o)*(l*v-f*p)+(e*u-i*o)*(l*g-h*p)+(n*s-r*a)*(c*v-f*d)-(n*u-i*a)*(c*g-h*d)+(r*u-i*s)*(c*p-l*d)}function Z(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=n[0],x=n[1],w=n[2],_=n[3];return t[0]=b*r+x*s+w*h+_*g,t[1]=b*i+x*u+w*f+_*v,t[2]=b*o+x*c+w*d+_*m,t[3]=b*a+x*l+w*p+_*y,b=n[4],x=n[5],w=n[6],_=n[7],t[4]=b*r+x*s+w*h+_*g,t[5]=b*i+x*u+w*f+_*v,t[6]=b*o+x*c+w*d+_*m,t[7]=b*a+x*l+w*p+_*y,b=n[8],x=n[9],w=n[10],_=n[11],t[8]=b*r+x*s+w*h+_*g,t[9]=b*i+x*u+w*f+_*v,t[10]=b*o+x*c+w*d+_*m,t[11]=b*a+x*l+w*p+_*y,b=n[12],x=n[13],w=n[14],_=n[15],t[12]=b*r+x*s+w*h+_*g,t[13]=b*i+x*u+w*f+_*v,t[14]=b*o+x*c+w*d+_*m,t[15]=b*a+x*l+w*p+_*y,t}function $(t,e,n){var r,i,o,a,s,u,c,l,h,f,d,p,g=n[0],v=n[1],m=n[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*g+s*v+h*m+e[12],t[13]=i*g+u*v+f*m+e[13],t[14]=o*g+c*v+d*m+e[14],t[15]=a*g+l*v+p*m+e[15]),t}function Q(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function J(t,e,n,r){var i,o,a,u,c,l,h,f,d,p,g,v,m,y,b,x,w,_,S,E,M,O,A,k,C=r[0],I=r[1],T=r[2],P=Math.hypot(C,I,T);return P<s.b?null:(C*=P=1/P,I*=P,T*=P,i=Math.sin(n),a=1-(o=Math.cos(n)),u=e[0],c=e[1],l=e[2],h=e[3],f=e[4],d=e[5],p=e[6],g=e[7],v=e[8],m=e[9],y=e[10],b=e[11],x=C*C*a+o,w=I*C*a+T*i,_=T*C*a-I*i,S=C*I*a-T*i,E=I*I*a+o,M=T*I*a+C*i,O=C*T*a+I*i,A=I*T*a-C*i,k=T*T*a+o,t[0]=u*x+f*w+v*_,t[1]=c*x+d*w+m*_,t[2]=l*x+p*w+y*_,t[3]=h*x+g*w+b*_,t[4]=u*S+f*E+v*M,t[5]=c*S+d*E+m*M,t[6]=l*S+p*E+y*M,t[7]=h*S+g*E+b*M,t[8]=u*O+f*A+v*k,t[9]=c*O+d*A+m*k,t[10]=l*O+p*A+y*k,t[11]=h*O+g*A+b*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function tt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function et(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function nt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t}function rt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function it(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ot(t,e,n){var r,i,o,a=n[0],u=n[1],c=n[2],l=Math.hypot(a,u,c);return l<s.b?null:(a*=l=1/l,u*=l,c*=l,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=u*a*o+c*r,t[2]=c*a*o-u*r,t[3]=0,t[4]=a*u*o-c*r,t[5]=u*u*o+i,t[6]=c*u*o+a*r,t[7]=0,t[8]=a*c*o+u*r,t[9]=u*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function at(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function st(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ut(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ct(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,f=r*c,d=i*u,p=i*c,g=o*c,v=a*s,m=a*u,y=a*c;return t[0]=1-(d+g),t[1]=h+y,t[2]=f-m,t[3]=0,t[4]=h-y,t[5]=1-(l+g),t[6]=p+v,t[7]=0,t[8]=f+m,t[9]=p-v,t[10]=1-(l+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function lt(t,e){var n=new s.a(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],u=e[4],c=e[5],l=e[6],h=e[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=2*(u*a+h*r+c*o-l*i)/f,n[1]=2*(c*a+h*i+l*r-u*o)/f,n[2]=2*(l*a+h*o+u*i-c*r)/f):(n[0]=2*(u*a+h*r+c*o-l*i),n[1]=2*(c*a+h*i+l*r-u*o),n[2]=2*(l*a+h*o+u*i-c*r)),ct(t,e,n),t}function ht(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function ft(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],c=e[9],l=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,l),t}function dt(t,e){var n=new s.a(3);ft(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,u=e[1]*i,c=e[2]*o,l=e[4]*r,h=e[5]*i,f=e[6]*o,d=e[8]*r,p=e[9]*i,g=e[10]*o,v=a+h+g,m=0;return v>0?(m=2*Math.sqrt(v+1),t[3]=.25*m,t[0]=(f-p)/m,t[1]=(d-c)/m,t[2]=(u-l)/m):a>h&&a>g?(m=2*Math.sqrt(1+a-h-g),t[3]=(f-p)/m,t[0]=.25*m,t[1]=(u+l)/m,t[2]=(d+c)/m):h>g?(m=2*Math.sqrt(1+h-a-g),t[3]=(d-c)/m,t[0]=(u+l)/m,t[1]=.25*m,t[2]=(f+p)/m):(m=2*Math.sqrt(1+g-a-h),t[3]=(u-l)/m,t[0]=(d+c)/m,t[1]=(f+p)/m,t[2]=.25*m),t}function pt(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,f=i*c,d=i*l,p=o*c,g=o*l,v=a*l,m=s*u,y=s*c,b=s*l,x=r[0],w=r[1],_=r[2];return t[0]=(1-(p+v))*x,t[1]=(f+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(f-b)*w,t[5]=(1-(h+v))*w,t[6]=(g+m)*w,t[7]=0,t[8]=(d+y)*_,t[9]=(g-m)*_,t[10]=(1-(h+p))*_,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function gt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,f=o*c,d=o*l,p=o*h,g=a*l,v=a*h,m=s*h,y=u*c,b=u*l,x=u*h,w=r[0],_=r[1],S=r[2],E=i[0],M=i[1],O=i[2],A=(1-(g+m))*w,k=(d+x)*w,C=(p-b)*w,I=(d-x)*_,T=(1-(f+m))*_,P=(v+y)*_,N=(p+b)*S,j=(v-y)*S,D=(1-(f+g))*S;return t[0]=A,t[1]=k,t[2]=C,t[3]=0,t[4]=I,t[5]=T,t[6]=P,t[7]=0,t[8]=N,t[9]=j,t[10]=D,t[11]=0,t[12]=n[0]+E-(A*E+I*M+N*O),t[13]=n[1]+M-(k*E+T*M+j*O),t[14]=n[2]+O-(C*E+P*M+D*O),t[15]=1,t}function vt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,f=i*a,d=i*s,p=i*u,g=o*a,v=o*s,m=o*u;return t[0]=1-h-p,t[1]=l+m,t[2]=f-v,t[3]=0,t[4]=l-m,t[5]=1-c-p,t[6]=d+g,t[7]=0,t[8]=f+v,t[9]=d-g,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function mt(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function yt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var bt=yt;function xt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t}function wt(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function _t(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t}var St=_t;function Et(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t}function Mt(t,e,n,r){var i,o,a,u,c,l,h,f,d,p,g=e[0],v=e[1],m=e[2],y=r[0],b=r[1],x=r[2],w=n[0],_=n[1],S=n[2];return Math.abs(g-w)<s.b&&Math.abs(v-_)<s.b&&Math.abs(m-S)<s.b?Y(t):(h=g-w,f=v-_,d=m-S,i=b*(d*=p=1/Math.hypot(h,f,d))-x*(f*=p),o=x*(h*=p)-y*d,a=y*f-b*h,(p=Math.hypot(i,o,a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),u=f*a-d*o,c=d*i-h*a,l=h*o-f*i,(p=Math.hypot(u,c,l))?(u*=p=1/p,c*=p,l*=p):(u=0,c=0,l=0),t[0]=i,t[1]=u,t[2]=h,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=d,t[11]=0,t[12]=-(i*g+o*v+a*m),t[13]=-(u*g+c*v+l*m),t[14]=-(h*g+f*v+d*m),t[15]=1,t)}function Ot(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],f=a-n[2],d=l*l+h*h+f*f;d>0&&(l*=d=1/Math.sqrt(d),h*=d,f*=d);var p=u*f-c*h,g=c*l-s*f,v=s*h-u*l;return(d=p*p+g*g+v*v)>0&&(p*=d=1/Math.sqrt(d),g*=d,v*=d),t[0]=p,t[1]=g,t[2]=v,t[3]=0,t[4]=h*v-f*g,t[5]=f*p-l*v,t[6]=l*g-h*p,t[7]=0,t[8]=l,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function At(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function kt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Ct(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function It(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Tt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function Pt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function Nt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function jt(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],p=t[11],g=t[12],v=t[13],m=t[14],y=t[15],b=e[0],x=e[1],w=e[2],_=e[3],S=e[4],E=e[5],M=e[6],O=e[7],A=e[8],k=e[9],C=e[10],I=e[11],T=e[12],P=e[13],N=e[14],j=e[15];return Math.abs(n-b)<=s.b*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(r-x)<=s.b*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-w)<=s.b*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(o-_)<=s.b*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=s.b*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(u-E)<=s.b*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-M)<=s.b*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(l-O)<=s.b*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(h-A)<=s.b*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(f-k)<=s.b*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(d-C)<=s.b*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(p-I)<=s.b*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(g-T)<=s.b*Math.max(1,Math.abs(g),Math.abs(T))&&Math.abs(v-P)<=s.b*Math.max(1,Math.abs(v),Math.abs(P))&&Math.abs(m-N)<=s.b*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(y-j)<=s.b*Math.max(1,Math.abs(y),Math.abs(j))}var Dt=Z,Lt=It,Rt=n(41);function Bt(){var t=new s.a(4);return s.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Gt(t){var e=new s.a(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function Ft(t,e,n,r){var i=new s.a(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function zt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Ut(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function Vt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function Wt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function Yt(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function Xt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function Ht(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function qt(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function Kt(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t}function Zt(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t}function $t(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function Qt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function Jt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}function te(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(n,r,i,o)}function ee(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o}function ne(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function re(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function ie(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function oe(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function ae(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function se(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function ue(t,e,n,r){var i=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],u=n[1]*r[3]-n[3]*r[1],c=n[2]*r[3]-n[3]*r[2],l=e[0],h=e[1],f=e[2],d=e[3];return t[0]=h*c-f*u+d*s,t[1]=-l*c+f*a-d*o,t[2]=l*u-h*a+d*i,t[3]=-l*s+h*o-f*i,t}function ce(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t}function le(t,e){var n,r,i,o,a,u;e=e||1;do{a=(n=2*s.c()-1)*n+(r=2*s.c()-1)*r}while(a>=1);do{u=(i=2*s.c()-1)*i+(o=2*s.c()-1)*o}while(u>=1);var c=Math.sqrt((1-a)/u);return t[0]=e*n,t[1]=e*r,t[2]=e*i*c,t[3]=e*o*c,t}function he(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function fe(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2],c=n[3],l=c*r+s*o-u*i,h=c*i+u*r-a*o,f=c*o+a*i-s*r,d=-a*r-s*i-u*o;return t[0]=l*c+d*-a+h*-u-f*-s,t[1]=h*c+d*-s+f*-a-l*-u,t[2]=f*c+d*-u+l*-s-h*-a,t[3]=e[3],t}function de(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pe(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function ge(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function ve(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],u=e[1],c=e[2],l=e[3];return Math.abs(n-a)<=s.b*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-u)<=s.b*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=s.b*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-l)<=s.b*Math.max(1,Math.abs(o),Math.abs(l))}var me,ye=Wt,be=Yt,xe=Xt,we=te,_e=ee,Se=ne,Ee=re,Me=(me=Bt(),function(t,e,n,r,i,o){var a,s;for(e||(e=4),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)me[0]=t[a],me[1]=t[a+1],me[2]=t[a+2],me[3]=t[a+3],i(me,me,o),t[a]=me[0],t[a+1]=me[1],t[a+2]=me[2],t[a+3]=me[3];return t});function Oe(){var t=new s.a(4);return s.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Ae(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function ke(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function Ce(t,e){var n=2*Math.acos(e[3]),r=Math.sin(n/2);return r>s.b?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n}function Ie(t,e){var n=an(t,e);return Math.acos(2*n*n-1)}function Te(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function Pe(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-r*s,t}function Ne(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u-o*s,t[1]=i*u+a*s,t[2]=o*u+r*s,t[3]=a*u-i*s,t}function je(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*s,t[1]=i*u-r*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function De(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t}function Le(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=n*u,t[1]=r*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function Re(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=.5*Math.log(n*n+r*r+i*i+o*o),t}function Be(t,e,n){return Re(t,e),on(t,t,n),Le(t,t),t}function Ge(t,e,n,r){var i,o,a,u,c,l=e[0],h=e[1],f=e[2],d=e[3],p=n[0],g=n[1],v=n[2],m=n[3];return(o=l*p+h*g+f*v+d*m)<0&&(o=-o,p=-p,g=-g,v=-v,m=-m),1-o>s.b?(i=Math.acos(o),a=Math.sin(i),u=Math.sin((1-r)*i)/a,c=Math.sin(r*i)/a):(u=1-r,c=r),t[0]=u*l+c*p,t[1]=u*h+c*g,t[2]=u*f+c*v,t[3]=u*d+c*m,t}function Fe(t){var e=s.c(),n=s.c(),r=s.c(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*n),t[1]=i*Math.cos(2*Math.PI*n),t[2]=o*Math.sin(2*Math.PI*r),t[3]=o*Math.cos(2*Math.PI*r),t}function ze(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function Ue(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Ve(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t}function We(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}function Ye(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Xe,He,qe,Ke,Ze,$e,Qe=Gt,Je=Ft,tn=zt,en=Ut,nn=Vt,rn=Te,on=Qt,an=se,sn=ce,un=ne,cn=un,ln=re,hn=ln,fn=ae,dn=ge,pn=ve,gn=(Xe=Rt.create(),He=Rt.fromValues(1,0,0),qe=Rt.fromValues(0,1,0),function(t,e,n){var r=Rt.dot(e,n);return r<-.999999?(Rt.cross(Xe,He,e),Rt.len(Xe)<1e-6&&Rt.cross(Xe,qe,e),Rt.normalize(Xe,Xe),ke(t,Xe,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(Rt.cross(Xe,e,n),t[0]=Xe[0],t[1]=Xe[1],t[2]=Xe[2],t[3]=1+r,fn(t,t))}),vn=(Ke=Oe(),Ze=Oe(),function(t,e,n,r,i,o){return Ge(Ke,e,i,o),Ge(Ze,n,r,o),Ge(t,Ke,Ze,2*o*(1-o)),t}),mn=($e=u(),function(t,e,n,r){return $e[0]=n[0],$e[3]=n[1],$e[6]=n[2],$e[1]=r[0],$e[4]=r[1],$e[7]=r[2],$e[2]=-e[0],$e[5]=-e[1],$e[8]=-e[2],fn(t,Ve(t,$e))}),yn=n(83)},function(t,e,n){"use strict";n.d(e,"AST_TOKEN_TYPES",(function(){return h})),n.d(e,"STORAGE_CLASS",(function(){return d})),n.d(e,"Target",(function(){return p})),n.d(e,"DefineValuePlaceholder",(function(){return v}));n(240),n(26),n(137),n(139),n(124),n(125),n(126),n(127),n(128),n(129),n(71),n(131),n(132),n(133),n(134);var r=n(123);n.d(e,"createEntity",(function(){return r.b}));var i=n(14);n.d(e,"IDENTIFIER",(function(){return i.a}));var o=n(94);n.d(e,"createWorldContainer",(function(){return o.a}));var a=n(249);n.d(e,"generateAABBFromVertices",(function(){return a.a}));var s=n(250);n.d(e,"isSafari",(function(){return s.a}));n(281);var u=n(282);n.d(e,"AABB",(function(){return u.a})),n.d(e,"Frustum",(function(){return u.b}));var c=n(117);n.o(c,"gl")&&n.d(e,"gl",(function(){return c.gl}));var l=n(262);n.o(l,"gl")&&n.d(e,"gl",(function(){return l.gl}));var h,f,d,p,g=n(263);n.o(g,"gl")&&n.d(e,"gl",(function(){return g.gl})),n.o(c,"gl")&&n.d(e,"gl",(function(){return c.gl})),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>[]"}(h||(h={})),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"}(f||(f={})),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"}(d||(d={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(p||(p={}));var v="__DefineValuePlaceholder__"},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.r(e),n.d(e,"G6GraphEvent",(function(){return Et})),n.d(e,"G6Event",(function(){return Ne})),n.d(e,"Arrow",(function(){return je})),n.d(e,"Shape",(function(){return Le})),n.d(e,"Node",(function(){return Xt})),n.d(e,"Edge",(function(){return Yt})),n.d(e,"Combo",(function(){return Ht})),n.d(e,"Hull",(function(){return ye})),n.d(e,"Marker",(function(){return De})),n.d(e,"registerNode",(function(){return Ue})),n.d(e,"registerCombo",(function(){return We})),n.d(e,"AbstractGraph",(function(){return xe})),n.d(e,"Util",(function(){return Ge})),n.d(e,"registerEdge",(function(){return Ve})),n.d(e,"registerBehavior",(function(){return Ye})),n.d(e,"AbstractLayout",(function(){return Fe})),n.d(e,"AbstractEvent",(function(){return ze})),n.d(e,"BaseGlobal",(function(){return Xe}));var r={};n.r(r),n.d(r,"compare",(function(){return m})),n.d(r,"getLineIntersect",(function(){return b})),n.d(r,"getRectIntersectByPoint",(function(){return x})),n.d(r,"getCircleIntersectByPoint",(function(){return w})),n.d(r,"getEllipseIntersectByPoint",(function(){return _})),n.d(r,"applyMatrix",(function(){return S})),n.d(r,"invertMatrix",(function(){return E})),n.d(r,"getCircleCenterByPoints",(function(){return M})),n.d(r,"distance",(function(){return O})),n.d(r,"scaleMatrix",(function(){return A})),n.d(r,"floydWarshall",(function(){return k})),n.d(r,"getAdjMatrix",(function(){return C})),n.d(r,"translate",(function(){return I})),n.d(r,"move",(function(){return T})),n.d(r,"scale",(function(){return P})),n.d(r,"rotate",(function(){return N})),n.d(r,"getDegree",(function(){return j})),n.d(r,"isPointInPolygon",(function(){return L})),n.d(r,"intersectBBox",(function(){return R})),n.d(r,"isPolygonsIntersect",(function(){return B})),n.d(r,"Line",(function(){return G})),n.d(r,"getBBoxBoundLine",(function(){return F})),n.d(r,"itemIntersectByLine",(function(){return U})),n.d(r,"fractionToLine",(function(){return V})),n.d(r,"getPointsCenter",(function(){return W})),n.d(r,"squareDist",(function(){return Y})),n.d(r,"pointLineSquareDist",(function(){return X})),n.d(r,"isPointsOverlap",(function(){return H})),n.d(r,"pointRectSquareDist",(function(){return q})),n.d(r,"pointLineDistance",(function(){return K})),n.d(r,"lerp",(function(){return Z}));var i={};n.r(i),n.d(i,"getBBox",(function(){return ct})),n.d(i,"getLoopCfgs",(function(){return lt})),n.d(i,"getLabelPosition",(function(){return ht})),n.d(i,"traverseTree",(function(){return dt})),n.d(i,"traverseTreeUp",(function(){return pt})),n.d(i,"getLetterWidth",(function(){return gt})),n.d(i,"getTextSize",(function(){return vt})),n.d(i,"plainCombosToTrees",(function(){return mt})),n.d(i,"reconstructTree",(function(){return yt})),n.d(i,"getComboBBox",(function(){return bt})),n.d(i,"shouldRefreshEdge",(function(){return xt})),n.d(i,"cloneBesidesImg",(function(){return wt}));var o={};n.r(o),n.d(o,"uniqueId",(function(){return Mt})),n.d(o,"formatPadding",(function(){return Ot})),n.d(o,"cloneEvent",(function(){return At})),n.d(o,"isViewportChanged",(function(){return kt})),n.d(o,"isNaN",(function(){return Ct})),n.d(o,"calculationItemsBBox",(function(){return It})),n.d(o,"processParallelEdges",(function(){return Tt}));var a={};n.r(a),n.d(a,"getSpline",(function(){return Jt})),n.d(a,"getControlPoint",(function(){return te})),n.d(a,"pointsToPolygon",(function(){return ee})),n.d(a,"pathToPoints",(function(){return ne})),n.d(a,"getClosedSpline",(function(){return re})),n.d(a,"roundedHull",(function(){return se})),n.d(a,"paddedHull",(function(){return ue}));var s={};n.r(s),n.d(s,"defaultSubjectColors",(function(){return Re}));var u=n(0),c={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(t){return Object.assign(this,t),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(t){var e=this,n=this.events;this.graph=t,"drag-canvas"!==this.type&&"brush-select"!==this.type&&"lasso-select"!==this.type||t.get("canvas").set("draggable",!0),Object(u.each)(n,(function(e,n){t.on(n,e)})),document.addEventListener("visibilitychange",(function(){e.keydown=!1}))},unbind:function(t){var e=this.events,n=t.get("canvas").get("draggable");"drag-canvas"!==this.type&&"brush-select"!==this.type&&"lasso-select"!==this.type||t.get("canvas").set("draggable",!1),Object(u.each)(e,(function(e,n){t.off(n,e)})),t.get("canvas").set("draggable",n)},get:function(t){return this[t]},set:function(t,e){return this[t]=e,this}},l=function(){function t(){}return t.registerBehavior=function(e,n){if(!n)throw new Error("please specify handler for this behavior: "+e);var r=Object(u.clone)(c);Object.assign(r,n);var i=function(t){var e=this;Object.assign(this,this.getDefaultCfg(),t);var n=this.getEvents();this.events=null;var r={};n&&(Object(u.each)(n,(function(t,n){r[n]=Object(u.wrapBehavior)(e,t)})),this.events=r)};i.prototype=r,t.types[e]=i},t.hasBehavior=function(e){return!!t.types[e]},t.getBehavior=function(e){return t.types[e]},t.types={},t}(),h=l,f=n(1),d=n(140),p=n(15),g=n(59),v=p.ext.transform,m=function(t){return function(e,n){return e[t]-n[t]}},y=function(t,e,n){return t>=e&&t<=n},b=function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=e.x-t.x,s=e.y-t.y,u=r.x-n.x,c=r.y-n.y,l=a*c-s*u,h=1/l;if(l*l>1e-4*(a*a+s*s)*(u*u+c*c)){var f=(i*c-o*u)*h,d=(i*s-o*a)*h;return y(f,0,1)&&y(d,0,1)?{x:t.x+f*a,y:t.y+f*s}:null}return null},x=function(t,e){var n=t.x,r=t.y,i=t.width,o=t.height,a=[],s={x:n+i/2,y:r+o/2};a.push({x:n,y:r}),a.push({x:n+i,y:r}),a.push({x:n+i,y:r+o}),a.push({x:n,y:r+o}),a.push({x:n,y:r});for(var u=null,c=1;c<a.length&&!(u=b(a[c-1],a[c],s,e));c++);return u},w=function(t,e){var n=t.x,r=t.y,i=t.r,o=e.x-n,a=e.y-r;if(o*o+a*a<i*i)return null;var s=Math.atan(a/o);return{x:n+Math.abs(i*Math.cos(s))*Math.sign(o),y:r+Math.abs(i*Math.sin(s))*Math.sign(a)}},_=function(t,e){var n=t.rx,r=t.ry,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=Math.atan2(s/r,a/n);return u<0&&(u+=2*Math.PI),{x:i+n*Math.cos(u),y:o+r*Math.sin(u)}},S=function(t,e,n){void 0===n&&(n=1);var r=[t.x,t.y,n];return e&&!isNaN(e[0])||(e=[1,0,0,0,1,0,0,0,1]),p.vec3.transformMat3(r,r,e),{x:r[0],y:r[1]}},E=function(t,e,n){void 0===n&&(n=1),e&&!isNaN(e[0])||(e=[1,0,0,0,1,0,0,0,1]);var r=p.mat3.invert([1,0,0,0,1,0,0,0,1],e);r||(r=[1,0,0,0,1,0,0,0,1]);var i=[t.x,t.y,n];return p.vec3.transformMat3(i,i,r),{x:i[0],y:i[1]}},M=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=t.x-n.x,a=t.y-n.y,s=(t.x*t.x-e.x*e.x-e.y*e.y+t.y*t.y)/2,u=(t.x*t.x-n.x*n.x-n.y*n.y+t.y*t.y)/2,c=i*o-r*a;return{x:-(a*s-i*u)/c,y:-(r*u-o*s)/c}},O=function(t,e){var n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)},A=function(t,e){var n=[];return t.forEach((function(t){var r=[];t.forEach((function(t){r.push(t*e)})),n.push(r)})),n},k=function(t){for(var e=[],n=t.length,r=0;r<n;r+=1){e[r]=[];for(var i=0;i<n;i+=1)r===i?e[r][i]=0:0!==t[r][i]&&t[r][i]?e[r][i]=t[r][i]:e[r][i]=1/0}for(var o=0;o<n;o+=1)for(r=0;r<n;r+=1)for(i=0;i<n;i+=1)e[r][i]>e[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e},C=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];i[a][s]=1,e||(i[s][a]=1)})),i},I=function(t,e){t.translate(e.x,e.y)},T=function(t,e,n,r){void 0===r&&(r={duration:500});var i=t.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var o=t.getCanvasBBox(),a=e.x-o.minX,s=e.y-o.minY;if(n){var u=a*i[0],c=s*i[4],l=0,h=0,f=0,d=0;t.animate((function(t){return i=v(i,[["t",(f=u*t)-l,(d=c*t)-h]]),l=f,h=d,{matrix:i}}),r)}else{var p=v(i,[["t",a,s]]);t.setMatrix(p)}},P=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=e;Object(u.isArray)(e)||(r=[e,e]),Object(u.isArray)(e)&&1===e.length&&(r=[e[0],e[0]]),n=v(n,[["s",r[0],r[1]]]),t.setMatrix(n)},N=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=v(n,[["r",e]]),t.setMatrix(n)},j=function(t,e,n){for(var r=[],i=0;i<t;i++)r[i]=0;return n.forEach((function(t){t.source&&(r[e[t.source]]+=1),t.target&&(r[e[t.target]]+=1)})),r};function D(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}var L=function(t,e,n){var r=!1,i=t.length;function o(t){return Math.abs(t)<1e-6?0:t<0?-1:1}if(i<=2)return!1;for(var a=0;a<i;a++){var s=t[a],u=t[(a+1)%i];if(D(s,u,[e,n]))return!0;o(s[1]-n)>0!=o(u[1]-n)>0&&o(e-(n-s[1])*(s[0]-u[0])/(s[1]-u[1])-s[0])<0&&(r=!r)}return r},R=function(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)},B=function(t,e){var n=function(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]}));return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,n),maxY:Math.max.apply(null,n)}},r=function(t){for(var e=[],n=t.length,r=0;r<n-1;r++){var i=t[r],o=t[r+1];e.push({from:{x:i[0],y:i[1]},to:{x:o[0],y:o[1]}})}if(e.length>1){var a=t[0],s=t[n-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e};if(t.length<2||e.length<2)return!1;var i=n(t),o=n(e);if(!R(i,o))return!1;var a=!1;if(Object(u.each)(e,(function(e){if(L(t,e[0],e[1]))return a=!0,!1})),a)return!0;if(Object(u.each)(t,(function(t){if(L(e,t[0],t[1]))return a=!0,!1})),a)return!0;var s=r(t),c=r(e),l=!1;return Object(u.each)(c,(function(t){if(function(t,e){var n=!1;return Object(u.each)(t,(function(t){if(b(t.from,t.to,e.from,e.to))return n=!0,!1})),n}(s,t))return l=!0,!1})),l},G=function(){function t(t,e,n,r){this.x1=t,this.y1=e,this.x2=n,this.y2=r}return t.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),r=Math.max(this.y1,this.y2);return{x:t,y:e,minX:t,minY:e,maxX:n,maxY:r,width:n-t,height:r-e}},t}(),F=function(t,e){return{top:[t.minX,t.minY,t.maxX,t.minY],left:[t.minX,t.minY,t.minX,t.maxY],bottom:[t.minX,t.maxY,t.maxX,t.maxY],right:[t.maxX,t.minY,t.maxX,t.maxY]}[e]},z=function(t,e){var n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),r=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),i=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(i){var o=n/i,a=r/i;if(o>=0&&o<=1&&a>=0&&a<=1)return o}return Number.POSITIVE_INFINITY},U=function(t,e){for(var n=["top","left","bottom","right"],r=t.getBBox(),i=0,o=[],a=0;a<4;a++){var s=F(r,n[a]),u=s[0],c=s[1],l=s[2],h=s[3];o[a]=b({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:u,y:c},{x:l,y:h}),o[a]&&(i+=1)}return[o,i]},V=function(t,e){for(var n=["top","left","bottom","right"],r=t.getBBox(),i=Number.POSITIVE_INFINITY,o=0,a=0;a<4;a++){var s=F(r,n[a]),u=s[0],c=s[1],l=s[2],h=s[3],f=z(e,new G(u,c,l,h));(f=Math.abs(f-.5))>=0&&f<=1&&(o+=1,i=f<i?f:i)}return 0===o?-1:i},W=function(t){var e=0,n=0;if(t.length>0){for(var r=0,i=t;r<i.length;r++){var o=i[r];e+=o.x,n+=o.y}e/=t.length,n/=t.length}return{x:e,y:n}},Y=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},X=function(t,e){var n,r=e.x1,i=e.y1,o=e.x2-r,a=e.y2-i,s=t.x-r,u=t.y-i,c=s*o+u*a;n=c<=0||(c=(s=o-s)*o+(u=a-u)*a)<=0?0:c*c/(o*o+a*a);var l=s*s+u*u-n;return l<0&&(l=0),l},H=function(t,e,n){return void 0===n&&(n=.001),Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(n,2)},q=function(t,e){var n=t.x<e.x,r=t.x>e.x+e.width,i=t.y>e.y+e.height,o=t.y<e.y;if(!(n||r||i||o))return 0;if(i&&!n&&!r)return Math.pow(e.y+e.height-t.y,2);if(o&&!n&&!r)return Math.pow(t.y-e.y,2);if(n&&!i&&!o)return Math.pow(e.x-t.x,2);if(r&&!i&&!o)return Math.pow(e.x+e.width-t.x,2);var a=Math.min(Math.abs(e.x-t.x),Math.abs(e.x+e.width-t.x)),s=Math.min(Math.abs(e.y-t.y),Math.abs(e.y+e.height-t.y));return a*a+s*s},K=function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e.x,s=e.y,u=[i-n,o-r];if(p.vec2.exactEquals(u,[0,0]))return NaN;var c=[-u[1],u[0]];p.vec2.normalize(c,c);var l=[a-n,s-r];return Math.abs(p.vec2.dot(l,c))},Z=function(t,e,n){return t+(e-t)*n},$="rgb(95, 149, 255)",Q="rgb(253, 253, 253)",J="rgb(247, 250, 255)",tt="rgb(224, 224, 224)",et="rgb(224, 224, 224)",nt={version:"0.5.0",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:$,fill:"rgb(239, 244, 255)"},size:20,color:$,linkPoints:{size:8,lineWidth:1,fill:J,stroke:$}},nodeStateStyles:{active:{fill:J,stroke:$,lineWidth:2,shadowColor:$,shadowBlur:10},selected:{fill:"rgb(255, 255, 255)",stroke:$,lineWidth:4,shadowColor:$,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:"rgb(223, 234, 255)",stroke:"#4572d9",lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:"rgb(247, 250, 255)",stroke:"rgb(191, 213, 255)",lineWidth:1},disable:{fill:"rgb(250, 250, 250)",stroke:"rgb(224, 224, 224)",lineWidth:1}},edgeLabel:{style:{fill:"rgb(0, 0, 0)",textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:tt,lineAppendWidth:2},color:tt},edgeStateStyles:{active:{stroke:$,lineWidth:1},selected:{stroke:$,lineWidth:2,shadowColor:$,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:$,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:"rgb(234, 234, 234)",lineWidth:1},disable:{stroke:"rgb(245, 245, 245)",lineWidth:1}},comboLabel:{style:{fill:"rgb(0, 0, 0)",textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:Q,lineWidth:1,stroke:et,r:5,width:20,height:10},size:[20,5],color:et,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:$,lineWidth:1,fill:"rgb(247, 250, 255)"},selected:{stroke:$,lineWidth:2,fill:Q,shadowColor:$,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:"#4572d9",lineWidth:2,fill:Q,"text-shape":{fontWeight:500}},inactive:{stroke:"rgb(224, 224, 224)",fill:Q,lineWidth:1},disable:{stroke:"rgb(234, 234, 234)",fill:"rgb(250, 250, 250)",lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:"undefined"!=typeof window&&window.getComputedStyle&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},rt={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,0:.6,1:.40099945068359377,2:.6,3:.6,4:.6,5:.6,6:.6,7:.5469985961914062,8:.6,9:.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875},it=Math.PI,ot=Math.sin,at=Math.cos,st=ot(it/8),ut=at(it/8),ct=function(t,e){var n=t.getBBox(),r={x:n.minX,y:n.minY},i={x:n.maxX,y:n.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),r=S(r,o),i=S(i,o)}var a=r.x,s=r.y,u=i.x,c=i.y;return{x:a,y:s,minX:a,minY:s,maxX:u,maxY:c,width:u-a,height:c-s}},lt=function(t){var e=t.sourceNode||t.targetNode,n=e.get("group").getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=e.getKeyShape().getBBox(),i=t.loopCfg||{},o=i.dist||2*Math.max(r.width,r.height),a=i.position||nt.defaultLoopPosition,s=[n[6],n[7]],u=[t.startPoint.x,t.startPoint.y],c=[t.endPoint.x,t.endPoint.y],l=r.height/2,h=r.height/2,f=l*st,d=l*ut,g=h*st,v=h*ut;if(u[0]===c[0]&&u[1]===c[1]){switch(a){case"top":u=[s[0]-f,s[1]-d],c=[s[0]+g,s[1]-v];break;case"top-right":l=r.height/2,h=r.width/2,u=[s[0]+(f=l*st),s[1]-(d=l*ut)],c=[s[0]+(v=h*ut),s[1]-(g=h*st)];break;case"right":l=r.width/2,h=r.width/2,u=[s[0]+(d=l*ut),s[1]-(f=l*st)],c=[s[0]+(v=h*ut),s[1]+(g=h*st)];break;case"bottom-right":l=r.width/2,h=r.height/2,u=[s[0]+(d=l*ut),s[1]+(f=l*st)],c=[s[0]+(g=h*st),s[1]+(v=h*ut)];break;case"bottom":l=r.height/2,h=r.height/2,u=[s[0]+(f=l*st),s[1]+(d=l*ut)],c=[s[0]-(g=h*st),s[1]+(v=h*ut)];break;case"bottom-left":l=r.height/2,h=r.width/2,u=[s[0]-(f=l*st),s[1]+(d=l*ut)],c=[s[0]-(v=h*ut),s[1]+(g=h*st)];break;case"left":l=r.width/2,h=r.width/2,u=[s[0]-(d=l*ut),s[1]+(f=l*st)],c=[s[0]-(v=h*ut),s[1]-(g=h*st)];break;case"top-left":l=r.width/2,h=r.height/2,u=[s[0]-(d=l*ut),s[1]-(f=l*st)],c=[s[0]-(g=h*st),s[1]-(v=h*ut)];break;default:l=r.width/2,h=r.width/2,u=[s[0]-(f=l*st),s[1]-(d=l*ut)],c=[s[0]+(g=h*st),s[1]-(v=h*ut)]}if(!1===i.clockwise){var m=[u[0],u[1]];u=[c[0],c[1]],c=[m[0],m[1]]}}var y=[u[0]-s[0],u[1]-s[1]],b=(l+o)/l,x=(h+o)/h;!1===i.clockwise&&(b=(h+o)/h,x=(l+o)/l);var w=p.vec2.scale([0,0],y,b),_=[s[0]+w[0],s[1]+w[1]],S=[c[0]-s[0],c[1]-s[1]],E=p.vec2.scale([0,0],S,x),M=[s[0]+E[0],s[1]+E[1]];return t.startPoint={x:u[0],y:u[1]},t.endPoint={x:c[0],y:c[1]},t.controlPoints=[{x:_[0],y:_[1]},{x:M[0],y:M[1]}],t},ht=function(t,e,n,r,i){var o=[],a=null==t?void 0:t.getPoint(e);if(!a)return{x:0,y:0,angle:0};if(e<1e-4)o=t.getStartTangent().reverse();else if(e>.9999)o=t.getEndTangent();else{var s=null==t?void 0:t.getPoint(e+1e-4);o.push([a.x,a.y]),o.push([s.x,s.y])}var u=Math.atan2(o[1][1]-o[0][1],o[1][0]-o[0][0]);if(u<0&&(u+=2*it),n&&(a.x+=at(u)*n,a.y+=ot(u)*n),r){var c=u-it/2;u>.5*it&&u<1.5*it&&(c-=it),a.x+=at(c)*r,a.y+=ot(c)*r}var l={x:a.x,y:a.y,angle:u};return i?(u>.5*it&&u<1.5*it&&(u-=it),Object(f.__assign)({rotate:u},l)):l},ft=function t(e,n){if(!1===n(e))return!1;if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return!1;return!0},dt=function(t,e){"function"==typeof e&&ft(t,e)},pt=function(t,e){"function"==typeof e&&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!1!==n(e)}(t,e)},gt=function(t,e){return e*(rt[t]||1)},vt=function(t,e){var n=0,r=new RegExp("[一-龥]+");return t.split("").forEach((function(t){r.test(t)?n+=e:n+=gt(t,e)})),[n,e]},mt=function(t,e){var n=[],r={},i={};t.forEach((function(t){i[t.id]=t})),t.forEach((function(t,e){var o=Object(u.clone)(t);o.itemType="combo",o.children=void 0,o.parentId===o.id?(console.warn("The parentId for combo "+o.id+" can not be the same as the combo's id"),delete o.parentId):o.parentId&&!i[o.parentId]&&(console.warn("The parent combo for combo "+o.id+" does not exist!"),delete o.parentId);var a=r[o.id];if(a){if(o.children=a.children,r[o.id]=o,!(a=o).parentId)return void n.push(a);var s=r[a.parentId];if(s)s.children?s.children.push(o):s.children=[o];else{var c={id:a.parentId,children:[a]};r[a.parentId]=c,r[o.id]=o}}else if(Object(u.isString)(t.parentId)){var l=r[t.parentId];if(l)l.children?l.children.push(o):l.children=[o],r[o.id]=o;else{var h={id:t.parentId,children:[o]};r[h.id]=h,r[o.id]=o}}else n.push(o),r[o.id]=o}));var o={};(e||[]).forEach((function(t){o[t.id]=t;var e=r[t.comboId];if(e){var n={id:t.id,comboId:t.comboId};e.children?e.children.push(n):e.children=[n],n.itemType="node",r[t.id]=n}}));var a=0;return n.forEach((function(t){t.depth=a+10,ft(t,(function(t){var e,n=r[t.id].itemType;e="node"===n?r[t.comboId]:r[t.parentId],t.depth=e&&"node"===n?a+1:a+10,a<t.depth&&(a=t.depth);var i=o[t.id];return i&&(i.depth=t.depth),!0}))})),n},yt=function(t,e,n){var r,i=t,o={root:{children:t}},a=!1,s="root";(t||[]).forEach((function(t){if(!a)return t.id===e?(r=t,"combo"===t.itemType?r.parentId=n:r.comboId=n,void(a=!0)):void dt(t,(function(t){return o[t.id]={children:t.children},i=o[t.parentId||t.comboId||"root"].children,!t||!t.removed&&e!==t.id||!i||(s=t.parentId||t.comboId||"root",r=t,"combo"===t.itemType?r.parentId=n:r.comboId=n,a=!0,!1)}))}));var u=(i=o[s].children)?i.indexOf(r):-1;if(u>-1&&i.splice(u,1),a||(r={id:e,itemType:"node",comboId:n},o[e]={children:void 0}),e){var c=!1;if(n){var l=0;(t||[]).forEach((function(t){c||dt(t,(function(t){return n!==t.id||(c=!0,t.children?t.children.push(r):t.children=[r],l=t.depth,"node"===r.itemType?r.depth=l+2:r.depth=l+1,!1)}))}))}else n&&c||"node"===r.itemType||t.push(r);var h=r.depth;dt(r,(function(t){return"node"===t.itemType?h+=2:h+=1,t.depth=h,!0}))}return t},bt=function(t,e){var n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};return t&&0!==t.length?(t.forEach((function(t){var r=e.findById(t.id);if(r&&r.isVisible()){r.set("bboxCanvasCache",void 0);var i=r.getCanvasBBox();i.x&&n.minX>i.minX&&(n.minX=i.minX),i.y&&n.minY>i.minY&&(n.minY=i.minY),i.x&&n.maxX<i.maxX&&(n.maxX=i.maxX),i.y&&n.maxY<i.maxY&&(n.maxY=i.maxY)}})),n.x=(n.minX+n.maxX)/2,n.y=(n.minY+n.maxY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,Object.keys(n).forEach((function(t){n[t]!==1/0&&n[t]!==-1/0||(n[t]=void 0)})),n):n},xt=function(t){var e=Object(u.isNumber)(t.x)||Object(u.isNumber)(t.y)||t.type||t.anchorPoints||t.size;return t.style&&(e=e||Object(u.isNumber)(t.style.r)||Object(u.isNumber)(t.style.width)||Object(u.isNumber)(t.style.height)||Object(u.isNumber)(t.style.rx)||Object(u.isNumber)(t.style.ry)),e},wt=function(t){var e={};return Object.keys(t).forEach((function(n){var r=t[n];if(Object(u.isObject)(r)&&!Object(u.isArray)(r)){var i={};Object.keys(r).forEach((function(t){var e=r[t];("img"!==t||Object(u.isString)(e))&&(i[t]=Object(u.clone)(e))})),e[n]=i}else e[n]=Object(u.clone)(r)})),e},_t=function(t){var e;if(!t)return console.error("G6 Error Tips: the data must be defined"),!1;var n=t.nodes,r=t.edges,i=t.combos,o=void 0===i?[]:i;if(!n&&!r){var a=!0;return dt(t,(function(t){return!!Object(u.isString)(t.id)||(a=!1,!1)})),a}var s=(n||[]).find((function(t){return!Object(u.isString)(t.id)}));if(s)return console.warn("G6 Warning Tips: missing 'id' property, or %c"+s.id+"%c is not a string.","font-size: 20px; color: red;",""),!1;var c=(n||[]).map((function(t){return t.id})),l=null===(e=o)||void 0===e?void 0:e.map((function(t){return t.id})),h=Object(f.__spreadArray)(Object(f.__spreadArray)([],c,!0),l,!0),d=(r||[]).find((function(t){return!h.includes(t.source)||!h.includes(t.target)}));return!d||(console.warn("G6 Warning Tips: The source %c"+d.source+"%c or the target %c"+d.target+"%c of the edge do not exist in the nodes or combos.","font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1)},St=function(){function t(t){this.graph=t,this.destroyed=!1,this.modes=t.get("modes")||{default:[]},this.formatModes(),this.mode=t.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return t.prototype.formatModes=function(){var t=this.modes;Object(u.each)(t,(function(t){Object(u.each)(t,(function(e,n){Object(u.isString)(e)&&(t[n]={type:e})}))}))},t.prototype.setBehaviors=function(t){var e,n=this.graph,r=this.modes[t],i=[];Object(u.each)(r||[],(function(t){var r=l.getBehavior(t.type||t);r&&(e=new r(t))&&(e.bind(n),i.push(e))})),this.currentBehaves=i},t.mergeBehaviors=function(t,e){return Object(u.each)(e,(function(e){t.indexOf(e)<0&&(Object(u.isString)(e)&&(e={type:e}),t.push(e))})),t},t.filterBehaviors=function(t,e){var n=[];return t.forEach((function(t){var r="";r=Object(u.isString)(t)?t:t.type,e.indexOf(r)<0&&n.push(t)})),n},t.prototype.setMode=function(t){var e=this.modes,n=this.graph,r=t;e[r]&&(n.emit("beforemodechange",{mode:t}),Object(u.each)(this.currentBehaves,(function(t){t.delegate&&t.delegate.remove(),t.unbind(n)})),this.setBehaviors(r),n.emit("aftermodechange",{mode:t}),this.mode=t)},t.prototype.getMode=function(){return this.mode},t.prototype.manipulateBehaviors=function(e,n,r){var i,o=this;if(i=Object(u.isArray)(e)?e:[e],Object(u.isArray)(n))return Object(u.each)(n,(function(e){o.modes[e]?o.modes[e]=r?t.mergeBehaviors(o.modes[e]||[],i):t.filterBehaviors(o.modes[e]||[],i):r&&(o.modes[e]=i)})),this;var a=n;return n||(a=this.mode),this.modes[a]||r&&(this.modes[a]=i),this.modes[a]=r?t.mergeBehaviors(this.modes[a]||[],i):t.filterBehaviors(this.modes[a]||[],i),this.formatModes(),this.setMode(this.mode),this},t.prototype.updateBehavior=function(t,e,n){Object(u.isString)(t)&&(t={type:t});var r=[];if(n&&n!==this.mode&&"default"!==n){if(!(r=this.modes[n])||!r.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;var i=r.length;for(a=0;a<i;a++){if((s=r[a]).type===t.type||s===t.type)return s===t.type&&(s={type:s}),Object.assign(s,e),r[a]=s,this;a===i-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(!(r=this.currentBehaves)||!r.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var o=r.length,a=0;a<o;a++){var s;if((s=r[a]).type===t.type)return s.updateCfg(e),this;a===o-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},t.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},t}(),Et=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.item=n.item,r.canvasX=n.canvasX,r.canvasY=n.canvasY,r.wheelDelta=n.wheelDelta,r.detail=n.detail,r}return Object(f.__extends)(e,t),e}(n(22).Event),Mt=function(t){return t+"-"+Math.random()+Date.now()},Ot=function(t){if(Object(u.isArray)(t))switch(t.length){case 4:return t;case 3:return t.push(t[1]),t;case 2:return t.concat(t);case 1:return[t[0],t[0],t[0],t[0]];default:return[0,0,0,0]}if(Object(u.isNumber)(t))return[t,t,t,t];if(Object(u.isString)(t)){var e=parseInt(t,10);return[e,e,e,e]}return[0,0,0,0]},At=function(t){var e=new Et(t.type,t);return e.clientX=t.clientX,e.clientY=t.clientY,e.x=t.x,e.y=t.y,e.target=t.target,e.currentTarget=t.currentTarget,e.bubbles=!0,e.item=t.item,e},kt=function(t){if(!t)return!1;for(var e=[1,0,0,0,1,0,0,0,1],n=0;n<9;n++)if(t[n]!==e[n])return!0;return!1},Ct=function(t){return Number.isNaN(Number(t))},It=function(t){for(var e=1/0,n=-1/0,r=1/0,i=-1/0,o=0;o<t.length;o++){var a=t[o].getBBox(),s=a.minX,u=a.minY,c=a.maxX,l=a.maxY;s<e&&(e=s),u<r&&(r=u),c>n&&(n=c),l>i&&(i=l)}return{x:Math.floor(e),y:Math.floor(r),width:Math.ceil(n)-Math.floor(e),height:Math.ceil(i)-Math.floor(r),minX:e,minY:r,maxX:n,maxY:i}},Tt=function(t,e,n,r,i){void 0===e&&(e=15),void 0===n&&(n="quadratic"),void 0===r&&(r=void 0),void 0===i&&(i=void 0);for(var o=t.length,a=2*e,s=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],u={},c=[],l={},h=0;h<o;h++){var f=t[h],d=f.source,p=f.target,g=d+"-"+p;if(!c[h]){u[g]||(u[g]=[]),c[h]=!0,u[g].push(f);for(var v=0;v<o;v++)if(h!==v){var m=t[v],y=m.source,b=m.target;c[v]||(d===b&&p===y?(u[g].push(m),c[v]=!0,l[y+"|"+b+"|"+(u[g].length-1)]=!0):d===y&&p===b&&(u[g].push(m),c[v]=!0))}}}for(var x in u)for(var w=u[x],_=w.length,S=0;S<_;S++){var E=w[S];if(E.source!==E.target)if(1===_&&r&&E.source!==E.target)E.type=r;else{E.type=n;var M=(S%2==0?1:-1)*(l[E.source+"|"+E.target+"|"+S]?-1:1);E.curveOffset=_%2==1?M*Math.ceil(S/2)*a:M*(Math.floor(S/2)*a+e)}else i&&(E.type=i),E.loopCfg={position:s[S%8],dist:20*Math.floor(S/8)+50}}return t},Pt=function(){function t(t){this.destroyed=!1,this.graph=t,this.destroyed=!1}return t.prototype.getViewCenter=function(){var t=this.getFormatPadding(),e=this.graph,n=this.graph.get("width"),r=e.get("height");return{x:(n-t[1]-t[3])/2+t[3],y:(r-t[0]-t[2])/2+t[0]}},t.prototype.fitCenter=function(){var t=this.graph,e=t.get("group");e.resetMatrix();var n=e.getCanvasBBox();if(0!==n.width&&0!==n.height){var r=this.getViewCenter(),i=n.x+n.width/2,o=n.y+n.height/2;t.translate(r.x-i,r.y-o)}},t.prototype.fitView=function(){var t=this.graph,e=this.getFormatPadding(),n=t.get("width"),r=t.get("height"),i=t.get("group");i.resetMatrix();var o=i.getCanvasBBox();if(0!==o.width&&0!==o.height){var a=this.getViewCenter(),s=o.x+o.width/2,u=o.y+o.height/2;t.translate(a.x-s,a.y-u);var c=(n-e[1]-e[3])/o.width,l=(r-e[0]-e[2])/o.height,h=c;c>l&&(h=l),t.zoom(h,a)||console.warn("zoom failed, ratio out of range, ratio: %f",h)}},t.prototype.fitViewByRules=function(t){var e=t.onlyOutOfViewPort,n=void 0!==e&&e,r=t.direction,i=void 0===r?"both":r,o=t.ratioRule,a=void 0===o?"min":o,s=this.graph,u=this.getFormatPadding(),c=s.get("width"),l=s.get("height"),h=s.get("group");h.resetMatrix();var f=h.getCanvasBBox();if(0!==f.width&&0!==f.height){var d=this.getViewCenter(),p=f.x+f.width/2,g=f.y+f.height/2;s.translate(d.x-p,d.y-g);var v,m=(c-u[1]-u[3])/f.width,y=(l-u[0]-u[2])/f.height;v="x"===i?m:"y"===i?y:"max"===a?Math.max(m,y):Math.min(m,y),n&&(v=v<1?v:1);var b=s.getZoom()*v,x=s.get("minZoom");b<x&&(b=x,console.warn("fitview failed, ratio out of range, ratio: %f",v,"graph minzoom has been used instead")),s.zoomTo(b,d)}},t.prototype.getFormatPadding=function(){var t=this.graph.get("fitViewPadding");return Ot(t)},t.prototype.focusPoint=function(t,e,n){var r=this,i=this.getViewCenter(),o=this.getPointByCanvas(i.x,i.y),a=this.graph.get("group").getMatrix();if(a||(a=[1,0,0,0,1,0,0,0,1]),e){var s=(o.x-t.x)*a[0],u=(o.y-t.y)*a[4],c=0,l=0,h=0,d=0;this.graph.get("canvas").animate((function(t){h=s*t,d=u*t,r.graph.translate(h-c,d-l),c=h,l=d}),Object(f.__assign)({},n))}else this.graph.translate((o.x-t.x)*a[0],(o.y-t.y)*a[4])},t.prototype.getPointByCanvas=function(t,e){var n=this.graph.get("group").getMatrix();return n||(n=[1,0,0,0,1,0,0,0,1]),E({x:t,y:e},n)},t.prototype.getPointByClient=function(t,e){var n=this.graph.get("canvas").getPointByClient(t,e);return this.getPointByCanvas(n.x,n.y)},t.prototype.getClientByPoint=function(t,e){var n=this.graph.get("canvas"),r=this.getCanvasByPoint(t,e),i=n.getClientByPoint(r.x,r.y);return{x:i.x,y:i.y}},t.prototype.getCanvasByPoint=function(t,e){var n=this.graph.get("group").getMatrix();return n||(n=[1,0,0,0,1,0,0,0,1]),S({x:t,y:e},n)},t.prototype.focus=function(t,e,n){if(Object(u.isString)(t)&&(t=this.graph.findById(t)),t){var r=0,i=0;if(t.getType&&"edge"===t.getType()){var o=t.getSource().get("group").getMatrix(),a=t.getTarget().get("group").getMatrix();o&&a?(r=(o[6]+a[6])/2,i=(o[7]+a[7])/2):(o||a)&&(r=o?o[6]:a[6],i=o?o[7]:a[7])}else{var s=t.get("group").getMatrix();s||(s=[1,0,0,0,1,0,0,0,1]),r=s[6],i=s[7]}this.focusPoint({x:r,y:i},e,n)}},t.prototype.changeSize=function(t,e){var n=this.graph;if(!Object(u.isNumber)(t)||!Object(u.isNumber)(e))throw Error("invalid canvas width & height, please make sure width & height type is number");n.set({width:t,height:e}),n.get("canvas").changeSize(t,e),n.get("plugins").forEach((function(t){t.get("gridContainer")&&t.positionInit()}))},t.prototype.destroy=function(){this.graph=null,this.destroyed=!1},t}();function Nt(t){return(Nt="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)}function jt(t){if("string"!=typeof t)return t;var e=function(t){if("string"!=typeof t)return t;try{return JSON.parse(t.trim())}catch(e){return t.trim()}},n=e(t);if("string"!=typeof n)return n;for(var r=function(t){return t[t.length-1]},i=t.trim(),o=[],a=[],s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.some((function(t){return r(a)===t}))},u=null,c=0,l="";c<i.length;){var h=i[c],f=s('"',"'");if(f||h.trim()){var d="\\"===i[c-1],p=s("}"),g=s("]"),v=s(","),m=r(o);if(f)if(r(a)!==h||d)l+=h;else{a.pop();var y=e(l);m.push(y),u=y,l=""}else if(g&&","===h)l&&(m.push(e(l)),l="");else if(p&&":"===h)a.push(","),l&&(m.push(l),l="");else if(v&&","===h)l&&(m.push(e(l)),l=""),a.pop();else if("}"===h&&(p||v)){l&&(m.push(e(l)),l=""),v&&a.pop();for(var b={},x=1;x<m.length;x+=2)b[m[x-1]]=m[x];o.pop(),o.length&&r(o).push(b),a.pop(),u=b}else"]"===h&&g?(l&&(m.push(e(l)),l=""),o.pop(),o.length&&r(o).push(m),a.pop(),u=m):"{"===h?(o.push([]),a.push("}")):"["===h?(o.push([]),a.push("]")):'"'===h?a.push('"'):"'"===h?a.push("'"):l+=h;c+=1}else c+=1}return u||l}function Dt(t,e){var n;void 0===e&&(e={x:0,y:0});var r=Object(f.__assign)({x:0,y:0,width:0,height:0},e);if(null===(n=t.children)||void 0===n?void 0:n.length){var i=t.attrs,o=void 0===i?{}:i,a=o.marginTop,s=Object(f.__assign)({},e);a&&(s.y+=a);for(var u=0;u<t.children.length;u++){t.children[u].attrs.key=(o.key||"root")+" -"+u+" ";var c=Dt(t.children[u],s);if(c.bbox){var l=c.bbox;"inline"===c.attrs.next?s.x+=c.bbox.width:s.y+=c.bbox.height,l.width+l.x>r.width&&(r.width=l.width+l.x),l.height+l.y>r.height&&(r.height=l.height+l.y)}}}return t.bbox=function(t,e,n){var r,i,o=t.attrs,a=void 0===o?{}:o,s={x:e.x||0,y:e.y||0,width:n.width||0,height:n.height||0};switch(t.type){case"maker":case"circle":a.r&&(i=2*a.r,r=2*a.r);break;case"text":a.text&&(i=vt(a.text,a.fontSize||12)[0],r=16,s.y+=r,s.height=r,s.width=i,t.attrs=Object(f.__assign)({fontSize:12,fill:"#000"},a));break;default:a.width&&(i=a.width),a.height&&(r=a.height)}return r>=0&&(s.height=r),i>=0&&(s.width=i),a.marginTop&&(s.y+=a.marginTop),a.marginLeft&&(s.x+=a.marginLeft),s}(t,e,r),t.attrs=Object(f.__assign)(Object(f.__assign)({},t.attrs),t.bbox),t}function Lt(t){var e={},n=function(e){var n=function(t){return function(e){for(var n=t.length,r=[],i=0,o="";i<n;)if("{"===t[i]&&"{"===t[i+1])r.push(o),o="",i+=2;else if("}"===t[i]&&"}"===t[i+1]){if(r.length){var a=r.pop();o=Object(u.get)(e,o,a.endsWith("=")?'"{'+o+'}"':o),r.push(a+o)}i+=2,o=""}else o+=t[i],i+=1;return r.push(o),r.map((function(t,e){return r[e-1]&&r[e-1].endsWith("=")?'"{'+t+'}"':t})).join("")}}("function"==typeof t?t(e):t)(e),r=document.createElement("div");r.innerHTML=n;var i=Dt(function t(e,n){var r={},i=e.getAttributeNames&&e.getAttributeNames()||[],o=e.children&&Array.from(e.children).map((function(e){return t(e,n)})),a={},s=e.tagName?e.tagName.toLowerCase():"group";return"text"===s&&(r.text=e.innerText),a.type=s,"img"===s&&(a.type="image"),Array.from(i).forEach((function(t){var n=t.split("-").reduce((function(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)})),i=e.getAttribute(t);try{if("style"===n||"attrs"===n){var o=jt(i);r=Object(f.__assign)(Object(f.__assign)({},r),o)}else a[n]=jt(i)}catch(t){if("style"===n)throw t;a[n]=i}})),a.attrs=r,n&&n.style&&a.name&&"object"===Nt(n.style[a.name])&&(a.attrs=Object(f.__assign)(Object(f.__assign)({},a.attrs),n.style[a.name])),n&&n.style&&a.keyshape&&(a.attrs=Object(f.__assign)(Object(f.__assign)({},a.attrs),n.style)),o.length&&(a.children=o),a}(r.children[0],e));return r.remove(),i};return{draw:function(t,r){var i=n(t),o=r;return function t(e){var n=e.attrs,i=void 0===n?{}:n,a=e.bbox,s=e.type,u=e.children,c=Object(f.__rest)(e,["attrs","bbox","type","children"]);if("group"!==e.type){var l=r.addShape(e.type,Object(f.__assign)({attrs:i,origin:{bbox:a,type:s,children:u}},c));e.keyshape&&(o=l)}e.children&&e.children.forEach((function(e){return t(e)}))}(i),e[t.id]=[i],o},update:function(t,r){e[t.id]||(e[t.id]=[]);var i=r.getContainer(),o=i.get("children"),a=n(t),s=function t(e,n){var r,i,o,a,s=(e||{}).type,u=((null==n?void 0:n.attrs)||{}).key;if(u&&e&&(e.attrs.key=u),!e&&n)return{action:"delete",val:n,type:s,key:u};if(e&&!n)return{action:"add",val:e,type:s};if(!e&&!n)return{action:"same",type:s};var c=[];if((null===(r=e.children)||void 0===r?void 0:r.length)>0||(null===(i=n.children)||void 0===i?void 0:i.length)>0)for(var l=Math.max(null===(o=e.children)||void 0===o?void 0:o.length,null===(a=n.children)||void 0===a?void 0:a.length),h=n.children||[],f=e.children||[],d=0;d<l;d+=1)c.push(t(f[d],h[d]));var p=Object.keys(n.attrs),g=Object.keys(e.attrs);return n.type!==e.type?{action:"restructure",nowTarget:e,formerTarget:n,key:u,children:c}:p.filter((function(t){return"children"!==t})).some((function(t){return e.attrs[t]!==n.attrs[t]||!g.includes(t)}))?{action:"change",val:e,children:c,type:s,key:u}:{action:"same",children:c,type:s,key:u}}(a,e[t.id].pop()),u=function t(e){var n;"group"!==e.type&&i.addShape(e.type,{attrs:e.attrs}),(null===(n=e.children)||void 0===n?void 0:n.length)&&e.children.map((function(e){return t(e)}))},c=function t(e){var n,r=o.find((function(t){return t.attrs.key===e.attrs.key}));r&&i.removeChild(r),(null===(n=e.children)||void 0===n?void 0:n.length)&&e.children.map((function(e){return t(e)}))};!function t(e){var n=e.key;if("group"!==e.type){var i=o.find((function(t){return t.attrs.key===n}));switch(e.action){case"change":if(i){var a=e.val.keyshape?r.getOriginStyle():{};i.attr(Object(f.__assign)(Object(f.__assign)({},a),e.val.attrs))}break;case"add":u(e.val);break;case"delete":c(e.val);break;case"restructure":c(e.formerTarget),u(e.nowTarget)}}e.children&&e.children.forEach((function(e){return t(e)}))}(s),e[t.id].push(a)},getAnchorPoints:function(){return[[0,.5],[1,.5],[.5,1],[.5,0]]}}}var Rt={};function Bt(t){return Rt[t]||(Rt[t]=Object(u.upperFirst)(t)),Rt[t]}var Gt={defaultShapeType:"defaultType",className:null,getShape:function(t){return this[t]||this[this.defaultShapeType]||this["simple-circle"]},draw:function(t,e,n){var r=this.getShape(t);n.shapeMap={};var i=r.draw(e,n);return r.afterDraw&&r.afterDraw(e,n,i),i},baseUpdate:function(t,e,n,r){var i,o,a=this.getShape(t);a.update&&(a.mergeStyle=null===(i=a.getOptions)||void 0===i?void 0:i.call(a,e,r),null===(o=a.update)||void 0===o||o.call(a,e,n,r)),a.afterUpdate&&a.afterUpdate(e,n)},setState:function(t,e,n,r){this.getShape(t).setState(e,n,r)},shouldUpdate:function(t){return!!this.getShape(t).update},getControlPoints:function(t,e){return this.getShape(t).getControlPoints(e)},getAnchorPoints:function(t,e){return this.getShape(t).getAnchorPoints(e)}},Ft={options:{},draw:function(t,e){return this.drawShape(t,e)},drawShape:function(){},afterDraw:function(){},afterUpdate:function(){},setState:function(){},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e=this.options.anchorPoints;return t.anchorPoints||e}},zt=function(){function t(){}return t.registerFactory=function(e,n){var r=Bt(e),i=Gt,o=Object(f.__assign)(Object(f.__assign)({},i),n);return t[r]=o,o.className=r,o},t.getFactory=function(e){return t[Bt(e)]},t.registerNode=function(e,n,r){var i,o=t.Node;if("string"==typeof n||"function"==typeof n){var a=Lt(n);i=Object(f.__assign)(Object(f.__assign)({},o.getShape("single-node")),a)}else if(n.jsx){a=Lt(n.jsx);i=Object(f.__assign)(Object(f.__assign)(Object(f.__assign)({},o.getShape("single-node")),a),n)}else{o.getShape(r);var s=r?o.getShape(r):Ft;i=Object(f.__assign)(Object(f.__assign)({},s),n)}return i.type=e,i.itemType="node",o[e]=i,i},t.registerEdge=function(e,n,r){var i=t.Edge,o=r?i.getShape(r):Ft,a=Object(f.__assign)(Object(f.__assign)({},o),n);return a.type=e,a.itemType="edge",i[e]=a,a},t.registerCombo=function(e,n,r){var i=t.Combo,o=r?i.getShape(r):Ft,a=Object(f.__assign)(Object(f.__assign)({},o),n);return a.type=e,a.itemType="combo",i[e]=a,a},t}(),Ut=zt;zt.registerFactory("node",{defaultShapeType:"circle"}),zt.registerFactory("edge",{defaultShapeType:"line"}),zt.registerFactory("combo",{defaultShapeType:"circle"});var Vt=function(){function t(t){this._cfg={},this.destroyed=!1;var e={id:void 0,type:"item",model:{},group:void 0,animate:!1,visible:!0,locked:!1,event:!0,keyShape:void 0,states:[]};this._cfg=Object.assign(e,this.getDefaultCfg(),t);var n=this.get("model"),r=n.id,i=this.get("type");r||(r=Mt(i),this.get("model").id=r),this.set("id",r);var o=t.group;o&&(o.set("item",this),o.set("id",r)),this.init(),this.draw();var a=n.shape||n.type||("edge"===i?"line":"circle"),s=this.get("shapeFactory");if(s&&s[a]){var c=s[a].options;if(c&&c.stateStyles){var l=this.get("styles")||n.stateStyles;l=Object(u.deepMix)({},c.stateStyles,l),this.set("styles",l)}}}return t.prototype.calculateBBox=function(){var t=this.get("keyShape"),e=this.get("group"),n=ct(t,e);return n.x=n.minX,n.y=n.minY,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,n},t.prototype.calculateCanvasBBox=function(){var t=this.get("keyShape"),e=this.get("group"),n=ct(t,e);return n.x=n.minX,n.y=n.minY,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,n},t.prototype.drawInner=function(){var t=this.get("shapeFactory"),e=this.get("group"),n=this.get("model");e.clear();var r=n.visible;if(void 0===r||r||this.changeVisibility(r),t){this.updatePosition(n);var i=this.getShapeCfg(n),o=i.type,a=t.draw(o,i,e);a&&(this.set("keyShape",a),a.set("isKeyShape",!0),a.set("draggable",!0)),this.setOriginStyle(),this.set("currentShape",o),this.restoreStates(t,o)}},t.prototype.setOriginStyle=function(){var t=this.get("group"),e=t.get("children"),n=this.getKeyShape(),r=this,i=n.get("name");if(this.get("originStyle")){var o=this.get("originStyle");i&&!o[i]&&(o[i]={});var a=this.getCurrentStatesStyle(),s=function(t){var n=e[t],s=n.get("name"),c=n.attr();if(s&&s!==i){var l=a[s];o[s]||(o[s]={}),l?Object.keys(c).forEach((function(t){var e=c[t];e!==l[t]&&(o[s][t]=e)})):o[s]="image"!==n.get("type")?Object(u.clone)(c):r.getShapeStyleByName(s)}else{var h=n.attr(),f={};Object.keys(a).forEach((function(t){var e=a[t];t!==i&&Object(u.isPlainObject)(e)||(f[t]=e)})),Object.keys(h).forEach((function(t){var e=h[t];f[t]!==e&&(i?o[i][t]=e:o[t]=e)}))}};for(l=0;l<e.length;l++)s(l);delete o.path,delete o.matrix,delete o.x,delete o.y,o[i]&&(delete o[i].x,delete o[i].y,delete o[i].matrix,delete o[i].path),r.set("originStyle",o)}else{for(var c={},l=0;l<e.length;l++){var h=e[l],f=h.get("type"),d=h.get("name");if(d&&d!==i)c[d]="image"!==f?Object(u.clone)(h.attr()):r.getShapeStyleByName(d),"text"===f&&c[d]&&(delete c[d].x,delete c[d].y,delete c[d].matrix);else{var p=r.getShapeStyleByName();if(delete p.path,delete p.matrix,i)if(d)c[i]=p;else{var g=Mt("shape");h.set("name",g),t.shapeMap[g]=h,c[g]="image"!==f?Object(u.clone)(h.attr()):r.getShapeStyleByName(d)}else Object.assign(c,p)}}r.set("originStyle",c)}},t.prototype.restoreStates=function(t,e){var n=this,r=n.get("states");Object(u.each)(r,(function(r){t.setState(e,r,!0,n)}))},t.prototype.init=function(){var t=Ut.getFactory(this.get("type"));this.set("shapeFactory",t)},t.prototype.get=function(t){return this._cfg[t]},t.prototype.set=function(t,e){Object(u.isPlainObject)(t)?this._cfg=Object(f.__assign)(Object(f.__assign)({},this._cfg),t):this._cfg[t]=e},t.prototype.getDefaultCfg=function(){return{}},t.prototype.clearCache=function(){this.set("bboxCache",null),this.set("bboxCanvasCache",null)},t.prototype.beforeDraw=function(){},t.prototype.afterDraw=function(){},t.prototype.afterUpdate=function(){},t.prototype.draw=function(){this.beforeDraw(),this.drawInner(),this.afterDraw()},t.prototype.getShapeStyleByName=function(t){var e,n=this.get("group");if(e=t?n.shapeMap[t]:this.getKeyShape()){var r={};return Object(u.each)(e.attr(),(function(t,e){("img"!==e||Object(u.isString)(t))&&(r[e]=t)})),r}return{}},t.prototype.getShapeCfg=function(t,e){var n=this.get("styles");if(n){var r=t;return r.style=Object(f.__assign)(Object(f.__assign)({},n),t.style),r}return t},t.prototype.getStateStyle=function(t){var e=this.get("styles");return e&&e[t]},t.prototype.getOriginStyle=function(){return this.get("originStyle")},t.prototype.getCurrentStatesStyle=function(){var t=this,e={},n=t.getStates();return n&&n.length?(Object(u.each)(t.getStates(),(function(n){e=Object.assign(e,t.getStateStyle(n))})),e):this.get("originStyle")},t.prototype.setState=function(t,e){var n=this.get("states"),r=this.get("shapeFactory"),i=t,o=t;Object(u.isString)(e)&&(i=t+":"+e,o=t+":");var a=n;if(Object(u.isBoolean)(e)){var s=n.indexOf(o);if(e){if(s>-1)return;n.push(i)}else s>-1&&n.splice(s,1)}else if(Object(u.isString)(e)){var c=n.filter((function(t){return t.includes(o)}));c.length>0&&this.clearStates(c),(a=a.filter((function(t){return!t.includes(o)}))).push(i),this.set("states",a)}if(r){var l=this.get("model").type;r.setState(l,t,e,this)}},t.prototype.clearStates=function(t){var e=this,n=e.getStates(),r=e.get("shapeFactory"),i=e.get("model").type;t||(t=n),Object(u.isString)(t)&&(t=[t]);var o=n.filter((function(e){return-1===t.indexOf(e)}));e.set("states",o),t.forEach((function(t){r.setState(i,t,!1,e)}))},t.prototype.getContainer=function(){return this.get("group")},t.prototype.getKeyShape=function(){return this.get("keyShape")},t.prototype.getModel=function(){return this.get("model")},t.prototype.getType=function(){return this.get("type")},t.prototype.getID=function(){return this.get("id")},t.prototype.isItem=function(){return!0},t.prototype.getStates=function(){return this.get("states")},t.prototype.hasState=function(t){return this.getStates().indexOf(t)>=0},t.prototype.refresh=function(t){var e=this.get("model");this.updatePosition(e),this.updateShape(t),this.afterUpdate(),this.clearCache()},t.prototype.getUpdateType=function(t){},t.prototype.update=function(t,e){void 0===e&&(e=void 0);var n=this.get("model");if("move"===e)this.updatePosition(t);else{var r=n.visible,i=t.visible;r!==i&&void 0!==i&&this.changeVisibility(i);var o={x:n.x,y:n.y};t.x=isNaN(+t.x)?n.x:+t.x,t.y=isNaN(+t.y)?n.y:+t.y;var a=this.get("styles");if(t.stateStyles){var s=t.stateStyles;Object(u.mix)(a,s),delete t.stateStyles}Object.assign(n,t),o.x===t.x&&o.y===t.y||this.updatePosition(t),this.updateShape(e)}this.afterUpdate(),this.clearCache()},t.prototype.updateShape=function(t){var e=this.get("shapeFactory"),n=this.get("model"),r=n.type;if(e.shouldUpdate(r)&&r===this.get("currentShape")){var i=this.getShapeCfg(n,t);e.baseUpdate(r,i,this,t),"move"!==t&&this.setOriginStyle()}else this.draw();this.restoreStates(e,r)},t.prototype.updatePosition=function(t){var e=this.get("model"),n=isNaN(+t.x)?+e.x:+t.x,r=isNaN(+t.y)?+e.y:+t.y,i=this.get("group");if(isNaN(n)||isNaN(r))return!1;e.x=n,e.y=r;var o=i.getMatrix();return(!o||o[6]!==n||o[7]!==r)&&(i.resetMatrix(),I(i,{x:n,y:r}),this.clearCache(),!0)},t.prototype.getBBox=function(){var t=this.get("bboxCache");return t||(t=this.calculateBBox(),this.set("bboxCache",t)),t},t.prototype.getCanvasBBox=function(){var t=this.get("bboxCanvasCache");return t||(t=this.calculateCanvasBBox(),this.set("bboxCanvasCache",t)),t},t.prototype.toFront=function(){this.get("group").toFront()},t.prototype.toBack=function(){this.get("group").toBack()},t.prototype.show=function(){this.changeVisibility(!0)},t.prototype.hide=function(){this.changeVisibility(!1)},t.prototype.changeVisibility=function(t){var e=this.get("group");t?e.show():e.hide(),this.set("visible",t)},t.prototype.isVisible=function(){return this.get("visible")},t.prototype.enableCapture=function(t){var e=this.get("group");e&&e.set("capture",t)},t.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),e.remove(),this._cfg=null,this.destroyed=!0}},t}(),Wt={source:"start",target:"end"},Yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(f.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,e){var n=Wt[t]+"Point",r=t+"Node",i=this.get(r);i&&!i.destroyed&&i.removeEdge(this),Object(u.isPlainObject)(e)?(this.set(n,e),this.set(r,null)):e&&(e.addEdge(this),this.set(r,e),this.set(n,null))},e.prototype.getLinkPoint=function(t,e,n){var r=Wt[t]+"Point",i=t+"Node",o=this.get(r);if(!o){var a=this.get(i),s=t+"Anchor",c=this.getPrePoint(t,n),l=e[s];Object(u.isNil)(l)||(o=a.getLinkPointByAnchor(l)),o=o||a.getLinkPoint(c),Object(u.isNil)(o.index)||this.set(t+"AnchorIndex",o.index)}return o},e.prototype.getPrePoint=function(t,e){if(e&&e.length)return e["source"===t?0:e.length-1];var n="source"===t?"target":"source";return this.getEndPoint(n)},e.prototype.getEndPoint=function(t){var e=t+"Node",n=Wt[t]+"Point",r=this.get(e);return r?r.get("model"):this.get(n)},e.prototype.getControlPointsByCenter=function(t){var e=this.getEndPoint("source"),n=this.getEndPoint("target"),r=this.get("shapeFactory"),i=t.type;return r.getControlPoints(i,{startPoint:e,endPoint:n})},e.prototype.getEndCenter=function(t){var e=t+"Node",n=Wt[t]+"Point",r=this.get(e);if(r){var i=r.getBBox();return{x:i.centerX,y:i.centerY}}return this.get(n)},e.prototype.init=function(){t.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(e,n){var r=this.get("linkCenter"),i=(null==n?void 0:n.includes("move"))?e:t.prototype.getShapeCfg.call(this,e);if(r)i.startPoint=this.getEndCenter("source"),i.endPoint=this.getEndCenter("target");else{var o=i.controlPoints||this.getControlPointsByCenter(i);i.startPoint=this.getLinkPoint("source",e,o),i.endPoint=this.getLinkPoint("target",e,o)}return i.sourceNode=this.get("sourceNode"),i.targetNode=this.get("targetNode"),i},e.prototype.getModel=function(){var t=this.get("model"),e=this.get("sourceNode"),n=this.get("targetNode");return e?delete t.sourceNode:t.source=this.get("startPoint"),n?delete t.targetNode:t.target=this.get("endPoint"),Object(u.isString)(t.source)||Object(u.isPlainObject)(t.source)||(t.source=t.source.getID()),Object(u.isString)(t.target)||Object(u.isPlainObject)(t.target)||(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){return!1},e.prototype.update=function(t,e){void 0===e&&(e=void 0);var n=this.get("model"),r=n.visible,i=t.visible;r!==i&&void 0!==i&&this.changeVisibility(i);var o=this.get("styles");if(t.stateStyles){var a=t.stateStyles;Object(u.mix)(o,a),delete t.stateStyles}Object.assign(n,t),this.updateShape(e),this.afterUpdate(),this.clearCache()},e.prototype.destroy=function(){var e=this.get("sourceNode"),n=this.get("targetNode");e&&!e.destroyed&&e.removeEdge(this),n&&!n.destroyed&&n.removeEdge(this),t.prototype.destroy.call(this)},e}(Vt),Xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(f.__extends)(e,t),e.prototype.getNearestPoint=function(t,e){for(var n=0,r=t[0],i=O(t[0],e),o=0;o<t.length;o++){var a=t[o],s=O(a,e);s<i&&(r=a,i=s,n=o)}return r.anchorIndex=n,r},e.prototype.getDefaultCfg=function(){return{type:"node",edges:[]}},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getInEdges=function(){var t=this;return this.get("edges").filter((function(e){return e.get("target")===t}))},e.prototype.getOutEdges=function(){var t=this;return this.get("edges").filter((function(e){return e.get("source")===t}))},e.prototype.getNeighbors=function(t){var e=this,n=this.get("edges");if("target"===t){return n.filter((function(t){return t.getSource()===e})).map((function(t){return t.getTarget()}))}if("source"===t){return n.filter((function(t){return t.getTarget()===e})).map((function(t){return t.getSource()}))}return n.map((function(t){return t.getSource()===e?t.getTarget():t.getSource()}))},e.prototype.getLinkPointByAnchor=function(t){return this.getAnchorPoints()[t]},e.prototype.getLinkPoint=function(t){var e,n,r=this.get("keyShape").get("type"),i=this.get("type"),o=this.getBBox();"combo"===i?(e=o.centerX||(o.maxX+o.minX)/2,n=o.centerY||(o.maxY+o.minY)/2):(e=o.centerX,n=o.centerY);var a,s=this.getAnchorPoints();switch(r){case"circle":a=w({x:e,y:n,r:o.width/2},t);break;case"ellipse":a=_({x:e,y:n,rx:o.width/2,ry:o.height/2},t);break;default:a=x(o,t)}var u=a;return s.length&&(u||(u=t),u=this.getNearestPoint(s,u)),u||(u={x:e,y:n}),u},e.prototype.getAnchorPoints=function(){var t=this.get("anchorPointsCache");if(!t){t=[];var e=this.get("shapeFactory"),n=this.getBBox(),r=this.get("model"),i=this.getShapeCfg(r),o=r.type,a=e.getAnchorPoints(o,i)||[];Object(u.each)(a,(function(e,r){var i={x:n.minX+e[0]*n.width,y:n.minY+e[1]*n.height,anchorIndex:r};t.push(i)})),this.set("anchorPointsCache",t)}return t},e.prototype.addEdge=function(t){this.get("edges").push(t)},e.prototype.lock=function(){this.set("locked",!0)},e.prototype.unlock=function(){this.set("locked",!1)},e.prototype.hasLocked=function(){return this.get("locked")},e.prototype.removeEdge=function(t){var e=this.getEdges(),n=e.indexOf(t);n>-1&&e.splice(n,1)},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("anchorPointsCache",null)},e.prototype.getUpdateType=function(t){var e,n,r,i,o;if(t){var a=!Object(u.isNil)(t.x),s=!Object(u.isNil)(t.y),c=Object.keys(t);return 1===c.length&&(a||s)||2===c.length&&a&&s?"move":Object(u.isNumber)(t.x)||Object(u.isNumber)(t.y)||t.type||t.anchorPoints||t.size||(null==t?void 0:t.style)&&((null===(e=null==t?void 0:t.style)||void 0===e?void 0:e.r)||(null===(n=null==t?void 0:t.style)||void 0===n?void 0:n.width)||(null===(r=null==t?void 0:t.style)||void 0===r?void 0:r.height)||(null===(i=null==t?void 0:t.style)||void 0===i?void 0:i.rx)||(null===(o=null==t?void 0:t.style)||void 0===o?void 0:o.ry))?"bbox|label":c.includes("label")||c.includes("labelCfg")?"style|label":"style"}},e}(Vt),Ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(f.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{type:"combo",nodes:[],edges:[],combos:[]}},e.prototype.getShapeCfg=function(t){var e=this.get("styles"),n=this.get("bbox");if(e&&n){var r=t,i={r:Math.hypot(n.height,n.width)/2||nt.defaultCombo.size[0]/2,width:n.width||nt.defaultCombo.size[0],height:n.height||nt.defaultCombo.size[1]};r.style=Object(f.__assign)(Object(f.__assign)(Object(f.__assign)({},e),t.style),i);var o=t.padding||nt.defaultCombo.padding;return Object(u.isNumber)(o)?(i.r+=o,i.width+=2*o,i.height+=2*o):(i.r+=o[0],i.width+=o[1]+o[3]||2*o[1],i.height+=o[0]+o[2]||2*o[0]),this.set("sizeCache",i),r}return t},e.prototype.calculateCanvasBBox=function(){if(!this.destroyed){var t=this.get("keyShape"),e=this.get("group"),n=ct(t,e);n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2;var r=this.get("sizeCache"),i=this.get("bboxCache")||{},o=i.x,a=i.x;if(r)r.width=Math.max(r.width,n.width),r.height=Math.max(r.height,n.height),"circle"===t.get("type")?(n.width=2*r.r,n.height=2*r.r):(n.width=r.width,n.height=r.height),n.minX=n.centerX-n.width/2,n.minY=n.centerY-n.height/2,n.maxX=n.centerX+n.width/2,n.maxY=n.centerY+n.height/2;else n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2;return n.x=n.minX,n.y=n.minY,n.x===o&&n.y===a||this.set("anchorPointsCache",null),n}},e.prototype.getChildren=function(){return{nodes:this.getNodes(),combos:this.getCombos()}},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.addChild=function(t){switch(t.getType()){case"node":this.addNode(t);break;case"combo":this.addCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.addCombo=function(t){return this.get("combos").push(t),!0},e.prototype.addNode=function(t){return this.get("nodes").push(t),!0},e.prototype.removeChild=function(t){switch(t.getType()){case"node":this.removeNode(t);break;case"combo":this.removeCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.removeCombo=function(t){if(t){var e=this.getCombos(),n=e.indexOf(t);return n>-1&&(e.splice(n,1),!0)}},e.prototype.removeNode=function(t){if(t){var e=this.getNodes(),n=e.indexOf(t);return n>-1&&(e.splice(n,1),!0)}},e.prototype.getUpdateType=function(t){},e.prototype.getBBox=function(){return this.set("bboxCanvasCache",null),this.calculateCanvasBBox()},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("bboxCanvasCache",null),this.set("anchorPointsCache",null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),this.set("sizeCache",null),this.set("bbox",null),e.remove(),this._cfg=null,this.destroyed=!0}},e}(Xt),qt=function(){function t(t){var e=this;this.edgeToBeUpdateMap={},this.throttleRefresh=Object(u.throttle)((function(t){var n,r=e.graph;if(r&&!r.get("destroyed")){var i=e.edgeToBeUpdateMap;i&&(null===(n=Object.keys(i))||void 0===n?void 0:n.length)&&(Object.keys(i).forEach((function(t){var e=i[t].edge;e&&!e.destroyed&&e.refresh(i[t].updateType)})),e.edgeToBeUpdateMap={})}}),16,{trailing:!0,leading:!0}),this.graph=t,this.destroyed=!1}return t.prototype.addItem=function(t,e){var n=this.graph,r="vedge"===t?"edge":t,i=n.get(r+"Group")||n.get("group"),o=Object(u.upperFirst)(r),a=null,s=n.get(r+Object(u.upperFirst)("stateStyles"))||{},c=n.get("default"+o);e.stateStyles&&(s=e.stateStyles),c&&Object(u.each)(c,(function(t,n){Object(u.isObject)(t)&&!Object(u.isArray)(t)?e[n]=Object(u.deepMix)({},t,e[n]):Object(u.isArray)(t)?e[n]=e[n]||Object(u.clone)(c[n]):e[n]=e[n]||c[n]}));var l=n.get(r+"Mapper");if(l){var h=l(e);h.stateStyles&&(s=h.stateStyles,delete h.stateStyles),Object(u.each)(h,(function(t,n){Object(u.isObject)(t)&&!Object(u.isArray)(t)?e[n]=Object(u.deepMix)({},e[n],t):e[n]=h[n]||e[n]}))}if(n.emit("beforeadditem",{type:t,model:e}),"edge"===t||"vedge"===t){var f=void 0,d=void 0;if(f=e.source,d=e.target,f&&Object(u.isString)(f)&&(f=n.findById(f)),d&&Object(u.isString)(d)&&(d=n.findById(d)),!f||!d)return void console.warn("The source or target node of edge "+e.id+" does not exist!");f.getType&&"combo"===f.getType()&&(e.isComboEdge=!0),d.getType&&"combo"===d.getType()&&(e.isComboEdge=!0),a=new Yt({model:e,source:f,target:d,styles:s,linkCenter:n.get("linkCenter"),group:i.addGroup()})}else if("node"===t)a=new Xt({model:e,styles:s,group:i.addGroup()});else if("combo"===t){var p=e.children,g=bt(p,n);isNaN(g.x)?isNaN(e.x)&&(e.x=100*Math.random()):e.x=g.x,isNaN(g.y)?isNaN(e.y)&&(e.y=100*Math.random()):e.y=g.y;var v=i.addGroup();v.setZIndex(e.depth);var m=(a=new Ht({model:e,styles:s,bbox:e.collapsed?bt([],n):g,group:v})).getModel();(p||[]).forEach((function(t){var e=n.findById(t.id);a.addChild(e),t.depth=m.depth+2})),e.collapsed&&setTimeout((function(){a.destroyed||n.collapseCombo(a)}),0)}if(a)return n.get(t+"s").push(a),n.get("itemMap")[a.get("id")]=a,n.emit("afteradditem",{item:a,model:e}),a},t.prototype.updateItem=function(t,e){var n,r,i=this,o=this.graph;if(Object(u.isString)(t)&&(t=o.findById(t)),t&&!t.destroyed){var a="";t.getType&&(a=t.getType());var s=o.get(a+"Mapper"),c=t.getModel(),l=t.getUpdateType(e);if(s){var h=s(Object(u.deepMix)({},c,e)),d=Object(u.deepMix)({},c,h,e);h.stateStyles&&(t.set("styles",d.stateStyles),delete d.stateStyles),Object(u.each)(d,(function(t,n){e[n]=t}))}else Object(u.each)(e,(function(t,n){c[n]&&Object(u.isObject)(t)&&!Object(u.isArray)(t)&&(e[n]=Object(f.__assign)(Object(f.__assign)({},c[n]),e[n]))}));if(o.emit("beforeupdateitem",{item:t,cfg:e}),"edge"===a){if(e.source){var p=e.source;Object(u.isString)(p)&&(p=o.findById(p)),t.setSource(p)}if(e.target){var g=e.target;Object(u.isString)(g)&&(g=o.findById(g)),t.setTarget(g)}t.update(e)}if("node"===a||"combo"===a){t.update(e,l);var v=t.getEdges(),m=(null==l?void 0:l.includes("bbox"))||"move"===l;if("node"===a)"move"===l?Object(u.each)(v,(function(t){i.edgeToBeUpdateMap[t.getID()]={edge:t,updateType:l},i.throttleRefresh()})):m&&Object(u.each)(v,(function(t){t.refresh(l)}));else if(m&&"combo"===a){var y=t.get("shapeFactory"),b=c.type||"circle";(void 0===c.animate||void 0===e.animate?null===(r=null===(n=y[b])||void 0===n?void 0:n.options)||void 0===r?void 0:r.animate:c.animate||e.animate)?setTimeout((function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&Object(u.each)(v,(function(t){t&&!t.destroyed&&t.refresh()}))}}),201):Object(u.each)(v,(function(t){t.refresh()}))}}o.emit("afterupdateitem",{item:t,cfg:e})}},t.prototype.updateCombo=function(t,e){var n,r,i=this,o=this.graph;if(Object(u.isString)(t)&&(t=o.findById(t)),t&&!t.destroyed){var a=t.getModel(),s=bt(a.collapsed?[]:e,o),c=a.collapsed?bt(e,o):s,l=c.x,h=c.y;t.set("bbox",s),t.update({x:l,y:h});var f=t.get("shapeFactory"),d=a.type||"circle";(void 0===a.animate?null===(r=null===(n=f[d])||void 0===n?void 0:n.options)||void 0===r?void 0:r.animate:a.animate)?setTimeout((function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&(t.getShapeCfg(a),i.updateComboEdges(t))}}),201):this.updateComboEdges(t)}},t.prototype.updateComboEdges=function(t){for(var e=t.getEdges()||[],n=0;n<e.length;n++){var r=e[n];if(r&&!r.destroyed){var i=r.get("shapeFactory"),o=r.getShapeCfg(r.getModel()),a=r.getContainer();a.clear();var s=i.draw(o.type,o,a);r.set("keyShape",s),s.set("isKeyShape",!0),s.set("draggable",!0),r.setOriginStyle()}}},t.prototype.collapseCombo=function(t){var e=this.graph;Object(u.isString)(t)&&(t=e.findById(t));var n=t.getChildren();n.nodes.forEach((function(t){e.hideItem(t)})),n.combos.forEach((function(t){e.hideItem(t)}))},t.prototype.expandCombo=function(t){var e=this.graph;Object(u.isString)(t)&&(t=e.findById(t));var n=t.getChildren();n.nodes.forEach((function(t){e.showItem(t)})),n.combos.forEach((function(t){t.getModel().collapsed?t.show():e.showItem(t)}))},t.prototype.removeItem=function(t){var e=this,n=this.graph;if(Object(u.isString)(t)&&(t=n.findById(t)),t&&!t.destroyed){var r=Object(u.clone)(t.getModel());n.emit("beforeremoveitem",{item:r});var i="";t.getType&&(i=t.getType());var o=n.get(i+"s"),a=o.indexOf(t);if(a>-1&&o.splice(a,1),"edge"===i){var s=n.get("v"+i+"s"),c=s.indexOf(t);c>-1&&s.splice(c,1)}var l=t.get("id");delete n.get("itemMap")[l];var h=n.get("comboTrees"),f=t.get("id");if("node"===i){var d=t.getModel().comboId;if(h&&d){var p=h,g=!1;h.forEach((function(t){g||dt(t,(function(t){if(t.id===f&&p){var e=p.indexOf(t);return p.splice(e,1),g=!0,!1}return p=t.children,!0}))}))}for(var v=(x=t.getEdges()).length-1;v>=0;v--)n.removeItem(x[v],!1);d&&n.updateCombo(d)}else if("combo"===i){var m,y=t.getModel().parentId,b=!1;(h||[]).forEach((function(t){b||dt(t,(function(t){return t.id!==f||(m=t,b=!0,!1)}))})),m.removed=!0,m&&m.children&&m.children.forEach((function(t){e.removeItem(t.id)}));var x;for(v=(x=t.getEdges()).length;v>=0;v--)n.removeItem(x[v],!1);y&&n.updateCombo(y)}t.destroy(),n.emit("afterremoveitem",{item:r,type:i})}},t.prototype.setItemState=function(t,e,n){var r=this.graph,i=e;Object(u.isString)(n)&&(i=e+":"+n),t.hasState(i)===n&&n||Object(u.isString)(n)&&t.hasState(i)||(r.emit("beforeitemstatechange",{item:t,state:i,enabled:n}),t.setState(e,n),r.autoPaint(),r.emit("afteritemstatechange",{item:t,state:i,enabled:n}))},t.prototype.priorityState=function(t,e){var n=this.graph,r=t;Object(u.isString)(t)&&(r=n.findById(t)),this.setItemState(r,e,!1),this.setItemState(r,e,!0)},t.prototype.clearItemStates=function(t,e){var n=this.graph;Object(u.isString)(t)&&(t=n.findById(t)),n.emit("beforeitemstatesclear",{item:t,states:e}),t.clearStates(e),n.emit("afteritemstatesclear",{item:t,states:e})},t.prototype.refreshItem=function(t){var e=this.graph;Object(u.isString)(t)&&(t=e.findById(t)),e.emit("beforeitemrefresh",{item:t}),t.refresh(),e.emit("afteritemrefresh",{item:t})},t.prototype.addCombos=function(t,e){var n=this,r=this.graph;(t||[]).forEach((function(t){pt(t,(function(t){var r;return e.forEach((function(e){e.id===t.id&&(e.children=t.children,e.depth=t.depth,r=e)})),r&&n.addItem("combo",r),!0}))}));var i=r.get("comboGroup");i&&i.sort()},t.prototype.changeItemVisibility=function(t,e){var n=this,r=this.graph;if(Object(u.isString)(t)&&(t=r.findById(t)),t){if(r.emit("beforeitemvisibilitychange",{item:t,visible:e}),t.changeVisibility(e),t.getType&&"node"===t.getType()){var i=t.getEdges();Object(u.each)(i,(function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&n.changeItemVisibility(t,e)}))}else if(t.getType&&"combo"===t.getType()){var o=r.get("comboTrees"),a=t.get("id"),s=[],c=!1;(o||[]).forEach((function(t){c||t.children&&0!==t.children.length&&dt(t,(function(t){return t.id!==a||(s=t.children,c=!0,!1)}))})),s&&(!e||e&&!t.getModel().collapsed)&&s.forEach((function(t){var i=r.findById(t.id);n.changeItemVisibility(i,e)}));i=t.getEdges();Object(u.each)(i,(function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&n.changeItemVisibility(t,e)}))}return r.emit("afteritemvisibilitychange",{item:t,visible:e}),t}console.warn("The item to be shown or hidden does not exist!")},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),Kt=null,Zt=function(){function t(t){this.graph=t,this.cachedStates={enabled:{},disabled:{}},this.destroyed=!1}return t.checkCache=function(t,e,n){if(n[e]){var r=n[e].indexOf(t);r>=0&&n[e].splice(r,1)}},t.cacheState=function(t,e,n){n[e]||(n[e]=[]),n[e].push(t)},t.prototype.updateState=function(e,n,r){var i=this,o=t.checkCache,a=t.cacheState;if(!e.destroyed){var s=this.cachedStates,u=s.enabled,c=s.disabled;r?(o(e,n,c),a(e,n,u)):(o(e,n,u),a(e,n,c)),Kt&&clearTimeout(Kt),Kt=setTimeout((function(){Kt=null,i.updateGraphStates()}),16)}},t.prototype.updateStates=function(t,e,n){var r=this;Object(u.isString)(e)?this.updateState(t,e,n):e.forEach((function(e){r.updateState(t,e,n)}))},t.prototype.updateGraphStates=function(){var t=this.graph.get("states"),e=this.cachedStates;Object(u.each)(e.disabled,(function(e,n){t[n]&&(t[n]=t[n].filter((function(t){return e.indexOf(t)<0&&!e.destroyed})))})),Object(u.each)(e.enabled,(function(e,n){if(t[n]){var r={};t[n].forEach((function(t){t.destroyed||(r[t.get("id")]=!0)})),e.forEach((function(e){if(!e.destroyed){var i=e.get("id");r[i]||(r[i]=!0,t[n].push(e))}}))}else t[n]=e})),this.graph.emit("graphstatechange",{states:t}),this.cachedStates={enabled:{},disabled:{}}},t.prototype.destroy=function(){this.graph=null,this.cachedStates=null,Kt&&clearTimeout(Kt),Kt=null,this.destroyed=!0},t}(),$t=n(39),Qt=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){if("\\"===t.charAt(0))return t.slice(1);var r=e[n];return 0===r&&(r="0"),r||""})):t},Jt=function(t){var e=[];if(t.length<2)throw new Error("point length must largn than 2, now it's "+t.length);for(var n=0,r=t;n<r.length;n++){var i=r[n],o=i.x,a=i.y;e.push(o),e.push(a)}var s=Object($t.a)(e);return s.unshift(["M",t[0].x,t[0].y]),s},te=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i={x:(1-n)*t.x+n*e.x,y:(1-n)*t.y+n*e.y},o=[0,0];p.vec2.normalize(o,[e.x-t.x,e.y-t.y]),o&&(o[0]||o[1])||(o=[0,0]);var a=[-o[1]*r,o[0]*r];return i.x+=a[0],i.y+=a[1],i},ee=function(t,e){var n=t.length;if(!n)return"";for(var r="",i=0;i<n;i++){var o=t[i];r+=Qt(0===i?"M{x} {y}":"L{x} {y}",o)}return e&&(r+="Z"),r},ne=function(t){var e=[];return t.forEach((function(t){if("A"!==t[0])for(var n=1;n<t.length;n+=2)e.push([t[n],t[n+1]]);else{var r=t.length;e.push([t[r-2],t[r-1]])}})),e},re=function(t){if(t.length<2)throw new Error("point length must largn than 2, now it's "+t.length);var e=t[0],n=t[1],r=t[t.length-1],i=t[t.length-2];t.unshift(r),t.unshift(i),t.push(e),t.push(n);for(var o=[],a=1;a<t.length-2;a+=1){var s=t[a-1].x,u=t[a-1].y,c=t[a].x,l=t[a].y,h=t[a+1].x,f=t[a+1].y,d=c+(h-s)/6,p=l+(f-u)/6,g=h-((a!==t.length-2?t[a+2].x:h)-c)/6,v=f-((a!==t.length-2?t[a+2].y:f)-l)/6;o.push(["C",d,p,g,v,h,f])}return o.unshift(["M",r.x,r.y]),o},ie=function(t,e){return p.vec2.scale([0,0],p.vec2.normalize([0,0],t),e)},oe=function(t,e){var n=[t[1]-e[1],e[0]-t[0]],r=Math.sqrt(n[0]*n[0]+n[1]*n[1]);if(0===r)throw new Error("p0 should not be equal to p1");return[n[0]/r,n[1]/r]},ae=function(t,e){return[e[0]-t[0],e[1]-t[1]]};function se(t,e){if(!t||t.length<1)return"";if(1===t.length)return function(t){var n=[t[0][0],t[0][1]-e],r=[t[0][0],t[0][1]+e];return"M "+n+" A "+e+","+e+",0,0,0,"+r+" A "+e+","+e+",0,0,0,"+n}(t);if(2===t.length)return function(t){var n=p.vec2.scale([0,0],oe(t[0],t[1]),e),r=p.vec2.scale([0,0],n,-1),i=p.vec2.add([0,0],t[0],n),o=p.vec2.add([0,0],t[1],n),a=p.vec2.add([0,0],t[1],r),s=p.vec2.add([0,0],t[0],r);return"M "+i+" L "+o+" A "+[e,e,"0,0,0",a].join(",")+" L "+s+" A "+[e,e,"0,0,0",i].join(",")}(t);for(var n=new Array(t.length),r=0;r<n.length;++r){var i=0===r?t[t.length-1]:t[r-1],o=t[r],a=p.vec2.scale([0,0],oe(i,o),e);n[r]=[p.vec2.add([0,0],i,a),p.vec2.add([0,0],o,a)]}var s="A "+[e,e,"0,0,0,"].join(",");return(n=n.map((function(t,e){var r="";return 0===e&&(r="M "+n[n.length-1][1]+" "),r+=s+t[0]+" L "+t[1]}))).join(" ")}function ue(t,e){var n,r,i,o=t.length;if(!t||o<1)return"";if(1===o)return r=[(n=t)[0][0],n[0][1]-e],i=[n[0][0],n[0][1]+e],"M "+r+" A "+[e,e,"0,0,0",i].join(",")+" A "+[e,e,"0,0,0",r].join(",");if(2===o)return function(t){var n=ae(t[0],t[1]),r=ie(n,e),i=p.vec2.add([0,0],t[0],p.vec2.scale([0,0],r,-1)),o=p.vec2.add([0,0],t[1],r),a=1.2*e,s=ie(p.vec2.normalize([0,0],n),a),u=p.vec2.scale([0,0],s,-1),c=p.vec2.add([0,0],i,u),l=p.vec2.add([0,0],o,u),h=p.vec2.add([0,0],i,s);return"M "+i+" C "+[c,l,o].join(",")+" S "+[h,i].join(",")+" Z"}(t);for(var a=t.map((function(e,n){var r=t[(n+1)%o];return{p:e,v:p.vec2.normalize([0,0],ae(e,r))}})),s=0;s<a.length;++s){var u=s>0?s-1:o-1,c=p.vec2.normalize([0,0],p.vec2.add([0,0],a[u].v,p.vec2.scale([0,0],a[s].v,-1)));a[s].p=p.vec2.add([0,0],a[s].p,p.vec2.scale([0,0],c,e))}return a.map((function(t){var e=t.p;return{x:e[0],y:e[1]}}))}var ce=function(t,e,n){return(t.y-n.y)*(e.x-n.x)-(t.x-n.x)*(e.y-n.y)},le=function(t){var e=t.map((function(t){return{x:t.getModel().x,y:t.getModel().y}}));if(e.sort((function(t,e){return t.x===e.x?t.y-e.y:t.x-e.x})),1===e.length)return e;for(var n=[],r=0;r<e.length;r++){for(;n.length>=2&&ce(n[n.length-2],n[n.length-1],e[r])<=0;)n.pop();n.push(e[r])}var i=[];for(r=e.length-1;r>=0;r--){for(;i.length>=2&&ce(i[i.length-2],i[i.length-1],e[r])<=0;)i.pop();i.push(e[r])}return i.pop(),n.pop(),n.concat(i)},he={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function fe(t,e,n){var r=!1,i=function(t,n){return e.cells[t+n*e.width]},o=function(t,e){var r=0;return i(t-1,e-1)>=n&&(r+=1),i(t,e-1)>n&&(r+=2),i(t-1,e)>n&&(r+=4),i(t,e)>n&&(r+=8),r},a=function(n,r){for(var i,a,s=n,u=r,c=0;c<e.width*e.height;c++){if(i=s,a=u,t.findIndex((function(t){return t.x===s&&t.y===u}))>-1){if(t[0].x===s&&t[0].y===u)return!0}else t.push({x:s,y:u});var l=o(s,u);switch(l){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:s++;break;case 12:case 14:case 4:s--;break;case 6:0===i&&(-1===a?s-=1:s+=1);break;case 1:case 13:case 5:u--;break;case 9:1===i&&(0===a?u-=1:u+=1);break;case 10:case 8:case 11:u++;break;default:return console.warn("Marching squares invalid state: "+l),!0}}};this.march=function(){for(var t=0;t<e.width&&!r;t+=1)for(var s=0;s<e.height&&!r;s+=1)i(t,s)>n&&15!==o(t,s)&&(r=a(t,s));return r}}var de=function(t,e){var n=Number.POSITIVE_INFINITY,r=null;return t.forEach((function(t){var i=V(t,e);i>=0&&i<n&&(r=t,n=i)})),r};function pe(t,e,n,r,i){var o=function(t,e,n){var r=null,i=Number.POSITIVE_INFINITY;return e.forEach((function(e){var o={x:t.getModel().x,y:t.getModel().y},a={x:e.getModel().x,y:e.getModel().y},s=Y(o,a),u=new G(o.x,o.y,a.x,a.y),c=n.reduce((function(t,e){return V(e,u)>0?t+1:t}),0);s*Math.pow(c+1,2)<i&&(r=e,i=s*Math.pow(c+1,2))})),r}(t,n,e);if(null===o)return[];return function(t){for(var n=[];t.length>0;){var r=t.pop();if(0===t.length){n.push(r);break}var i=t.pop(),o=new G(r.x1,r.y1,i.x2,i.y2);de(e,o)?(n.push(r),t.push(i)):t.push(o)}return n}(function(t,e,n,r){var i=[],o=[];o.push(t);for(var a=!0,s=0,u=function(t,e){var n=!1;return e.forEach((function(e){n||(H(t,{x:e.x1,y:e.y1})||H(t,{x:e.x2,y:e.y2}))&&(n=!0)})),n},c=function(t,e){for(var n=0,r=e;n<r.length;n++){var i=r[n].getBBox(),o=[[i.x,i.y],[i.x+i.width,i.y],[i.x,i.y+i.height],[i.x+i.width,i.y+i.height]];if(L(o,t.x,t.y))return!0}return!1};a&&s<n;){a=!1;for(var l=function(){var t=o.pop(),n=de(e,t);if(n){var l=U(n,t),h=l[0];if(2===l[1]){var f=function(s){for(var l=r,f=me(n,l,h,s),d=u(f,o)||u(f,i),p=c(f,e);!d&&p&&l>=1;)f=me(n,l/=1.5,h,s),d=u(f,o)||u(f,i),p=c(f,e);!f||d||s&&p||(o.push(new G(t.x1,t.y1,f.x,f.y)),o.push(new G(f.x,f.y,t.x2,t.y2)),a=!0)};f(!0),a||f(!1)}}a||i.push(t),s+=1};!a&&o.length;)l()}for(;o.length;)i.push(o.pop());return i}(new G(t.getModel().x,t.getModel().y,o.getModel().x,o.getModel().y),e,r,i))}var ge=function(t,e,n){var r=Object.assign(he,n),i=W(t.map((function(t){return{x:t.getModel().x,y:t.getModel().y}})));t=t.sort((function(t,e){return Y({x:t.getModel().x,y:t.getModel().y},i)-Y({x:e.getModel().x,y:e.getModel().y},i)}));var o=[],a=[];t.forEach((function(t){pe(t,e,o,r.maxRoutingIterations,r.morphBuffer).forEach((function(t){a.push(t)})),o.push(t)}));for(var s,u,c,l,h,f=function(t,e,n){var r={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},i=[];t.forEach((function(t){i.push(t.getBBox())})),e.forEach((function(t){i.push(t.getBBox())}));for(var o=0,a=i;o<a.length;o++){var s=a[o];r.minX=(s.minX<r.minX?s.minX:r.minX)-n,r.minY=(s.minY<r.minY?s.minY:r.minY)-n,r.maxX=(s.maxX>r.maxX?s.maxX:r.maxX)+n,r.maxY=(s.maxY>r.maxY?s.maxY:r.maxY)+n}return r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.x=r.minX,r.y=r.minY,r}(t,a,r.nodeR0),d=(s=f.width,u=f.height,c=r.pixelGroupSize,l=Math.ceil(s/c),h=Math.ceil(u/c),{cells:new Float32Array(Math.max(0,l*h)).fill(0),width:l,height:h}),p=[],g=[],v=0;v<r.maxMarchingIterations;v++)if(ve(t,e,a,f,d,r),g=[],new fe(p=[],d,r.threshold).march()){var m=p.map((function(t){return{x:Math.round(t.x*r.pixelGroupSize+f.minX),y:Math.round(t.y*r.pixelGroupSize+f.minY)}}));if(m){var y=m.length;if(r.skip>1)for(y=Math.floor(m.length/r.skip);y<3&&r.skip>1;)r.skip-=1,y=Math.floor(m.length/r.skip);for(var b=0,x=0;x<y;x+=1,b+=r.skip)g.push({x:m[b].x,y:m[b].y})}if(g&&function(){for(var e=0,n=t;e<n.length;e++){var r=n[e],i=g.map((function(t){return[t.x,t.y]}));if(!L(i,r.getBBox().centerX,r.getBBox().centerY))return!1}return!0}())return g;if(r.threshold*=.9,v<=.5*r.maxMarchingIterations)r.memberInfluenceFactor*=1.2,r.edgeInfluenceFactor*=1.2;else{if(!(0!==r.nonMemberInfluenceFactor&&e.length>0))break;r.nonMemberInfluenceFactor*=.8}}return g};function ve(t,e,n,r,i,o){function a(t,e){var n=Math.floor((t-e)/o.pixelGroupSize);return n<0?0:n}function s(t,e){return t*o.pixelGroupSize+e}var u=(o.nodeR0-o.nodeR1)*(o.nodeR0-o.nodeR1),c=(o.edgeR0-o.edgeR1)*(o.edgeR0-o.edgeR1),l=function(t,e){return[Math.min(a(t.minX,e+r.minX),i.width),Math.min(a(t.minY,e+r.minY),i.height),Math.min(a(t.maxX,-e+r.minX),i.width),Math.min(a(t.maxY,-e+r.minY),i.height)]},h=function(t,e){for(var n=t.getBBox(),a=l(n,o.nodeR1),u=a[0],c=a[1],h=a[2],f=a[3],d=c;d<f;d+=1)for(var p=u;p<h;p+=1)if(!(e<0&&i[p+d*i.width]<=0)){var g=s(p,r.minX),v=s(d,r.minY),m=q({x:g,y:v},{x:n.minX,y:n.minY,width:n.width,height:n.height});if(m<Math.pow(o.nodeR1,2)){var y=Math.sqrt(m)-o.nodeR1;i.cells[p+d*i.width]+=e*y*y}}};o.nodeInfluenceFactor&&t.forEach((function(t){h(t,o.nodeInfluenceFactor/u)})),o.edgeInfluenceFactor&&n.forEach((function(t){!function(t,e){for(var n=t.getBBox(),a=l(n,o.edgeR1),u=a[0],c=a[1],h=a[2],f=a[3],d=c;d<f;d+=1)for(var p=u;p<h;p+=1)if(!(e<0&&i.cells[p+d*i.width]<=0)){var g=s(p,r.minX),v=s(d,r.minY),m=X({x:g,y:v},t);if(m<Math.pow(o.edgeR1,2)){var y=Math.sqrt(m)-o.edgeR1;i.cells[p+d*i.width]+=e*y*y}}}(t,o.edgeInfluenceFactor/c)})),o.negativeNodeInfluenceFactor&&e.forEach((function(t){h(t,o.negativeNodeInfluenceFactor/u)}))}function me(t,e,n,r){var i=t.getBBox(),o=n[0],a=n[1],s=n[2],u=n[3],c={topLeft:{x:i.minX-e,y:i.minY-e},topRight:{x:i.maxX+e,y:i.minY-e},bottomLeft:{x:i.minX-e,y:i.maxY+e},bottomRight:{x:i.maxX+e,y:i.maxY+e}},l=i.height*i.width;function h(t,e){return i.width*(.5*(t.y-i.minY+(e.y-i.minY)))}if(a)return o?r?c.topLeft:c.bottomRight:s?r?c.bottomLeft:c.topRight:h(a,u)<.5*l?a.y>u.y?r?c.topLeft:c.bottomRight:r?c.topRight:c.bottomLeft:a.y<u.y?r?c.bottomLeft:c.topRight:r?c.bottomRight:c.topLeft;if(u){if(o)return r?c.topRight:c.bottomLeft;if(s)return r?c.bottomRight:c.topLeft}return h(o,s)<.5*l?o.x>s.x?r?c.topLeft:c.bottomRight:r?c.bottomLeft:c.topRight:o.x<s.x?r?c.topRight:c.bottomLeft:r?c.bottomRight:c.topLeft}var ye=function(){function t(t,e){this.cfg=Object(u.deepMix)(this.getDefaultCfg(),e),this.graph=t,this.id=this.cfg.id,this.group=this.cfg.group,this.members=this.cfg.members.map((function(e){return Object(u.isString)(e)?t.findById(e):e})),this.nonMembers=this.cfg.nonMembers.map((function(e){return Object(u.isString)(e)?t.findById(e):e})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()}return t.prototype.getDefaultCfg=function(){return{id:"g6-hull",type:"round-convex",members:[],nonMembers:[],style:{fill:"lightblue",stroke:"blue",opacity:.2},padding:10}},t.prototype.setPadding=function(){var t=this.members.length&&this.members[0].getKeyShape().getCanvasBBox().width/2;this.padding=this.cfg.padding>0?this.cfg.padding+t:10+t,this.cfg.bubbleCfg={nodeR0:this.padding-t,nodeR1:this.padding-t,morphBuffer:this.padding-t}},t.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),"round-convex"!==this.type&&"smooth-convex"!==this.type&&"bubble"!==this.type&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},t.prototype.calcPath=function(t,e){var n,r,i;switch(this.type){case"round-convex":i=se((n=le(t)).map((function(t){return[t.x,t.y]})),this.padding),r=Object($t.b)(i);break;case"smooth-convex":2===(n=le(t)).length?(i=se(n.map((function(t){return[t.x,t.y]})),this.padding),r=Object($t.b)(i)):n.length>2&&(i=ue(n.map((function(t){return[t.x,t.y]})),this.padding),r=re(i));break;case"bubble":r=(n=ge(t,e,this.cfg.bubbleCfg)).length>=2&&re(n)}return r},t.prototype.render=function(){this.group.addShape("path",{attrs:Object(f.__assign)({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id,capture:!1}),this.group.toBack()},t.prototype.addMember=function(t){if(t){Object(u.isString)(t)&&(t=this.graph.findById(t)),this.members.push(t);var e=this.nonMembers.indexOf(t);return e>-1&&this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.addNonMember=function(t){if(t){Object(u.isString)(t)&&(t=this.graph.findById(t)),this.nonMembers.push(t);var e=this.members.indexOf(t);return e>-1&&this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.removeMember=function(t){if(t){Object(u.isString)(t)&&(t=this.graph.findById(t));var e=this.members.indexOf(t);return e>-1&&(this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.removeNonMember=function(t){if(t){Object(u.isString)(t)&&(t=this.graph.findById(t));var e=this.nonMembers.indexOf(t);return e>-1&&(this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.updateData=function(t,e){var n=this;this.group.findById(this.id).remove(),t&&(this.members=t.map((function(t){return Object(u.isString)(t)?n.graph.findById(t):t}))),e&&(this.nonMembers=e.map((function(t){return Object(u.isString)(t)?n.graph.findById(t):t}))),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.updateStyle=function(t){this.group.findById(this.id).attr(Object(f.__assign)({},t))},t.prototype.updateCfg=function(t){var e=this;this.cfg=Object(u.deepMix)(this.cfg,t),this.id=this.cfg.id,this.group=this.cfg.group,t.members&&(this.members=this.cfg.members.map((function(t){return Object(u.isString)(t)?e.graph.findById(t):t}))),t.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map((function(t){return Object(u.isString)(t)?e.graph.findById(t):t}))),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.contain=function(t){var e,n,r=this,i=(e=Object(u.isString)(t)?this.graph.findById(t):t).getKeyShape();if("path"===e.get("type"))n=ne(i.attr("path"));else{var o=i.getCanvasBBox();n=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return n=n.map((function(t){var e=r.graph.getPointByCanvas(t[0],t[1]);return[e.x,e.y]})),B(n,ne(this.path))},t.prototype.destroy=function(){this.group.remove(),this.cfg=null},t}(),be=p.ext.transform,xe=function(t){function e(e){var n=t.call(this)||this;return n.cfg=Object(u.deepMix)(n.getDefaultCfg(),e),n.init(),n.animating=!1,n.destroyed=!1,n.cfg.enabledStack&&(n.undoStack=new g.Stack(n.cfg.maxStep),n.redoStack=new g.Stack(n.cfg.maxStep)),n}return Object(f.__extends)(e,t),e.prototype.init=function(){this.initCanvas();var t=new Pt(this),e=new St(this),n=new qt(this),r=new Zt(this);this.set({viewController:t,modeController:e,itemController:n,stateController:r}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},e.prototype.initGroups=function(){var t=this.get("canvas");if(t){var e=(t.get("el")||{}).id,n=void 0===e?"g6":e,r=t.addGroup({id:n+"-root",className:nt.rootContainerClassName});if(this.get("groupByTypes")){var i=r.addGroup({id:n+"-edge",className:nt.edgeContainerClassName}),o=r.addGroup({id:n+"-node",className:nt.nodeContainerClassName}),a=r.addGroup({id:n+"-combo",className:nt.comboContainerClassName});a.toBack(),this.set({nodeGroup:o,edgeGroup:i,comboGroup:a})}var s=r.addGroup({id:n+"-delegate",className:nt.delegateContainerClassName});this.set({delegateGroup:s}),this.set("group",r)}},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.2,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[]}},e.prototype.set=function(t,e){return Object(u.isPlainObject)(t)?this.cfg=Object(f.__assign)(Object(f.__assign)({},this.cfg),t):this.cfg[t]=e,this},e.prototype.get=function(t){var e;return null===(e=this.cfg)||void 0===e?void 0:e[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,e){Object(u.isString)(t)&&(t=this.findById(t));var n=this.get("itemController");e||(e=t.get("states")),n.clearItemStates(t,e),this.get("stateController").updateStates(t,e,!1)},e.prototype.node=function(t){"function"==typeof t&&this.set("nodeMapper",t)},e.prototype.edge=function(t){"function"==typeof t&&this.set("edgeMapper",t)},e.prototype.combo=function(t){"function"==typeof t&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,e){var n,r=this.get(t+"s");return Object(u.each)(r,(function(t,r){if(e(t,r))return n=t})),n},e.prototype.findAll=function(t,e){var n=[];return Object(u.each)(this.get(t+"s"),(function(t,r){e(t,r)&&n.push(t)})),n},e.prototype.findAllByState=function(t,e){return this.findAll(t,(function(t){return t.hasState(e)}))},e.prototype.translate=function(t,e){var n=this.get("group"),r=Object(u.clone)(n.getMatrix());r||(r=[1,0,0,0,1,0,0,0,1]),r=be(r,[["t",t,e]]),n.setMatrix(r),this.emit("viewportchange",{action:"translate",matrix:n.getMatrix()}),this.autoPaint()},e.prototype.moveTo=function(t,e,n,r){var i=this.get("group");T(i,{x:t,y:e},n,r||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:i.getMatrix()})},e.prototype.fitView=function(t,e){t&&this.set("fitViewPadding",t);var n=this.get("viewController");e?n.fitViewByRules(e):n.fitView(),this.autoPaint()},e.prototype.fitCenter=function(){this.get("viewController").fitCenter(),this.autoPaint()},e.prototype.addBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!0),this},e.prototype.removeBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!1),this},e.prototype.updateBehavior=function(t,e,n){return this.get("modeController").updateBehavior(t,e,n),this},e.prototype.zoom=function(t,e,n,r){var i=this,o=this.get("group"),a=Object(u.clone)(o.getMatrix()),s=this.get("minZoom"),c=this.get("maxZoom");if(a||(a=[1,0,0,0,1,0,0,0,1]),a=be(a,e?[["t",-e.x,-e.y],["s",t,t],["t",e.x,e.y]]:[["s",t,t]]),s&&a[0]<s||c&&a[0]>c)return!1;if(n){var l=Object(u.clone)(o.getMatrix());l||(l=[1,0,0,0,1,0,0,0,1]);var h=l[0],f=h*t,d=void 0;if(r)if(r.callback){var p=r.callback;(d=Object(u.clone)(r)).callback=function(){i.emit("viewportchange",{action:"zoom",matrix:l}),p()}}else d=r;else d={duration:500,callback:function(){i.emit("viewportchange",{action:"zoom",matrix:l})}};o.animate((function(t){if(1===t)l=a;else{var n=Z(h,f,t)/l[0];l=be(l,e?[["t",-e.x,-e.y],["s",n,n],["t",e.x,e.y]]:[["s",n,n]])}return{matrix:l}}),d)}else o.setMatrix(a),this.emit("viewportchange",{action:"zoom",matrix:a}),this.autoPaint();return!0},e.prototype.zoomTo=function(t,e){var n=t/this.getZoom();return this.zoom(n,e)},e.prototype.focusItem=function(t,e,n){var r=this.get("viewController"),i=!1;e?i=!0:void 0===e&&(i=this.get("animate"));var o={};n?o=n:void 0===n&&(o=this.get("animateCfg")),r.focus(t,i,o),this.autoPaint()},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,e){return this.get("viewController").getPointByClient(t,e)},e.prototype.getClientByPoint=function(t,e){return this.get("viewController").getClientByPoint(t,e)},e.prototype.getPointByCanvas=function(t,e){return this.get("viewController").getPointByCanvas(t,e)},e.prototype.getCanvasByPoint=function(t,e){return this.get("viewController").getCanvasByPoint(t,e)},e.prototype.getGraphCenterPoint=function(){var t=this.get("group").getCanvasBBox();return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}},e.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},e.prototype.showItem=function(t,e){void 0===e&&(e=!0);var n=this.get("itemController").changeItemVisibility(t,!0);if(e&&this.get("enabledStack")){var r=n.getID(),i={},o={};switch(n.getType()){case"node":i.nodes=[{id:r,visible:!1}],o.nodes=[{id:r,visible:!0}];break;case"edge":i.nodes=[{id:r,visible:!1}],o.edges=[{id:r,visible:!0}];break;case"combo":i.nodes=[{id:r,visible:!1}],o.combos=[{id:r,visible:!0}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.hideItem=function(t,e){void 0===e&&(e=!0);var n=this.get("itemController").changeItemVisibility(t,!1);if(e&&this.get("enabledStack")){var r=n.getID(),i={},o={};switch(n.getType()){case"node":i.nodes=[{id:r,visible:!0}],o.nodes=[{id:r,visible:!1}];break;case"edge":i.nodes=[{id:r,visible:!0}],o.edges=[{id:r,visible:!1}];break;case"combo":i.nodes=[{id:r,visible:!0}],o.combos=[{id:r,visible:!1}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.refreshItem=function(t){this.get("itemController").refreshItem(t)},e.prototype.setAutoPaint=function(t){this.set("autoPaint",t),this.get("canvas").set("autoDraw",t)},e.prototype.remove=function(t,e){void 0===e&&(e=!0),this.removeItem(t,e)},e.prototype.removeItem=function(t,e){void 0===e&&(e=!0);var n=t;if(Object(u.isString)(t)&&(n=this.findById(t)),!n&&Object(u.isString)(t))console.warn("The item to be removed does not exist!");else if(n){var r="";if(n.getType&&(r=n.getType()),e&&this.get("enabledStack")){var i=Object(f.__assign)(Object(f.__assign)({},n.getModel()),{itemType:r}),o={};switch(r){case"node":o.nodes=[i],o.edges=[];for(var a=n.getEdges(),s=a.length-1;s>=0;s--)o.edges.push(Object(f.__assign)(Object(f.__assign)({},a[s].getModel()),{itemType:"edge"}));break;case"edge":o.edges=[i];break;case"combo":o.combos=[i]}this.pushStack("delete",{before:o,after:{}})}if("node"===r)n.getModel().comboId&&this.updateComboTree(n,void 0,!1);if(this.get("itemController").removeItem(n),"combo"===r){var c=yt(this.get("comboTrees"));this.set("comboTrees",c)}}},e.prototype.addItem=function(t,e,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0);var i=this.get("comboSorted");this.set("comboSorted",i&&!r);var o=this.get("itemController");if(!function(t,e){if("node"===t||"combo"===t){if(e.id&&!Object(u.isString)(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c"+e.id+"%c is not a string.","font-size: 20px; color: red;",""),!1}else if(!("edge"!==t||e.source&&e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0}(t,e))return!1;if(!e.id||!this.findById(e.id)){var a,s=this.get("comboTrees");if(s||(s=[]),"combo"===t){var c=this.get("itemMap"),l=!1;if(s.forEach((function(n){l||pt(n,(function(n){if(e.parentId===n.id){l=!0;var r=Object(f.__assign)({id:e.id,depth:n.depth+2},e);n.children?n.children.push(r):n.children=[r],e.depth=r.depth,a=o.addItem(t,e)}var i=c[n.id];return l&&i&&i.getType&&"combo"===i.getType()&&o.updateCombo(i,n.children),!0}))})),!l){var h=Object(f.__assign)({id:e.id,depth:0},e);e.depth=h.depth,s.push(h),a=o.addItem(t,e)}this.set("comboTrees",s)}else if("node"===t&&Object(u.isString)(e.comboId)&&s){var d;(d=this.findById(e.comboId))&&d.getType&&"combo"!==d.getType()&&console.warn("'"+e.comboId+"' is not a id of a combo in the graph, the node will be added without combo."),a=o.addItem(t,e);var p=this.get("itemMap"),g=!1,v=!1;(s||[]).forEach((function(t){v||g||pt(t,(function(t){if(t.id===e.id)return v=!0,!1;if(e.comboId===t.id&&!v){g=!0;var n=Object(u.clone)(e);n.itemType="node",t.children?t.children.push(n):t.children=[n],n.depth=t.depth+1}return g&&p[t.id].getType&&"combo"===p[t.id].getType()&&o.updateCombo(p[t.id],t.children),!0}))}))}else a=o.addItem(t,e);if("node"===t&&e.comboId||"combo"===t&&e.parentId)(d=this.findById(e.comboId||e.parentId))&&d.getType&&"combo"===d.getType()&&d.addChild(a);var m=this.get("combos");if(m&&m.length>0&&this.sortCombos(),this.autoPaint(),n&&this.get("enabledStack")){var y=Object(f.__assign)(Object(f.__assign)({},a.getModel()),{itemType:t}),b={};switch(t){case"node":b.nodes=[y];break;case"edge":b.edges=[y];break;case"combo":b.combos=[y]}this.pushStack("add",{before:{},after:b})}return a}console.warn("This item exists already. Be sure the id %c"+e.id+"%c is unique.","font-size: 20px; color: red;","")},e.prototype.add=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=!0),this.addItem(t,e,n,r)},e.prototype.updateItem=function(t,e,n){var r=this;void 0===n&&(n=!0);var i,o=this.get("itemController");i=Object(u.isString)(t)?this.findById(t):t;var a=Object(u.clone)(i.getModel()),s="";i.getType&&(s=i.getType());var c=Object(f.__spreadArray)([],i.getStates(),!0);if("combo"===s&&Object(u.each)(c,(function(t){return r.setItemState(i,t,!1)})),o.updateItem(i,e),"combo"===s&&Object(u.each)(c,(function(t){return r.setItemState(i,t,!0)})),n&&this.get("enabledStack")){var l={nodes:[],edges:[],combos:[]},h={nodes:[],edges:[],combos:[]},d=Object(f.__assign)({id:a.id},e);switch(s){case"node":l.nodes.push(a),h.nodes.push(d);break;case"edge":l.edges.push(a),h.edges.push(d);break;case"combo":l.combos.push(a),h.combos.push(d)}"node"===s&&l.nodes.push(a),this.pushStack("update",{before:l,after:h})}},e.prototype.update=function(t,e,n){void 0===n&&(n=!0),this.updateItem(t,e,n)},e.prototype.setItemState=function(t,e,n){Object(u.isString)(t)&&(t=this.findById(t)),this.get("itemController").setItemState(t,e,n);var r=this.get("stateController");Object(u.isString)(n)?r.updateState(t,e+":"+n,!0):r.updateState(t,e,n)},e.prototype.priorityState=function(t,e){this.get("itemController").priorityState(t,e)},e.prototype.data=function(t){_t(t),this.set("data",t)},e.prototype.render=function(){var t=this;this.set("comboSorted",!1);var e=this.get("data");if(this.get("enabledStack")&&this.clearStack(),!e)throw new Error("data must be defined first");var n=e.nodes,r=void 0===n?[]:n,i=e.edges,o=void 0===i?[]:i,a=e.combos,s=void 0===a?[]:a;if(this.clear(!0),this.emit("beforerender"),Object(u.each)(r,(function(e){t.add("node",e,!1,!1)})),s&&0!==s.length){var c=mt(s,r);this.set("comboTrees",c),t.addCombos(s)}Object(u.each)(o,(function(e){t.add("edge",e,!1,!1)}));var l=t.get("animate");(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",!1);var h=t.get("layoutController");if(h){if(h.layout((function(){t.get("fitView")?t.fitView():t.get("fitCenter")&&t.fitCenter();t.autoPaint(),t.emit("afterrender"),(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",l)})),this.destroyed)return}else t.get("fitView")&&t.fitView(),t.get("fitCenter")&&t.fitCenter(),t.emit("afterrender"),t.set("animate",l);this.get("groupByTypes")||(s&&0!==s.length?this.sortCombos():e.nodes&&e.edges&&e.nodes.length<e.edges.length?this.getNodes().forEach((function(t){t.toFront()})):this.getEdges().forEach((function(t){t.toBack()})));this.get("enabledStack")&&this.pushStack("render")},e.prototype.read=function(t){this.data(t),this.render()},e.prototype.diffItems=function(t,e,n){var r,i=this,o=this.get("itemMap");Object(u.each)(n,(function(n){if(r=o[n.id]){if(i.get("animate")&&"node"===t){var a=r.getContainer().getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]),r.set("originAttrs",{x:a[6],y:a[7]})}i.updateItem(r,n,!1)}else r=i.addItem(t,n,!1);r&&e[t+"s"].push(r)}))},e.prototype.changeData=function(t,e){void 0===e&&(e=!0);var n=this;if(!_t(t))return this;e&&this.get("enabledStack")&&this.pushStack("changedata",{before:n.save(),after:t}),this.set("comboSorted",!1),this.removeHulls(),this.getNodes().map((function(t){return n.clearItemStates(t)})),this.getEdges().map((function(t){return n.clearItemStates(t)}));var r=this.get("canvas"),i=r.get("localRefresh");r.set("localRefresh",!1),n.get("data")||(n.data(t),n.render());var o=this.get("itemMap"),a={nodes:[],edges:[]},s=t.combos;if(s){var c=mt(s,t.nodes);this.set("comboTrees",c)}else this.set("comboTrees",[]);this.diffItems("node",a,t.nodes),Object(u.each)(o,(function(t,e){o[e].getModel().depth=0,t.getType&&"edge"===t.getType()||(t.getType&&"combo"===t.getType()?(delete o[e],t.destroy()):a.nodes.indexOf(t)<0&&(delete o[e],n.remove(t,!1)))}));for(var l=this.getCombos(),h=l.length-1;h>=0;h--)l[h].destroyed&&l.splice(h,1);s&&(n.addCombos(s),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",a,t.edges),Object(u.each)(o,(function(t,e){(!t.getType||"node"!==t.getType()&&"combo"!==t.getType())&&a.edges.indexOf(t)<0&&(delete o[e],n.remove(t,!1))})),this.set({nodes:a.nodes,edges:a.edges});var f=this.get("layoutController");return f&&(f.changeData(),n.get("animate")&&!f.getLayoutType()?n.positionsAnimate():n.autoPaint()),setTimeout((function(){r.set("localRefresh",i)}),16),this},e.prototype.addCombos=function(t){var e=this.get("comboTrees");this.get("itemController").addCombos(e,t)},e.prototype.createCombo=function(t,e){var n=this;this.set("comboSorted",!1);var r,i="";if(t){if(Object(u.isString)(t))i=t,r={id:t};else{if(!(i=t.id))return void console.warn("Create combo failed. Please assign a unique string id for the adding combo.");r=t}var o=e.map((function(t){var e=n.findById(t),r=e.getModel(),o="";e.getType&&(o=e.getType());var a={id:e.getID(),itemType:o};return"combo"===o?(a.parentId=i,r.parentId=i):"node"===o&&(a.comboId=i,r.comboId=i),a}));r.children=o,this.addItem("combo",r,!1),this.set("comboSorted",!1);var a=this.get("comboTrees");(a||[]).forEach((function(t){pt(t,(function(t){return t.id!==i||(t.itemType="combo",t.children=o,!1)}))})),a&&this.sortCombos()}},e.prototype.uncombo=function(t){var e,n=this,r=t;if(Object(u.isString)(t)&&(r=this.findById(t)),!r||r.getType&&"combo"!==r.getType())console.warn("The item is not a combo!");else{var i=r.getModel().parentId,o=this.get("comboTrees");o||(o=[]);var a,s=this.get("itemMap"),c=r.get("id"),l=[],h=this.get("combos"),f=this.findById(i);if(o.forEach((function(t){a||pt(t,(function(t){var e;if(t.id===c){a=t,r.getEdges().forEach((function(t){n.removeItem(t,!1)}));var o=h.indexOf(r);h.splice(o,1),delete s[c],r.destroy(),n.emit("afterremoveitem",{item:r,type:"combo"})}return!i||!a||t.id!==i||(f.removeCombo(r),-1!==(o=(l=t.children).indexOf(a))&&l.splice(o,1),null===(e=a.children)||void 0===e||e.forEach((function(t){var e=n.findById(t.id),r=e.getModel();e.getType&&"combo"===e.getType()?(t.parentId=i,delete t.comboId,r.parentId=i,delete r.comboId):e.getType&&"node"===e.getType()&&(t.comboId=i,r.comboId=i),f.addChild(e),l.push(t)})),!1)}))})),!i&&a){var d=o.indexOf(a);o.splice(d,1),null===(e=a.children)||void 0===e||e.forEach((function(t){t.parentId=void 0;var e=n.findById(t.id).getModel();delete e.parentId,delete e.comboId,"node"!==t.itemType&&o.push(t)}))}}},e.prototype.updateCombos=function(){var t=this,e=this.get("comboTrees"),n=this.get("itemController"),r=this.get("itemMap");(e||[]).forEach((function(e){pt(e,(function(e){if(!e)return!0;var i=r[e.id];if(i&&i.getType&&"combo"===i.getType()){var o=Object(f.__spreadArray)([],i.getStates(),!0);Object(u.each)(o,(function(e){return t.setItemState(i,e,!1)})),n.updateCombo(i,e.children),Object(u.each)(o,(function(e){return t.setItemState(i,e,!0)}))}return!0}))})),this.sortCombos()},e.prototype.updateCombo=function(t){var e,n=this,r=t;if(Object(u.isString)(t)&&(r=this.findById(t)),!r||r.getType&&"combo"!==r.getType())console.warn("The item to be updated is not a combo!");else{e=r.get("id");var i=this.get("comboTrees"),o=this.get("itemController"),a=this.get("itemMap");(i||[]).forEach((function(t){pt(t,(function(t){if(!t)return!0;var r=a[t.id];if(e===t.id&&r&&r.getType&&"combo"===r.getType()){var i=Object(f.__spreadArray)([],r.getStates(),!0);Object(u.each)(i,(function(t){r.getStateStyle(t)&&n.setItemState(r,t,!1)})),o.updateCombo(r,t.children),Object(u.each)(i,(function(t){r.getStateStyle(t)&&n.setItemState(r,t,!0)})),e&&(e=t.parentId)}return!0}))}))}},e.prototype.updateComboTree=function(t,e,n){void 0===n&&(n=!0);var r;this.set("comboSorted",!1);var i,o=(r=Object(u.isString)(t)?this.findById(t):t).getModel(),a=o.comboId||o.parentId,s="";if(r.getType&&(s=r.getType()),e&&"combo"===s){var c,l=this.get("comboTrees"),h=!0;if((l||[]).forEach((function(t){c||dt(t,(function(t){if(!c)return t.id===r.getID()&&(c=t),!0}))})),dt(c,(function(t){return t.id!==e||(h=!1,!1)})),!h)return void console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!")}if(n&&this.get("enabledStack")){var f={},d={};"combo"===s?(f.combos=[{id:o.id,parentId:o.parentId}],d.combos=[{id:o.id,parentId:e}]):"node"===s&&(f.nodes=[{id:o.id,parentId:o.comboId}],d.nodes=[{id:o.id,parentId:e}]),this.pushStack("updateComboTree",{before:f,after:d})}if(o.parentId||o.comboId){var p=this.findById(o.parentId||o.comboId);p&&p.removeChild(r)}("combo"===s?o.parentId=e:"node"===s&&(o.comboId=e),e)&&((i=this.findById(e))&&i.addChild(r));a&&((i=this.findById(a))&&i.removeChild(r));var g=yt(this.get("comboTrees"),o.id,e);this.set("comboTrees",g),this.updateCombos()},e.prototype.save=function(){var t=[],e=[],n=[];return Object(u.each)(this.get("nodes"),(function(e){t.push(e.getModel())})),Object(u.each)(this.get("edges"),(function(t){e.push(t.getModel())})),Object(u.each)(this.get("combos"),(function(t){n.push(t.getModel())})),{nodes:t,edges:e,combos:n}},e.prototype.changeSize=function(t,e){return this.get("viewController").changeSize(t,e),this},e.prototype.refresh=function(){if(this.emit("beforegraphrefresh"),this.get("animate"))this.positionsAnimate();else{var t=this.get("nodes"),e=this.get("edges"),n=this.get("edges");Object(u.each)(t,(function(t){t.refresh()})),Object(u.each)(e,(function(t){t.refresh()})),Object(u.each)(n,(function(t){t.refresh()}))}this.emit("aftergraphrefresh"),this.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if(Object(u.isString)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType()))return t.getChildren();console.warn("The combo does not exist!")},e.prototype.positionsAnimate=function(){var t=this;t.emit("beforeanimate");var e=t.get("animateCfg"),n=e.onFrame,r=t.getNodes(),i=r.map((function(t){var e=t.getModel();return{id:e.id,x:e.x,y:e.y}}));t.isAnimating()&&t.stopAnimate(),t.get("canvas").animate((function(e){Object(u.each)(i,(function(r){var i=t.findById(r.id);if(i&&!i.destroyed){var o=i.get("originAttrs"),a=i.get("model");if(!o){var s=i.getContainer().getMatrix();s||(s=[1,0,0,0,1,0,0,0,1]),o={x:s[6],y:s[7]},i.set("originAttrs",o)}if(n){var u=n(i,e,r,o);i.set("model",Object.assign(a,u))}else a.x=o.x+(r.x-o.x)*e,a.y=o.y+(r.y-o.y)*e}})),t.refreshPositions()}),{duration:e.duration,easing:e.easing,callback:function(){Object(u.each)(r,(function(t){t.set("originAttrs",null)})),e.callback&&e.callback(),t.emit("afteranimate"),t.animating=!1}})},e.prototype.refreshPositions=function(){this.emit("beforegraphrefreshposition");var t,e=this.get("nodes"),n=this.get("edges"),r=this.get("vedges"),i=this.get("combos"),o={};Object(u.each)(e,(function(e){t=e.getModel();var n=e.get("originAttrs");if(!n||t.x!==n.x||t.y!==n.y){var r=e.updatePosition({x:t.x,y:t.y});o[t.id]=r,t.comboId&&(o[t.comboId]=o[t.comboId]||r)}})),i&&0!==i.length&&this.updateCombos(),Object(u.each)(n,(function(t){var e=t.getSource().getModel(),n=t.getTarget();if(!Object(u.isPlainObject)(n)){var r=n.getModel();(o[e.id]||o[r.id]||t.getModel().isComboEdge)&&t.refresh()}})),Object(u.each)(r,(function(t){t.refresh()})),this.emit("aftergraphrefreshposition"),this.autoPaint()},e.prototype.stopAnimate=function(){this.get("canvas").stopAnimate()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){return this.get("modeController").getMode()},e.prototype.setMode=function(t){return this.get("modeController").setMode(t),this},e.prototype.clear=function(t){var e;return void 0===t&&(t=!1),null===(e=this.get("canvas"))||void 0===e||e.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t,e,n){var r=this,i=this.get("layoutController");if(Object(u.isString)(t)&&(t={type:t}),e){var o=n;o||(o="begin"===e?{x:0,y:0}:{x:this.getWidth()/2,y:this.getHeight()/2}),o=this.getPointByCanvas(o.x,o.y);var a=["force","gForce","fruchterman"];a.includes(t.type)||!t.type&&a.includes(null==i?void 0:i.layoutType)?t.center=[o.x,o.y]:this.once("afterlayout",(function(t){var n=r.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];o.x=o.x*n[0]+n[6],o.y=o.y*n[0]+n[7];var i=r.getGroup().getCanvasBBox(),a=i.minX,s=i.maxX,u=i.minY,c={x:(a+s)/2,y:(u+i.maxY)/2};"begin"===e&&(c.x=a,c.y=u),r.translate(o.x-c.x,o.y-c.y)}))}var s=this.get("layout"),c={};Object.assign(c,s,t),this.set("layout",c),i.isLayoutTypeSame(c)&&c.gpuEnabled===s.gpuEnabled?i.updateLayoutCfg(c):i.changeLayout(c)},e.prototype.destroyLayout=function(){this.get("layoutController").destroyLayout()},e.prototype.layout=function(){var t=this.get("layoutController"),e=this.get("layout");e&&t&&(e.workerEnabled?t.layout():t.layoutMethod?t.relayout(!0):t.layout())},e.prototype.collapseCombo=function(t){var e=this;if(Object(u.isString)(t)&&(t=this.findById(t)),t){this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var n=t.getModel();this.get("itemController").collapseCombo(t),n.collapsed=!0;var r=this.getEdges().concat(this.get("vedges")),i=[],o=[],a=this.get("comboTrees"),s=!1;(a||[]).forEach((function(t){s||dt(t,(function(t){if(s&&t.depth<=n.depth)return!1;if(n.id===t.id&&(s=!0),s){var r=e.findById(t.id);r&&r.getType&&"combo"===r.getType()&&(i=i.concat(r.getNodes()),o=o.concat(r.getCombos()))}return!0}))}));var c={},l=[];r.forEach((function(t){if(!t.isVisible()||t.getModel().isVEdge){var r=t.getSource(),a=t.getTarget();if((i.includes(r)||o.includes(r))&&!i.includes(a)&&!o.includes(a)||r.getModel().id===n.id){if((f=t.getModel()).isVEdge)return void e.removeItem(t,!1);for(var s=a.getModel();!a.isVisible();){if(!(a=e.findById(s.parentId||s.comboId))||!s.parentId&&!s.comboId)return;s=a.getModel()}var u=s.id;if(c[n.id+"-"+u])return void(c[n.id+"-"+u]+=f.size||1);var h=e.addItem("vedge",{source:n.id,target:u,isVEdge:!0},!1);c[n.id+"-"+u]=f.size||1,l.push(h)}else if(!i.includes(r)&&!o.includes(r)&&(i.includes(a)||o.includes(a))||a.getModel().id===n.id){var f;if((f=t.getModel()).isVEdge)return void e.removeItem(t,!1);for(var d=r.getModel();!r.isVisible();){if(!(r=e.findById(d.parentId||d.comboId))||!d.parentId&&!d.comboId)return;d=r.getModel()}var p=d.id;if(c[p+"-"+n.id])return void(c[p+"-"+n.id]+=f.size||1);h=e.addItem("vedge",{target:n.id,source:p,isVEdge:!0},!1);c[p+"-"+n.id]=f.size||1,l.push(h)}}})),l.forEach((function(t){var n=t.getModel();e.updateItem(t,{size:c[n.source+"-"+n.target]},!1)})),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})}else console.warn("The combo to be collapsed does not exist!")},e.prototype.expandCombo=function(t){var e=this;if(Object(u.isString)(t)&&(t=this.findById(t)),!t||t.getType&&"combo"!==t.getType())console.warn("The combo to be collapsed does not exist!");else{this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var n=t.getModel();this.get("itemController").expandCombo(t),n.collapsed=!1;var r=this.getEdges().concat(this.get("vedges")),i=[],o=[],a=this.get("comboTrees"),s=!1;(a||[]).forEach((function(t){s||dt(t,(function(t){if(s&&t.depth<=n.depth)return!1;if(n.id===t.id&&(s=!0),s){var r=e.findById(t.id);r&&r.getType&&"combo"===r.getType()&&(i=i.concat(r.getNodes()),o=o.concat(r.getCombos()))}return!0}))}));var c={},l={};r.forEach((function(t){if(!t.isVisible()||t.getModel().isVEdge){var r=t.getSource(),a=t.getTarget(),s=r.get("id"),u=a.get("id");if((i.includes(r)||o.includes(r))&&!i.includes(a)&&!o.includes(a)||s===n.id){if(t.getModel().isVEdge)return void e.removeItem(t,!1);for(var h=a.getModel();!a.isVisible();){if(!(a=e.findById(h.comboId||h.parentId))||!h.parentId&&!h.comboId)return;h=a.getModel()}u=h.id;for(var f=r.getModel();!r.isVisible();){if(!(r=e.findById(f.comboId||f.parentId))||!f.parentId&&!f.comboId)return;if(f.comboId===n.id||f.parentId===n.id)break;f=r.getModel()}if(s=f.id,u){if(c[p=s+"-"+u])return c[p]+=t.getModel().size||1,void e.updateItem(l[p],{size:c[p]},!1);var d=e.addItem("vedge",{source:s,target:u,isVEdge:!0},!1);c[p]=t.getModel().size||1,l[p]=d}}else if(!i.includes(r)&&!o.includes(r)&&(i.includes(a)||o.includes(a))||u===n.id){if(t.getModel().isVEdge)return void e.removeItem(t,!1);for(f=r.getModel();!r.isVisible();){if(!(r=e.findById(f.comboId||f.parentId))||!f.parentId&&!f.comboId)return;f=r.getModel()}s=f.id;for(h=a.getModel();!a.isVisible();){if(!(a=e.findById(h.comboId||h.parentId))||!h.parentId&&!h.comboId)return;if(h.comboId===n.id||h.parentId===n.id)break;h=a.getModel()}if(u=h.id,s){var p;if(c[p=s+"-"+u])return c[p]+=t.getModel().size||1,void e.updateItem(l[p],{size:c[p]},!1);d=e.addItem("vedge",{target:u,source:s,isVEdge:!0},!1);c[p]=t.getModel().size||1,l[p]=d}}else(i.includes(r)||o.includes(r))&&(i.includes(a)||o.includes(a))&&r.isVisible()&&a.isVisible()&&t.show()}})),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})}},e.prototype.collapseExpandCombo=function(t){if(Object(u.isString)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType())){for(var e=t.getModel(),n=this.findById(e.parentId);n;){var r=n.getModel();if(r.collapsed)return console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),void(n=void 0);n=this.findById(r.parentId)}e.collapsed?this.expandCombo(t):this.collapseCombo(t),this.updateCombo(t)}},e.prototype.sortCombos=function(){var t=this;if(!this.get("comboSorted")){this.set("comboSorted",!0);var e=[],n={};(this.get("comboTrees")||[]).forEach((function(t){dt(t,(function(t){return e[t.depth]?e[t.depth].push(t.id):e[t.depth]=[t.id],n[t.id]=t.depth,!0}))})),(this.getEdges().concat(this.get("vedges"))||[]).forEach((function(t){var r=t.getModel(),i=n[r.source]||0,o=n[r.target]||0,a=Math.max(i,o);e[a]?e[a].push(r.id):e[a]=[r.id]})),e.forEach((function(e){if(e&&e.length)for(var n=e.length-1;n>=0;n--){var r=t.findById(e[n]);r&&r.toFront()}}))}},e.prototype.getNeighbors=function(t,e){var n=t;return Object(u.isString)(t)&&(n=this.findById(t)),n.getNeighbors(e)},e.prototype.getNodeDegree=function(t,e,n){void 0===e&&(e=void 0),void 0===n&&(n=!1);var r=t;Object(u.isString)(t)&&(r=this.findById(t));var i=this.get("degrees");i&&!n||(i=Object(g.getDegree)(this.save()),this.set("degrees",i));var o=i[r.getID()],a=0;if(!o)return 0;switch(e){case"in":a=o.inDegree;break;case"out":a=o.outDegree;break;case"all":a=o;break;default:a=o.degree}return a},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear())},e.prototype.pushStack=function(t,e,n){if(void 0===t&&(t="update"),void 0===n&&(n="undo"),this.get("enabledStack")){var r=e?Object(u.clone)(e):{before:{},after:Object(u.clone)(this.save())};"redo"===n?this.redoStack.push({action:t,data:r}):this.undoStack.push({action:t,data:r}),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack})}else console.warn("请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !")},e.prototype.getAdjMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var n=this.get("adjMatrix");return n&&t||(n=Object(g.getAdjMatrix)(this.save(),e),this.set("adjMatrix",n)),n},e.prototype.getShortestPathMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var n=this.get("adjMatrix"),r=this.get("shortestPathMatrix");return n&&t||(n=Object(g.getAdjMatrix)(this.save(),e),this.set("adjMatrix",n)),r&&t||(r=Object(g.floydWarshall)(this.save(),e),this.set("shortestPathMatrix",r)),r},e.prototype.on=function(e,n,r){return t.prototype.on.call(this,e,n,r)},e.prototype.destroy=function(){this.clear(),this.clearStack(),this.get("itemController").destroy(),this.get("modeController").destroy(),this.get("viewController").destroy(),this.get("stateController").destroy(),this.get("canvas").destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null},e.prototype.createHull=function(t){if(t.members&&!(t.members.length<1)){var e=this.get("hullGroup"),n=this.get("hullMap");if(n||(n={},this.set("hullMap",n)),e&&!e.get("destroyed")||((e=this.get("group").addGroup({id:"hullGroup"})).toBack(),this.set("hullGroup",e)),n[t.id])return console.warn("Existed hull id."),n[t.id];var r=e.addGroup({id:t.id+"-container"}),i=new ye(this,Object(f.__assign)(Object(f.__assign)({},t),{group:r}));return n[i.id]=i,i}console.warn("Create hull failed! The members is empty.")},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var e,n;n=Object(u.isString)(t)?this.getHullById(t):t,null===(e=this.get("hullMap"))||void 0===e||delete e[n.id],n.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();t&&Object.keys(t).length&&(Object.keys(t).forEach((function(e){t[e].destroy()})),this.set("hullMap",{}))},e}(d.a);function we(t){return(we="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)}var _e=p.ext.transform,Se=["startArrow","endArrow"],Ee={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},Me={edge:{lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},node:Ee,combo:Ee},Oe={options:{labelCfg:{style:{fontFamily:nt.windowFontFamily}},descriptionCfg:{style:{fontFamily:nt.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(t){return{}},getOptions:function(t,e){return"move"===e||(null==e?void 0:e.includes("bbox"))?{}:Object(u.deepMix)({},this.options,this.getCustomConfig(t)||{},t)},draw:function(t,e){e.shapeMap={},this.mergeStyle=this.getOptions(t);var n=this.drawShape(t,e);if(n.set("className",this.itemType+"-shape"),e.shapeMap[this.itemType+"-shape"]=n,t.label){var r=this.drawLabel(t,e);r.set("className",this.itemType+"-label"),e.shapeMap[this.itemType+"-label"]=r}return n},afterDraw:function(t,e,n){},drawShape:function(t,e){return null},drawLabel:function(t,e){var n=(this.mergeStyle||this.getOptions(t)||{}).labelCfg||{},r=this.getLabelStyle(t,n,e),i=r.rotate;delete r.rotate;var o=e.addShape("text",{attrs:r,draggable:!0,className:"text-shape",name:"text-shape"});if(e.shapeMap["text-shape"]=o,!isNaN(i)&&""!==i){var a=o.getBBox(),s=[1,0,0,0,1,0,0,0,1];if(r.rotateCenter)switch(r.rotateCenter){case"center":s=_e(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]]);break;case"lefttop":s=_e(s,[["t",-r.x,-r.y],["r",i],["t",r.x,r.y]]);break;case"leftcenter":s=_e(s,[["t",-r.x,-r.y-a.height/2],["r",i],["t",r.x,r.y+a.height/2]]);break;default:s=_e(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]])}else s=_e(s,[["t",-r.x,-r.y-a.height/2],["r",i],["t",r.x,r.y+a.height/2]]);o.setMatrix(s)}if(r.background){var u=this.drawLabelBg(t,e,o),c=this.itemType+"-label-bg";u.set("classname",c),e.shapeMap[c]=u,o.toFront()}return o},drawLabelBg:function(t,e,n){var r=this.options.labelCfg,i=Object(u.mix)({},r,t.labelCfg),o=this.getLabelBgStyleByPosition(n,t,i,e),a=e.addShape("rect",{name:"text-bg-shape",attrs:o});return e.shapeMap["text-bg-shape"]=a,a},getLabelStyleByPosition:function(t,e,n){return{text:t.label}},getLabelBgStyleByPosition:function(t,e,n,r){return{}},getLabelStyle:function(t,e,n){var r=this.getLabelStyleByPosition(t,e,n),i=this.itemType+"Label",o=nt[i]?nt[i].style:null;return Object(f.__assign)(Object(f.__assign)(Object(f.__assign)({},o),r),e.style)},getShapeStyle:function(t){return t.style},update:function(t,e,n){this.updateShapeStyle(t,e,n),this.updateLabel(t,e,n)},updateShapeStyle:function(t,e,n){var r,i=e.getContainer(),o=e.getKeyShape(),a=Object(u.mix)({},o.attr(),t.style),s=function(t){var e,n=a[t];if(Object(u.isPlainObject)(n)){var s=(null===(r=i.shapeMap)||void 0===r?void 0:r[t])||i.find((function(e){return e.get("name")===t}));null==s||s.attr(n)}else o.attr(((e={})[t]=n,e))};for(var c in a)s(c)},updateLabel:function(t,e,n){var r,i;if(t.label||""===t.label){var o=e.getContainer(),a=(this.mergeStyle||this.getOptions({},n)||{}).labelCfg,s=void 0===a?{}:a,c=this.itemType+"-label",l=o.shapeMap[c]||o.find((function(t){return t.get("className")===c})),h=this.itemType+"-label-bg",d=o.shapeMap[h]||o.find((function(t){return t.get("className")===h}));if(l){(!n||"bbox|label"===n||"edge"===this.itemType&&"style"!==n)&&(s=Object(u.deepMix)(s,t.labelCfg));var p=this.getLabelStyleByPosition(t,s,o),g=null===(r=t.labelCfg)||void 0===r?void 0:r.style,v=Object(f.__assign)(Object(f.__assign)({},p),g),m=v.rotate;if(delete v.rotate,isNaN(m)||""===m)1!==(null===(i=l.getMatrix())||void 0===i?void 0:i[4])&&l.resetMatrix(),l.attr(v);else{var y=[1,0,0,0,1,0,0,0,1];y=_e(y,[["t",-v.x,-v.y],["r",m],["t",v.x,v.y]]),v.matrix=y,l.attr(v)}if(d)if(v.background){var b=this.getLabelBgStyleByPosition(l,t,s,o);if(isNaN(m)||""===m)d.resetMatrix();else{var x=[1,0,0,0,1,0,0,0,1];x=_e(x,[["t",-b.x,-b.y],["r",m],["t",b.x,b.y]]),b.matrix=x}d.attr(b)}else o.removeChild(d);else v.background&&((d=this.drawLabelBg(t,o,l)).set("classname",h),o.shapeMap[h]=d,l.toFront())}else{var w=this.drawLabel(t,o);w.set("className",c),o.shapeMap[c]=w}}},afterUpdate:function(t,e){},setState:function(t,e,n){var r,i,o,a=n.get("keyShape");if(a&&!a.destroyed){var s=n.getType(),c=Object(u.isBoolean)(e)?t:t+":"+e,l=this.getStateStyle(c,n),h=n.getStateStyle(c);if(h||l){var f=Object(u.mix)({},h||l),d=n.getContainer(),p={x:1,y:1,cx:1,cy:1};if("combo"===s&&(p.r=1,p.width=1,p.height=1),e){var g=function(t){var e,n=f[t];if(Object(u.isPlainObject)(n)&&!Se.includes(t)){var r=(null===(o=d.shapeMap)||void 0===o?void 0:o[t])||d.find((function(e){return e.get("name")===t}));null==r||r.attr(n)}else a.attr(((e={})[t]=n,e))};for(var v in f)g(v)}else{var m=wt(n.getCurrentStatesStyle()),y=n.getModel(),b=Object(u.mix)({},y.style,wt(n.getOriginStyle())),x=a.get("name"),w=a.attr(),_={};Object.keys(w).forEach((function(t){if("img"!==t){var e=w[t];e&&"object"===we(e)?_[t]=Object(u.clone)(e):_[t]=e}}));var S={},E=function(t){var e=f[t];if(Object(u.isPlainObject)(e)&&!Se.includes(t)){var n=d.shapeMap[t]||d.find((function(e){return e.get("name")===t}));if(n){var r=wt(n.attr());Object(u.each)(e,(function(e,i){if(t===x&&_[i]&&!p[i]){delete _[i];var o=b[t][i]||Me[s][i];a.attr(i,o)}else if(r[i]||0===r[i]){delete r[i];var u=b[t][i]||Me[s][i];n.attr(i,u)}})),S[t]=r}}else if(_[t]&&!p[t]){delete _[t];var i=b[t]||(b[x]?b[x][t]:void 0)||Me[s][t];a.attr(t,i)}};for(var M in f)E(M);for(var v in x?S[x]=_:Object(u.mix)(S,_),m)if(!p[v]){var O=m[v];Object(u.isPlainObject)(O)&&!Se.includes(v)||(x?(Object(u.mix)(b[x],((i={})[v]=O,i)),delete b[v]):Object(u.mix)(b,((r={})[v]=O,r)),delete m[v])}var A={};Object(u.deepMix)(A,b,S,m);var k=!1,C=function(t){var e,n,r=A[t];if(Object(u.isPlainObject)(r)&&!Se.includes(t)){var i=d.shapeMap[t]||d.find((function(e){return e.get("name")===t}));i&&("text"===i.get("type")&&(delete r.x,delete r.y,delete r.matrix),t===x&&("combo"===s&&(delete r.r,delete r.width,delete r.height),k=!0),i.attr(r))}else if(!k){var o=r||Me[s][t];"combo"===s?x||a.attr(((e={})[t]=o,e)):a.attr(((n={})[t]=o,n))}};for(var I in A)C(I)}}}},getStateStyle:function(t,e){var n=e.getModel(),r=e.getType(),i=this.getOptions(n),o=i.stateStyles,a=i.style,s=void 0===a?{}:a,c=n.stateStyles?n.stateStyles[t]:o&&o[t];return"combo"===r?Object(u.clone)(c):Object(u.mix)({},s,c)},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e,n;return(null==t?void 0:t.anchorPoints)||(null===(e=this.getCustomConfig(t))||void 0===e?void 0:e.anchorPoints)||(null===(n=this.options)||void 0===n?void 0:n.anchorPoints)}},Ae={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:nt.nodeLabel.offset,getSize:function(t){var e,n=(null===(e=this.mergeStyle)||void 0===e?void 0:e.size)||t.size||this.getOptions({}).size||nt.defaultNode.size;return Object(u.isArray)(n)&&1===n.length&&(n=[n[0],n[0]]),Object(u.isArray)(n)||(n=[n,n]),n},getLabelStyleByPosition:function(t,e){var n=e.position||this.labelPosition;if("center"===n)return{x:0,y:0,text:t.label};var r=e.offset;Object(u.isNil)(r)&&(r=this.offset);var i,o=this.getSize(t);switch(n){case"top":i={x:0,y:-o[1]/2-r,textBaseline:"bottom"};break;case"bottom":i={x:0,y:o[1]/2+r,textBaseline:"top"};break;case"left":i={x:-o[0]/2-r,y:0,textAlign:"right"};break;default:i={x:o[0]/2+r,y:0,textAlign:"left"}}return i.text=t.label,i},getLabelBgStyleByPosition:function(t,e,n,r){var i;if(!t)return{};var o=null===(i=n.style)||void 0===i?void 0:i.background;if(!o)return{};var a=t.getBBox(),s=Ot(o.padding),u=a.width+s[1]+s[3],c=a.height+s[0]+s[2];return Object(f.__assign)(Object(f.__assign)({x:a.minX-s[3],y:a.minY-s[0]},o),{width:u,height:c})},drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t),i=e.addShape(n,{attrs:r,draggable:!0,name:"node-shape"});return e.shapeMap["node-shape"]=i,i},updateLinkPoints:function(t,e){var n,r=(this.mergeStyle||this.getOptions(t)).linkPoints,i=e.shapeMap["link-point-left"]||e.find((function(t){return"link-point-left"===t.get("className")})),o=e.shapeMap["link-point-right"]||e.find((function(t){return"link-point-right"===t.get("className")})),a=e.shapeMap["link-point-top"]||e.find((function(t){return"link-point-top"===t.get("className")})),s=e.shapeMap["link-point-bottom"]||e.find((function(t){return"link-point-bottom"===t.get("className")}));i&&(n=i.attr()),o&&!n&&(n=o.attr()),a&&!n&&(n=a.attr()),s&&!n&&(n=s.attr()),n||(n=r);var c=Object(u.mix)({},n,t.linkPoints),l=c.fill,h=c.stroke,d=c.lineWidth,p=c.size/2;p||(p=c.r);var g=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},v=g.left,m=g.right,y=g.top,b=g.bottom,x=this.getSize(t),w=x[0],_=x[1],S={r:p,fill:l,stroke:h,lineWidth:d};if(i)v||void 0===v?i.attr(Object(f.__assign)(Object(f.__assign)({},S),{x:-w/2,y:0})):(i.remove(),delete e.shapeMap["link-point-left"]);else if(v){var E="link-point-left";e.shapeMap[E]=e.addShape("circle",{attrs:Object(f.__assign)(Object(f.__assign)({},S),{x:-w/2,y:0}),className:E,name:E,isAnchorPoint:!0})}if(o)m||void 0===m||(o.remove(),delete e.shapeMap["link-point-right"]),o.attr(Object(f.__assign)(Object(f.__assign)({},S),{x:w/2,y:0}));else if(m){var M="link-point-right";e.shapeMap[M]=e.addShape("circle",{attrs:Object(f.__assign)(Object(f.__assign)({},S),{x:w/2,y:0}),className:M,name:M,isAnchorPoint:!0})}if(a)y||void 0===y||(a.remove(),delete e.shapeMap["link-point-top"]),a.attr(Object(f.__assign)(Object(f.__assign)({},S),{x:0,y:-_/2}));else if(y){var O="link-point-top";e.shapeMap[O]=e.addShape("circle",{attrs:Object(f.__assign)(Object(f.__assign)({},S),{x:0,y:-_/2}),className:O,name:O,isAnchorPoint:!0})}if(s)b||void 0===b?s.attr(Object(f.__assign)(Object(f.__assign)({},S),{x:0,y:_/2})):(s.remove(),delete e.shapeMap["link-point-bottom"]);else if(b){var A="link-point-bottom";e.shapeMap[A]=e.addShape("circle",{attrs:Object(f.__assign)(Object(f.__assign)({},S),{x:0,y:_/2}),className:A,name:A,isAnchorPoint:!0})}},updateShape:function(t,e,n,r,i){e.get("keyShape").attr(Object(f.__assign)({},n)),this.updateLabel(t,e,i),r&&this.updateIcon(t,e)},updateIcon:function(t,e){var n=this,r=e.getContainer(),i=(this.mergeStyle||this.getOptions(t)).icon,o=(t.icon?t.icon:{show:void 0}).show,a=r.shapeMap[this.type+"-icon"]||r.find((function(t){return t.get("name")===n.type+"-icon"}));if(a)if(o||void 0===o){var s=Object(u.mix)({},a.attr(),i),c=s.width,l=void 0===c?20:c,h=s.height,d=void 0===h?20:h;a.attr(Object(f.__assign)(Object(f.__assign)({},s),{x:-l/2,y:-d/2}))}else a.remove();else if(o){l=i.width,d=i.height;var p=this.type+"-icon";r.shapeMap[p]=r.addShape("image",{attrs:Object(f.__assign)(Object(f.__assign)({},i),{x:-l/2,y:-d/2}),className:p,name:p});var g=r.shapeMap["node-label"]||r.find((function(t){return"node-label"===t.get("name")}));g&&g.toFront()}}},ke=Object(f.__assign)(Object(f.__assign)({},Oe),Ae);Ut.registerNode("single-node",ke);var Ce={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:nt.defaultEdge.size,style:{x:0,y:0,stroke:nt.defaultEdge.style.stroke,lineAppendWidth:nt.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:nt.edgeLabel.style.fill,fontSize:nt.edgeLabel.style.fontSize,fontFamily:nt.windowFontFamily}},stateStyles:Object(f.__assign)({},nt.edgeStateStyles)},getPath:function(t){var e=[];return Object(u.each)(t,(function(t,n){0===n?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])})),e},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},r=Object(u.mix)({},e,n,t.style),i=t.size||nt.defaultEdge.size,o=(t=this.getPathPoints(t)).startPoint,a=t.endPoint,s=this.getControlPoints(t),c=[o];s&&(c=c.concat(s)),c.push(a);var l=this.getPath(c);return Object(u.mix)({},nt.defaultEdge.style,{stroke:nt.defaultEdge.color,lineWidth:i,path:l},r)},updateShapeStyle:function(t,e,n){var r,i=e.getContainer(),o=(null===(r=e.getKeyShape)||void 0===r?void 0:r.call(e))||i.shapeMap["edge-shape"],a=t.size,s=(t=this.getPathPoints(t)).startPoint,c=t.endPoint,l=this.getControlPoints(t),h=[s];l&&(h=h.concat(l)),h.push(c);var d=o.attr(),p=t.style||{};void 0===p.stroke&&(p.stroke=t.color);var g=t.sourceNode,v=t.targetNode,m={radius:p.radius};l||(m={source:g,target:v,offset:p.offset,radius:p.radius});var y=this.getPath(h,m),b={};"move"===n?b={path:y}:(d.endArrow&&!1===p.endArrow&&(t.style.endArrow={path:""}),d.startArrow&&!1===p.startArrow&&(t.style.startArrow={path:""}),void 0===(b=Object(f.__assign)({},t.style)).lineWidth&&(b.lineWdith=(Object(u.isNumber)(a)?a:null==a?void 0:a[0])||d.lineWidth),void 0===b.path&&(b.path=y),void 0===b.stroke&&(b.stroke=d.stroke||t.color)),o&&o.attr(b)},getLabelStyleByPosition:function(t,e,n){var r,i=e.position||this.labelPosition,o={},a=null==n?void 0:n.shapeMap["edge-shape"];r="start"===i?0:"end"===i?1:.5;var s,c=e.refX||this.refX,l=e.refY||this.refY;if(t.startPoint.x===t.endPoint.x&&t.startPoint.y===t.endPoint.y)return o.x=t.startPoint.x+c,o.y=t.startPoint.y+l,o.text=t.label,o;s=Object(u.isNil)(e.autoRotate)?this.labelAutoRotate:e.autoRotate;var h=ht(a,r,c,l,s);return o.x=h.x,o.y=h.y,o.rotate=h.rotate,o.textAlign=this._getTextAlign(i,h.angle),o.text=t.label,o},getLabelBgStyleByPosition:function(t,e,n,r){if(!t)return{};var i=t.getBBox(),o=n.style&&n.style.background;if(!o)return{};var a,s=o.padding,c=i.width+s[1]+s[3],l=i.height+s[0]+s[2],h=n.position||this.labelPosition,d=Object(f.__assign)(Object(f.__assign)({},o),{width:c,height:l,x:i.minX-s[2],y:i.minY-s[0],rotate:0});a=Object(u.isNil)(n.autoRotate)?this.labelAutoRotate:n.autoRotate;var p,g=null==r?void 0:r.shapeMap["edge-shape"];p="start"===h?0:"end"===h?1:.5;var v=n.refX||this.refX,m=n.refY||this.refY;if(e.startPoint.x===e.endPoint.x&&e.startPoint.y===e.endPoint.y)return d.x=e.startPoint.x+v-c/2,d.y=e.startPoint.y+m-l/2,d;var y=v-c/2;"start"===n.position?y=v-s[2]:"end"===n.position&&(y=v-c);var b=ht(g,p,y,m+l/2,a);return a&&(d.x=b.x,d.y=b.y),d.rotate=b.rotate,d},_getTextAlign:function(t,e){var n="center";return e?(e%=2*Math.PI,"center"!==t&&(n=e>=0&&e<=Math.PI/2||e>=1.5*Math.PI&&e<2*Math.PI?t:function(t){var e=t;return"start"===t?e="end":"end"===t&&(e="start"),e}(t)),n):t},getControlPoints:function(t){return t.controlPoints},getPathPoints:function(t){return t},drawShape:function(t,e){var n=this.getShapeStyle(t),r=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n});return e.shapeMap["edge-shape"]=r,r},drawLabel:function(t,e){var n=this.options.labelCfg,r=Object(u.deepMix)({},n,t.labelCfg),i=this.getLabelStyle(t,r,e),o=i.rotate;delete i.rotate;var a=e.addShape("text",{attrs:i,name:"text-shape"});if(e.shapeMap["text-shape"]=a,isNaN(o)||""===o||a.rotateAtStart(o),i.background){var s=this.drawLabelBg(t,e,a,i,o),c=this.itemType+"-label-bg";s.set("classname",c),e.shapeMap[c]=s,a.toFront()}return a},drawLabelBg:function(t,e,n,r,i){var o=this.options.labelCfg,a=Object(u.deepMix)({},o,t.labelCfg),s=this.getLabelBgStyleByPosition(n,t,a,e);delete s.rotate;var c=e.addShape("rect",{name:"text-bg-shape",attrs:s});return e.shapeMap["text-bg-shape"]=c,isNaN(i)||c.rotateAtStart(i),c}},Ie=Object(f.__assign)(Object(f.__assign)({},Oe),Ce);Ut.registerEdge("single-edge",Ie),Ut.registerEdge("line",{getControlPoints:function(){}},"single-edge"),Ut.registerEdge("spline",{getPath:function(t){return Jt(t)}},"single-edge"),Ut.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(t){var e,n,r=t.startPoint,i=t.endPoint,o=(r.x+i.x)/2,a=(r.y+i.y)/2;if(void 0!==t.controlPoints){if(n=t.controlPoints[0],e=M(r,n,i),r.x<=i.x&&r.y>i.y?this.clockwise=e.x>n.x?0:1:r.x<=i.x&&r.y<i.y?this.clockwise=e.x>n.x?1:0:r.x>i.x&&r.y<=i.y?this.clockwise=e.y<n.y?0:1:this.clockwise=e.y<n.y?1:0,(n.x-r.x)/(n.y-r.y)==(i.x-r.x)/(i.y-r.y))return[]}else{void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),Object(u.isArray)(t.curveOffset)&&(t.curveOffset=t.curveOffset[0]),t.curveOffset<0?this.clockwise=0:this.clockwise=1;var s={x:i.x-r.x,y:i.y-r.y},c=Math.atan2(s.y,s.x);n={x:t.curveOffset*Math.cos(-Math.PI/2+c)+o,y:t.curveOffset*Math.sin(-Math.PI/2+c)+a},e=M(r,n,i)}var l=O(r,e);return[{x:l,y:l}]},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),2===t.length?e.push(["L",t[1].x,t[1].y]):e.push(["A",t[1].x,t[1].y,0,0,this.clockwise,t[2].x,t[2].y]),e}},"single-edge"),Ut.registerEdge("quadratic",{curvePosition:.5,curveOffset:-20,getControlPoints:function(t){var e=t.controlPoints;if(!e||!e.length){var n=t.startPoint,r=t.endPoint;void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),void 0===t.curvePosition&&(t.curvePosition=this.curvePosition),Object(u.isArray)(this.curveOffset)&&(t.curveOffset=t.curveOffset[0]),Object(u.isArray)(this.curvePosition)&&(t.curvePosition=t.curveOffset[0]),e=[te(n,r,t.curvePosition,t.curveOffset)]}return e},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),e.push(["Q",t[1].x,t[1].y,t[2].x,t[2].y]),e}},"single-edge"),Ut.registerEdge("cubic",{curvePosition:[.5,.5],curveOffset:[-20,20],getControlPoints:function(t){var e=t.controlPoints;if(void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),void 0===t.curvePosition&&(t.curvePosition=this.curvePosition),Object(u.isNumber)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),Object(u.isNumber)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]),!e||!e.length||e.length<2){var n=t.startPoint,r=t.endPoint;e=[te(n,r,t.curvePosition[0],t.curveOffset[0]),te(n,r,t.curvePosition[1],t.curveOffset[1])]}return e},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),e.push(["C",t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y]),e}},"single-edge"),Ut.registerEdge("cubic-vertical",{curvePosition:[.5,.5],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(t){var e=t.startPoint,n=t.endPoint;void 0===t.curvePosition&&(t.curvePosition=this.curvePosition),void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),void 0===t.minCurveOffset&&(t.minCurveOffset=this.minCurveOffset),Object(u.isNumber)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),Object(u.isNumber)(t.minCurveOffset)&&(t.minCurveOffset=[t.minCurveOffset,-t.minCurveOffset]),Object(u.isNumber)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]);var r=n.y-e.y,i=[0,0];return t.curveOffset?i=t.curveOffset:Math.abs(r)<Math.abs(t.minCurveOffset[0])&&(i=t.minCurveOffset),[{x:e.x,y:e.y+r*this.curvePosition[0]+i[0]},{x:n.x,y:n.y-r*this.curvePosition[1]+i[1]}]}},"cubic"),Ut.registerEdge("cubic-horizontal",{curvePosition:[.5,.5],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(t){var e=t.startPoint,n=t.endPoint;void 0===t.curvePosition&&(t.curvePosition=this.curvePosition),void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),void 0===t.minCurveOffset&&(t.minCurveOffset=this.minCurveOffset),Object(u.isNumber)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),Object(u.isNumber)(t.minCurveOffset)&&(t.minCurveOffset=[t.minCurveOffset,-t.minCurveOffset]),Object(u.isNumber)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]);var r=n.x-e.x,i=[0,0];return t.curveOffset?i=t.curveOffset:Math.abs(r)<Math.abs(t.minCurveOffset[0])&&(i=t.minCurveOffset),[{x:e.x+r*this.curvePosition[0]+i[0],y:e.y},{x:n.x-r*this.curvePosition[1]+i[1],y:n.y}]}},"cubic"),Ut.registerEdge("loop",{getPathPoints:function(t){return lt(t)},getControlPoints:function(t){return t.controlPoints},afterDraw:function(t){t.controlPoints=void 0},afterUpdate:function(t){t.controlPoints=void 0}},"cubic");var Te={itemType:"combo",shapeType:"single-combo",labelPosition:"top",refX:nt.comboLabel.refX,refY:nt.comboLabel.refY,options:{style:{stroke:nt.defaultCombo.style.stroke,fill:nt.defaultCombo.style.fill,lineWidth:nt.defaultCombo.style.lineWidth},labelCfg:{style:{fill:nt.comboLabel.style.fill,fontSize:nt.comboLabel.style.fontSize,fontFamily:nt.windowFontFamily}},stateStyles:Object(f.__assign)({},nt.comboStateStyles)},getSize:function(t){var e=Object(u.clone)(t.size||this.options.size||nt.defaultCombo.size);return Object(u.isArray)(e)&&1===e.length&&(e=[e[0],e[0]]),Object(u.isArray)(e)||(e=[e,e]),e},getLabelStyleByPosition:function(t,e){var n=e.position||this.labelPosition,r=t.style,i=t.padding||this.options.padding;Object(u.isArray)(i)&&(i=i[0]);var o=e.refX,a=e.refY;Object(u.isNil)(o)&&(o=this.refX),Object(u.isNil)(a)&&(a=this.refY);var s,c=this.getSize(t),l=(Math.max(r.r,c[0]/2)||c[0]/2)+i;switch(n){case"top":s={x:0,y:-l-a,textBaseline:"bottom",textAlign:"center"};break;case"bottom":s={x:0,y:l+a,textBaseline:"bottom",textAlign:"center"};break;case"left":s={x:-l+o,y:0,textAlign:"left"};break;case"center":s={x:0,y:0,text:t.label,textAlign:"center"};break;default:s={x:l+o,y:0,textAlign:"right"}}return s.text=t.label,s},drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t);return e.addShape(n,{attrs:r,draggable:!0,name:"combo-shape"})},updateShape:function(t,e,n){var r=e.get("keyShape");(void 0===t.animate?this.options.animate:t.animate)&&r.animate?r.animate(n,{duration:200,easing:"easeLinear"}):r.attr(Object(f.__assign)({},n)),this.updateLabel(t,e)}},Pe=Object(f.__assign)(Object(f.__assign)({},Oe),Te);Ut.registerCombo("single-combo",Pe),Ut.registerCombo("circle",{options:{size:[nt.defaultCombo.size[0],nt.defaultCombo.size[0]],padding:nt.defaultCombo.padding[0],animate:!0,style:{stroke:nt.defaultCombo.style.stroke,fill:nt.defaultCombo.style.fill,lineWidth:nt.defaultCombo.style.lineWidth},labelCfg:{style:{fill:nt.comboLabel.style.fill,fontSize:nt.comboLabel.style.fontSize},refX:0,refY:0},stateStyles:Object(f.__assign)({},nt.comboStateStyles)},shapeType:"circle",labelPosition:"top",drawShape:function(t,e){var n=this.getShapeStyle(t);return delete n.height,delete n.width,e.addShape("circle",{attrs:n,className:"circle-combo",name:"circle-combo",draggable:!0})},getShapeStyle:function(t){var e=this.options.style,n=t.padding||this.options.padding;Object(u.isArray)(n)&&(n=n[0]);var r,i={stroke:t.color},o=Object(u.mix)({},e,i,t.style);if(t.fixSize)r=Object(u.isNumber)(t.fixSize)?t.fixSize:t.fixSize[0];else{var a=this.getSize(t);r=!Object(u.isNumber)(o.r)||isNaN(o.r)?a[0]/2||nt.defaultCombo.style.r:Math.max(o.r,a[0]/2)||a[0]/2}o.r=r+n;var s=Object(f.__assign)({x:0,y:0},o);return t.style?t.style.r=r:t.style={r:r},s},update:function(t,e){var n=this.getSize(t),r=t.padding||this.options.padding;Object(u.isArray)(r)&&(r=r[0]);var i,o=Object(u.clone)(t.style);i=t.fixSize?Object(u.isNumber)(t.fixSize)?t.fixSize:t.fixSize[0]:Math.max(o.r,n[0]/2)||n[0]/2,o.r=i+r;var a=e.get("sizeCache");a&&(a.r=o.r);var s={stroke:t.color},c=e.get("keyShape"),l=Object(u.mix)({},c.attr(),s,o);t.style?t.style.r=i:t.style={r:i},this.updateShape(t,e,l,!0)}},"single-combo"),Ut.registerCombo("rect",{options:{size:[40,5],padding:[25,20,15,20],animate:!0,style:{radius:0,stroke:nt.defaultCombo.style.stroke,fill:nt.defaultCombo.style.fill,lineWidth:nt.defaultCombo.style.lineWidth},labelCfg:{style:{fill:nt.comboLabel.style.fill,fontSize:nt.comboLabel.style.fontSize,fontFamily:nt.windowFontFamily}},anchorPoints:[[0,.5],[1,.5]],stateStyles:Object(f.__assign)({},nt.comboStateStyles)},shapeType:"rect",labelPosition:"top",drawShape:function(t,e){var n=this.getShapeStyle(t);return e.addShape("rect",{attrs:n,className:"rect-combo",name:"rect-combo",draggable:!0})},getLabelStyleByPosition:function(t,e){var n=e.position||this.labelPosition,r=t.style,i=t.padding||this.options.padding;Object(u.isNumber)(i)&&(i=[i,i,i,i]);var o=e.refX,a=e.refY;Object(u.isNil)(o)&&(o=this.refX),Object(u.isNil)(a)&&(a=this.refY);var s,c=r.width/2+i[3],l=r.height/2+i[0];switch(n){case"top":s={x:0-c+o,y:0-l+a,textBaseline:"top",textAlign:"left"};break;case"bottom":s={x:0,y:l+a,textBaseline:"bottom",textAlign:"center"};break;case"left":s={x:0-c+a,y:0,textAlign:"left"};break;case"center":s={x:0,y:0,text:t.label,textAlign:"center"};break;default:s={x:c+o,y:0,textAlign:"right"}}return s.text=t.label,s},getShapeStyle:function(t){var e=this.options.style,n=t.padding||this.options.padding;Object(u.isNumber)(n)&&(n=[n,n,n,n]);var r,i,o={stroke:t.color},a=Object(u.mix)({},e,o,t.style),s=this.getSize(t),c=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize;c?Object(u.isNumber)(c)?(r=c,i=c):(r=c[0],i=c[1]):(r=!Object(u.isNumber)(a.width)||isNaN(a.width)?s[0]||nt.defaultCombo.style.width:Math.max(a.width,s[0])||s[0],i=!Object(u.isNumber)(a.height)||isNaN(a.height)?s[1]||nt.defaultCombo.style.height:Math.max(a.height,s[1])||s[1]);var l=-r/2-n[3],h=-i/2-n[0];a.width=r+n[1]+n[3],a.height=i+n[0]+n[2];var d=Object(f.__assign)({x:l,y:h},a);return t.style?(t.style.width=r,t.style.height=i):t.style={width:r,height:i},d},update:function(t,e){var n=this.getSize(t),r=t.padding||this.options.padding;Object(u.isNumber)(r)&&(r=[r,r,r,r]);var i,o,a=Object(u.clone)(t.style),s=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize;s?Object(u.isNumber)(s)?(i=s,o=s):(i=s[0],o=s[1]):(i=Math.max(a.width,n[0])||n[0],o=Math.max(a.height,n[1])||n[1]),a.width=i+r[1]+r[3],a.height=o+r[0]+r[2];var c=e.get("sizeCache");c&&(c.width=a.width,c.height=a.height),a.x=-i/2-r[3],a.y=-o/2-r[0];var l={stroke:t.color},h=e.get("keyShape"),f=Object(u.mix)({},h.attr(),l,a);t.style?(t.style.width=i,t.style.height=o):t.style={width:i,height:o},this.updateShape(t,e,f,!1)},updateShape:function(t,e,n){var r=e.get("keyShape");(void 0===t.animate?this.options.animate:t.animate)&&r.animate?r.animate(n,{duration:200,easing:"easeLinear"}):r.attr(Object(f.__assign)({},n)),this.updateLabel(t,e)}},"single-combo"),Ut.registerNode("simple-circle",{options:{size:nt.defaultNode.size,style:{x:0,y:0,stroke:nt.defaultNode.style.stroke,fill:nt.defaultNode.style.fill,lineWidth:nt.defaultNode.style.lineWidth},labelCfg:{style:{fill:nt.nodeLabel.style.fill,fontSize:nt.nodeLabel.style.fontSize,fontFamily:nt.windowFontFamily}},stateStyles:Object(f.__assign)({},nt.nodeStateStyles)},shapeType:"simple-circle",labelPosition:"center",shapeMap:{},drawShape:function(t,e){var n=this.getShapeStyle(t),r=this.type+"-keyShape",i=e.addShape("circle",{attrs:n,className:this.type+"-keyShape",name:r,draggable:!0});return e.shapeMap[r]=i,i},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=Object(u.deepMix)({},e,n),i=this.getSize(t)[0]/2;return Object(f.__assign)({x:0,y:0,r:i},r)},update:function(t,e,n){var r=this.getSize(t),i={stroke:t.color,r:r[0]/2},o=e.get("keyShape"),a=Object(u.deepMix)({},o.attr(),i,t.style);this.updateShape(t,e,a,!0,n)}},"single-node"),Ut.registerNode("simple-rect",{options:{size:[100,30],style:{radius:0,stroke:nt.defaultNode.style.stroke,fill:nt.defaultNode.style.fill,lineWidth:nt.defaultNode.style.lineWidth},labelCfg:{style:{fill:nt.nodeLabel.style.fill,fontSize:nt.nodeLabel.style.fontSize,fontFamily:nt.windowFontFamily}},anchorPoints:[[0,.5],[1,.5]],stateStyles:Object(f.__assign)({},nt.nodeStateStyles)},shapeType:"simple-rect",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);return e.addShape("rect",{attrs:n,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0})},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=Object(u.mix)({},e,n),i=this.getSize(t),o=r.width||i[0],a=r.height||i[1];return Object(f.__assign)({x:-o/2,y:-a/2,width:o,height:a},r)},update:function(t,e,n){e.getContainer();var r=(this.mergeStyle||this.getOptions(t)).style,i=this.getSize(t),o=e.get("keyShape");t.size||(i[0]=o.attr("width")||r.width,i[1]=o.attr("height")||r.height);var a={stroke:t.color,x:-i[0]/2,y:-i[1]/2,width:i[0],height:i[1]},s=Object(u.mix)({},r,o.attr(),a);s=Object(u.mix)(s,t.style),this.updateShape(t,e,s,!1,n)}},"single-node"),Ut.registerNode("image",{options:{img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ",size:200,labelCfg:{style:{fontFamily:nt.windowFontFamily}},clipCfg:{show:!1,type:"circle",r:50,rx:50,ry:35,width:50,height:35,points:[[30,12],[12,30],[30,48],[48,30]],path:[["M",25,25],["L",50,25],["A",12.5,12.5,0,1,1,50,50],["A",12.5,12.5,0,1,0,50,50],["L",25,75],["Z"]],x:0,y:0}},shapeType:"image",labelPosition:"bottom",drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t);delete r.fill;var i=e.addShape(n,{attrs:r,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0});return this.drawClip(t,i),i},drawClip:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).clipCfg;if(n.show){var r=n.type,i=n.x,o=n.y,a=n.style;if("circle"===r){var s=n.r;e.setClip({type:"circle",attrs:Object(f.__assign)({r:s,x:i,y:o},a)})}else if("rect"===r){var u=n.width,c=n.height,l=i-u/2,h=o-c/2;e.setClip({type:"rect",attrs:Object(f.__assign)({x:l,y:h,width:u,height:c},a)})}else if("ellipse"===r){var d=n.rx,p=n.ry;e.setClip({type:"ellipse",attrs:Object(f.__assign)({x:i,y:o,rx:d,ry:p},a)})}else if("polygon"===r){var g=n.points;e.setClip({type:"polygon",attrs:Object(f.__assign)({points:g},a)})}else if("path"===r){var v=n.path;e.setClip({type:"path",attrs:Object(f.__assign)({path:v},a)})}}},getShapeStyle:function(t){var e=this.mergeStyle||this.getOptions(t),n=e.style,r=e.img,i=this.getSize(t),o=i[0],a=i[1];return n&&(o=n.width||i[0],a=n.height||i[1]),Object(f.__assign)({x:-o/2,y:-a/2,width:o,height:a,img:r},n)},updateShapeStyle:function(t,e){var n=e.getContainer(),r=this.itemType+"-shape",i=n.shapeMap[r]||n.find((function(t){return t.get("className")===r}))||e.getKeyShape(),o=this.getShapeStyle(t);i&&!i.destroyed&&i.attr(o)}},"single-node");var Ne,je={triangle:function(t,e,n){void 0===t&&(t=10),void 0===e&&(e=15),void 0===n&&(n=0);var r=2*n;return"M "+r+",0 L "+(r+e)+",-"+t/2+" L "+(r+e)+","+t/2+" Z"},vee:function(t,e,n){void 0===t&&(t=15),void 0===e&&(e=20),void 0===n&&(n=0);var r=2*n;return"M "+r+",0 L "+(r+e)+",-"+t/2+"\n L "+(r+2*e/3)+",0 L "+(r+e)+","+t/2+" Z"},circle:function(t,e){return void 0===t&&(t=5),void 0===e&&(e=0),"M "+2*e+", 0\n a "+t+","+t+" 0 1,0 "+2*t+",0\n a "+t+","+t+" 0 1,0 "+2*-t+",0"},rect:function(t,e,n){void 0===t&&(t=10),void 0===e&&(e=10),void 0===n&&(n=0);var r=2*n;return"M "+r+","+-t/2+" \n L "+(r+e)+","+-t/2+" \n L "+(r+e)+","+t/2+" \n L "+r+","+t/2+" Z"},diamond:function(t,e,n){void 0===t&&(t=15),void 0===e&&(e=15),void 0===n&&(n=0);var r=2*n;return"M "+r+",0 \n L "+(r+e/2)+","+-t/2+" \n L "+(r+e)+",0 \n L "+(r+e/2)+","+t/2+" Z"},triangleRect:function(t,e,n,r,i,o){void 0===t&&(t=15),void 0===e&&(e=15),void 0===n&&(n=15),void 0===r&&(r=3),void 0===i&&(i=5),void 0===o&&(o=0);var a=2*o,s=a+e+i;return"M "+a+",0 L "+(a+e)+",-"+t/2+" L "+(a+e)+","+t/2+" Z\n M "+s+", -"+n/2+"\n L "+(s+r)+" -"+n/2+"\n L "+(s+r)+" "+n/2+"\n L "+s+" "+n/2+"\n Z"}},De={collapse:function(t,e,n){return[["M",t-n,e],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0],["M",t-n+4,e],["L",t+n-4,e]]},expand:function(t,e,n){return[["M",t-n,e],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0],["M",t-n+4,e],["L",t-n+2*n-4,e],["M",t-n+n,e-n+4],["L",t,e+n-4]]},upTriangle:function(t,e,n){var r=n*Math.cos(Math.PI/6),i=n*Math.sin(Math.PI/6);return[["M",t-r,e+i],["L",t+r,e+i],["L",t,e-n],["Z"]]},downTriangle:function(t,e,n){var r=n*Math.cos(Math.PI/6),i=n*Math.sin(Math.PI/6);return[["M",t-r,e-i],["L",t+r,e-i],["L",t,e+n],["Z"]]}},Le=Ut,Re=["#5F95FF","#61DDAA","#65789B","#F6BD16","#7262FD","#78D3F8","#9661BC","#F6903D","#008685","#F08BB4"],Be=p.ext.transform,Ge=Object(f.__assign)(Object(f.__assign)(Object(f.__assign)(Object(f.__assign)(Object(f.__assign)(Object(f.__assign)({},o),i),a),r),s),{transform:Be,mat3:p.mat3}),Fe=function(){function t(t){this.graph=t,this.layoutCfg=t.get("layout")||{},this.layoutType=this.getLayoutType(),this.layoutMethods=[],this.initLayout()}return t.prototype.initLayout=function(){},t.prototype.getLayoutType=function(){return this.getLayoutCfgType(this.layoutCfg)},t.prototype.getLayoutCfgType=function(t){var e=t.type;if(e)return e;var n=t.pipes;return Array.isArray(n)?n.map((function(t){return(null==t?void 0:t.type)||""})):null},t.prototype.isLayoutTypeSame=function(t){var e=this.getLayoutCfgType(t);return Array.isArray(this.layoutType)?this.layoutType.every((function(t,n){return t===e[n]})):(null==t?void 0:t.type)===this.layoutType},t.prototype.refreshLayout=function(){var t=this.graph;t&&(t.get("animate")?t.positionsAnimate():t.refreshPositions())},t.prototype.changeLayout=function(t){this.layoutCfg=t,this.destoryLayoutMethods(),this.layout()},t.prototype.changeData=function(){this.destoryLayoutMethods(),this.layout()},t.prototype.destoryLayoutMethods=function(){var t=this.layoutMethods;null==t||t.forEach((function(t){t.destroy()})),this.layoutMethods=[]},t.prototype.destroyLayout=function(){var t=this.graph;this.destoryLayoutMethods(),t.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0},t.prototype.setDataFromGraph=function(){for(var t=[],e=[],n=[],r=[],i=[],o=[],a=this.graph.getNodes(),s=this.graph.getEdges(),u=this.graph.getCombos(),c=a.length,l=0;l<c;l++){var h=a[l];if(h&&!h.destroyed){var f=h.getModel();h.isVisible()?t.push(f):e.push(f)}}var d=s.length;for(l=0;l<d;l++){var p=s[l];if(p&&!p.destroyed){f=p.getModel();p.isVisible()?f.isComboEdge?i.push(f):n.push(f):r.push(f)}}var g=u.length;for(l=0;l<g;l++){var v=u[l];if(!v.destroyed){f=v.getModel();v.isVisible()?o.push(f):r.push(f)}}return{nodes:t,hiddenNodes:e,edges:n,hiddenEdges:r,combos:o,hiddenCombos:[],comboEdges:i}},t.prototype.reLayoutMethod=function(t,e){var n=this;return new Promise((function(r,i){var o=n.graph,a=null==e?void 0:e.type;e.onLayoutEnd=function(){o.emit("aftersublayout",{type:a}),r()},t.init(n.data),"force"===a&&(t.ticking=!1,t.forceSimulation.stop()),o.emit("beforesublayout",{type:a}),t.execute(),t.isCustomLayout&&e.onLayoutEnd&&e.onLayoutEnd()}))},t.prototype.relayout=function(t){var e=this,n=this.graph,r=this.layoutMethods,i=this.layoutCfg;if(t){this.data=this.setDataFromGraph();var o=this.data.nodes;if(!o)return!1;this.initPositions(i.center,o)}n.emit("beforelayout");var a=Promise.resolve();null==r||r.forEach((function(t,n){var r=i[n];a=a.then((function(){return e.reLayoutMethod(t,r)}))})),a.then((function(){i.onAllLayoutEnd&&i.onAllLayoutEnd()})).catch((function(t){console.warn("relayout failed",t)}))},t.prototype.filterLayoutData=function(t,e){var n,r,i=t.nodes,o=t.edges,a=Object(f.__rest)(t,["nodes","edges"]);if(!i)return t;n=Object(u.isFunction)(null==e?void 0:e.nodesFilter)?e.nodesFilter:function(){return!0};var s=i.filter(n);if(Object(u.isFunction)(null==e?void 0:e.edgesFilter))r=e.edgesFilter;else{var c=s.reduce((function(t,e){return t[e.id]=!0,t}),{});r=function(t){return c[t.source]&&c[t.target]}}return Object(f.__assign)({nodes:s,edges:o.filter(r)},a)},t.prototype.getLayoutBBox=function(t){var e=this.graph,n=Object(u.groupBy)(e.getNodes(),(function(t){return t.getModel().layoutOrder})),r=Object.values(n).map((function(t){var e=It(t);return e.size=[e.width,e.height],e}));return{groupNodes:Object.values(Object(u.groupBy)(t,"layoutOrder")),layoutNodes:r}},t.prototype.layoutAnimate=function(){},t.prototype.moveToZero=function(){var t=this.graph.get("data").nodes;if(void 0!==t[0].x&&null!==t[0].x&&!Ct(t[0].x)){for(var e=[0,0],n=t.length,r=0;r<n;r++){var i=t[r];e[0]+=i.x,e[1]+=i.y}e[0]/=t.length,e[1]/=t.length;for(r=0;r<n;r++){(i=t[r]).x-=e[0],i.y-=e[1]}}},t.prototype.initPositions=function(t,e){var n=this.graph;if(!e)return!1;var r=e?e.length:0;if(r){var i=.85*n.get("width"),o=.85*n.get("height"),a=Math.ceil(Math.sqrt(r)*(i/o)),s=i/(a-1),u=o/(Math.ceil(r/a)-1);isFinite(s)&&s||(s=0),isFinite(u)&&s||(u=0);for(var c=t[0]-i/2,l=t[1]-o/2,h=!0,f=0;f<r;f++){var d=e[f];Ct(+d.x)&&(h=!1,d.x=f%a*s+c),Ct(+d.y)&&(h=!1,d.y=Math.floor(f/a)*u+l)}return h}},t.prototype.destroy=function(){this.graph=null,this.destoryLayoutMethods(),this.destroyed=!0},t}(),ze=function(t){this.graph=t,this.destroyed=!1,this.initEvents()};!function(t){t.CLICK="click",t.DBLCLICK="dblclick",t.MOUSEDOWN="mousedown",t.MOUDEUP="mouseup",t.CONTEXTMENU="contextmenu",t.MOUSEENTER="mouseenter",t.MOUSEOUT="mouseout",t.MOUSEOVER="mouseover",t.MOUSEMOVE="mousemove",t.MOUSELEAVE="mouseleave",t.DRAGSTART="dragstart",t.DRAGEND="dragend",t.DRAG="drag",t.DRAGENTER="dragenter",t.DRAGLEAVE="dragleave",t.DRAGOVER="dragover",t.DRAGOUT="dragout",t.DDROP="drop",t.KEYUP="keyup",t.KEYDOWN="keydown",t.WHEEL="wheel",t.FOCUS="focus",t.BLUR="blur",t.TOUCHSTART="touchstart",t.TOUCHMOVE="touchmove",t.TOUCHEND="touchend",t.CANVAS_TOUCHSTART="canvas:touchstart",t.CANVAS_TOUCHMOVE="canvas:touchmove",t.CANVAS_TOUCHEND="canvas:touchend",t.NODE_TOUCHSTART="node:touchstart",t.NODE_TOUCHMOVE="node:touchmove",t.NODE_TOUCHEND="node:touchend",t.COMBO_TOUCHSTART="combo:touchstart",t.COMBO_TOUCHMOVE="combo:touchmove",t.COMBO_TOUCHEND="combo:touchend",t.EDGE_TOUCHSTART="edge:touchstart",t.EDGE_TOUCHMOVE="edge:touchmove",t.EDGE_TOUCHEND="edge:touchend",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_CLICK="node:click",t.NODE_DBLCLICK="node:dblclick",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEOUT="node:mouseout",t.NODE_MOUSEOVER="node:mouseover",t.NODE_DROP="node:drop",t.NODE_DRAGOVER="node:dragover",t.NODE_DRAGENTER="node:dragenter",t.NODE_DRAGLEAVE="node:dragleave",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DRAGEND="node:dragend",t.NODE_TAP="node:tap",t.NODE_PANSTART="node:panstart",t.NODE_PANMOVE="node:panmove",t.NODE_PANEND="node:panend",t.COMBO_CONTEXTMENU="combo:contextmenu",t.COMBO_CLICK="combo:click",t.COMBO_DBLCLICK="combo:dblclick",t.COMBO_MOUSEDOWN="combo:mousedown",t.COMBO_MOUSEUP="combo:mouseup",t.COMBO_MOUSEENTER="combo:mouseenter",t.COMBO_MOUSELEAVE="combo:mouseleave",t.COMBO_MOUSEMOVE="combo:mousemove",t.COMBO_MOUSEOUT="combo:mouseout",t.COMBO_MOUSEOVER="combo:mouseover",t.COMBO_DROP="combo:drop",t.COMBO_DRAGOVER="combo:dragover",t.COMBO_DRAGENTER="combo:dragenter",t.COMBO_DRAGLEAVE="combo:dragleave",t.COMBO_DRAGSTART="combo:dragstart",t.COMBO_DRAG="combo:drag",t.COMBO_DRAGEND="combo:dragend",t.COMBO_TAP="combo:tap",t.COMBO_PANSTART="combo:panstart",t.COMBO_PANMOVE="combo:panmove",t.COMBO_PANEND="combo:panend",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_CLICK="edge:click",t.EDGE_DBLCLICK="edge:dblclick",t.EDGE_MOUSEDOWN="edge:mousedown",t.EDGE_MOUSEUP="edge:mouseup",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_MOUSEMOVE="edge:mousemove",t.EDGE_MOUSEOUT="edge:mouseout",t.EDGE_MOUSEOVER="edge:mouseover",t.EDGE_DROP="edge:drop",t.EDGE_DRAGOVER="edge:dragover",t.EDGE_DRAGENTER="edge:dragenter",t.EDGE_DRAGLEAVE="edge:dragleave",t.CANVAS_CONTEXTMENU="canvas:contextmenu",t.CANVAS_CLICK="canvas:click",t.CANVAS_DBLCLICK="canvas:dblclick",t.CANVAS_MOUSEDOWN="canvas:mousedown",t.CANVAS_MOUSEUP="canvas:mouseup",t.CANVAS_MOUSEENTER="canvas:mouseenter",t.CANVAS_MOUSELEAVE="canvas:mouseleave",t.CANVAS_MOUSEMOVE="canvas:mousemove",t.CANVAS_MOUSEOUT="canvas:mouseout",t.CANVAS_MOUSEOVER="canvas:mouseover",t.CANVAS_DROP="canvas:drop",t.CANVAS_DRAGENTER="canvas:dragenter",t.CANVAS_DRAGLEAVE="canvas:dragleave",t.CANVAS_DRAGSTART="canvas:dragstart",t.CANVAS_DRAG="canvas:drag",t.CANVAS_DRAGEND="canvas:dragend",t.CANVAS_TAP="canvas:tap",t.CANVAS_PANSTART="canvas:panstart",t.CANVAS_PANMOVE="canvas:panmove",t.CANVAS_PANEND="canvas:panend",t.BEFORERENDER="beforerender",t.AFTERRENDER="afterrender",t.BEFOREADDITEM="beforeadditem",t.AFTERADDITEM="afteradditem",t.BEFOREREMOVEITEM="beforeremoveitem",t.AFTERREMOVEITEM="afterremoveitem",t.BEFOREUPDATEITEM="beforeupdateitem",t.AFTERUPDATEITEM="afterupdateitem",t.BEFOREITEMVISIBILITYCHANGE="beforeitemvisibilitychange",t.AFTERITEMVISIBILITYCHANGE="afteritemvisibilitychange",t.BEFOREITEMSTATECHANGE="beforeitemstatechange",t.AFTERITEMSTATECHANGE="afteritemstatechange",t.BEFOREITEMREFRESH="beforeitemrefresh",t.AFTERITEMREFRESH="afteritemrefresh",t.BEFOREITEMSTATESCLEAR="beforeitemstatesclear",t.AFTERITEMSTATESCLEAR="afteritemstatesclear",t.BEFOREMODECHANGE="beforemodechange",t.AFTERMODECHANGE="aftermodechange",t.BEFORELAYOUT="beforelayout",t.AFTERLAYOUT="afterlayout",t.BEFORECREATEEDGE="beforecreateedge",t.AFTERCREATEEDGE="aftercreateedge",t.BEFOREGRAPHREFRESHPOSITION="beforegraphrefreshposition",t.AFTERGRAPHREFRESHPOSITION="aftergraphrefreshposition",t.BEFOREGRAPHREFRESH="beforegraphrefresh",t.AFTERGRAPHREFRESH="aftergraphrefresh",t.BEFOREANIMATE="beforeanimate",t.AFTERANIMATE="afteranimate",t.BEFOREPAINT="beforepaint",t.AFTERPAINT="afterpaint",t.BEFORECOLLAPSEEXPANDCOMBO="beforecollapseexpandcombo",t.AFTERCOLLAPSEEXPANDCOMBO="aftercollapseexpandcombo",t.GRAPHSTATECHANGE="graphstatechange",t.AFTERACTIVATERELATIONS="afteractivaterelations",t.NODESELECTCHANGE="nodeselectchange",t.TOOLTIPCHANGE="tooltipchange",t.WHEELZOOM="wheelzoom",t.VIEWPORTCHANGE="viewportchange",t.DRAGNODEEND="dragnodeend",t.STACKCHANGE="stackchange",t.TAP="tap",t.PINCHSTART="pinchstart",t.PINCHMOVE="pinchmove",t.PANSTART="panstart",t.PANMOVE="panmove",t.PANEND="panend"}(Ne||(Ne={}));var Ue=Le.registerNode,Ve=Le.registerEdge,We=Le.registerCombo,Ye=h.registerBehavior,Xe=nt;e.default={version:nt.version,AbstractGraph:xe,BaseGlobal:Xe,Util:Ge,Shape:Le,Node:Xt,Edge:Yt,Combo:Ht,Hull:ye,registerNode:Le.registerNode,registerEdge:Le.registerEdge,registerCombo:Le.registerCombo,registerBehavior:h.registerBehavior,Arrow:je,Marker:De,AbstractLayout:Fe,AbstractEvent:ze}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=e.getServiceIdentifierAsString=e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=e.decorate=e.id=e.MetadataReader=e.postConstruct=e.targetName=e.multiInject=e.unmanaged=e.optional=e.LazyServiceIdentifer=e.inject=e.named=e.tagged=e.injectable=e.ContainerModule=e.AsyncContainerModule=e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=e.Container=e.METADATA_KEY=void 0;var r=n(34);e.METADATA_KEY=r;var i=n(505);Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return i.Container}});var o=n(56);Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return o.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return o.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return o.TargetTypeEnum}});var a=n(521);Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return a.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return a.ContainerModule}});var s=n(522);Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return s.injectable}});var u=n(523);Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return u.tagged}});var c=n(524);Object.defineProperty(e,"named",{enumerable:!0,get:function(){return c.named}});var l=n(245);Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return l.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return l.LazyServiceIdentifer}});var h=n(525);Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return h.optional}});var f=n(526);Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return f.unmanaged}});var d=n(527);Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return d.multiInject}});var p=n(528);Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return p.targetName}});var g=n(529);Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return g.postConstruct}});var v=n(243);Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return v.MetadataReader}});var m=n(69);Object.defineProperty(e,"id",{enumerable:!0,get:function(){return m.id}});var y=n(61);Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return y.decorate}});var b=n(248);Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return b.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return b.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return b.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return b.typeConstraint}});var x=n(93);Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return x.getServiceIdentifierAsString}});var w=n(530);Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return w.multiBindToService}})},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function n(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)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.TextureCompressionBC="texture-compression-bc"}(e.ExtensionName||(e.ExtensionName={})),function(t){t.ClampToEdge="clamp-to-edge",t.Repeat="repeat",t.MirrorRepeat="mirror-repeat"}(e.AddressMode||(e.AddressMode={})),function(t){t.UniformBuffer="uniform-buffer",t.StorageBuffer="storage-buffer",t.ReadonlyStorageBuffer="readonly-storage-buffer",t.Sampler="sampler",t.ComparisonSampler="comparison-sampler",t.SampledTexture="sampled-texture",t.ReadonlyStorageTexture="readonly-storage-texture",t.WriteonlyStorageTexture="writeonly-storage-texture"}(e.BindingType||(e.BindingType={})),function(t){t.Zero="zero",t.One="one",t.SrcColor="src-color",t.OneMinusSrcColor="one-minus-src-color",t.SrcAlpha="src-alpha",t.OneMinusSrcAlpha="one-minus-src-alpha",t.DstColor="dst-color",t.OneMinusDstColor="one-minus-dst-color",t.DstAlpha="dst-alpha",t.OneMinusDstAlpha="one-minus-dst-alpha",t.SrcAlphaSaturated="src-alpha-saturated",t.BlendColor="blend-color",t.OneMinusBlendColor="one-minus-blend-color"}(e.BlendFactor||(e.BlendFactor={})),function(t){t.Add="add",t.Subtract="subtract",t.ReverseSubtract="reverse-subtract",t.Min="min",t.Max="max"}(e.BlendOperation||(e.BlendOperation={})),function(t){t.Never="never",t.Less="less",t.Equal="equal",t.LessEqual="less-equal",t.Greater="greater",t.NotEqual="not-equal",t.GreaterEqual="greater-equal",t.Always="always"}(e.CompareFunction||(e.CompareFunction={})),function(t){t.None="none",t.Front="front",t.Back="back"}(e.CullMode||(e.CullMode={})),function(t){t.Nearest="nearest",t.Linear="linear"}(e.FilterMode||(e.FilterMode={})),function(t){t.CCW="ccw",t.CW="cw"}(e.FrontFace||(e.FrontFace={})),function(t){t.Uint16="uint16",t.Uint32="uint32"}(e.IndexFormat||(e.IndexFormat={})),function(t){t.Vertex="vertex",t.Instance="instance"}(e.InputStepMode||(e.InputStepMode={})),function(t){t.Load="load"}(e.LoadOp||(e.LoadOp={})),function(t){t.PointList="point-list",t.LineList="line-list",t.LineStrip="line-strip",t.TriangleList="triangle-list",t.TriangleStrip="triangle-strip"}(e.PrimitiveTopology||(e.PrimitiveTopology={})),function(t){t.Keep="keep",t.Zero="zero",t.Replace="replace",t.Invert="invert",t.IncrementClamp="increment-clamp",t.DecrementClamp="decrement-clamp",t.IncrementWrap="increment-wrap",t.DecrementWrap="decrement-wrap"}(e.StencilOperation||(e.StencilOperation={})),function(t){t.Store="store",t.Clear="clear"}(e.StoreOp||(e.StoreOp={})),function(t){t.E1d="1d",t.E2d="2d",t.E3d="3d"}(e.TextureDimension||(e.TextureDimension={})),function(t){t.R8Unorm="r8unorm",t.R8Snorm="r8snorm",t.R8Uint="r8uint",t.R8Sint="r8sint",t.R16Uint="r16uint",t.R16Sint="r16sint",t.R16Float="r16float",t.RG8Unorm="rg8unorm",t.RG8Snorm="rg8snorm",t.RG8Uint="rg8uint",t.RG8Sint="rg8sint",t.R32Uint="r32uint",t.R32Sint="r32sint",t.R32Float="r32float",t.RG16Uint="rg16uint",t.RG16Sint="rg16sint",t.RG16Float="rg16float",t.RGBA8Unorm="rgba8unorm",t.RGBA8UnormSRGB="rgba8unorm-srgb",t.RGBA8Snorm="rgba8snorm",t.RGBA8Uint="rgba8uint",t.RGBA8Sint="rgba8sint",t.BGRA8Unorm="bgra8unorm",t.BGRA8UnormSRGB="bgra8unorm-srgb",t.RGB10A2Unorm="rgb10a2unorm",t.RG11B10Float="rg11b10float",t.RG32Uint="rg32uint",t.RG32Sint="rg32sint",t.RG32Float="rg32float",t.RGBA16Uint="rgba16uint",t.RGBA16Sint="rgba16sint",t.RGBA16Float="rgba16float",t.RGBA32Uint="rgba32uint",t.RGBA32Sint="rgba32sint",t.RGBA32Float="rgba32float",t.Depth32Float="depth32float",t.Depth24Plus="depth24plus",t.Depth24PlusStencil8="depth24plus-stencil8"}(e.TextureFormat||(e.TextureFormat={})),function(t){t.Float="float",t.Sint="sint",t.Uint="uint"}(e.TextureComponentType||(e.TextureComponentType={})),function(t){t.E1d="1d",t.E2d="2d",t.E2dArray="2d-array",t.Cube="cube",t.CubeArray="cube-array",t.E3d="3d"}(e.TextureViewDimension||(e.TextureViewDimension={})),function(t){t.Uchar2="uchar2",t.Uchar4="uchar4",t.Char2="char2",t.Char4="char4",t.Uchar2Norm="uchar2norm",t.Uchar4Norm="uchar4norm",t.Char2Norm="char2norm",t.Char4Norm="char4norm",t.Ushort2="ushort2",t.Ushort4="ushort4",t.Short2="short2",t.Short4="short4",t.Ushort2Norm="ushort2norm",t.Ushort4Norm="ushort4norm",t.Short2Norm="short2norm",t.Short4Norm="short4norm",t.Half2="half2",t.Half4="half4",t.Float="float",t.Float2="float2",t.Float3="float3",t.Float4="float4",t.Uint="uint",t.Uint2="uint2",t.Uint3="uint3",t.Uint4="uint4",t.Int="int",t.Int2="int2",t.Int3="int3",t.Int4="int4"}(e.VertexFormat||(e.VertexFormat={})),function(t){t.All="all",t.StencilOnly="stencil-only",t.DepthOnly="depth-only"}(e.TextureAspect||(e.TextureAspect={})),function(t){t.Error="error",t.Warning="warning",t.Info="info"}(e.CompilationMessageType||(e.CompilationMessageType={})),function(t){t.Occlusion="occlusion"}(e.QueryType||(e.QueryType={})),function(t){t[t.MapRead=1]="MapRead",t[t.MapWrite=2]="MapWrite",t[t.CopySrc=4]="CopySrc",t[t.CopyDst=8]="CopyDst",t[t.Index=16]="Index",t[t.Vertex=32]="Vertex",t[t.Uniform=64]="Uniform",t[t.Storage=128]="Storage",t[t.Indirect=256]="Indirect",t[t.QueryResolve=512]="QueryResolve"}(e.BufferUsage||(e.BufferUsage={})),function(t){t[t.Red=1]="Red",t[t.Green=2]="Green",t[t.Blue=4]="Blue",t[t.Alpha=8]="Alpha",t[t.All=15]="All"}(e.ColorWrite||(e.ColorWrite={})),function(t){t[t.Vertex=1]="Vertex",t[t.Fragment=2]="Fragment",t[t.Compute=4]="Compute"}(e.ShaderStage||(e.ShaderStage={})),function(t){t[t.CopySrc=1]="CopySrc",t[t.CopyDst=2]="CopyDst",t[t.Sampled=4]="Sampled",t[t.Storage=8]="Storage",t[t.OutputAttachment=16]="OutputAttachment"}(e.TextureUsage||(e.TextureUsage={})),function(t){t[t.Read=1]="Read",t[t.Write=2]="Write"}(e.MapMode||(e.MapMode={}))},function(t,e,n){t.exports=n(501)},function(t,e){t.exports=function(t,e,n,r){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e,n,r,i){var o={};return Object.keys(r).forEach((function(t){o[t]=r[t]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce((function(n,r){return r(t,e,n)||n}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}));var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r={HierarchyComponentManager:Symbol("HierarchyComponentManager"),TransformComponentManager:Symbol("TransformComponentManager"),NameComponentManager:Symbol("NameComponentManager"),SceneGraphSystem:Symbol("SceneGraphSystem"),FrameGraphSystem:Symbol("FrameGraphSystem"),ResourcePool:Symbol("ResourcePool"),ResourceHandleComponentManager:Symbol("ResourceHandleComponentManager"),PassNodeComponentManager:Symbol("PassNodeComponentManager"),RendererSystem:Symbol("RendererSystem"),RenderPass:Symbol("RenderPass"),RenderPassFactory:Symbol("Factory<IRenderPass>"),Renderable:Symbol("Factory<IRenderPass>"),MeshSystem:Symbol("MeshSystem"),MeshComponentManager:Symbol("MeshComponentManager"),CullableComponentManager:Symbol("CullableComponentManager"),Geometry:Symbol("Geometry"),GeometrySystem:Symbol("GeometrySystem"),GeometryComponentManager:Symbol("GeometryComponentManager"),Material:Symbol("Material"),MaterialSystem:Symbol("MaterialSystem"),MaterialComponentManager:Symbol("MaterialComponentManager"),ForwardRenderPath:Symbol("ForwardRenderPath"),ComputeSystem:Symbol("ComputeSystem"),ComputeComponentManager:Symbol("ComputeComponentManager"),ComputeStrategy:Symbol("ComputeStrategy"),Systems:Symbol("Systems"),World:Symbol("World"),RenderEngine:Symbol("RenderEngine"),WebGPUEngine:Symbol("WebGPUEngine"),WebGLEngine:Symbol("WebGLEngine"),ShaderModuleService:Symbol("ShaderModuleService"),ConfigService:Symbol("ConfigService"),InteractorService:Symbol("InteractorService"),IEventEmitter:Symbol("IEventEmitter"),Light:Symbol("Light")}},function(t,e,n){"use strict";n.r(e),n.d(e,"mat3",(function(){return i.a})),n.d(e,"vec2",(function(){return i.d})),n.d(e,"vec3",(function(){return i.e})),n.d(e,"ext",(function(){return r}));var r={};n.r(r),n.d(r,"leftTranslate",(function(){return o})),n.d(r,"leftRotate",(function(){return a})),n.d(r,"leftScale",(function(){return s})),n.d(r,"transform",(function(){return u})),n.d(r,"direction",(function(){return c})),n.d(r,"angleTo",(function(){return l})),n.d(r,"vertical",(function(){return h}));var i=n(2);function o(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.a.fromTranslation(r,n),i.a.multiply(t,r,e)}function a(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.a.fromRotation(r,n),i.a.multiply(t,r,e)}function s(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.a.fromScaling(r,n),i.a.multiply(t,r,e)}function u(t,e){for(var n,r,u,c=t?[].concat(t):[1,0,0,0,1,0,0,0,1],l=0,h=e.length;l<h;l++){var f=e[l];switch(f[0]){case"t":o(c,c,[f[1],f[2]]);break;case"s":s(c,c,[f[1],f[2]]);break;case"r":a(c,c,f[1]);break;case"m":n=c,r=c,u=f[1],i.a.multiply(n,u,r)}}return c}function c(t,e){return t[0]*e[1]-e[0]*t[1]}function l(t,e,n){var r=i.d.angle(t,e),o=c(t,e)>=0;return n?o?2*Math.PI-r:r:o?r:2*Math.PI-r}function h(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}},function(t,e){function n(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function s(t){n(a,i,o,s,u,"next",t)}function u(t){n(a,i,o,s,u,"throw",t)}s(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"f",(function(){return s})),n.d(e,"l",(function(){return u})),n.d(e,"j",(function(){return c}));var r=n(0);function i(){return window?window.devicePixelRatio:1}function o(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function a(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function s(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)}function u(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}function c(t,e){return t[0]===e[0]&&t[1]===e[1]}n.d(e,"i",(function(){return r.isNil})),n.d(e,"k",(function(){return r.isString})),n.d(e,"h",(function(){return r.isFunction})),n.d(e,"g",(function(){return r.isArray})),n.d(e,"c",(function(){return r.each})),n.d(e,"o",(function(){return r.toRadian})),n.d(e,"m",(function(){return r.mod})),n.d(e,"n",(function(){return r.requestAnimationFrame})),n.d(e,"a",(function(){return r.clearAnimationFrame}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},i={opacity:"opacity",fillStyle:"fill",fill:"fill",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",x:"x",y:"y",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,n(e)}t.exports=n,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.d(e,"j",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"g",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(0);function i(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}n.d(e,"e",(function(){return r.isNil})),n.d(e,"d",(function(){return r.isFunction})),n.d(e,"h",(function(){return r.isString})),n.d(e,"f",(function(){return r.isObject})),n.d(e,"i",(function(){return r.mix})),n.d(e,"a",(function(){return r.each})),n.d(e,"k",(function(){return r.upperFirst}));var o="undefined"!=typeof window&&void 0!==window.document;function a(t,e){if(t.isCanvas())return!0;for(var n=e.getParent(),r=!1;n;){if(n===t){r=!0;break}n=n.getParent()}return r}function s(t){return t.cfg.visible&&t.cfg.capture}},function(t,e,n){"use strict";n.d(e,"e",(function(){return y})),n.d(e,"b",(function(){return E})),n.d(e,"a",(function(){return T})),n.d(e,"c",(function(){return f})),n.d(e,"d",(function(){return R})),n.d(e,"f",(function(){return r}));var r={};function i(t){return Math.min.apply(null,t)}function o(t){return Math.max.apply(null,t)}function a(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function s(t,e){return Math.abs(t-e)<.001}function u(t,e){var n=i(t),r=i(e);return{x:n,y:r,width:o(t)-n,height:o(e)-r}}function c(t,e,n,r){return{minX:i([t,n]),maxX:o([t,n]),minY:i([e,r]),maxY:o([e,r])}}function l(t){return(t+2*Math.PI)%(2*Math.PI)}n.r(r),n.d(r,"distance",(function(){return a})),n.d(r,"isNumberEqual",(function(){return s})),n.d(r,"getBBoxByArray",(function(){return u})),n.d(r,"getBBoxRange",(function(){return c})),n.d(r,"piMod",(function(){return l}));var h=n(83),f={box:function(t,e,n,r){return u([t,n],[e,r])},length:function(t,e,n,r){return a(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var s=(n-t)*(i-t)+(r-e)*(o-e);return s<0?a(t,e,i,o):s>(n-t)*(n-t)+(r-e)*(r-e)?a(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(h.exactEquals(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];h.normalize(s,s);var u=[i-t,o-e];return Math.abs(h.dot(u,s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function d(t,e,n,r,i,o){var s,u=1/0,c=[n,r],l=20;o&&o>200&&(l=o/10);for(var h=1/l,f=h/10,d=0;d<=l;d++){var p=d*h,g=[i.apply(null,t.concat([p])),i.apply(null,e.concat([p]))];(b=a(c[0],c[1],g[0],g[1]))<u&&(s=p,u=b)}if(0===s)return{x:t[0],y:e[0]};if(1===s){var v=t.length;return{x:t[v-1],y:e[v-1]}}u=1/0;for(d=0;d<32&&!(f<1e-4);d++){var m=s-f,y=s+f,b=(g=[i.apply(null,t.concat([m])),i.apply(null,e.concat([m]))],a(c[0],c[1],g[0],g[1]));if(m>=0&&b<u)s=m,u=b;else{var x=[i.apply(null,t.concat([y])),i.apply(null,e.concat([y]))],w=a(c[0],c[1],x[0],x[1]);y<=1&&w<u?(s=y,u=w):f*=.5}}return{x:i.apply(null,t.concat([s])),y:i.apply(null,e.concat([s]))}}function p(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function g(t,e,n){var r=t+n-2*e;if(s(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function v(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function m(t,e,n,r,i,o,a){var s=p(t,n,i,a),u=p(e,r,o,a),c=f.pointAt(t,e,n,r,a),l=f.pointAt(n,r,i,o,a);return[[t,e,c.x,c.y,s,u],[s,u,l.x,l.y,i,o]]}var y={box:function(t,e,n,r,i,o){var a=g(t,n,i)[0],s=g(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(p(t,n,i,a)),void 0!==s&&l.push(p(e,r,o,s)),u(c,l)},length:function(t,e,n,r,i,o){return function t(e,n,r,i,o,s,u){if(0===u)return(a(e,n,r,i)+a(r,i,o,s)+a(e,n,o,s))/2;var c=m(e,n,r,i,o,s,.5),l=c[0],h=c[1];return l.push(u-1),h.push(u-1),t.apply(null,l)+t.apply(null,h)}(t,e,n,r,i,o,3)},nearestPoint:function(t,e,n,r,i,o,a,s){return d([t,n,i],[e,r,o],a,s,p)},pointDistance:function(t,e,n,r,i,o,s,u){var c=this.nearestPoint(t,e,n,r,i,o,s,u);return a(c.x,c.y,s,u)},interpolationAt:p,pointAt:function(t,e,n,r,i,o,a){return{x:p(t,n,i,a),y:p(e,r,o,a)}},divide:function(t,e,n,r,i,o,a){return m(t,e,n,r,i,o,a)},tangentAngle:function(t,e,n,r,i,o,a){var s=v(t,n,i,a),u=v(e,r,o,a);return l(Math.atan2(u,s))}};function b(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function x(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function w(t,e,n,r){var i,o,a,u=-3*t+9*e-9*n+3*r,c=6*t-12*e+6*n,l=3*e-3*t,h=[];if(s(u,0))s(c,0)||(i=-l/c)>=0&&i<=1&&h.push(i);else{var f=c*c-4*u*l;s(f,0)?h.push(-c/(2*u)):f>0&&(o=(-c-(a=Math.sqrt(f)))/(2*u),(i=(-c+a)/(2*u))>=0&&i<=1&&h.push(i),o>=0&&o<=1&&h.push(o))}return h}function _(t,e,n,r,i,o,a,s,u){var c=b(t,n,i,a,u),l=b(e,r,o,s,u),h=f.pointAt(t,e,n,r,u),d=f.pointAt(n,r,i,o,u),p=f.pointAt(i,o,a,s,u),g=f.pointAt(h.x,h.y,d.x,d.y,u),v=f.pointAt(d.x,d.y,p.x,p.y,u);return[[t,e,h.x,h.y,g.x,g.y,c,l],[c,l,v.x,v.y,p.x,p.y,a,s]]}function S(t,e,n,r,i,o,s,u,c){if(0===c)return function(t,e){for(var n=0,r=t.length,i=0;i<r;i++){n+=a(t[i],e[i],t[(i+1)%r],e[(i+1)%r])}return n/2}([t,n,i,s],[e,r,o,u]);var l=_(t,e,n,r,i,o,s,u,.5),h=l[0],f=l[1];return h.push(c-1),f.push(c-1),S.apply(null,h)+S.apply(null,f)}var E={extrema:w,box:function(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],h=w(t,n,i,a),f=w(e,r,o,s),d=0;d<h.length;d++)c.push(b(t,n,i,a,h[d]));for(d=0;d<f.length;d++)l.push(b(e,r,o,s,f[d]));return u(c,l)},length:function(t,e,n,r,i,o,a,s){return S(t,e,n,r,i,o,a,s,3)},nearestPoint:function(t,e,n,r,i,o,a,s,u,c,l){return d([t,n,i,a],[e,r,o,s],u,c,b,l)},pointDistance:function(t,e,n,r,i,o,s,u,c,l,h){var f=this.nearestPoint(t,e,n,r,i,o,s,u,c,l,h);return a(f.x,f.y,c,l)},interpolationAt:b,pointAt:function(t,e,n,r,i,o,a,s,u){return{x:b(t,n,i,a,u),y:b(e,r,o,s,u)}},divide:function(t,e,n,r,i,o,a,s,u){return _(t,e,n,r,i,o,a,s,u)},tangentAngle:function(t,e,n,r,i,o,a,s,u){var c=x(t,n,i,a,u),h=x(e,r,o,s,u);return l(Math.atan2(h,c))}};function M(t,e){var n=Math.abs(t);return e>0?n:-1*n}var O=function(t,e,n,r,i,o){var a=n,s=r;if(0===a||0===s)return{x:t,y:e};for(var u,c,l=i-t,h=o-e,f=Math.abs(l),d=Math.abs(h),p=a*a,g=s*s,v=Math.PI/4,m=0;m<4;m++){u=a*Math.cos(v),c=s*Math.sin(v);var y=(p-g)*Math.pow(Math.cos(v),3)/a,b=(g-p)*Math.pow(Math.sin(v),3)/s,x=u-y,w=c-b,_=f-y,S=d-b,E=Math.hypot(w,x),O=Math.hypot(S,_);v+=E*Math.asin((x*S-w*_)/(E*O))/Math.sqrt(p+g-u*u-c*c),v=Math.min(Math.PI/2,Math.max(0,v))}return{x:t+M(u,l),y:e+M(c,h)}};function A(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function k(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function C(t,e,n){return{x:t*Math.cos(n),y:e*Math.sin(n)}}function I(t,e,n){var r=Math.cos(n),i=Math.sin(n);return[t*r-e*i,t*i+e*r]}var T={box:function(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,c=-1/0,l=[o,a],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;o<a?o<f&&f<a&&l.push(f):a<f&&f<o&&l.push(f)}for(h=0;h<l.length;h++){var d=A(t,0,n,r,i,l[h]);d<u&&(u=d),d>c&&(c=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,v=-1/0,m=[o,a];for(h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var y=p+h;o<a?o<y&&y<a&&m.push(y):a<y&&y<o&&m.push(y)}for(h=0;h<m.length;h++){var b=k(0,e,n,r,i,m[h]);b<g&&(g=b),b>v&&(v=b)}return{x:u,y:g,width:c-u,height:v-g}},length:function(t,e,n,r,i,o,a){},nearestPoint:function(t,e,n,r,i,o,a,s,u){var c=I(s-t,u-e,-i),l=c[0],h=c[1],f=O(0,0,n,r,l,h),d=function(t,e,n,r){return(Math.atan2(r*t,n*e)+2*Math.PI)%(2*Math.PI)}(n,r,f.x,f.y);d<o?f=C(n,r,o):d>a&&(f=C(n,r,a));var p=I(f.x,f.y,i);return{x:p[0]+t,y:p[1]+e}},pointDistance:function(t,e,n,r,i,o,s,u,c){var l=this.nearestPoint(t,e,n,r,u,c);return a(l.x,l.y,u,c)},pointAt:function(t,e,n,r,i,o,a,s){var u=(a-o)*s+o;return{x:A(t,0,n,r,i,u),y:k(0,e,n,r,i,u)}},tangentAngle:function(t,e,n,r,i,o,a,s){var u=(a-o)*s+o,c=function(t,e,n,r,i,o,a,s){return-1*n*Math.cos(i)*Math.sin(s)-r*Math.sin(i)*Math.cos(s)}(0,0,n,r,i,0,0,u),h=function(t,e,n,r,i,o,a,s){return-1*n*Math.sin(i)*Math.sin(s)+r*Math.cos(i)*Math.cos(s)}(0,0,n,r,i,0,0,u);return l(Math.atan2(h,c))}};function P(t){for(var e=0,n=[],r=0;r<t.length-1;r++){var i=t[r],o=t[r+1],s=a(i[0],i[1],o[0],o[1]),u={from:i,to:o,length:s};n.push(u),e+=s}return{segments:n,totalLength:e}}function N(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=a(r[0],r[1],i[0],i[1])}return e}function j(t,e){if(e>1||e<0||t.length<2)return null;var n=P(t),r=n.segments,i=n.totalLength;if(0===i)return{x:t[0][0],y:t[0][1]};for(var o=0,a=null,s=0;s<r.length;s++){var u=r[s],c=u.from,l=u.to,h=u.length/i;if(e>=o&&e<=o+h){var d=(e-o)/h;a=f.pointAt(c[0],c[1],l[0],l[1],d);break}o+=h}return a}function D(t,e){if(e>1||e<0||t.length<2)return 0;for(var n=P(t),r=n.segments,i=n.totalLength,o=0,a=0,s=0;s<r.length;s++){var u=r[s],c=u.from,l=u.to,h=u.length/i;if(e>=o&&e<=o+h){a=Math.atan2(l[1]-c[1],l[0]-c[0]);break}o+=h}return a}function L(t,e,n){for(var r=1/0,i=0;i<t.length-1;i++){var o=t[i],a=t[i+1],s=f.pointDistance(o[0],o[1],a[0],a[1],e,n);s<r&&(r=s)}return r}var R={box:function(t){for(var e=[],n=[],r=0;r<t.length;r++){var i=t[r];e.push(i[0]),n.push(i[1])}return u(e,n)},length:function(t){return N(t)},pointAt:function(t,e){return j(t,e)},pointDistance:function(t,e,n){return L(t,e,n)},tangentAngle:function(t,e){return D(t,e)}}},function(t,e,n){"use strict";var r=n(53);n.d(e,"PathUtil",(function(){return r}));n(176),n(177);var i=n(120);n.d(e,"Event",(function(){return i.a}));n(121);var o=n(278);n.d(e,"AbstractCanvas",(function(){return o.a}));var a=n(179);n.d(e,"AbstractGroup",(function(){return a.a}));var s=n(180);n.d(e,"AbstractShape",(function(){return s.a}));var u=n(279);n.d(e,"getBBoxMethod",(function(){return u.a}));var c=n(70);n.d(e,"getTextHeight",(function(){return c.b})),n.d(e,"assembleFont",(function(){return c.a}));var l=n(20);n.d(e,"isAllowCapture",(function(){return l.b}));var h=n(40);n.d(e,"multiplyVec2",(function(){return h.c})),n.d(e,"invert",(function(){return h.a}));var f=n(122);n.d(e,"getOffScreenContext",(function(){return f.a}))},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(531);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(43).default,i=n(23);t.exports=function(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return d}));var r=n(10),i=n.n(r),o=n(16),a=n.n(o),s=n(8),u=n.n(s),c=n(7),l=n.n(c),h=n(123),f=function t(e){l()(this,t)},d=function(){function t(e){l()(this,t),this.clazz=void 0,this.components=[],this.entities=[],this.lookup={},this.clazz=e}var e;return u()(t,[{key:"clear",value:function(){this.components=[],this.entities=[],this.lookup={}}},{key:"contains",value:function(t){return this.lookup[t]>-1}},{key:"create",value:function(t,e){this.lookup[t]=this.components.length;var n=new this.clazz(e||{});return this.components.push(n),this.entities.push(t),n}},{key:"remove",value:function(t){var e=this.lookup[t];e>-1&&e<this.components.length-1&&(this.components[e]=this.components[this.components.length-1],this.entities[e]=this.entities[this.entities.length-1],this.lookup[this.entities[e]]=e),this.components.pop(),this.entities.pop(),delete this.lookup[t]}},{key:"removeKeepSorted",value:function(t){var e=this.lookup[t];if(e>-1){var n=this.entities[e];if(e<this.components.length-1){for(var r=e+1;r<this.components.length;++r)this.components[r-1]=this.components[r];for(var i=e+1;i<this.entities.length;++i)this.entities[i-1]=this.entities[i],this.lookup[this.entities[i-1]]=i-1}this.components.pop(),this.entities.pop(),delete this.lookup[n]}}},{key:"moveItem",value:function(t,e){if(t!==e){for(var n=this.components[t],r=this.entities[t],i=t<e?1:-1,o=t;o!==e;o+=i){var a=o+i;this.components[o]=this.components[a],this.entities[o]=this.entities[a],this.lookup[this.entities[o]]=o}this.components[e]=n,this.entities[e]=r,this.lookup[r]=e}}},{key:"getEntity",value:function(t){return this.entities[t]}},{key:"getComponent",value:function(t){return this.components[t]}},{key:"getComponentByEntity",value:function(t){var e=this.lookup[t];return e>-1?this.components[e]:null}},{key:"getCount",value:function(){return this.components.length}},{key:"getEntityByComponentIndex",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r);if(this.lookup[i]===t)return i}return h.a}},{key:"find",value:function(t){for(var e=0;e<this.getCount();e++){var n=this.getComponent(e);if(t(n,e))return n}return null}},{key:"findIndex",value:function(t){for(var e=0;e<this.getCount();e++){if(t(this.getComponent(e),e))return e}return-1}},{key:"forEach",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r),o=this.lookup[i];t(i,this.getComponent(o))}}},{key:"forEachAsync",value:(e=a()(i.a.mark((function t(e){var n,r,o,a,s;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0,r=Object.keys(this.lookup);case 1:if(!(n<r.length)){t.next=10;break}return o=r[n],a=Number(o),s=this.lookup[a],t.next=7,e(a,this.getComponent(s));case 7:n++,t.next=1;break;case 10:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"map",value:function(t){for(var e=[],n=0,r=Object.keys(this.lookup);n<r.length;n++){var i=r[n],o=Number(i),a=this.lookup[o];e.push(t(o,this.getComponent(a)))}return e}}]),t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return u}));var r=n(0),i=n(18);function o(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function a(t){var e=i.a[t.type],n=t.getParent();if(!e)throw new Error("the type "+t.type+" is not supported by svg");var r=o(e);if(t.get("id")&&(r.id=t.get("id")),t.set("el",r),t.set("attrs",{}),n){var a=n.get("el");a||(a=n.createDom(),n.set("el",a)),a.appendChild(r)}return r}function s(t,e){var n=t.get("el"),i=Object(r.toArray)(n.children).sort(e),o=document.createDocumentFragment();i.forEach((function(t){o.appendChild(t)})),n.appendChild(o)}function u(t,e){var n=t.parentNode,r=Array.from(n.childNodes).filter((function(t){return 1===t.nodeType&&"defs"!==t.nodeName.toLowerCase()})),i=r[e],o=r.indexOf(t);if(i){if(o>e)n.insertBefore(t,i);else if(o<e){var a=r[e+1];a?n.insertBefore(t,a):n.appendChild(t)}}else n.appendChild(t)}},function(t,e,n){var r=n(533),i=n(534),o=n(241),a=n(535);t.exports=function(t){return r(t)||i(t)||o(t)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r;try{r={cloneDeep:n(438),constant:n(162),defaults:n(439),each:n(205),filter:n(208),find:n(440),flatten:n(235),forEach:n(206),forIn:n(447),has:n(219),isUndefined:n(220),last:n(448),map:n(221),mapValues:n(449),max:n(450),merge:n(452),min:n(458),minBy:n(459),now:n(460),pick:n(461),range:n(466),reduce:n(223),sortBy:n(469),uniqueId:n(474),values:n(228),zipObject:n(475)}}catch(t){}r||(r=window._),t.exports=r},function(t,e){t.exports=function(t,e){throw new Error("Decorating class property failed. Please ensure that proposal-class-properties is enabled and runs after the decorators transform.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return l})),n.d(e,"b",(function(){return h})),n.d(e,"c",(function(){return f})),n.d(e,"e",(function(){return g})),n.d(e,"h",(function(){return v})),n.d(e,"f",(function(){return m})),n.d(e,"g",(function(){return y}));var r=n(0),i=n(144),o=n(95),a=n(17),s=n(35),u={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function c(t,e){var n=e.attr();for(var o in n){var a=n[o],s=u[o]?u[o]:o;"matrix"===s&&a?t.transform(a[0],a[1],a[3],a[4],a[6],a[7]):"lineDash"===s&&t.setLineDash?Object(r.isArray)(a)&&t.setLineDash(a):("strokeStyle"===s||"fillStyle"===s?a=Object(i.b)(t,e,a):"globalAlpha"===s&&(a*=t.globalAlpha),t[s]=a)}}function l(t,e,n){for(var r=0;r<e.length;r++){var i=e[r];i.cfg.visible?i.draw(t,n):i.skipDraw()}}function h(t,e,n){var i=t.get("refreshElements");Object(r.each)(i,(function(e){if(e!==t)for(var n=e.cfg.parent;n&&n!==t&&!n.cfg.refresh;)n.cfg.refresh=!0,n=n.cfg.parent})),i[0]===t?d(e,n):function t(e,n){for(var r=0;r<e.length;r++){var i=e[r];if(i.cfg.visible)if(i.cfg.hasChanged)i.cfg.refresh=!0,i.isGroup()&&d(i.cfg.children,n);else if(i.cfg.refresh)i.isGroup()&&t(i.cfg.children,n);else{var o=p(i,n);i.cfg.refresh=o,o&&i.isGroup()&&t(i.cfg.children,n)}}}(e,n)}function f(t){for(var e=0;e<t.length;e++){var n=t[e];n.cfg.hasChanged=!1,n.isGroup()&&!n.destroyed&&f(n.cfg.children)}}function d(t,e){for(var n=0;n<t.length;n++){var r=t[n];r.cfg.refresh=!0,r.isGroup()&&d(r.get("children"),e)}}function p(t,e){var n=t.cfg.cacheCanvasBBox;return t.cfg.isInView&&n&&Object(a.f)(n,e)}function g(t,e,n,r){var i=n.path,a=n.startArrow,u=n.endArrow;if(i){var c=[0,0],l=[0,0],h={dx:0,dy:0};e.beginPath();for(var f=0;f<i.length;f++){var d=i[f],p=d[0];if(0===f&&a&&a.d){var g=t.getStartTangent();h=s.c(g[0][0],g[0][1],g[1][0],g[1][1],a.d)}else if(f===i.length-2&&"Z"===i[f+1][0]&&u&&u.d){if("Z"===i[f+1][0]){g=t.getEndTangent();h=s.c(g[0][0],g[0][1],g[1][0],g[1][1],u.d)}}else if(f===i.length-1&&u&&u.d&&"Z"!==i[0]){g=t.getEndTangent();h=s.c(g[0][0],g[0][1],g[1][0],g[1][1],u.d)}var v=h.dx,m=h.dy;switch(p){case"M":e.moveTo(d[1]-v,d[2]-m),l=[d[1],d[2]];break;case"L":e.lineTo(d[1]-v,d[2]-m);break;case"Q":e.quadraticCurveTo(d[1],d[2],d[3]-v,d[4]-m);break;case"C":e.bezierCurveTo(d[1],d[2],d[3],d[4],d[5]-v,d[6]-m);break;case"A":var y=void 0;r?(y=r[f])||(y=Object(o.a)(c,d),r[f]=y):y=Object(o.a)(c,d);var b=y.cx,x=y.cy,w=y.rx,_=y.ry,S=y.startAngle,E=y.endAngle,M=y.xRotation,O=y.sweepFlag;if(e.ellipse)e.ellipse(b,x,w,_,M,S,E,1-O);else{var A=w>_?w:_,k=w>_?1:w/_,C=w>_?_/w:1;e.translate(b,x),e.rotate(M),e.scale(k,C),e.arc(0,0,A,S,E,1-O),e.scale(1/k,1/C),e.rotate(-M),e.translate(-b,-x)}break;case"Z":e.closePath()}if("Z"===p)c=l;else{var I=d.length;c=[d[I-2],d[I-1]]}}}}function v(t,e){var n=t.get("canvas");n&&("remove"===e&&(t._cacheCanvasBBox=t.get("cacheCanvasBBox")),t.get("hasChanged")||(t.set("hasChanged",!0),t.cfg.parent&&t.cfg.parent.get("hasChanged")||(n.refreshElement(t,e,n),n.get("autoDraw")&&n.draw())))}function m(t){if(!t.length)return null;var e=[],n=[],i=[],o=[];return Object(r.each)(t,(function(t){var r=function(t){var e;if(t.destroyed)e=t._cacheCanvasBBox;else{var n=t.get("cacheCanvasBBox"),r=n&&!(!n.width||!n.height),i=t.getCanvasBBox(),o=i&&!(!i.width||!i.height);r&&o?e=Object(a.l)(n,i):r?e=n:o&&(e=i)}return e}(t);r&&(e.push(r.minX),n.push(r.minY),i.push(r.maxX),o.push(r.maxY))})),{minX:Object(r.min)(e),minY:Object(r.min)(n),maxX:Object(r.max)(i),maxY:Object(r.max)(o)}}function y(t,e){return t&&e&&Object(a.f)(t,e)?{minX:Math.max(t.minX,e.minX),minY:Math.max(t.minY,e.minY),maxX:Math.min(t.maxX,e.maxX),maxY:Math.min(t.maxY,e.maxY)}:null}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Util=void 0;const r=n(5),i=n(147),o=n(78);e.Util={generateId:()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){let e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),objectClone:t=>t?JSON.parse(JSON.stringify(t)):null,removeFromList(t,e){const n=[];for(let r=0;r<t.length;r++)if(e(t[r])){let e=t.splice(r,1);n.push(...e),r--}return n},groupBy(t,e){const n={};return t.forEach(t=>{let r=t[e];void 0===n[r]&&(n[r]=[]),n[r].push(t)}),n},assert(t,e){if(t)throw e},textParser(t){let e=/\[[^\]]*\]/g;if(e.test(t)){return t.match(e).map(t=>t.replace(/\[|\]/g,""))}return t},clamp:(t,e,n)=>t<=e&&t>=n?t:t>e?e:t<n?n:void 0,convertGroupTable2ModelList(t){const e=[];return t.forEach(t=>{e.push(...t.modelList)}),e},convertG6Data(t){let e=[...t.node,...t.marker],n=t.link;return{nodes:e.map(t=>t.getG6ModelProps()),edges:n.map(t=>t.getG6ModelProps())}},convertModelList2G6Data:t=>({nodes:t.filter(t=>!(t instanceof i.SVLink)).map(t=>t.getG6ModelProps()),edges:t.filter(t=>t instanceof i.SVLink).map(t=>t.getG6ModelProps())}),calcRotateMatrix:(t,e)=>(o.Util.mat3.rotate(t,t,e),t),registerShape:(t,e,n)=>(e.update=void 0,r.registerNode(t,e,n))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]},function(t,e,n){"use strict";n.d(e,"c",(function(){return h})),n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return d}));var r=n(1),i=n(57),o=Math.sin,a=Math.cos,s=Math.atan2,u=Math.PI;function c(t,e,n,r,c,l,h){var f=e.stroke,d=e.lineWidth,p=s(r-l,n-c),g=new i.Path({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*a(u/6)+","+10*o(u/6)+" L0,0 L"+10*a(u/6)+",-"+10*o(u/6),stroke:f,lineWidth:d}});g.translate(c,l),g.rotateAtPoint(c,l,p),t.set(h?"startArrowShape":"endArrowShape",g)}function l(t,e,n,u,c,l,h){var f=e.startArrow,d=e.endArrow,p=e.stroke,g=e.lineWidth,v=h?f:d,m=v.d,y=v.fill,b=v.stroke,x=v.lineWidth,w=Object(r.__rest)(v,["d","fill","stroke","lineWidth"]),_=s(u-l,n-c);m&&(c-=a(_)*m,l-=o(_)*m);var S=new i.Path({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:Object(r.__assign)(Object(r.__assign)({},w),{stroke:b||p,lineWidth:x||g,fill:y})});S.translate(c,l),S.rotateAtPoint(c,l,_),t.set(h?"startArrowShape":"endArrowShape",S)}function h(t,e,n,r,i){var u=s(r-e,n-t);return{dx:a(u)*i,dy:o(u)*i}}function f(t,e,n,r,i,o){"object"==typeof e.startArrow?l(t,e,n,r,i,o,!0):e.startArrow?c(t,e,n,r,i,o,!0):t.set("startArrowShape",null)}function d(t,e,n,r,i,o){"object"==typeof e.endArrow?l(t,e,n,r,i,o,!1):e.endArrow?c(t,e,n,r,i,o,!1):t.set("startArrowShape",null)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(27);function i(t,e){var n=t.cfg.el,r=t.attr(),i={dx:r.shadowOffsetX,dy:r.shadowOffsetY,blur:r.shadowBlur,color:r.shadowColor};if(i.dx||i.dy||i.blur||i.color){var o=e.find("filter",i);o||(o=e.addShadow(i)),n.setAttribute("filter","url(#"+o+")")}else n.removeAttribute("filter")}function o(t){var e=t.attr().matrix;if(e){for(var n=t.cfg.el,r=[],i=0;i<9;i+=3)r.push(e[i]+","+e[i+1]);-1===(r=r.join(",")).indexOf("NaN")?n.setAttribute("transform","matrix("+r+")"):console.warn("invalid matrix:",e)}}function a(t,e){var n=t.getClip(),i=t.get("el");if(n){if(n&&!i.hasAttribute("clip-path")){Object(r.a)(n),n.createPath(e);var o=e.addClip(n);i.setAttribute("clip-path","url(#"+o+")")}}else i.removeAttribute("clip-path")}},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),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"}(r||(r={}))},function(t,e,n){"use strict";var r=n(29),i=n(48).Graph;function o(t,e,n,i){var o;do{o=r.uniqueId(i)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function a(t){return r.max(r.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!r.isUndefined(n))return n})))}t.exports={addDummyNode:o,simplify:function(t){var e=(new i).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},asNonCompoundGraph:function(t){var e=new i({multigraph:t.isMultigraph()}).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=t.width/2,c=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(s)*u>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(u=-u),n=u,r=u*s/a);return{x:i+n,y:o+r}},buildLayerMatrix:function(t){var e=r.map(r.range(a(t)+1),(function(){return[]}));return r.forEach(t.nodes(),(function(n){var i=t.node(n),o=i.rank;r.isUndefined(o)||(e[o][i.order]=n)})),e},normalizeRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank})));r.forEach(t.nodes(),(function(n){var i=t.node(n);r.has(i,"rank")&&(i.rank-=e)}))},removeEmptyRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];r.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=t.graph().nodeRankFactor;r.forEach(n,(function(e,n){r.isUndefined(e)&&n%o!=0?--i:i&&r.forEach(e,(function(e){t.node(e).rank+=i}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return o(t,"border",i,e)},maxRank:a,partition:function(t,e){var n={lhs:[],rhs:[]};return r.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=r.now();try{return e()}finally{console.log(t+" time: "+(r.now()-n)+"ms")}},notime:function(t,e){return e()}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return g})),n.d(e,"d",(function(){return _}));var r=n(0),i=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,o=/[^\s\,]+/gi;var a=function(t){var e=t||[];return Object(r.isArray)(e)?e:Object(r.isString)(e)?(e=e.match(i),Object(r.each)(e,(function(t,n){if((t=t.match(o))[0].length>1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}Object(r.each)(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0},s=n(2);var u=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],o=0,a=t.length;o<a;o+=2)i.push([t[o],t[o+1]]);var u,c,l,h=function(t,e,n,r){var i,o,a,u,c,l,h,f=[],d=!!r;if(d){a=r[0],u=r[1];for(var p=0,g=t.length;p<g;p+=1){var v=t[p];a=s.d.min([0,0],a,v),u=s.d.max([0,0],u,v)}}p=0;for(var m=t.length;p<m;p+=1){v=t[p];if(0!==p||n)if(p!==m-1||n){i=t[[p?p-1:m-1,p-1][n?0:1]],o=t[n?(p+1)%m:p+1];var y=[0,0];y=s.d.sub(y,o,i),y=s.d.scale(y,y,e);var b=s.d.distance(v,i),x=s.d.distance(v,o),w=b+x;0!==w&&(b/=w,x/=w);var _=s.d.scale([0,0],y,-b),S=s.d.scale([0,0],y,x);l=s.d.add([0,0],v,_),c=s.d.add([0,0],v,S),c=s.d.min([0,0],c,s.d.max([0,0],o,v)),c=s.d.max([0,0],c,s.d.min([0,0],o,v)),_=s.d.sub([0,0],c,v),_=s.d.scale([0,0],_,-b/x),l=s.d.add([0,0],v,_),l=s.d.min([0,0],l,s.d.max([0,0],i,v)),l=s.d.max([0,0],l,s.d.min([0,0],i,v)),S=s.d.sub([0,0],v,l),S=s.d.scale([0,0],S,x/b),c=s.d.add([0,0],v,S),d&&(l=s.d.max([0,0],l,a),l=s.d.min([0,0],l,u),c=s.d.max([0,0],c,a),c=s.d.min([0,0],c,u)),f.push(h),f.push(l),h=c}else l=v,f.push(h),f.push(l);else h=v}return n&&f.push(f.shift()),f}(i,.4,r,n),f=i.length,d=[];for(o=0;o<f-1;o+=1)u=h[2*o],c=h[2*o+1],l=i[o+1],d.push(["C",u[0],u[1],c[0],c[1],l[0],l[1]]);return r&&(u=h[f],c=h[f+1],l=i[0],d.push(["C",u[0],u[1],c[0],c[1],l[0],l[1]])),d};var c="\t\n\v\f\r \u2028\u2029",l=new RegExp("([a-z])["+c+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+c+"]*,?["+c+"]*)+)","ig"),h=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+c+"]*,?["+c+"]*","ig");function f(t){if(!t)return null;if(Object(r.isArray)(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(l,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(h,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}var d=/[a-z]/;function p(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function g(t){var e=f(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,r=0;r<e.length;r++){var i=e[r][0];if(d.test(i)||["V","H","T","S"].indexOf(i)>=0){n=!0;break}}if(!n)return e;var o=[],a=0,s=0,u=0,c=0,l=0,h=e[0];"M"!==h[0]&&"m"!==h[0]||(u=a=+h[1],c=s=+h[2],l++,o[0]=["M",a,s]);r=l;for(var g=e.length;r<g;r++){var v=e[r],m=o[r-1],y=[],b=(i=v[0]).toUpperCase();if(i!==b)switch(y[0]=b,b){case"A":y[1]=v[1],y[2]=v[2],y[3]=v[3],y[4]=v[4],y[5]=v[5],y[6]=+v[6]+a,y[7]=+v[7]+s;break;case"V":y[1]=+v[1]+s;break;case"H":y[1]=+v[1]+a;break;case"M":u=+v[1]+a,c=+v[2]+s,y[1]=u,y[2]=c;break;default:for(var x=1,w=v.length;x<w;x++)y[x]=+v[x]+(x%2?a:s)}else y=e[r];switch(b){case"Z":a=+u,s=+c;break;case"H":y=["L",a=y[1],s];break;case"V":y=["L",a,s=y[1]];break;case"T":a=y[1],s=y[2];var _=p([m[1],m[2]],[m[3],m[4]]);y=["Q",_[0],_[1],a,s];break;case"S":a=y[y.length-2],s=y[y.length-1];var S=m.length,E=p([m[S-4],m[S-3]],[m[S-2],m[S-1]]);y=["C",E[0],E[1],y[1],y[2],a,s];break;case"M":u=y[y.length-2],c=y[y.length-1];break;default:a=y[y.length-2],s=y[y.length-1]}o.push(y)}return o}Math.PI;function v(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function m(t,e){return v(t)*v(e)?(t[0]*e[0]+t[1]*e[1])/(v(t)*v(e)):1}function y(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(m(t,e))}function b(t,e){return t[0]===e[0]&&t[1]===e[1]}function x(t,e){var n=e[1],i=e[2],o=Object(r.mod)(Object(r.toRadian)(e[3]),2*Math.PI),a=e[4],s=e[5],u=t[0],c=t[1],l=e[6],h=e[7],f=Math.cos(o)*(u-l)/2+Math.sin(o)*(c-h)/2,d=-1*Math.sin(o)*(u-l)/2+Math.cos(o)*(c-h)/2,p=f*f/(n*n)+d*d/(i*i);p>1&&(n*=Math.sqrt(p),i*=Math.sqrt(p));var g=n*n*(d*d)+i*i*(f*f),v=g?Math.sqrt((n*n*(i*i)-g)/g):1;a===s&&(v*=-1),isNaN(v)&&(v=0);var x=i?v*n*d/i:0,w=n?v*-i*f/n:0,_=(u+l)/2+Math.cos(o)*x-Math.sin(o)*w,S=(c+h)/2+Math.sin(o)*x+Math.cos(o)*w,E=[(f-x)/n,(d-w)/i],M=[(-1*f-x)/n,(-1*d-w)/i],O=y([1,0],E),A=y(E,M);return m(E,M)<=-1&&(A=Math.PI),m(E,M)>=1&&(A=0),0===s&&A>0&&(A-=2*Math.PI),1===s&&A<0&&(A+=2*Math.PI),{cx:_,cy:S,rx:b(t,[l,h])?0:n,ry:b(t,[l,h])?0:i,startAngle:O,endAngle:O+A,xRotation:o,arcFlag:a,sweepFlag:s}}function w(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function _(t){for(var e=[],n=null,r=null,i=null,o=0,s=(t=a(t)).length,u=0;u<s;u++){var c=t[u];r=t[u+1];var l=c[0],h={command:l,prePoint:n,params:c,startTangent:null,endTangent:null};switch(l){case"M":i=[c[1],c[2]],o=u;break;case"A":var f=x(n,c);h.arcParams=f}if("Z"===l)n=i,r=t[o+1];else{var d=c.length;n=[c[d-2],c[d-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),h.currentPoint=n,e[o]&&b(n,e[o].currentPoint)&&(e[o].prePoint=h.prePoint);var p=r?[r[r.length-2],r[r.length-1]]:null;h.nextPoint=p;var g=h.prePoint;if(["L","H","V"].includes(l))h.startTangent=[g[0]-n[0],g[1]-n[1]],h.endTangent=[n[0]-g[0],n[1]-g[1]];else if("Q"===l){var v=[c[1],c[2]];h.startTangent=[g[0]-v[0],g[1]-v[1]],h.endTangent=[n[0]-v[0],n[1]-v[1]]}else if("T"===l){v=w((_=e[u-1]).currentPoint,g);"Q"===_.command?(h.command="Q",h.startTangent=[g[0]-v[0],g[1]-v[1]],h.endTangent=[n[0]-v[0],n[1]-v[1]]):(h.command="TL",h.startTangent=[g[0]-n[0],g[1]-n[1]],h.endTangent=[n[0]-g[0],n[1]-g[1]])}else if("C"===l){var m=[c[1],c[2]],y=[c[3],c[4]];h.startTangent=[g[0]-m[0],g[1]-m[1]],h.endTangent=[n[0]-y[0],n[1]-y[1]],0===h.startTangent[0]&&0===h.startTangent[1]&&(h.startTangent=[m[0]-y[0],m[1]-y[1]]),0===h.endTangent[0]&&0===h.endTangent[1]&&(h.endTangent=[y[0]-m[0],y[1]-m[1]])}else if("S"===l){var _;m=w((_=e[u-1]).currentPoint,g),y=[c[1],c[2]];"C"===_.command?(h.command="C",h.startTangent=[g[0]-m[0],g[1]-m[1]],h.endTangent=[n[0]-y[0],n[1]-y[1]]):(h.command="SQ",h.startTangent=[g[0]-y[0],g[1]-y[1]],h.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===l){var S=.001,E=h.arcParams||{},M=E.cx,O=void 0===M?0:M,A=E.cy,k=void 0===A?0:A,C=E.rx,I=void 0===C?0:C,T=E.ry,P=void 0===T?0:T,N=E.sweepFlag,j=void 0===N?0:N,D=E.startAngle,L=void 0===D?0:D,R=E.endAngle,B=void 0===R?0:R;0===j&&(S*=-1);var G=I*Math.cos(L-S)+O,F=P*Math.sin(L-S)+k;h.startTangent=[G-i[0],F-i[1]];var z=I*Math.cos(L+B+S)+O,U=P*Math.sin(L+B-S)+k;h.endTangent=[g[0]-z,g[1]-U]}e.push(h)}return e}},function(t,e,n){"use strict";function r(t,e){var n=[],r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=e[0],d=e[1],p=e[2],g=e[3],v=e[4],m=e[5],y=e[6],b=e[7],x=e[8];return n[0]=f*r+d*a+p*c,n[1]=f*i+d*s+p*l,n[2]=f*o+d*u+p*h,n[3]=g*r+v*a+m*c,n[4]=g*i+v*s+m*l,n[5]=g*o+v*u+m*h,n[6]=y*r+b*a+x*c,n[7]=y*i+b*s+x*l,n[8]=y*o+b*u+x*h,n}function i(t,e){var n=[],r=e[0],i=e[1];return n[0]=t[0]*r+t[3]*i+t[6],n[1]=t[1]*r+t[4]*i+t[7],n}function o(t){var e=[],n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=l*a-s*c,f=-l*o+s*u,d=c*o-a*u,p=n*h+r*f+i*d;return p?(p=1/p,e[0]=h*p,e[1]=(-l*r+i*c)*p,e[2]=(s*r-i*a)*p,e[3]=f*p,e[4]=(l*n-i*u)*p,e[5]=(-s*n+i*o)*p,e[6]=d*p,e[7]=(-c*n+r*u)*p,e[8]=(a*n-r*o)*p,e):null}n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";n.r(e),n.d(e,"create",(function(){return i})),n.d(e,"clone",(function(){return o})),n.d(e,"length",(function(){return a})),n.d(e,"fromValues",(function(){return s})),n.d(e,"copy",(function(){return u})),n.d(e,"set",(function(){return c})),n.d(e,"add",(function(){return l})),n.d(e,"subtract",(function(){return h})),n.d(e,"multiply",(function(){return f})),n.d(e,"divide",(function(){return d})),n.d(e,"ceil",(function(){return p})),n.d(e,"floor",(function(){return g})),n.d(e,"min",(function(){return v})),n.d(e,"max",(function(){return m})),n.d(e,"round",(function(){return y})),n.d(e,"scale",(function(){return b})),n.d(e,"scaleAndAdd",(function(){return x})),n.d(e,"distance",(function(){return w})),n.d(e,"squaredDistance",(function(){return _})),n.d(e,"squaredLength",(function(){return S})),n.d(e,"negate",(function(){return E})),n.d(e,"inverse",(function(){return M})),n.d(e,"normalize",(function(){return O})),n.d(e,"dot",(function(){return A})),n.d(e,"cross",(function(){return k})),n.d(e,"lerp",(function(){return C})),n.d(e,"hermite",(function(){return I})),n.d(e,"bezier",(function(){return T})),n.d(e,"random",(function(){return P})),n.d(e,"transformMat4",(function(){return N})),n.d(e,"transformMat3",(function(){return j})),n.d(e,"transformQuat",(function(){return D})),n.d(e,"rotateX",(function(){return L})),n.d(e,"rotateY",(function(){return R})),n.d(e,"rotateZ",(function(){return B})),n.d(e,"angle",(function(){return G})),n.d(e,"zero",(function(){return F})),n.d(e,"str",(function(){return z})),n.d(e,"exactEquals",(function(){return U})),n.d(e,"equals",(function(){return V})),n.d(e,"sub",(function(){return Y})),n.d(e,"mul",(function(){return X})),n.d(e,"div",(function(){return H})),n.d(e,"dist",(function(){return q})),n.d(e,"sqrDist",(function(){return K})),n.d(e,"len",(function(){return Z})),n.d(e,"sqrLen",(function(){return $})),n.d(e,"forEach",(function(){return Q}));var r=n(13);function i(){var t=new r.a(3);return r.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=new r.a(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function a(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function s(t,e,n){var i=new r.a(3);return i[0]=t,i[1]=e,i[2]=n,i}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function c(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function l(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function h(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function f(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function d(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function g(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function v(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function m(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function x(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function _(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function S(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function E(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function O(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function k(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function C(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function I(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,c=a*(o-1),l=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*c+i[0]*l,t[1]=e[1]*s+n[1]*u+r[1]*c+i[1]*l,t[2]=e[2]*s+n[2]*u+r[2]*c+i[2]*l,t}function T(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,c=s*a,l=3*o*s,h=3*u*a,f=u*o;return t[0]=e[0]*c+n[0]*l+r[0]*h+i[0]*f,t[1]=e[1]*c+n[1]*l+r[1]*h+i[1]*f,t[2]=e[2]*c+n[2]*l+r[2]*h+i[2]*f,t}function P(t,e){e=e||1;var n=2*r.c()*Math.PI,i=2*r.c()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=i*e,t}function N(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function j(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function D(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,h=o*s-r*c,f=r*u-i*s,d=i*f-o*h,p=o*l-r*f,g=r*h-i*l,v=2*a;return l*=v,h*=v,f*=v,d*=2,p*=2,g*=2,t[0]=s+l+d,t[1]=u+h+p,t[2]=c+f+g,t}function L(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function R(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function B(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function G(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),c=u&&A(t,e)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function F(t){return t[0]=0,t[1]=0,t[2]=0,t}function z(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function V(t,e){var n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(n-a)<=r.b*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=r.b*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-u)<=r.b*Math.max(1,Math.abs(o),Math.abs(u))}var W,Y=h,X=f,H=d,q=w,K=_,Z=a,$=S,Q=(W=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)W[0]=t[a],W[1]=t[a+1],W[2]=t[a+2],i(W,W,o),t[a]=W[0],t[a+1]=W[1],t[a+2]=W[2];return t})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]};e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=n=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),n(e)}t.exports=n,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r;try{r={clone:n(326),constant:n(162),each:n(205),filter:n(208),has:n(219),isArray:n(32),isEmpty:n(402),isFunction:n(88),isUndefined:n(220),keys:n(60),map:n(221),reduce:n(223),size:n(405),transform:n(411),union:n(412),values:n(228)}}catch(t){}r||(r=window._),t.exports=r},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){"use strict";n(57),n(22);var r=n(283);n.d(e,"Canvas",(function(){return r.a}));n(79),n(95)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uniqueId=e.getOutEdgesNodeId=e.getNeighbors=e.getEdgesByNodeId=void 0;e.getNeighbors=function(t,e,n){void 0===e&&(e=[]);var r=e.filter((function(e){return e.source===t||e.target===t}));if("target"===n){return r.filter((function(e){return e.source===t})).map((function(t){return t.target}))}if("source"===n){return r.filter((function(e){return e.target===t})).map((function(t){return t.source}))}return r.map((function(e){return e.source===t?e.target:e.source}))};e.getOutEdgesNodeId=function(t,e){return e.filter((function(e){return e.source===t}))};e.getEdgesByNodeId=function(t,e){return e.filter((function(e){return e.source===t||e.target===t}))};e.uniqueId=function(t){void 0===t&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(n)}},function(t,e,n){var r;try{r=n(324)}catch(t){}r||(r=window.graphlib),t.exports=r},function(t,e,n){var r=n(187),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(34),i=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===r.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=i},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return Y}));var r,i,o,a,s,u,c,l,h,f,d,p,g,v,m,y,b,x,w,_,S,E,M,O,A=n(10),k=n.n(A),C=n(16),I=n.n(C),T=n(11),P=n.n(T),N=n(7),j=n.n(N),D=n(8),L=n.n(D),R=n(12),B=n.n(R),G=(n(30),n(2)),F=n(6),z=n(14),U=n(37);function V(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return W(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function W(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}var Y=(r=Object(F.injectable)(),i=Object(F.inject)(z.a.MeshComponentManager),o=Object(F.inject)(z.a.GeometryComponentManager),a=Object(F.inject)(z.a.MaterialComponentManager),s=Object(F.inject)(z.a.CullableComponentManager),u=Object(F.inject)(z.a.TransformComponentManager),c=Object(F.inject)(z.a.HierarchyComponentManager),l=Object(F.inject)(z.a.Systems),h=Object(F.named)(z.a.FrameGraphSystem),f=Object(F.inject)(z.a.RenderEngine),d=Object(F.inject)(z.a.ResourcePool),r((O=M=function(){function t(){var e=this;j()(this,t),P()(this,"mesh",v,this),P()(this,"geometry",m,this),P()(this,"material",y,this),P()(this,"cullable",b,this),P()(this,"transform",x,this),P()(this,"hierarchy",w,this),P()(this,"frameGraphSystem",_,this),P()(this,"engine",S,this),P()(this,"resourcePool",E,this),this.modelCache={},this.setup=function(t,e,n){var r=t.createRenderTarget(e,"color buffer",{width:1,height:1,usage:U.a.RENDER_ATTACHMENT|U.a.SAMPLED|U.a.COPY_SRC});n.data={output:e.write(t,r)}},this.execute=function(){var t=I()(k.a.mark((function t(n,r,i){var o,a,s,u,c,l;return k.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=n.getResourceNode(r.data.output),a=e.resourcePool.getOrCreateResource(o.resource),s=V(i),t.prev=3,s.s();case 5:if((u=s.n()).done){t.next=11;break}return c=u.value,t.next=9,e.initView(c);case 9:t.next=5;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),s.e(t.t0);case 16:return t.prev=16,s.f(),t.finish(16);case 19:l=e.engine.getCanvas(),a.resize({width:l.width,height:l.height}),e.engine.setScissor({enable:!1}),e.engine.clear({framebuffer:a,color:i[0].getClearColor(),depth:1}),e.engine.useFramebuffer(a,(function(){var t,n=V(i);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.renderView(r)}}catch(t){n.e(t)}finally{n.f()}}));case 24:case"end":return t.stop()}}),t,null,[[3,13,16,19]])})));return function(e,n,r){return t.apply(this,arguments)}}()}var e,n;return L()(t,[{key:"renderView",value:function(t){var e=t.getScene(),n=t.getCamera(),r=n.getViewTransform(),i=G.b.multiply(G.b.create(),n.getPerspective(),r);n.getFrustum().extractFromVPMatrix(i);var o=t.getViewport(),a=o.x,s=o.y,u=o.width,c=o.height;this.engine.viewport({x:a,y:s,width:u,height:c});var l,h=V(e.getEntities());try{for(h.s();!(l=h.n()).done;){var f=l.value;this.renderMesh(f,{camera:n,view:t,viewMatrix:r})}}catch(t){h.e(t)}finally{h.f()}}},{key:"renderMesh",value:function(t,e){var n=e.camera,r=e.view,i=e.viewMatrix,o=this.mesh.getComponentByEntity(t);if(o&&o.visible){var a=o.material,s=o.geometry;if(s&&!s.dirty&&a){var u=this.transform.getComponentByEntity(t),c=G.b.multiply(G.b.create(),i,u.worldTransform),l=r.getViewport(),h=l.width,f=l.height;a.setUniform({projectionMatrix:n.getPerspective(),modelViewMatrix:c,modelMatrix:u.worldTransform,viewMatrix:i,cameraPosition:n.getPosition(),u_viewport:[h,f]}),o.model&&(o.model.draw({uniforms:a.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{})}),a.uniforms.forEach((function(t){t.dirty=!1})),a.dirty=!1)}}}},{key:"initMesh",value:(n=I()(k.a.mark((function t(e,n){var r,i,o,a,s,u,c,l;return k.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.mesh.getComponentByEntity(e)){t.next=3;break}return t.abrupt("return");case 3:if(i=r.material,(o=r.geometry)&&!o.dirty&&i){t.next=7;break}return t.abrupt("return");case 7:if(r.model){t.next=24;break}if(a="m-".concat(i.entity,"-g-").concat(o.entity),!this.modelCache[a]){t.next=12;break}return r.model=this.modelCache[a],t.abrupt("return");case 12:return i.setUniform({projectionMatrix:1,modelViewMatrix:1,modelMatrix:1,viewMatrix:1,cameraPosition:1,u_viewport:1}),s=this.engine,u=s.createModel,c=s.createAttribute,l={vs:i.vertexShaderGLSL,fs:i.fragmentShaderGLSL,defines:i.defines,attributes:o.attributes.reduce((function(t,e){return e.data&&e.buffer&&(t[e.name]=c({buffer:e.buffer,attributes:e.attributes,arrayStride:e.arrayStride,stepMode:e.stepMode,divisor:"vertex"===e.stepMode?0:1})),t}),{}),uniforms:i.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{}),scissor:{enable:!0,box:function(){return n.getViewport()}}},i.cull&&(l.cull=i.cull),i.depth&&(l.depth=i.depth),i.blend&&(l.blend=i.blend),o.indicesBuffer&&(l.elements=o.indicesBuffer),o.maxInstancedCount&&(l.instances=o.maxInstancedCount,l.count=o.vertexCount||3),t.next=22,u(l);case 22:r.model=t.sent,this.modelCache[a]=r.model;case 24:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"initView",value:(e=I()(k.a.mark((function t(e){var n,r,i,o;return k.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getScene(),r=V(n.getEntities()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=i.value,t.next=8,this.initMesh(o,e);case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[2,12,15,18]])}))),function(t){return e.apply(this,arguments)})}]),t}(),M.IDENTIFIER="Render Pass",g=O,v=B()(g.prototype,"mesh",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),m=B()(g.prototype,"geometry",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),y=B()(g.prototype,"material",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),b=B()(g.prototype,"cullable",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),x=B()(g.prototype,"transform",[u],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),w=B()(g.prototype,"hierarchy",[c],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_=B()(g.prototype,"frameGraphSystem",[l,h],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),S=B()(g.prototype,"engine",[f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),E=B()(g.prototype,"resourcePool",[d],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),p=g))||p)},function(t,e,n){"use strict";n.r(e),n.d(e,"catmullRomToBezier",(function(){return u})),n.d(e,"fillPath",(function(){return I})),n.d(e,"fillPathByDiff",(function(){return N})),n.d(e,"formatPath",(function(){return L})),n.d(e,"intersection",(function(){return A})),n.d(e,"parsePathArray",(function(){return v})),n.d(e,"parsePathString",(function(){return s})),n.d(e,"pathToAbsolute",(function(){return l})),n.d(e,"pathToCurve",(function(){return p})),n.d(e,"rectPath",(function(){return _}));var r=n(0),i="\t\n\v\f\r \u2028\u2029",o=new RegExp("([a-z])["+i+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+i+"]*,?["+i+"]*)+)","ig"),a=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+i+"]*,?["+i+"]*","ig"),s=function(t){if(!t)return null;if(Object(r.isArray)(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(o,(function(r,i,o){var s=[],u=i.toLowerCase();if(o.replace(a,(function(t,e){e&&s.push(+e)})),"m"===u&&s.length>2&&(n.push([i].concat(s.splice(0,2))),u="l",i="m"===i?"l":"L"),"o"===u&&1===s.length&&n.push([i,s[0]]),"r"===u)n.push([i].concat(s));else for(;s.length>=e[u]&&(n.push([i].concat(s.splice(0,e[u]))),e[u]););return t})),n},u=function(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?o[3]={x:+t[0],y:+t[1]}:i-2===r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n},c=function(t,e,n,r,i){var o=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var a=Math.PI/180,s=t+n*Math.cos(-r*a),u=t+n*Math.cos(-i*a);o=[["M",s,e+n*Math.sin(-r*a)],["A",n,n,0,+(i-r>180),0,u,e+n*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return o},l=function(t){if(!(t=s(t))||!t.length)return[["M",0,0]];var e,n,r=[],i=0,o=0,a=0,l=0,h=0;"M"===t[0][0]&&(a=i=+t[0][1],l=o=+t[0][2],h++,r[0]=["M",i,o]);for(var f=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),d=void 0,p=void 0,g=h,v=t.length;g<v;g++){if(r.push(d=[]),(e=(p=t[g])[0])!==e.toUpperCase())switch(d[0]=e.toUpperCase(),d[0]){case"A":d[1]=p[1],d[2]=p[2],d[3]=p[3],d[4]=p[4],d[5]=p[5],d[6]=+p[6]+i,d[7]=+p[7]+o;break;case"V":d[1]=+p[1]+o;break;case"H":d[1]=+p[1]+i;break;case"R":for(var m=2,y=(n=[i,o].concat(p.slice(1))).length;m<y;m++)n[m]=+n[m]+i,n[++m]=+n[m]+o;r.pop(),r=r.concat(u(n,f));break;case"O":r.pop(),(n=c(i,o,p[1],p[2])).push(n[0]),r=r.concat(n);break;case"U":r.pop(),r=r.concat(c(i,o,p[1],p[2],p[3])),d=["U"].concat(r[r.length-1].slice(-2));break;case"M":a=+p[1]+i,l=+p[2]+o;break;default:for(m=1,y=p.length;m<y;m++)d[m]=+p[m]+(m%2?i:o)}else if("R"===e)n=[i,o].concat(p.slice(1)),r.pop(),r=r.concat(u(n,f)),d=["R"].concat(p.slice(-2));else if("O"===e)r.pop(),(n=c(i,o,p[1],p[2])).push(n[0]),r=r.concat(n);else if("U"===e)r.pop(),r=r.concat(c(i,o,p[1],p[2],p[3])),d=["U"].concat(r[r.length-1].slice(-2));else for(var b=0,x=p.length;b<x;b++)d[b]=p[b];if("O"!==(e=e.toUpperCase()))switch(d[0]){case"Z":i=+a,o=+l;break;case"H":i=d[1];break;case"V":o=d[1];break;case"M":a=d[d.length-2],l=d[d.length-1];break;default:i=d[d.length-2],o=d[d.length-1]}}return r},h=function(t,e,n,r){return[t,e,n,r,n,r]},f=function(t,e,n,r,i,o){return[1/3*t+2/3*n,1/3*e+2/3*r,1/3*i+2/3*n,1/3*o+2/3*r,i,o]},d=function(t,e,n,r,i,o,a,s,u,c){n===r&&(n+=1);var l,h,f,p,g,v=120*Math.PI/180,m=Math.PI/180*(+i||0),y=[],b=function(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}};if(c)h=c[0],f=c[1],p=c[2],g=c[3];else{t=(l=b(t,e,-m)).x,e=l.y,s=(l=b(s,u,-m)).x,u=l.y,t===s&&e===u&&(s+=1,u+=1);var x=(t-s)/2,w=(e-u)/2,_=x*x/(n*n)+w*w/(r*r);_>1&&(n*=_=Math.sqrt(_),r*=_);var S=n*n,E=r*r,M=(o===a?-1:1)*Math.sqrt(Math.abs((S*E-S*w*w-E*x*x)/(S*w*w+E*x*x)));p=M*n*w/r+(t+s)/2,g=M*-r*x/n+(e+u)/2,h=Math.asin(((e-g)/r).toFixed(9)),f=Math.asin(((u-g)/r).toFixed(9)),h=t<p?Math.PI-h:h,f=s<p?Math.PI-f:f,h<0&&(h=2*Math.PI+h),f<0&&(f=2*Math.PI+f),a&&h>f&&(h-=2*Math.PI),!a&&f>h&&(f-=2*Math.PI)}var O=f-h;if(Math.abs(O)>v){var A=f,k=s,C=u;f=h+v*(a&&f>h?1:-1),s=p+n*Math.cos(f),u=g+r*Math.sin(f),y=d(s,u,n,r,i,0,a,k,C,[f,A,p,g])}O=f-h;var I=Math.cos(h),T=Math.sin(h),P=Math.cos(f),N=Math.sin(f),j=Math.tan(O/4),D=4/3*n*j,L=4/3*r*j,R=[t,e],B=[t+D*T,e-L*I],G=[s+D*N,u-L*P],F=[s,u];if(B[0]=2*R[0]-B[0],B[1]=2*R[1]-B[1],c)return[B,G,F].concat(y);for(var z=[],U=0,V=(y=[B,G,F].concat(y).join().split(",")).length;U<V;U++)z[U]=U%2?b(y[U-1],y[U],m).y:b(y[U],y[U+1],m).x;return z},p=function(t,e){var n,r=l(t),i=e&&l(e),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=[],u=[],c="",p="",g=function(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(d.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"===n||"S"===n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),t=["C",r,i].concat(t.slice(1));break;case"T":"Q"===n||"T"===n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(f(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(f(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(h(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(h(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(h(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(h(e.x,e.y,e.X,e.Y))}return t},v=function(t,e){if(t[e].length>7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(u[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),n=Math.max(r.length,i&&i.length||0)}},m=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],n=Math.max(r.length,i&&i.length||0))};n=Math.max(r.length,i&&i.length||0);for(var y=0;y<n;y++){r[y]&&(c=r[y][0]),"C"!==c&&(s[y]=c,y&&(p=s[y-1])),r[y]=g(r[y],o,p),"A"!==s[y]&&"C"===c&&(s[y]="C"),v(r,y),i&&(i[y]&&(c=i[y][0]),"C"!==c&&(u[y]=c,y&&(p=u[y-1])),i[y]=g(i[y],a,p),"A"!==u[y]&&"C"===c&&(u[y]="C"),v(i,y)),m(r,i,o,a,y),m(i,r,a,o,y);var b=r[y],x=i&&i[y],w=b.length,_=i&&x.length;o.x=b[w-2],o.y=b[w-1],o.bx=parseFloat(b[w-4])||o.x,o.by=parseFloat(b[w-3])||o.y,a.bx=i&&(parseFloat(x[_-4])||a.x),a.by=i&&(parseFloat(x[_-3])||a.y),a.x=i&&x[_-2],a.y=i&&x[_-1]}return i?[r,i]:r},g=/,?([a-z]),?/gi,v=function(t){return t.join(",").replace(g,"$1")},m=function(t,e,n,r,i){return t*(t*(-3*e+9*n-9*r+3*i)+6*e-12*n+6*r)-3*e+3*n},y=function(t,e,n,r,i,o,a,s,u){null===u&&(u=1);for(var c=(u=u>1?1:u<0?0:u)/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,d=0;d<12;d++){var p=c*l[d]+c,g=m(p,t,n,i,a),v=m(p,e,r,o,s),y=g*g+v*v;f+=h[d]*Math.sqrt(y)}return c*f},b=function(t,e,n,r,i,o,a,s){for(var u,c,l,h,f=[],d=[[],[]],p=0;p<2;++p)if(0===p?(c=6*t-12*n+6*i,u=-3*t+9*n-9*i+3*a,l=3*n-3*t):(c=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*s,l=3*r-3*e),Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;(h=-l/c)>0&&h<1&&f.push(h)}else{var g=c*c-4*l*u,v=Math.sqrt(g);if(!(g<0)){var m=(-c+v)/(2*u);m>0&&m<1&&f.push(m);var y=(-c-v)/(2*u);y>0&&y<1&&f.push(y)}}for(var b,x=f.length,w=x;x--;)b=1-(h=f[x]),d[0][x]=b*b*b*t+3*b*b*h*n+3*b*h*h*i+h*h*h*a,d[1][x]=b*b*b*e+3*b*b*h*r+3*b*h*h*o+h*h*h*s;return d[0][w]=t,d[1][w]=e,d[0][w+1]=a,d[1][w+1]=s,d[0].length=d[1].length=w+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}},x=function(t,e,n,r,i,o,a,s){if(!(Math.max(t,n)<Math.min(i,a)||Math.min(t,n)>Math.max(i,a)||Math.max(e,r)<Math.min(o,s)||Math.min(e,r)>Math.max(o,s))){var u=(t-n)*(o-s)-(e-r)*(i-a);if(u){var c=((t*r-e*n)*(i-a)-(t-n)*(i*s-o*a))/u,l=((t*r-e*n)*(o-s)-(e-r)*(i*s-o*a))/u,h=+c.toFixed(2),f=+l.toFixed(2);if(!(h<+Math.min(t,n).toFixed(2)||h>+Math.max(t,n).toFixed(2)||h<+Math.min(i,a).toFixed(2)||h>+Math.max(i,a).toFixed(2)||f<+Math.min(e,r).toFixed(2)||f>+Math.max(e,r).toFixed(2)||f<+Math.min(o,s).toFixed(2)||f>+Math.max(o,s).toFixed(2)))return{x:c,y:l}}}},w=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},_=function(t,e,n,r,i){if(i)return[["M",+t+ +i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]];return o.parsePathArray=v,o},S=function(t,e,n,r){return null===t&&(t=e=n=r=0),null===e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:Math.min(n,r)/2,r2:Math.max(n,r)/2,r0:Math.sqrt(n*n+r*r)/2,path:_(t,e,n,r),vb:[t,e,n,r].join(" ")}},E=function(t,e,n,i,o,a,s,u){Object(r.isArray)(t)||(t=[t,e,n,i,o,a,s,u]);var c=b.apply(null,t);return S(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)},M=function(t,e,n,r,i,o,a,s,u){var c=1-u,l=Math.pow(c,3),h=Math.pow(c,2),f=u*u,d=f*u,p=t+2*u*(n-t)+f*(i-2*n+t),g=e+2*u*(r-e)+f*(o-2*r+e),v=n+2*u*(i-n)+f*(a-2*i+n),m=r+2*u*(o-r)+f*(s-2*o+r);return{x:l*t+3*h*u*n+3*c*u*u*i+d*a,y:l*e+3*h*u*r+3*c*u*u*o+d*s,m:{x:p,y:g},n:{x:v,y:m},start:{x:c*t+u*n,y:c*e+u*r},end:{x:c*i+u*a,y:c*o+u*s},alpha:90-180*Math.atan2(p-v,g-m)/Math.PI}},O=function(t,e,n){if(!function(t,e){return t=S(t),e=S(e),w(e,t.x,t.y)||w(e,t.x2,t.y)||w(e,t.x,t.y2)||w(e,t.x2,t.y2)||w(t,e.x,e.y)||w(t,e.x2,e.y)||w(t,e.x,e.y2)||w(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)}(E(t),E(e)))return n?0:[];for(var r=~~(y.apply(0,t)/8),i=~~(y.apply(0,e)/8),o=[],a=[],s={},u=n?0:[],c=0;c<r+1;c++){var l=M.apply(0,t.concat(c/r));o.push({x:l.x,y:l.y,t:c/r})}for(c=0;c<i+1;c++){l=M.apply(0,e.concat(c/i));a.push({x:l.x,y:l.y,t:c/i})}for(c=0;c<r;c++)for(var h=0;h<i;h++){var f=o[c],d=o[c+1],p=a[h],g=a[h+1],v=Math.abs(d.x-f.x)<.001?"y":"x",m=Math.abs(g.x-p.x)<.001?"y":"x",b=x(f.x,f.y,d.x,d.y,p.x,p.y,g.x,g.y);if(b){if(s[b.x.toFixed(4)]===b.y.toFixed(4))continue;s[b.x.toFixed(4)]=b.y.toFixed(4);var _=f.t+Math.abs((b[v]-f[v])/(d[v]-f[v]))*(d.t-f.t),O=p.t+Math.abs((b[m]-p[m])/(g[m]-p[m]))*(g.t-p.t);_>=0&&_<=1&&O>=0&&O<=1&&(n?u+=1:u.push({x:b.x,y:b.y,t1:_,t2:O}))}}return u},A=function(t,e){return function(t,e,n){var r,i,o,a,s,u,c,l,h,f;t=p(t),e=p(e);for(var d=n?0:[],g=0,v=t.length;g<v;g++){var m=t[g];if("M"===m[0])r=s=m[1],i=u=m[2];else{"C"===m[0]?(h=[r,i].concat(m.slice(1)),r=h[6],i=h[7]):(h=[r,i,r,i,s,u,s,u],r=s,i=u);for(var y=0,b=e.length;y<b;y++){var x=e[y];if("M"===x[0])o=c=x[1],a=l=x[2];else{"C"===x[0]?(f=[o,a].concat(x.slice(1)),o=f[6],a=f[7]):(f=[o,a,o,a,c,l,c,l],o=c,a=l);var w=O(h,f,n);if(n)d+=w;else{for(var _=0,S=w.length;_<S;_++)w[_].segment1=g,w[_].segment2=y,w[_].bez1=h,w[_].bez2=f;d=d.concat(w)}}}}}return d}(t,e)};function k(t,e){var n=[],r=[];return t.length&&function t(e,i){if(1===e.length)n.push(e[0]),r.push(e[0]);else{for(var o=[],a=0;a<e.length-1;a++)0===a&&n.push(e[0]),a===e.length-2&&r.push(e[a+1]),o[a]=[(1-i)*e[a][0]+i*e[a+1][0],(1-i)*e[a][1]+i*e[a+1][1]];t(o,i)}}(t,e),{left:n,right:r.reverse()}}var C=function(t,e,n){if(1===n)return[[].concat(t)];var r=[];if("L"===e[0]||"C"===e[0]||"Q"===e[0])r=r.concat(function(t,e,n){var r=[[t[1],t[2]]];n=n||2;var i=[];"A"===e[0]?(r.push(e[6]),r.push(e[7])):"C"===e[0]?(r.push([e[1],e[2]]),r.push([e[3],e[4]]),r.push([e[5],e[6]])):"S"===e[0]||"Q"===e[0]?(r.push([e[1],e[2]]),r.push([e[3],e[4]])):r.push([e[1],e[2]]);for(var o=r,a=1/n,s=0;s<n-1;s++){var u=k(o,a/(1-a*s));i.push(u.left),o=u.right}return i.push(o),i.map((function(t){var e=[];return 4===t.length&&(e.push("C"),e=e.concat(t[2])),t.length>=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])}))}(t,e,n));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=n-1;o++)r.push(i)}return r},I=function(t,e){if(1===t.length)return t;var n=t.length-1,r=e.length-1,i=n/r,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a<r-n;a++)t.push(t[0]);return t}for(a=0;a<r;a++){var s=Math.floor(i*a);o[s]=(o[s]||0)+1}var u=o.reduce((function(e,r,i){return i===n?e.concat(t[n]):e.concat(C(t[i],t[i+1],r))}),[]);return u.unshift(t[0]),"Z"!==e[r]&&"z"!==e[r]||u.push("Z"),u},T=function(t,e){if(t.length!==e.length)return!1;var n=!0;return Object(r.each)(t,(function(t,r){if(t!==e[r])return n=!1,!1})),n};function P(t,e,n){var r=null,i=n;return e<i&&(i=e,r="add"),t<i&&(i=t,r="del"),{type:r,min:i}}var N=function(t,e){var n=function(t,e){var n,r,i=t.length,o=e.length,a=0;if(0===i||0===o)return null;for(var s=[],u=0;u<=i;u++)s[u]=[],s[u][0]={min:u};for(var c=0;c<=o;c++)s[0][c]={min:c};for(u=1;u<=i;u++){n=t[u-1];for(c=1;c<=o;c++){r=e[c-1],a=T(n,r)?0:1;var l=s[u-1][c].min+1,h=s[u][c-1].min+1,f=s[u-1][c-1].min+a;s[u][c]=P(l,h,f)}}return s}(t,e),r=t.length,i=e.length,o=[],a=1,s=1;if(n[r][i].min!==r){for(var u=1;u<=r;u++){var c=n[u][u].min;s=u;for(var l=a;l<=i;l++)n[u][l].min<c&&(c=n[u][l].min,s=l);a=s,n[u][a].type&&o.push({index:u-1,type:n[u][a].type})}for(u=o.length-1;u>=0;u--)a=o[u].index,"add"===o[u].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var h=i-(r=t.length);if(r<i)for(u=0;u<h;u++)"z"===t[r-1][0]||"Z"===t[r-1][0]?t.splice(r-2,0,t[r-2]):t.push(t[r-1]),r+=1;return t};function j(t,e,n){for(var r,i=[].concat(t),o=1/(n+1),a=D(e)[0],s=1;s<=n;s++)o*=s,0===(r=Math.floor(t.length*o))?i.unshift([a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]):i.splice(r,0,[a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]);return i}function D(t){var e=[];switch(t[0]){case"M":case"L":e.push([t[1],t[2]]);break;case"A":e.push([t[6],t[7]]);break;case"Q":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"T":e.push([t[1],t[2]]);break;case"C":e.push([t[5],t[6]]),e.push([t[1],t[2]]),e.push([t[3],t[4]]);break;case"S":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"H":case"V":e.push([t[1],t[1]])}return e}var L=function(t,e){if(t.length<=1)return t;for(var n,r=0;r<e.length;r++)if(t[r][0]!==e[r][0])switch(n=D(t[r]),e[r][0]){case"M":t[r]=["M"].concat(n[0]);break;case"L":t[r]=["L"].concat(n[0]);break;case"A":t[r]=[].concat(e[r]),t[r][6]=n[0][0],t[r][7]=n[0][1];break;case"Q":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=j(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=j(n,t[r-1],2)}t[r]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=j(n,t[r-1],1)}t[r]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[r]=e[r]}return t}},function(t,e,n){var r=n(88),i=n(156);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){var r=n(382),i=n(392),o=n(68),a=n(32),s=n(399);t.exports=function(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?a(t)?i(t[0],t[1]):r(t):s(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0;e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},function(t,e,n){"use strict";n.r(e),n.d(e,"Base",(function(){return c})),n.d(e,"Circle",(function(){return l})),n.d(e,"Ellipse",(function(){return f})),n.d(e,"Image",(function(){return p})),n.d(e,"Line",(function(){return y})),n.d(e,"Marker",(function(){return _})),n.d(e,"Path",(function(){return N})),n.d(e,"Polygon",(function(){return D})),n.d(e,"Polyline",(function(){return L})),n.d(e,"Rect",(function(){return B})),n.d(e,"Text",(function(){return G}));var r={};n.r(r),n.d(r,"Base",(function(){return c})),n.d(r,"Circle",(function(){return l})),n.d(r,"Ellipse",(function(){return f})),n.d(r,"Image",(function(){return p})),n.d(r,"Line",(function(){return y})),n.d(r,"Marker",(function(){return _})),n.d(r,"Path",(function(){return N})),n.d(r,"Polygon",(function(){return D})),n.d(r,"Polyline",(function(){return L})),n.d(r,"Rect",(function(){return B})),n.d(r,"Text",(function(){return G}));var i=n(1),o=n(22),a=n(17),s=n(31),u=n(79),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return r},e.prototype.getGroupBase=function(){return u.a},e.prototype.onCanvasChange=function(t){Object(s.h)(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),n=Object(o.getBBoxMethod)(t)(this),r=e/2,i=n.x-r,a=n.y-r,s=n.x+n.width+r,u=n.y+n.height+r;return{x:i,minX:i,y:a,minY:a,width:n.width+e,height:n.height+e,maxX:s,maxY:u}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,e){e&&(t.save(),Object(s.a)(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.draw=function(t,e){var n=this.cfg.clipShape;if(e){if(!1===this.cfg.refresh)return void this.set("hasChanged",!1);var r=this.getCanvasBBox();if(!Object(a.f)(e,r))return this.set("hasChanged",!1),void(this.cfg.isInView&&this._afterDraw())}t.save(),Object(s.a)(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),n=Object(a.f)(e,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isFill()&&(Object(a.i)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.isStroke()&&n>0&&(Object(a.i)(i)||1===i||(t.globalAlpha=i),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,e){var n=this.isStroke(),r=this.isFill(),i=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(o.AbstractShape),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),s=o.x,u=o.y,c=o.r,l=i/2,h=Object(a.b)(s,u,t,e);return r&&n?h<=c+l:r?h<=c:!!n&&(h>=c-l&&h<=c+l)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.r;t.beginPath(),t.arc(n,r,i,0,2*Math.PI,!1),t.closePath()},e}(c);function h(t,e,n,r){return t/(n*n)+e/(r*r)}var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=i/2,s=o.x,u=o.y,c=o.rx,l=o.ry,f=(t-s)*(t-s),d=(e-u)*(e-u);return r&&n?h(f,d,c+a,l+a)<=1:r?h(f,d,c,l)<=1:!!n&&(h(f,d,c-a,l-a)>=1&&h(f,d,c+a,l+a)<=1)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,r,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,s=i>o?1:i/o,u=i>o?o/i:1;t.save(),t.translate(n,r),t.scale(s,u),t.arc(0,0,a,0,2*Math.PI),t.restore(),t.closePath()}},e}(c);function d(t){return t instanceof HTMLElement&&Object(a.k)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var e=this,n=this.attrs;if(Object(a.k)(t)){var r=new Image;r.onload=function(){if(e.destroyed)return!1;e.attr("img",r),e.set("loading",!1),e._afterLoading();var t=e.get("callback");t&&t.call(e)},r.crossOrigin="Anonymous",r.src=t,this.set("loading",!0)}else t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):d(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),"img"===e&&this._setImage(n)},e.prototype.createPath=function(t){if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,s=e.sx,u=e.sy,c=e.swidth,l=e.sheight,h=e.img;(h instanceof Image||d(h))&&(Object(a.i)(s)||Object(a.i)(u)||Object(a.i)(c)||Object(a.i)(l)?t.drawImage(h,n,r,i,o):t.drawImage(h,s,u,c,l,n,r,i,o))},e}(c),g=n(21);function v(t,e,n,r,i,o,a){var s=Math.min(t,n),u=Math.max(t,n),c=Math.min(e,r),l=Math.max(e,r),h=i/2;return o>=s-h&&o<=u+h&&a>=c-h&&a<=l+h&&g.c.pointToLine(t,e,n,r,o,a)<=i/2}var m=n(35),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=t.startArrow,a=t.endArrow;o&&m.b(this,t,r,i,e,n),a&&m.a(this,t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){if(!n||!i)return!1;var o=this.attr();return v(o.x1,o.y1,o.x2,o.y2,i,t,e)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.startArrow,s=e.endArrow,u={dx:0,dy:0},c={dx:0,dy:0};a&&a.d&&(u=m.c(n,r,i,o,e.startArrow.d)),s&&s.d&&(c=m.c(n,r,i,o,e.endArrow.d)),t.beginPath(),t.moveTo(n+u.dx,r+u.dy),t.lineTo(i-c.dx,o-c.dy)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2;return g.c.length(e,n,r,i)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2;return g.c.pointAt(n,r,i,o,t)},e}(c),b=n(0),x=n(39),w={circle:function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]},"triangle-down":function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),-1!==["symbol","x","y","r","radius"].indexOf(e)&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return Object(b.isNil)(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t,n,r=this.attr(),i=r.x,o=r.y,s=r.symbol||"circle",u=this._getR(r);if(Object(a.h)(s))n=(t=s)(i,o,u),n=Object(x.c)(n);else{if(!(t=e.Symbols[s]))return console.warn(s+" marker is not supported."),null;n=t(i,o,u)}return n},e.prototype.createPath=function(t){var e=this._getPath(),n=this.get("paramsCache");Object(s.e)(this,t,{path:e},n)},e.Symbols=w,e}(c);function S(t,e,n){var r=Object(o.getOffScreenContext)();return t.createPath(r),r.isPointInPath(e,n)}function E(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function M(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function O(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(M(a,s,[e,n]))return!0;E(a[1]-n)>0!=E(s[1]-n)>0&&E(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}var A=n(15),k=n(41);function C(t,e,n,r,i,o,s,u){var c=(Math.atan2(u-e,s-t)+2*Math.PI)%(2*Math.PI);if(c<r||c>i)return!1;var l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return Object(a.b)(l.x,l.y,s,u)<=o/2}var I=A.ext.transform;var T=Object(i.__assign)({hasArc:function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e},extractPolygons:function(t){for(var e=t.length,n=[],r=[],i=[],o=0;o<e;o++){var a=t[o],s=a[0];"M"===s?(i.length&&(r.push(i),i=[]),i.push([a[1],a[2]])):"Z"===s?i.length&&(n.push(i),i=[]):i.push([a[1],a[2]])}return i.length>0&&r.push(i),{polygons:n,polylines:r}},isPointInStroke:function(t,e,n,r,i){for(var o=!1,s=e/2,u=0;u<t.length;u++){var c=t[u],l=c.currentPoint,h=c.params,f=c.prePoint,d=c.box;if(!d||Object(a.e)(d.x-s,d.y-s,d.width+e,d.height+e,n,r)){switch(c.command){case"L":case"Z":o=v(f[0],f[1],l[0],l[1],e,n,r);break;case"Q":o=g.e.pointDistance(f[0],f[1],h[1],h[2],h[3],h[4],n,r)<=e/2;break;case"C":o=g.b.pointDistance(f[0],f[1],h[1],h[2],h[3],h[4],h[5],h[6],n,r,i)<=e/2;break;case"A":var p=c.arcParams,m=p.cx,y=p.cy,b=p.rx,x=p.ry,w=p.startAngle,_=p.endAngle,S=p.xRotation,E=[n,r,1],M=b>x?b:x,O=I(null,[["t",-m,-y],["r",-S],["s",1/(b>x?1:b/x),1/(b>x?x/b:1)]]);k.transformMat3(E,E,O),o=C(0,0,M,w,_,e,E[0],E[1])}if(o)break}}return o}},o.PathUtil);function P(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=O(t[i],e,n))break}return r}var N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this._setPathArr(t.path),this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),"path"===e&&this._setPathArr(n),this.setArrow()},e.prototype._setPathArr=function(t){this.attrs.path=Object(x.c)(t);var e=T.hasArc(t);this.set("hasArc",e),this.set("paramsCache",{}),this.set("segments",null),this.set("curve",null),this.set("tCache",null),this.set("totalLength",null)},e.prototype.getSegments=function(){var t=this.get("segements");return t||(t=Object(x.d)(this.attr("path")),this.set("segments",t)),t},e.prototype.setArrow=function(){var t=this.attr(),e=t.startArrow,n=t.endArrow;if(e){var r=this.getStartTangent();m.b(this,t,r[0][0],r[0][1],r[1][0],r[1][1])}if(n){r=this.getEndTangent();m.a(this,t,r[0][0],r[0][1],r[1][0],r[1][1])}},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.getSegments(),a=this.get("hasArc"),s=!1;if(n){var u=this.getTotalLength();s=T.isPointInStroke(o,i,t,e,u)}if(!s&&r)if(a)s=S(this,t,e);else{var c=this.attr("path"),l=T.extractPolygons(c);s=P(l.polygons,t,e)||P(l.polylines,t,e)}return s},e.prototype.createPath=function(t){var e=this.attr(),n=this.get("paramsCache");Object(s.e)(this,t,e,n)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.get("totalLength");return Object(b.isNil)(t)?(this._calculateCurve(),this._setTcache(),this.get("totalLength")):t},e.prototype.getPoint=function(t){var e,n,r=this.get("tCache");r||(this._calculateCurve(),this._setTcache(),r=this.get("tCache"));var i=this.get("curve");if(!r||0===r.length)return i?{x:i[0][1],y:i[0][2]}:null;Object(b.each)(r,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)}));var o=i[n];if(Object(b.isNil)(o)||Object(b.isNil)(n))return null;var a=o.length,s=i[n+1];return g.b.pointAt(o[a-2],o[a-1],s[1],s[2],s[3],s[4],s[5],s[6],e)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",T.pathToCurve(t))},e.prototype._setTcache=function(){var t,e,n,r,i=0,o=0,a=[],s=this.get("curve");s&&(Object(b.each)(s,(function(t,e){n=s[e+1],r=t.length,n&&(i+=g.b.length(t[r-2],t[r-1],n[1],n[2],n[3],n[4],n[5],n[6])||0)})),this.set("totalLength",i),0!==i?(Object(b.each)(s,(function(u,c){n=s[c+1],r=u.length,n&&((t=[])[0]=o/i,e=g.b.length(u[r-2],u[r-1],n[1],n[2],n[3],n[4],n[5],n[6]),o+=e||0,t[1]=o/i,a.push(t))})),this.set("tCache",a)):this.set("tCache",[]))},e.prototype.getStartTangent=function(){var t,e=this.getSegments();if(e.length>1){var n=e[0].currentPoint,r=e[1].currentPoint,i=e[1].startTangent;t=[],i?(t.push([n[0]-i[0],n[1]-i[1]]),t.push([n[0],n[1]])):(t.push([r[0],r[1]]),t.push([n[0],n[1]]))}return t},e.prototype.getEndTangent=function(){var t,e=this.getSegments(),n=e.length;if(n>1){var r=e[n-2].currentPoint,i=e[n-1].currentPoint,o=e[n-1].endTangent;t=[],o?(t.push([i[0]-o[0],i[1]-o[1]]),t.push([i[0],i[1]])):(t.push([r[0],r[1]]),t.push([i[0],i[1]]))}return t},e}(c);function j(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(v(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],u=t[o-1];if(v(s[0],s[1],u[0],u[1],e,n,r))return!0}return!1}var D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr().points,a=!1;return n&&(a=j(o,i,t,e,!0)),!a&&r&&(a=O(o,t,e)),a},e.prototype.createPath=function(t){var e=this.attr().points;if(!(e.length<2)){t.beginPath();for(var n=0;n<e.length;n++){var r=e[n];0===n?t.moveTo(r[0],r[1]):t.lineTo(r[0],r[1])}t.closePath()}},e}(c),L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),this.setArrow(),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.setArrow=function(){var t=this.attr(),e=this.attrs,n=e.points,r=e.startArrow,i=e.endArrow,o=n.length,a=n[0][0],s=n[0][1],u=n[o-1][0],c=n[o-1][1];r&&m.b(this,t,n[1][0],n[1][1],a,s),i&&m.a(this,t,n[o-2][0],n[o-2][1],u,c)},e.prototype.isFill=function(){return!1},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){return!(!n||!i)&&j(this.attr().points,i,t,e,!1)},e.prototype.isStroke=function(){return!0},e.prototype.createPath=function(t){var e=this.attr(),n=e.points,r=e.startArrow,i=e.endArrow,o=n.length;if(!(n.length<2)){var a,s=n[0][0],u=n[0][1],c=n[o-1][0],l=n[o-1][1];if(r&&r.d)s+=(a=m.c(s,u,n[1][0],n[1][1],r.d)).dx,u+=a.dy;if(i&&i.d)c-=(a=m.c(n[o-2][0],n[o-2][1],c,l,i.d)).dx,l-=a.dy;t.beginPath(),t.moveTo(s,u);for(var h=0;h<o-1;h++){var f=n[h];t.lineTo(f[0],f[1])}t.lineTo(c,l)}},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return Object(b.isNil)(e)?(this.set("totalLength",g.d.length(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,n,r=this.attr().points,i=this.get("tCache");return i||(this._setTcache(),i=this.get("tCache")),Object(b.each)(i,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),g.c.pointAt(r[n][0],r[n][1],r[n+1][0],r[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,r,i=0,o=[];Object(b.each)(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=g.c.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=r,n[1]=i/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(c),R=n(144);var B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),s=o.x,u=o.y,c=o.width,l=o.height,h=o.radius;if(h){var f=!1;return n&&(f=function(t,e,n,r,i,o,a,s){return v(t+i,e,t+n-i,e,o,a,s)||v(t+n,e+i,t+n,e+r-i,o,a,s)||v(t+n-i,e+r,t+i,e+r,o,a,s)||v(t,e+r-i,t,e+i,o,a,s)||C(t+n-i,e+i,i,1.5*Math.PI,2*Math.PI,o,a,s)||C(t+n-i,e+r-i,i,0,.5*Math.PI,o,a,s)||C(t+i,e+r-i,i,.5*Math.PI,Math.PI,o,a,s)||C(t+i,e+i,i,Math.PI,1.5*Math.PI,o,a,s)}(s,u,c,l,h,i,t,e)),!f&&r&&(f=S(this,t,e)),f}var d=i/2;return r&&n?Object(a.e)(s-d,u-d,c+d,l+d,t,e):r?Object(a.e)(s,u,c,l,t,e):n?function(t,e,n,r,i,o,s){var u=i/2;return Object(a.e)(t-u,e-u,n,i,o,s)||Object(a.e)(t+n-u,e-u,i,r,o,s)||Object(a.e)(t+u,e+r-u,n,i,o,s)||Object(a.e)(t-u,e+u,i,r,o,s)}(s,u,c,l,i,t,e):void 0},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,a=e.radius;if(t.beginPath(),0===a)t.rect(n,r,i,o);else{var s=Object(R.a)(a),u=s[0],c=s[1],l=s[2],h=s[3];t.moveTo(n+u,r),t.lineTo(n+i-c,r),0!==c&&t.arc(n+i-c,r+c,c,-Math.PI/2,0),t.lineTo(n+i,r+o-l),0!==l&&t.arc(n+i-l,r+o-l,l,0,Math.PI/2),t.lineTo(n+h,r+o),0!==h&&t.arc(n+h,r+o-h,h,Math.PI/2,Math.PI),t.lineTo(n,r+u),0!==u&&t.arc(n+u,r+u,u,Math.PI,1.5*Math.PI),t.closePath()}},e}(c),G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=Object(o.assembleFont)(t)},e.prototype._setText=function(t){var e=null;Object(a.k)(t)&&-1!==t.indexOf("\n")&&(e=t.split("\n")),this.set("textArr",e)},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),e.startsWith("font")&&this._assembleFont(),"text"===e&&this._setText(n)},e.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n},e.prototype._drawTextArr=function(t,e,n){var r,i=this.attrs,s=i.textBaseline,u=i.x,c=i.y,l=1*i.fontSize,h=this._getSpaceingY(),f=Object(o.getTextHeight)(i.text,i.fontSize,i.lineHeight);Object(a.c)(e,(function(e,i){r=c+i*(h+l)-f+l,"middle"===s&&(r+=f-l-(f-l)/2),"top"===s&&(r+=f-l),Object(a.i)(e)||(n?t.fillText(e,u,r):t.strokeText(e,u,r))}))},e.prototype._drawText=function(t,e){var n=this.attr(),r=n.x,i=n.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,e);else{var s=n.text;Object(a.i)(s)||(e?t.fillText(s,r,i):t.strokeText(s,r,i))}},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isStroke()&&n>0&&(Object(a.i)(i)||1===i||(t.globalAlpha=r),this.stroke(t)),this.isFill()&&(Object(a.i)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(c)},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return f}));var r,i=n(62),o=n.n(i),a=n(7),s=n.n(a),u=n(8),c=n.n(u),l=n(2),h=n(130);!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(r||(r={}));var f=function(){function t(e){if(s()(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new h.a)}return c()(t,[{key:"extractFromVPMatrix",value:function(t){var e=o()(t,16),n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],f=e[8],d=e[9],p=e[10],g=e[11],v=e[12],m=e[13],y=e[14],b=e[15];l.e.set(this.planes[0].normal,a-n,h-s,g-f),this.planes[0].distance=-(b-v),l.e.set(this.planes[1].normal,a+n,h+s,g+f),this.planes[1].distance=-(b+v),l.e.set(this.planes[2].normal,a+r,h+u,g+d),this.planes[2].distance=-(b+m),l.e.set(this.planes[3].normal,a-r,h-u,g-d),this.planes[3].distance=-(b-m),l.e.set(this.planes[4].normal,a-i,h-c,g-p),this.planes[4].distance=-(b-y),l.e.set(this.planes[5].normal,a+i,h+c,g+p),this.planes[5].distance=-(b+y),this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}()},function(t,e,n){"use strict";n.r(e),n.d(e,"getAdjMatrix",(function(){return r})),n.d(e,"breadthFirstSearch",(function(){return h})),n.d(e,"connectedComponent",(function(){return d})),n.d(e,"getDegree",(function(){return g})),n.d(e,"getInDegree",(function(){return v})),n.d(e,"getOutDegree",(function(){return m})),n.d(e,"detectCycle",(function(){return _})),n.d(e,"detectDirectedCycle",(function(){return lt})),n.d(e,"detectAllCycles",(function(){return w})),n.d(e,"detectAllDirectedCycle",(function(){return x})),n.d(e,"detectAllUndirectedCycle",(function(){return b})),n.d(e,"depthFirstSearch",(function(){return y})),n.d(e,"dijkstra",(function(){return M})),n.d(e,"findAllPath",(function(){return k})),n.d(e,"findShortestPath",(function(){return A})),n.d(e,"floydWarshall",(function(){return C})),n.d(e,"labelPropagation",(function(){return I})),n.d(e,"louvain",(function(){return R})),n.d(e,"minimumSpanningTree",(function(){return V})),n.d(e,"pageRank",(function(){return W})),n.d(e,"getNeighbors",(function(){return u})),n.d(e,"Stack",(function(){return ct})),n.d(e,"GADDI",(function(){return ut}));var r=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];!a&&0!==a||!s&&0!==s||(i[a][s]=1,e||(i[s][a]=1))})),i},i=function(t,e){return t===e},o=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},t}(),a=function(){function t(t){void 0===t&&(t=i),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new o(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new o(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(null!==n)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},t.prototype.find=function(t){var e=t.value,n=void 0===e?void 0:e,r=t.callback,i=void 0===r?void 0:r;if(!this.head)return null;for(var o=this.head;o;){if(i&&i(o.value))return o;if(void 0!==n&&this.compare(o.value,n))return o;o=o.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach((function(t){return e.append(t)})),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map((function(e){return e.toString(t)})).toString()},t}(),s=function(){function t(){this.linkedList=new a}return t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)},t}(),u=function(t,e,n){void 0===e&&(e=[]);var r=e.filter((function(e){return e.source===t||e.target===t}));if("target"===n){return r.filter((function(e){return e.source===t})).map((function(t){return t.target}))}if("source"===n){return r.filter((function(e){return e.target===t})).map((function(t){return t.source}))}return r.map((function(e){return e.source===t?e.target:e.source}))},c=function(t,e){return e.filter((function(e){return e.source===t||e.target===t}))},l=function(t){void 0===t&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(n)};var h=function(t,e,n,r){void 0===r&&(r=!0);var i=function(t){void 0===t&&(t={});var e,n=t,r=function(){},i=(e={},function(t){var n=t.next;return!e[n]&&(e[n]=!0,!0)});return n.allowTraversal=t.allowTraversal||i,n.enter=t.enter||r,n.leave=t.leave||r,n}(n),o=new s,a=t.edges,c=void 0===a?[]:a;o.enqueue(e);for(var l="",h=function(){var t=o.dequeue();i.enter({current:t,previous:l}),u(t,c,r?"target":void 0).forEach((function(e){i.allowTraversal({previous:l,current:t,next:e})&&o.enqueue(e)})),i.leave({current:t,previous:l}),l=t};!o.isEmpty();)h()},f=function(t){for(var e=t.nodes,n=void 0===e?[]:e,r=t.edges,i=void 0===r?[]:r,o=[],a={},s={},c={},l=[],h=0,f=function t(e){s[e.id]=h,c[e.id]=h,h+=1,o.push(e),a[e.id]=!0;for(var r=u(e.id,i,"target").filter((function(t){return n.map((function(t){return t.id})).indexOf(t)>-1})),f=function(i){var o=r[i];if(s[o]||0===s[o])a[o]&&(c[e.id]=Math.min(c[e.id],s[o]));else{var u=n.filter((function(t){return t.id===o}));u.length>0&&t(u[0]),c[e.id]=Math.min(c[e.id],c[o])}},d=0;d<r.length;d++)f(d);if(c[e.id]===s[e.id]){for(var p=[];o.length>0;){var g=o.pop();if(a[g.id]=!1,p.push(g),g===e)break}p.length>0&&l.push(p)}},d=0,p=n;d<p.length;d++){var g=p[d];s[g.id]||0===s[g.id]||f(g)}return l};function d(t,e){return e?f(t):function(t){for(var e=t.nodes,n=void 0===e?[]:e,r=t.edges,i=void 0===r?[]:r,o=[],a={},s=[],c=function t(e){s.push(e),a[e.id]=!0;for(var r=u(e.id,i),o=function(e){var i=r[e];if(!a[i]){var o=n.filter((function(t){return t.id===i}));o.length>0&&t(o[0])}},c=0;c<r.length;++c)o(c)},l=0;l<n.length;l++){var h=n[l];if(!a[h.id]){c(h);for(var f=[];s.length>0;)f.push(s.pop());o.push(f)}}return o}(t)}var p=function(t){var e={},n=t.nodes,r=void 0===n?[]:n,i=t.edges,o=void 0===i?[]:i;return r.forEach((function(t){e[t.id]={degree:0,inDegree:0,outDegree:0}})),o.forEach((function(t){e[t.source].degree++,e[t.source].outDegree++,e[t.target].degree++,e[t.target].inDegree++})),e},g=p,v=function(t,e){return p(t)[e]?p(t)[e].inDegree:0},m=function(t,e){return p(t)[e]?p(t)[e].outDegree:0};function y(t,e,n){!function t(e,n,r,i){i.enter({current:n,previous:r});var o=e.edges;u(n,void 0===o?[]:o,"target").forEach((function(o){i.allowTraversal({previous:r,current:n,next:o})&&t(e,o,n,i)})),i.leave({current:n,previous:r})}(t,e,"",function(t){void 0===t&&(t={});var e,n=t,r=function(){},i=(e={},function(t){var n=t.next;return!e[n]&&(e[n]=!0,!0)});return n.allowTraversal=t.allowTraversal||i,n.enter=t.enter||r,n.leave=t.leave||r,n}(n))}var b=function(t,e,n){var r,i;void 0===n&&(n=!0);for(var o=[],a=0,s=d(t,!1);a<s.length;a++){var c=s[a];if(c.length)for(var l=c[0],h=l.id,f=[l],p=((r={})[h]=l,r),g=((i={})[h]=new Set,i);f.length>0;)for(var v=f.pop(),m=v.id,y=u(m,t.edges),b=function(r){var i,a=y[r],s=t.nodes.find((function(t){return t.id===a}));if(a===m)o.push(((i={})[a]=v,i));else if(a in g){if(!g[m].has(s)){for(var u=!0,c=[s,v],l=p[m];g[a].size&&!g[a].has(l)&&(c.push(l),l!==p[l.id]);)l=p[l.id];if(c.push(l),e&&n?(u=!1,c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!0)):e&&!n&&c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!1),u){for(var h={},d=1;d<c.length;d+=1)h[c[d-1].id]=c[d];c.length&&(h[c[c.length-1].id]=c[0]),o.push(h)}g[a].add(v)}}else p[a]=v,f.push(s),g[a]=new Set([v])},x=0;x<y.length;x+=1)b(x)}return o},x=function(t,e,n){void 0===n&&(n=!0);for(var r=[],i=new Set,o=[],a=[],s={},c={},l=function t(u,c,l){var h=!1;if(e&&!1===n&&e.indexOf(u.id)>-1)return h;r.push(u),i.add(u);for(var f=l[u.id],d=0;d<f.length;d+=1){if((v=s[f[d]])===c){for(var p={},g=1;g<r.length;g+=1)p[r[g-1].id]=r[g];r.length&&(p[r[r.length-1].id]=r[0]),a.push(p),h=!0}else i.has(v)||t(v,c,l)&&(h=!0)}if(h)!function(t){for(var e=[t];e.length>0;){var n=e.pop();i.has(n)&&(i.delete(n),o[n.id].forEach((function(t){e.push(t)})),o[n.id].clear())}}(u);else for(d=0;d<f.length;d+=1){var v=s[f[d]];o[v.id].has(u)||o[v.id].add(u)}return r.pop(),h},h=t.nodes,d=void 0===h?[]:h,p=0;p<d.length;p+=1){var g=d[p],v=g.id;c[v]=p,s[p]=g}if(e&&n){var m=function(t){var n=e[t];c[d[t].id]=c[n],c[n]=0,s[0]=d.find((function(t){return t.id===n})),s[c[d[t].id]]=d[t]};for(p=0;p<e.length;p++)m(p)}for(var y=function(r){for(var i,o,s=1/0,l=0;l<r.length;l+=1)for(var h=r[l],f=0;f<h.length;f++){var d=c[h[f].id];d<s&&(s=d,o=l)}var p=r[o],g=[];for(l=0;l<p.length;l+=1){var v=p[l];g[v.id]=[];for(var m=0,y=u(v.id,t.edges,"target").filter((function(t){return p.map((function(t){return t.id})).indexOf(t)>-1}));m<y.length;m++){var b=y[m];b!==v.id||!1===n&&e.indexOf(v.id)>-1?g[v.id].push(c[b]):a.push(((i={})[v.id]=v,i))}}return{component:p,adjList:g,minIdx:s}},b=0;b<d.length;){var x=d.filter((function(t){return c[t.id]>=b})),w=f({nodes:x,edges:t.edges}).filter((function(t){return t.length>1}));if(0===w.length)break;var _=y(w),S=_.minIdx,E=_.adjList,M=_.component;if(!(M.length>1))break;M.forEach((function(t){o[t.id]=new Set}));var O=s[S];if(e&&n&&-1===e.indexOf(O.id))return a;l(O,O,E),b=S+1}return a},w=function(t,e,n,r){return void 0===r&&(r=!0),e?x(t,n,r):b(t,n,r)},_=function(t){var e=null,n=t.nodes,r={},i={},o={},a={};(void 0===n?[]:n).forEach((function(t){i[t.id]=t}));for(var s={enter:function(t){var n=t.current,a=t.previous;if(o[n]){e={};for(var s=n,u=a;u!==n;)e[s]=u,s=u,u=r[u];e[s]=u}else o[n]=n,delete i[n],r[n]=a},leave:function(t){var e=t.current;a[e]=e,delete o[e]},allowTraversal:function(t){var n=t.next;return!e&&!a[n]}};Object.keys(i).length;){y(t,Object.keys(i)[0],s)}return e},S=n(1),E=n(0),M=function(t,e,n,r){var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u=[],l={},h={},f={};o.forEach((function(t,n){var r=t.id;u.push(r),h[r]=1/0,r===e&&(h[r]=0)}));for(var d=o.length,p=function(t){var e=function(t,e,n){for(var r,i=1/0,o=0;o<e.length;o++){var a=e[o].id;!n[a]&&t[a]<=i&&(i=t[a],r=e[o])}return r}(h,o,l),i=e.id;if(l[i]=!0,h[i]===1/0)return"continue";(n?function(t,e){return e.filter((function(e){return e.source===t}))}(i,s):c(i,s)).forEach((function(t){var n=t.target,o=t.source,a=n===i?o:n,s=r&&t[r]?t[r]:1;h[a]>h[e.id]+s?(h[a]=h[e.id]+s,f[a]=[e.id]):h[a]===h[e.id]+s&&f[a].push(e.id)}))},g=0;g<d;g++)p();f[e]=[e];var v={};for(var m in h)h[m]!==1/0&&O(e,m,f,v);var y={};for(var m in v)y[m]=v[m][0];return{length:h,path:y,allPath:v}};function O(t,e,n,r){if(t===e)return[t];if(r[e])return r[e];for(var i=[],o=0,a=n[e];o<a.length;o++){var s=O(t,a[o],n,r);if(!s)return;for(var u=0,c=s;u<c.length;u++){var l=c[u];Object(E.isArray)(l)?i.push(Object(S.__spreadArray)(Object(S.__spreadArray)([],l,!0),[e],!1)):i.push([l,e])}}return r[e]=i,r[e]}var A=function(t,e,n,r,i){var o=M(t,e,r,i),a=o.length,s=o.path,u=o.allPath;return{length:a[n],path:s[n],allPath:u[n]}},k=function(t,e,n,r){var i;if(e===n)return[[e]];var o=t.edges,a=void 0===o?[]:o,s=[e],c=((i={})[e]=!0,i),l=[],h=[],f=r?u(e,a,"target"):u(e,a);for(l.push(f);s.length>0&&l.length>0;){var d=l[l.length-1];if(d.length){var p=d.shift();if(p&&(s.push(p),c[p]=!0,f=r?u(p,a,"target"):u(p,a),l.push(f.filter((function(t){return!c[t]})))),s[s.length-1]===n){var g=s.map((function(t){return t}));h.push(g);v=s.pop();c[v]=!1,l.pop()}}else{var v=s.pop();c[v]=!1,l.pop()}}return h},C=function(t,e){for(var n=r(t,e),i=[],o=n.length,a=0;a<o;a+=1){i[a]=[];for(var s=0;s<o;s+=1)a===s?i[a][s]=0:0!==n[a][s]&&n[a][s]?i[a][s]=n[a][s]:i[a][s]=1/0}for(var u=0;u<o;u+=1)for(a=0;a<o;a+=1)for(s=0;s<o;s+=1)i[a][s]>i[a][u]+i[u][s]&&(i[a][s]=i[a][u]+i[u][s]);return i},I=function(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===i&&(i=1e3);var o=t.nodes,a=void 0===o?[]:o,s=t.edges,u=void 0===s?[]:s,c={},h={};a.forEach((function(t,e){var n=l();t.clusterId=n,c[n]={id:n,nodes:[t]},h[t.id]={node:t,idx:e}}));var f=r(t,e),d=[],p={};f.forEach((function(t,e){var n=0,r=a[e].id;p[r]={},t.forEach((function(t,e){if(t){n+=t;var i=a[e].id;p[r][i]=t}})),d.push(n)}));for(var g=0,v=function(){var t=!1;if(a.forEach((function(e){var n={};Object.keys(p[e.id]).forEach((function(t){var r=p[e.id][t],i=h[t].node.clusterId;n[i]||(n[i]=0),n[i]+=r}));var r=-1/0,i=[];if(Object.keys(n).forEach((function(t){r<n[t]?(r=n[t],i=[t]):r===n[t]&&i.push(t)})),1!==i.length||i[0]!==e.clusterId){var o=i.indexOf(e.clusterId);if(o>=0&&i.splice(o,1),i&&i.length){t=!0;var a=c[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*i.length),l=c[i[u]];l.nodes.push(e),e.clusterId=l.id}}})),!t)return"break";g++};g<i;){if("break"===v())break}Object.keys(c).forEach((function(t){var e=c[t];e.nodes&&e.nodes.length||delete c[t]}));var m=[],y={};u.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=h[e].node.clusterId,a=h[r].node.clusterId,s="".concat(o,"---").concat(a);if(y[s])y[s].weight+=i,y[s].count++;else{var u={source:o,target:a,weight:i,count:1};y[s]=u,m.push(u)}}));var b=[];return Object.keys(c).forEach((function(t){b.push(c[t])})),{clusters:b,clusterEdges:m}},T=function(){function t(t){this.arr=t}return t.prototype.add=function(e){var n,r=e.arr;if(!(null===(n=this.arr)||void 0===n?void 0:n.length))return new t(r);if(!(null==r?void 0:r.length))return new t(this.arr);if(this.arr.length===r.length){var i=[];for(var o in this.arr)i[o]=this.arr[o]+r[o];return new t(i)}},t.prototype.subtract=function(e){var n,r=e.arr;if(!(null===(n=this.arr)||void 0===n?void 0:n.length))return new t(r);if(!(null==r?void 0:r.length))return new t(this.arr);if(this.arr.length===r.length){var i=[];for(var o in this.arr)i[o]=this.arr[o]-r[o];return new t(i)}},t.prototype.avg=function(e){var n=[];for(var r in this.arr)n[r]=this.arr[r]/e;return new t(n)},t.prototype.negate=function(){var e=[];for(var n in this.arr)e[n]=-this.arr[n];return new t(e)},t.prototype.squareEuclideanDistance=function(t){var e,n=t.arr;if(!(null===(e=this.arr)||void 0===e?void 0:e.length)||!(null==n?void 0:n.length))return 0;if(this.arr.length===n.length){var r=0;for(var i in this.arr)r+=Math.pow(this.arr[i]-t.arr[i],2);return r}},t.prototype.normalize=function(){var e=[],n=Object(E.clone)(this.arr);n.sort((function(t,e){return t-e}));var r=n[n.length-1],i=n[0];for(var o in this.arr)e[o]=(this.arr[o]-i)/(r-i);return new t(e)},t}(),P=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/,N=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/,j=function(t,e,n,r){for(var i=e.length,o=2*r,a=0,s=0;s<i;s++)for(var u=t[s].clusterId,c=0;c<i;c++){if(u===t[c].clusterId)a+=(e[s][c]||0)-(n[s]||0)*(n[c]||0)/o}return a*=1/o},D=function(t,e){return e.map((function(e){if(t.hasOwnProperty(e)){if(!isNaN(Number(t[e])))return Number(t[e]);if(t[e].match(P)||t[e].match(N))return Number(Date.parse(new Date(t[e])))/1e3}return 0}))},L=function(t,e){void 0===t&&(t=[]);for(var n=t.length,r=new T([]),i=0;i<n;i++)r=r.add(new T(e[i]));var o=r.avg(n);o.normalize();var a=0;for(i=0;i<n;i++){a+=(u=new T(e[i])).squareEuclideanDistance(o)}var s=[];t.forEach((function(){s.push([])}));for(i=0;i<n;i++){var u=new T(e[i]);t[i].clusterInertial=0;for(var c=0;c<n;c++)if(i!==c){var l=new T(e[c]);s[i][c]=u.squareEuclideanDistance(l),t[i].clusterInertial+=s[i][c]}else s[i][c]=0}var h=0,f=2*n*a;for(i=0;i<n;i++){var d=t[i].clusterId;for(c=0;c<n;c++){var p=t[c].clusterId;if(i!==c&&d===p)h+=t[i].clusterInertial*t[c].clusterInertial/Math.pow(f,2)-s[i][c]/f}}return Number(h.toFixed(4))},R=function(t,e,n,i,o,a){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===i&&(i=1e-4),void 0===o&&(o=!1),void 0===a&&(a=1);var s=t.nodes,u=void 0===s?[]:s,c=t.edges,l=void 0===c?[]:c,h=[];if(o){u.forEach((function(t,e){t.properties=t.properties||{},t.originIndex=e}));var f=[];u.every((function(t){return t.hasOwnProperty("nodeType")}))&&(f=Array.from(new Set(u.map((function(t){return t.nodeType})))),u.forEach((function(t){t.properties.nodeType=f.findIndex((function(e){return e===t.nodeType}))})));var d=function(t){void 0===t&&(t=[]);var e={};t.forEach((function(t){Object.keys(t.properties).forEach((function(n){!"".concat(t.properties[n]).match(P)&&!"".concat(t.properties[n]).match(N)&&isNaN(Number(t.properties[n]))||"id"===n?e.hasOwnProperty(n)&&delete e[n]:e.hasOwnProperty(n)?e[n]+=1:e[n]=1}))}));var n=Object.keys(e).sort((function(t,n){return e[n]-e[t]}));return n.length<100?n:n.slice(0,100)}(u);h=function(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=D(e[r].properties,t);return n}(d,u)}var p=1,g={},v={};u.forEach((function(t,e){var n=String(p++);t.clusterId=n,g[n]={id:n,nodes:[t]},v[t.id]={node:t,idx:e}}));var m=r(t,e),y=[],b={},x=0;m.forEach((function(t,e){var n=0,r=u[e].id;b[r]={},t.forEach((function(t,e){if(t){n+=t;var i=u[e].id;b[r][i]=t,x+=t}})),y.push(n)})),x/=2;for(var w=1/0,_=1/0,S=0,M=[],O={};;){w=o&&u.every((function(t){return t.hasOwnProperty("properties")}))?j(u,m,y,x)+L(u,h)*a:j(u,m,y,x),0===S&&(_=w,M=u,O=g);var A=w>0&&w>_&&w-_<i;if(w>_&&(M=u.map((function(t){return{node:t,clusterId:t.clusterId}})),O=Object(E.clone)(g),_=w),A||S>100)break;S++,Object.keys(g).forEach((function(t){var e=0;l.forEach((function(r){var i=r.source,o=r.target,a=v[i].node.clusterId,s=v[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=r[n]||1)})),g[t].sumTot=e})),u.forEach((function(t,e){var r,i=g[t.clusterId],s=0,u=y[e]/(2*x),c=0,f=i.nodes;f.forEach((function(t){var n=v[t.id].idx;c+=m[e][n]||0}));var d=c-i.sumTot*u,p=f.filter((function(e){return e.id!==t.id})),w=[];p.forEach((function(t,e){w[e]=h[t.originIndex]}));var _=L(p,h)*a,S=b[t.id];if(Object.keys(S).forEach((function(n){var i=v[n].node.clusterId;if(i!==t.clusterId){var c=g[i],l=c.nodes;if(l&&l.length){var f=0;l.forEach((function(t){var n=v[t.id].idx;f+=m[e][n]||0}));var p=f-c.sumTot*u,y=l.concat([t]),b=[];y.forEach((function(t,e){b[e]=h[t.originIndex]}));var x=L(y,h)*a,w=p-d;o&&(w=p+x-(d+_)),w>s&&(s=w,r=c)}}})),s>0){r.nodes.push(t);var E=t.clusterId;t.clusterId=r.id;var M=i.nodes.indexOf(t);i.nodes.splice(M,1);var O=0,A=0;l.forEach((function(t){var e=t.source,i=t.target,o=v[e].node.clusterId,a=v[i].node.clusterId;(o===r.id&&a!==r.id||a===r.id&&o!==r.id)&&(O+=t[n]||1),(o===E&&a!==E||a===E&&o!==E)&&(A+=t[n]||1)})),r.sumTot=O,i.sumTot=A}}))}var k={},C=0;Object.keys(O).forEach((function(t){var e=O[t];if(e.nodes&&e.nodes.length){var n=String(C+1);n!==t&&(e.id=n,e.nodes=e.nodes.map((function(t){return{id:t.id,clusterId:n}})),O[n]=e,k[t]=n,delete O[t],C++)}else delete O[t]})),M.forEach((function(t){var e=t.node,n=t.clusterId;e.clusterId=n,e.clusterId&&k[e.clusterId]&&(e.clusterId=k[e.clusterId])}));var I=[],T={};l.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=v[e].node.clusterId,a=v[r].node.clusterId,s="".concat(o,"---").concat(a);if(T[s])T[s].weight+=i,T[s].count++;else{var u={source:o,target:a,weight:i,count:1};T[s]=u,I.push(u)}}));var R=[];return Object.keys(O).forEach((function(t){R.push(O[t])})),{clusters:R,clusterEdges:I}},B=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var r=n[e];this.parent[r]=r}}return t.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},t.prototype.union=function(t,e){var n=this.find(t),r=this.find(e);n!==r&&(n<r?(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]):(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]))},t.prototype.connected=function(t,e){return this.find(t)===this.find(e)},t}(),G=function(t,e){return t-e},F=function(){function t(t){void 0===t&&(t=G),this.compareFn=t,this.list=[]}return t.prototype.getLeft=function(t){return 2*t+1},t.prototype.getRight=function(t){return 2*t+2},t.prototype.getParent=function(t){return 0===t?null:Math.floor((t-1)/2)},t.prototype.isEmpty=function(){return this.list.length<=0},t.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},t.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,r=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==r&&r<o&&this.compareFn(this.list[n],this.list[r])>0?n=r:null!==i&&i<o&&this.compareFn(this.list[n],this.list[i])>0&&(n=i),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},t}(),z=function(t,e){var n=[],r=t.nodes,i=void 0===r?[]:r,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return n;var s=i[0],u=new Set;u.add(s);var l=new F((function(t,n){return e?t.weight-n.weight:0}));for(c(s.id,a).forEach((function(t){l.insert(t)}));!l.isEmpty();){var h=l.delMin(),f=h.source,d=h.target;u.has(f)&&u.has(d)||(n.push(h),u.has(f)||(u.add(f),c(f,a).forEach((function(t){l.insert(t)}))),u.has(d)||(u.add(d),c(d,a).forEach((function(t){l.insert(t)}))))}return n},U=function(t,e){var n=[],r=t.nodes,i=void 0===r?[]:r,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return n;var s=a.map((function(t){return t}));e&&s.sort((function(t,e){return t.weight-e.weight}));for(var u=new B(i.map((function(t){return t.id})));s.length>0;){var c=s.shift(),l=c.source,h=c.target;u.connected(l,h)||(n.push(c),u.union(l,h))}return n},V=function(t,e,n){return n?{prim:z,kruskal:U}[n](t,e):U(t,e)},W=function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var r,i=1,o=0,a=1e3,s=t.nodes,c=void 0===s?[]:s,l=t.edges,h=void 0===l?[]:l,f=c.length,d={},p={},v=0;v<f;++v){d[y=(S=c[v]).id]=1/f,p[y]=1/f}for(var m=g(t);a>0&&i>e;){o=0;for(v=0;v<f;++v){var y=(S=c[v]).id;if(r=0,0===m[S.id].inDegree)d[y]=0;else{for(var b=u(y,h,"source"),x=0;x<b.length;++x){var w=b[x],_=m[w].outDegree;_>0&&(r+=p[w]/_)}d[y]=n*r,o+=d[y]}}o=(1-o)/f,i=0;for(v=0;v<f;++v){var S;r=d[y=(S=c[v]).id]+o,i+=Math.abs(r-p[y]),p[y]=r}a-=1}return p},Y=function(t,e,n,r){void 0===t&&(t=-1),void 0===e&&(e=-1),void 0===n&&(n=-1),void 0===r&&(r="-1"),this.id=t,this.from=e,this.to=n,this.label=r},X=function(){function t(t,e){void 0===t&&(t=-1),void 0===e&&(e="-1"),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return t.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},t}(),H=function(){function t(t,e,n){void 0===t&&(t=-1),void 0===e&&(e=!0),void 0===n&&(n=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return t.prototype.getNodeNum=function(){return this.nodes.length},t.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new X(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},t.prototype.addEdge=function(t,e,n,r){if((this.edgeIdAutoIncrease||void 0===t)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[t])){var i=new Y(t,e,n,r);if(this.edges.push(i),this.edgeMap[t]=i,this.nodeMap[e].addEdge(i),this.edgeLabelMap[r]||(this.edgeLabelMap[r]=[]),this.edgeLabelMap[r].push(i),!this.directed){var o=new Y(t,n,e,r);this.nodeMap[n].addEdge(o),this.edgeLabelMap[r].push(o)}}},t}(),q=function(){function t(t,e,n,r,i){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||"-1",edgeLabel:r||"-1",nodeLabel2:i||"-1"}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),K=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var n=0;n<e;n++)if(this.dfsEdgeList[n]!==t[n])return!1;return!0},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t.prototype.pushBack=function(t,e,n,r,i){return this.dfsEdgeList.push(new q(t,e,n,r,i)),this.dfsEdgeList},t.prototype.toGraph=function(t,e){void 0===t&&(t=-1),void 0===e&&(e=!1);var n=new H(t,!0,e);return this.dfsEdgeList.forEach((function(t){var e=t.fromNode,r=t.toNode,i=t.nodeEdgeNodeLabel,o=i.nodeLabel1,a=i.edgeLabel,s=i.nodeLabel2;"-1"!==o&&n.addNode(e,o),"-1"!==s&&n.addNode(r,s),"-1"!==o&&s!==o&&n.addEdge(void 0,e,r,a)})),n},t.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length-1;e>=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,i=n.toNode;r<i&&(void 0===t||i===t)&&(this.rmpath.push(e),t=r)}return this.rmpath},t.prototype.getNodeNum=function(){var t={};return this.dfsEdgeList.forEach((function(e){t[e.fromNode]||(t[e.fromNode]=!0),t[e.toNode]||(t[e.toNode]=!0)})),Object.keys(t).length},t}(),Z=function(){function t(t){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],t){for(;t;){var e=t.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,t=t.preNode}this.edges=this.edges.reverse()}}return t.prototype.hasNode=function(t){return 1===this.nodesUsed[t.id]},t.prototype.hasEdge=function(t){return 1===this.edgesUsed[t.id]},t}(),$=function(){function t(t){var e=t.graphs,n=t.minSupport,r=void 0===n?2:n,i=t.minNodeNum,o=void 0===i?1:i,a=t.maxNodeNum,s=void 0===a?4:a,u=t.top,c=void 0===u?10:u,l=t.directed,h=void 0!==l&&l,f=t.verbose,d=void 0!==f&&f;this.graphs=e,this.dfsCode=new K,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=r,this.top=c,this.directed=h,this.counter=0,this.maxNodeNum=s,this.minNodeNum=o,this.verbose=d,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return t.prototype.findForwardRootEdges=function(t,e){var n=this,r=[],i=t.nodeMap;return e.edges.forEach((function(t){(n.directed||e.label<=i[t.to].label)&&r.push(t)})),r},t.prototype.findBackwardEdge=function(t,e,n,r){if(!this.directed&&e===n)return null;for(var i=t.nodeMap,o=i[n.to].edges,a=o.length,s=0;s<a;s++){var u=o[s];if(!r.hasEdge(u)&&u.to===e.from)if(this.directed){if(i[e.from].label<i[n.to].label||i[e.from].label===i[n.to].label&&e.label<=u.label)return u}else if(e.label<u.label||e.label===u.label&&i[e.to].label<=i[n.to].label)return u}return null},t.prototype.findForwardPureEdges=function(t,e,n,r){for(var i=[],o=e.to,a=t.nodeMap[o].edges,s=a.length,u=0;u<s;u++){var c=a[u],l=t.nodeMap[c.to];n<=l.label&&!r.hasNode(l)&&i.push(c)}return i},t.prototype.findForwardRmpathEdges=function(t,e,n,r){for(var i=[],o=t.nodeMap,a=o[e.to].label,s=o[e.from].edges,u=s.length,c=0;c<u;c++){var l=s[c],h=o[l.to].label;e.to===l.to||n>h||r.hasNode(o[l.to])||(e.label<l.label||e.label===l.label&&a<=h)&&i.push(l)}return i},t.prototype.getSupport=function(t){var e={};return t.forEach((function(t){e[t.graphId]||(e[t.graphId]=!0)})),Object.keys(e).length},t.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach((function(n){var r=t[n],i=r.nodeLabel1,o=r.edgeLabel,a=r.nodeLabel2;e?(i<e.nodeLabel1||i===e.nodeLabel1&&o<e.edgeLabel||i===e.nodeLabel1&&o===e.edgeLabel&&a<e.nodeLabel2)&&(e={nodeLabel1:i,edgeLabel:o,nodeLabel2:a}):e={nodeLabel1:i,edgeLabel:o,nodeLabel2:a}})),e},t.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),1===e.dfsEdgeList.length)return!0;var n=this.directed,r=e.toGraph(-1,n),i=r.nodeMap,o=new K,a={};r.nodes.forEach((function(e){t.findForwardRootEdges(r,e).forEach((function(t){var n=i[t.to],o="".concat(e.label,"-").concat(t.label,"-").concat(n.label);a[o]||(a[o]={projected:[],nodeLabel1:e.label,edgeLabel:t.label,nodeLabel2:n.label});var s={graphId:r.id,edge:t,preNode:null};a[o].projected.push(s)}))}));var s=this.findMinLabel(a);if(s){o.dfsEdgeList.push(new q(0,1,s.nodeLabel1,s.edgeLabel,s.nodeLabel2));var u="".concat(s.nodeLabel1,"-").concat(s.edgeLabel,"-").concat(s.nodeLabel2);return function a(s){for(var u=o.buildRmpath(),c=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,l=o.dfsEdgeList[u[0]].toNode,h={},f=!1,d=0,p=n?-1:0,g=function(e){if(f)return"break";s.forEach((function(n){var i=new Z(n),a=t.findBackwardEdge(r,i.edges[u[e]],i.edges[u[0]],i);a&&(h[a.label]||(h[a.label]={projected:[],edgeLabel:a.label}),h[a.label].projected.push({graphId:r.id,edge:h,preNode:n}),d=o.dfsEdgeList[u[e]].fromNode,f=!0)}))},v=u.length-1;v>p;v--){if("break"===g(v))break}if(f){var m=t.findMinLabel(h);o.dfsEdgeList.push(new q(l,d,"-1",m.edgeLabel,"-1"));var y=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[y]===o.dfsEdgeList[y]&&a(h[m.edgeLabel].projected)}var b={};f=!1;var x=0;s.forEach((function(e){var n=new Z(e),o=t.findForwardPureEdges(r,n.edges[u[0]],c,n);o.length>0&&(f=!0,x=l,o.forEach((function(t){var n="".concat(t.label,"-").concat(i[t.to].label);b[n]||(b[n]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}));var w=u.length,_=function(e){if(f)return"break";var n=u[e];s.forEach((function(e){var a=new Z(e),s=t.findForwardRmpathEdges(r,a.edges[n],c,a);s.length>0&&(f=!0,x=o.dfsEdgeList[n].fromNode,s.forEach((function(t){var n="".concat(t.label,"-").concat(i[t.to].label);b[n]||(b[n]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}))};for(v=0;v<w;v++){if("break"===_(v))break}if(!f)return!0;var S=t.findMinLabel(b);o.dfsEdgeList.push(new q(x,l+1,"-1",S.edgeLabel,S.nodeLabel2));var E=o.dfsEdgeList.length-1;return e.dfsEdgeList[E]===o.dfsEdgeList[E]&&a(b["".concat(S.edgeLabel,"-").concat(S.nodeLabel2)].projected)}(a[u].projected)}},t.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(Object(E.clone)(t))}},t.prototype.subGraphMining=function(t){var e=this;if(!(this.getSupport(t)<this.minSupport)&&this.isMin()){this.report();var n=this.dfsCode.getNodeNum(),r=this.dfsCode.buildRmpath(),i=this.dfsCode.dfsEdgeList[r[0]].toNode,o=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,a={},s={};t.forEach((function(t){for(var u=e.graphs[t.graphId],c=u.nodeMap,l=new Z(t),h=r.length-1;h>=0;h--){var f=e.findBackwardEdge(u,l.edges[r[h]],l.edges[r[0]],l);if(f){var d="".concat(e.dfsCode.dfsEdgeList[r[h]].fromNode,"-").concat(f.label);s[d]||(s[d]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[h]].fromNode,edgeLabel:f.label}),s[d].projected.push({graphId:t.graphId,edge:f,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(u,l.edges[r[0]],o,l).forEach((function(e){var n="".concat(i,"-").concat(e.label,"-").concat(c[e.to].label);a[n]||(a[n]={projected:[],fromNodeId:i,edgeLabel:e.label,nodeLabel2:c[e.to].label}),a[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var p=function(n){e.findForwardRmpathEdges(u,l.edges[r[n]],o,l).forEach((function(i){var o="".concat(e.dfsCode.dfsEdgeList[r[n]].fromNode,"-").concat(i.label,"-").concat(c[i.to].label);a[o]||(a[o]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[r[n]].fromNode,edgeLabel:i.label,nodeLabel2:c[i.to].label}),a[o].projected.push({graphId:t.graphId,edge:i,preNode:t})}))};for(h=0;h<r.length;h++)p(h)}})),Object.keys(s).forEach((function(t){var n=s[t],r=n.toNodeId,o=n.edgeLabel;e.dfsCode.dfsEdgeList.push(new q(i,r,"-1",o,"-1")),e.subGraphMining(s[t].projected),e.dfsCode.dfsEdgeList.pop()})),Object.keys(a).forEach((function(t){var n=a[t],r=n.fromNodeId,o=n.edgeLabel,s=n.nodeLabel2;e.dfsCode.dfsEdgeList.push(new q(r,i+1,"-1",o,s)),e.subGraphMining(a[t].projected),e.dfsCode.dfsEdgeList.pop()}))}},t.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,n=this.minSupport,r=this.frequentSize1Subgraphs,i={},o={},a={},s={};return Object.keys(t).forEach((function(n){var r=t[n],u=r.nodeMap;r.nodes.forEach((function(t,r){var c=t.label,l="".concat(n,"-").concat(c);if(!a[l]){var h=i[c]||0;h++,i[c]=h}a[l]={graphKey:n,label:c},t.edges.forEach((function(t){var r=c,i=u[t.to].label;if(!e&&r>i){var a=i;i=r,r=a}var l=t.label,h="".concat(n,"-").concat(r,"-").concat(l,"-").concat(i),f="".concat(r,"-").concat(l,"-").concat(i);if(!o[f]){var d=o[f]||0;d++,o[f]=d}s[h]={graphId:n,nodeLabel1:r,edgeLabel:l,nodeLabel2:i}}))}))})),Object.keys(i).forEach((function(t){if(!(i[t]<n)){var e={nodes:[],edges:[]};e.nodes.push({id:"0",label:t}),r.push(e)}})),r},t.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs,n=(this.directed,{});Object.keys(e).forEach((function(r){var i=e[r],o=i.nodeMap;i.nodes.forEach((function(e){t.findForwardRootEdges(i,e).forEach((function(t){var i=o[t.to],a="".concat(e.label,"-").concat(t.label,"-").concat(i.label);n[a]||(n[a]={projected:[],nodeLabel1:e.label,edgeLabel:t.label,nodeLabel2:i.label});var s={graphId:r,edge:t,preNode:null};n[a].projected.push(s)}))}))})),Object.keys(n).forEach((function(e){var r=n[e],i=r.projected,o=r.nodeLabel1,a=r.edgeLabel,s=r.nodeLabel2;t.dfsCode.dfsEdgeList.push(new q(0,1,o,a,s)),t.subGraphMining(i),t.dfsCode.dfsEdgeList.pop()}))}},t}(),Q=function(t){var e=t.graphs,n=t.directed,r=void 0!==n&&n,i=t.nodeLabelProp,o=void 0===i?"cluster":i,a=t.edgeLabelProp,s=void 0===a?"cluster":a,u=function(t,e,n,r){var i={};return Object.keys(t).forEach((function(o,a){var s=t[o],u=new H(a,!0,e),c={};s.nodes.forEach((function(t,e){u.addNode(e,t[n]),c[t.id]=e})),s.edges.forEach((function(t,e){var n=c[t.source],i=c[t.target];u.addEdge(-1,n,i,t[r])})),u&&u.getNodeNum()&&(i[u.id]=u)})),i}(e,r,o,s),c=t.minSupport,l=t.maxNodeNum,h=t.minNodeNum,f=t.verbose,d=t.top,p=new $({graphs:u,minSupport:c,maxNodeNum:l,minNodeNum:h,top:d,verbose:f,directed:r});return p.run(),function(t,e,n){var r=[];return t.forEach((function(t){var i={nodes:[],edges:[]};t.nodes.forEach((function(t){var n;i.nodes.push(((n={id:"".concat(t.id)})[e]=t.label,n))})),t.edges.forEach((function(t){var e;i.edges.push(((e={source:"".concat(t.from),target:"".concat(t.to)})[n]=t.label,e))})),r.push(i)})),r}(p.frequentSubgraphs,o,s)},J=function(t,e,n,r){void 0===n&&(n="cluster"),void 0===r&&(r=2);var i=[],o=t.nodes;return e.forEach((function(t,e){i.push(tt(o,t,e,n,r))})),i},tt=function(t,e,n,r,i){var o=[n],a=[],s={};return e.forEach((function(e,u){if(e<=i&&n!==u){o.push(u),a.push(t[u]);var c=t[u][r];s[c]?(s[c].count++,s[c].dists.push(e)):s[c]={count:1,dists:[e]}}})),Object.keys(s).forEach((function(t){s[t].dists=s[t].dists.sort((function(t,e){return t-e}))})),{nodeIdx:n,nodeId:t[n].id,nodeIdxs:o,neighbors:a,neighborNum:o.length-1,nodeLabelCountMap:s}},et=function(t,e,n,r){var i=n.nodes;return r||(r={}),Object.keys(t).forEach((function(o){var a,s;if(!r||!r[o]){r[o]={nodes:[],edges:[]};var u=t[o],c=null===(a=e[u.start])||void 0===a?void 0:a.nodeIdxs,l=null===(s=e[u.end])||void 0===s?void 0:s.nodeIdxs;if(c&&l){var h=new Set(l),f=c.filter((function(t){return h.has(t)}));if(f&&f.length){for(var d={},p=f.length,g=0;g<p;g++){var v=i[f[g]];r[o].nodes.push(v),d[v.id]=!0}n.edges.forEach((function(t){d[t.source]&&d[t.target]&&r[o].edges.push(t)}))}}}})),r},nt=function(t,e,n,r){var i,o,a={};t.nodes.forEach((function(t){a[t.id]=t}));var s=0;return!(null===(i=null==e?void 0:e.edges)||void 0===i?void 0:i.length)||(null===(o=null==e?void 0:e.nodes)||void 0===o?void 0:o.length)<2?0:(t.edges.forEach((function(t){var i=a[t.source][n],o=a[t.target][n],u=null==e?void 0:e.nodes[0][n],c=null==e?void 0:e.nodes[1][n],l=null==e?void 0:e.edges[0][r];t[r]===l&&(i===u&&o===c||i===c&&o===u)&&s++})),s)},rt=function(t,e){var n={},r={};return t.forEach((function(t,i){n[t.id]={idx:i,node:t,degree:0,inDegree:0,outDegree:0};var o=t[e];r[o]||(r[o]=[]),r[o].push(t)})),{nodeMap:n,nodeLabelMap:r}},it=function(t,e,n){var r={},i={};return t.forEach((function(t,o){r["".concat(l)]={idx:o,edge:t};var a=t[e];i[a]||(i[a]=[]),i[a].push(t);var s=n[t.source];s&&(s.degree++,s.outDegree++);var u=n[t.target];u&&(u.degree++,u.inDegree++)})),{edgeMap:r,edgeLabelMap:i}},ot=function(t,e,n){var r=e.length,i={};return e.forEach((function(e,o){for(var a=n?0:o+1,s=t[o].id,u=a;u<r;u++)if(o!==u){var c=t[u].id,l=e[u];i["".concat(s,"-").concat(c)]=l,n||(i["".concat(c,"-").concat(s)]=l)}})),i},at=function(t,e,n,r,i,o,a,s,u,c,l){var h,f="".concat(e.id,"-").concat(n.id);if(c&&c[f])return c[f];var d=l?l[f]:void 0;if(!d){var p=((h={})[f]={start:r[e.id].idx,end:r[n.id].idx,distance:i},h);d=(l=et(p,o,t,l))[f]}return nt(d,a,s,u)},st=function(t,e,n,r){var i,o,a,s=null===(i=t[e])||void 0===i?void 0:i.degree,u=null===(o=t[e])||void 0===o?void 0:o.inDegree,c=null===(a=t[e])||void 0===a?void 0:a.outDegree;return void 0===t[e]&&(s=1/0,u=1/0,c=1/0,r[e].forEach((function(t){var e=n[t.id].degree;s>e&&(s=e);var r=n[t.id].inDegree;u>r&&(u=r);var i=n[t.id].outDegree;c>i&&(c=i)})),t[e]={degree:s,inDegree:u,outDegree:c}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:c}},ut=function(t,e,n,r,i,o,a){var s;if(void 0===n&&(n=!1),void 0===o&&(o="cluster"),void 0===a&&(a="cluster"),t&&t.nodes){var u=t.nodes.length;if(u){var c=C(t,n),l=C(e,n),h=ot(t.nodes,c,n),f=ot(e.nodes,l,n),d=rt(t.nodes,o),p=d.nodeMap,g=d.nodeLabelMap,v=rt(e.nodes,o),m=v.nodeMap,y=v.nodeLabelMap;it(t.edges,a,p);var b=it(e.edges,a,m).edgeLabelMap,x=[];null==l||l.forEach((function(t){x=x.concat(t)})),i||(i=Math.max.apply(Math,Object(S.__spreadArray)(Object(S.__spreadArray)([],x,!1),[2],!1))),r||(r=i);var w=J(t,c,o,r),_=J(e,l,o,r),E=function(t,e,n,r,i){var o=Math.ceil(n/e),a={},s=0;return r.forEach((function(t,r){for(var u=0,c=0,l=t.nodeIdxs,h=t.neighborNum-1;u<o;){for(var f=l[1+Math.floor(Math.random()*h)],d=0;(a["".concat(r,"-").concat(f)]||a["".concat(f,"-").concat(r)])&&(f=Math.floor(Math.random()*e),!(++d>2*e)););if(d<2*e&&(a["".concat(r,"-").concat(f)]={start:r,end:f,distance:i[r][f]},u++,++s>=n))return a;if(++c>2*e)break}u<o&&(o=(o+(o-u))/(e-r-1))})),a}(0,u,Math.min(100,u*(u-1)/2),_,c),O=et(E,w,t),A=Q({graphs:O,nodeLabelProp:o,edgeLabelProp:a,minSupport:1,minNodeNum:1,maxNodeNum:4,directed:n}).slice(0,10),k=A.length,I=[];A.forEach((function(t,e){I[e]={},Object.keys(O).forEach((function(n){var r=O[n],i=nt(r,t,o,a);I[e][n]=i}))}));var T=function(t,e,n){for(var r=1/0,i=0,o=function(e){var n=t[e],o=Object.keys(n).sort((function(t,e){return n[t]-n[e]})),a=[];o.forEach((function(t,e){a[e%10]||(a[e%10]={graphs:[],totalCount:0,aveCount:0}),a[e%10].graphs.push(t),a[e%10].totalCount+=n[t]}));var s=0,u=[];a.forEach((function(t){var e=t.totalCount/t.graphs.length;t.aveCount=e,u.push(e);var r=0,i=t.length;t.graphs.forEach((function(e,i){var o=n[e];t.graphs.forEach((function(t,e){i!==e&&(r+=Math.abs(o-n[t]))}))})),s+=r/=i*(i-1)/2})),s/=a.length;var c=0;u.forEach((function(t,e){u.forEach((function(n,r){e!==r&&(c+=Math.abs(t-n))})),c/=u.length*(u.length-1)/2}));var l=c-s;r<l&&(r=l,i=e)},a=0;a<e;a++)o(a);return{structure:n[i],structureCountMap:t[i]}}(I,k,A),P=T.structure,N=T.structureCountMap,j=e.nodes[0],D=[],L=null===(s=e.nodes[0])||void 0===s?void 0:s[o],R=-1/0;e.nodes.forEach((function(t){var e=t[o],n=g[e];(null==n?void 0:n.length)>R&&(R=n.length,D=n,L=e,j=t)}));var B={},G={},F={},z={},U={},V={};Object.keys(y).forEach((function(r,i){U[r]=[],n&&(V[r]=[]);var s=-1/0,u=y[r],c={};u.forEach((function(t){var e=f["".concat(j.id,"-").concat(t.id)];if(e&&U[r].push(e),s<e&&(s=e),c["".concat(j.id,"-").concat(t.id)]={start:0,end:m[t.id].idx,distance:e},n){var i=f["".concat(t.id,"-").concat(j.id)];i&&V[r].push(i)}})),U[r]=U[r].sort((function(t,e){return t-e})),n&&(V[r]=V[r].sort((function(t,e){return t-e}))),G=et(c,_,e,G);var l=[];if(Object.keys(c).forEach((function(t){if(F[t])l.push(F[t]);else{var e=G[t];F[t]=nt(e,P,o,a),l.push(F[t])}})),l=l.sort((function(t,e){return e-t})),z["".concat(j.id,"-").concat(r)]=l,r!==L)for(var d=function(e){var n=D[e],i=w[p[n.id].idx],s=i.nodeLabelCountMap[r],u=y[r].length;if(!s||s.count<u)return D.splice(e,1),"continue";for(var c=!1,f=0;f<u;f++)if(s.dists[f]>U[r][f]){c=!0;break}if(c)return D.splice(e,1),"continue";var d={};i.neighbors.forEach((function(t){var e=h["".concat(n.id,"-").concat(t.id)];d["".concat(n.id,"-").concat(t.id)]={start:p[n.id].idx,end:p[t.id].idx,distance:e}})),O=et(d,w,t,O);var g=[];Object.keys(d).forEach((function(t){if(N[t])g.push(N[t]);else{var e=O[t];N[t]=nt(e,P,o,a),g.push(N[t])}})),g=g.sort((function(t,e){return e-t}));var v=!1;for(f=0;f<u;f++)if(g[f]<l[f]){v=!0;break}return v?(D.splice(e,1),"continue"):void 0},g=((null==D?void 0:D.length)||0)-1;g>=0;g--)d(g)}));var W=[];null==D||D.forEach((function(r){for(var s=p[r.id].idx,u=tt(t.nodes,c[s],s,o,i).neighbors,l=!1,f=u.length-1;f>=0;f--){if(u.length+1<e.nodes.length)return void(l=!0);var d=u[f],g=d[o];if(y[g]&&y[g].length)if(U[g]&&U[g].length){var v="".concat(r.id,"-").concat(d.id),b=h[v],x=U[g].length-1;if(b>U[g][x])u.splice(f,1);else{if(n){var _="".concat(d.id,"-").concat(r.id),S=h[_];if(x=V[g].length-1,S>V[g][x]){u.splice(f,1);continue}}var E=N[v]?N[v]:at(t,r,d,p,b,w,P,o,a,N,O),M="".concat(j.id,"-").concat(g);if(E<z[M][z[M].length-1])u.splice(f,1);else{var A=st(B,g,m,y),k=A.minPatternNodeLabelDegree;A.minPatternNodeLabelInDegree,A.minPatternNodeLabelOutDegree;p[d.id].degree<k&&u.splice(f,1)}}}else u.splice(f,1);else u.splice(f,1)}l||W.push({nodes:[r].concat(u)})}));var Y=M(e,j.id,!1).length,X={};n?(Object.keys(Y).forEach((function(t){var e=m[t].node[o];X[e]?X[e].push(Y[t]):X[e]=[Y[t]]})),Object.keys(X).forEach((function(t){X[t].sort((function(t,e){return t-e}))}))):X=U;for(var H=function(r){var i=W[r],s=i.nodes[0],u={},c={};i.nodes.forEach((function(t,e){c[t.id]={idx:e,node:t,degree:0,inDegree:0,outDegree:0};var n=t[o];u[n]?u[n]++:u[n]=1}));var l=[],h={};t.edges.forEach((function(t){c[t.source]&&c[t.target]&&(l.push(t),h[t[a]]?h[t[a]]++:h[t[a]]=1,c[t.source].degree++,c[t.target].degree++,c[t.source].outDegree++,c[t.target].inDegree++)}));for(var f=Object.keys(b).length,d=!1,g=0;g<f;g++){var v=Object.keys(b)[g];if(!h[v]||h[v]<b[v].length){d=!0;break}}if(d)return W.splice(r,1),"continue";var x=l.length;if(x<e.edges.length)return W.splice(r,1),"break";var w=!1,_=function(t){var e=l[t],r=e[a],i=b[r];if(!i||!i.length)return h[r]--,i&&h[r]<i.length?(w=!0,"break"):(l.splice(t,1),c[e.source].degree--,c[e.target].degree--,c[e.source].outDegree--,c[e.target].inDegree--,"continue");var s=c[e.source].node[o],u=c[e.target].node[o],f=!1;return i.forEach((function(t){var e=m[t.source].node,r=m[t.target].node;e[o]===s&&r[o]===u&&(f=!0),n||e[o]!==u||r[o]!==s||(f=!0)})),f?void 0:(h[r]--,i&&h[r]<i.length?(w=!0,"break"):(l.splice(t,1),c[e.source].degree--,c[e.target].degree--,c[e.source].outDegree--,c[e.target].inDegree--,"continue"))};for(g=x-1;g>=0;g--){if("break"===_(g))break}if(w)return W.splice(r,1),"continue";i.edges=l;var S=M(i,i.nodes[0].id,!1).length;if(Object.keys(S).reverse().forEach((function(t){if(t!==i.nodes[0].id&&!w){if(S[t]===1/0){var e=c[t].node[o];if(u[e]--,u[e]<y[e].length)return void(w=!0);var n=i.nodes.indexOf(c[t].node);return i.nodes.splice(n,1),void(c[t]=void 0)}var r=p[t].node[o];if(!X[r]||!X[r].length||S[t]>X[r][X[r].length-1]){e=c[t].node[o];if(u[e]--,u[e]<y[e].length)return void(w=!0);n=i.nodes.indexOf(c[t].node);i.nodes.splice(n,1),c[t]=void 0}}})),w)return W.splice(r,1),"continue";for(var E=!0,O=0;E&&!w;){if(E=!1,n?c[s.id].degree<m[j.id].degree||c[s.id].inDegree<m[j.id].inDegree||c[s.id].outDegree<m[j.id].outDegree:c[s.id].degree<m[j.id].degree){w=!0;break}if(u[s[o]]<y[s[o]].length){w=!0;break}for(var A=i.nodes.length-1;A>=0;A--){var k=i.nodes[A],C=c[k.id].degree,I=c[k.id].inDegree,T=c[k.id].outDegree,P=k[o],N=st(B,P,m,y),D=N.minPatternNodeLabelDegree,L=N.minPatternNodeLabelInDegree,R=N.minPatternNodeLabelOutDegree;if(n?C<D||I<L||T<R:C<D){if(u[k[o]]--,u[k[o]]<y[k[o]].length){w=!0;break}i.nodes.splice(A,1),c[k.id]=void 0,E=!0}}if(w||!E&&0!==O)break;for(var G=(x=l.length)-1;G>=0;G--){var F=l[G];if(!c[F.source]||!c[F.target]){l.splice(G,1);var z=F[a];if(h[z]--,c[F.source]&&(c[F.source].degree--,c[F.source].outDegree--),c[F.target]&&(c[F.target].degree--,c[F.target].inDegree--),b[z]&&h[z]<b[z].length){w=!0;break}E=!0}}O++}return w||w||i.nodes.length<e.nodes.length||l.length<e.edges.length?(W.splice(r,1),"continue"):void 0},q=W.length-1;q>=0;q--){if("break"===H(q))break}var K=W.length,Z=function(t){var e=W[t],n={};e.edges.forEach((function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);n[e]?n[e]++:n[e]=1}));for(var r=function(t){var e=W[t],r={};e.edges.forEach((function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1}));var i=!0;Object.keys(r).length!==Object.keys(n).length?i=!1:Object.keys(n).forEach((function(t){r[t]!==n[t]&&(i=!1)})),i&&W.splice(t,1)},i=K-1;i>t;i--)r(i);K=W.length};for(q=0;q<=K-1;q++)Z(q);return W}}},ct=function(){function t(t){void 0===t&&(t=10),this.linkedList=new a,this.maxStep=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},t.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},t.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},t.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toArray=function(){return this.linkedList.toArray().map((function(t){return t.value}))},t.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},t}(),lt=_;e.default={getAdjMatrix:r,breadthFirstSearch:h,connectedComponent:d,getDegree:g,getInDegree:v,getOutDegree:m,detectCycle:_,detectDirectedCycle:lt,detectAllCycles:w,detectAllDirectedCycle:x,detectAllUndirectedCycle:b,depthFirstSearch:y,dijkstra:M,findAllPath:k,findShortestPath:A,floydWarshall:C,labelPropagation:I,louvain:R,minimumSpanningTree:V,pageRank:W,getNeighbors:u,Stack:ct,GADDI:ut}},function(t,e,n){var r=n(191),i=n(158),o=n(54);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var r=n(42),i=n(34);function o(t,e,n,i,o){var a={},s="number"==typeof o,u=void 0!==o&&s?o.toString():n;if(s&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(a=Reflect.getMetadata(t,e));var c=a[u];if(Array.isArray(c))for(var l=0,h=c;l<h.length;l++){var f=h[l];if(f.key===i.key)throw new Error(r.DUPLICATED_METADATA+" "+f.key.toString())}else c=[];c.push(i),a[u]=c,Reflect.defineMetadata(t,a,e)}function a(t,e){Reflect.decorate(t,e)}function s(t,e){return function(n,r){e(n,r,t)}}e.tagParameter=function(t,e,n,r){o(i.TAGGED,t,e,r,n)},e.tagProperty=function(t,e,n){o(i.TAGGED_PROP,t.constructor,e,n)},e.decorate=function(t,e,n){"number"==typeof n?a([s(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):a([t],e)}},function(t,e,n){var r=n(502),i=n(503),o=n(241),a=n(504);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n(82),n(22);var r=n(280);n.d(e,"Canvas",(function(){return r.a}));n(80)},function(t,e,n){var r=n(267),i=n(266),o=n(274),a=n(171),s=n(275),u=[0,0];t.exports.computeMiter=function(t,e,n,a,c){return r(t,n,a),o(t,t),i(e,-t[1],t[0]),i(u,-n[1],n[0]),c/s(e,u)},t.exports.normal=function(t,e){return i(t,-e[1],e[0]),t},t.exports.direction=function(t,e,n){return a(t,e,n),o(t,t),t}},function(t,e,n){var r=n(337),i=n(342);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(74),i=n(338),o=n(339),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)?i(t):o(t)}},function(t,e,n){var r=n(191),i=n(362),o=n(54);t.exports=function(t){return o(t)?r(t,!0):i(t)}},function(t,e){t.exports=function(t){return t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var r=0;e.id=function(){return r++}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return s}));var r=n(20),i=n(122);function o(t,e,n){var i=1;return Object(r.h)(t)&&(i=t.split("\n").length),i>1?e*i+function(t,e){return e?e-t:.14*t}(e,n)*(i-1):e}function a(t,e){var n=Object(i.a)(),o=0;if(Object(r.e)(t)||""===t)return o;if(n.save(),n.font=e,Object(r.h)(t)&&t.includes("\n")){var a=t.split("\n");Object(r.a)(a,(function(t){var e=n.measureText(t).width;o<e&&(o=e)}))}else o=n.measureText(t).width;return n.restore(),o}function s(t){var e=t.fontSize,n=t.fontFamily,r=t.fontWeight;return[t.fontStyle,t.fontVariant,r,e+"px",n].join(" ").trim()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return L}));var r,i,o,a,s,u,c,l,h,f,d,p,g,v=n(10),m=n.n(v),y=n(16),b=n.n(y),x=n(11),w=n.n(x),_=n(7),S=n.n(_),E=n(8),M=n.n(E),O=n(12),A=n.n(O),k=(n(30),n(6)),C=n(14),I=n(145),T=n(52);function P(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return N(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function N(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}var j=1,D=2,L=(r=Object(k.injectable)(),i=Object(k.inject)(C.a.RenderEngine),o=Object(k.inject)(C.a.ResourcePool),a=Object(k.inject)(C.a.RenderPassFactory),s=Object(k.inject)(C.a.MeshComponentManager),r((g=p=function(){function t(){var e=this;S()(this,t),w()(this,"engine",l,this),w()(this,"resourcePool",h,this),w()(this,"renderPassFactory",f,this),w()(this,"mesh",d,this),this.pickingFBO=void 0,this.views=void 0,this.highlightEnabled=!0,this.highlightColor=[255,0,0,255],this.alreadyInRendering=!1,this.setup=function(t,e,n){var r=t.createRenderTarget(e,"picking fbo",{width:1,height:1});n.data={output:e.write(t,r)},e.hasSideEffect=!0},this.execute=function(){var t=b()(m.a.mark((function t(n,r,i){var o,a,s;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.views=i,!e.alreadyInRendering){t.next=3;break}return t.abrupt("return");case 3:o=P(i);try{for(s=function(){var t=a.value,i=t.getViewport(),o=i.width,s=i.height;e.alreadyInRendering=!0;var u=n.getResourceNode(r.data.output);e.pickingFBO=e.resourcePool.getOrCreateResource(u.resource),e.pickingFBO.resize({width:o,height:s}),e.engine.useFramebuffer(e.pickingFBO,(function(){e.engine.clear({framebuffer:e.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var n,r=e.renderPassFactory(T.a.IDENTIFIER),i=[],o=P(t.getScene().getEntities());try{for(o.s();!(n=o.n()).done;){var a=n.value,s=e.mesh.getComponentByEntity(a);s.material.setUniform("u_PickingStage",j),i.push(s)}}catch(t){o.e(t)}finally{o.f()}r.renderView(t),i.forEach((function(t){t.material.setUniform("u_PickingStage",D)})),e.alreadyInRendering=!1}))},o.s();!(a=o.n()).done;)s()}catch(t){o.e(t)}finally{o.f()}case 5:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),this.pick=function(t,n){var r,i,o=t.x,a=t.y,s=e.engine,u=s.readPixels,c=s.useFramebuffer,l=n.getViewport(),h=l.width,f=l.height,d=o*window.devicePixelRatio,p=a*window.devicePixelRatio;if(!(d>h||d<0||p>f||p<0))return c(e.pickingFBO,(function(){0===(r=u({x:Math.round(d),y:Math.round(f-(a+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]&&0===r[1]&&0===r[2]||(i=Object(I.a)(r),e.highlightEnabled&&e.highlightPickedFeature(r,n))})),i}}return M()(t,[{key:"enableHighlight",value:function(t){this.highlightEnabled=t}},{key:"setHighlightColor",value:function(t){this.highlightColor=t}},{key:"highlightPickedFeature",value:function(t,e){if(t){var n,r=P(e.getScene().getEntities());try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.mesh.getComponentByEntity(i).material;o.setUniform("u_PickingStage",D),o.setUniform("u_PickingColor",[t[0],t[1],t[2]]),o.setUniform("u_HighlightColor",this.highlightColor)}}catch(t){r.e(t)}finally{r.f()}}}}]),t}(),p.IDENTIFIER="PixelPicking Pass",c=g,l=A()(c.prototype,"engine",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),h=A()(c.prototype,"resourcePool",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),f=A()(c.prototype,"renderPassFactory",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),d=A()(c.prototype,"mesh",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),u=c))||u)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n(36),i=n(27);function o(t,e){e.forEach((function(e){e.draw(t)}))}function a(t,e){var n=t.get("canvas");if(n&&n.get("autoDraw")){var o=n.get("context"),a=t.getParent(),s=a?a.getChildren():[n],u=t.get("el");if("remove"===e)if(t.get("isClipShape")){var c=u&&u.parentNode,l=c&&c.parentNode;c&&l&&l.removeChild(c)}else u&&u.parentNode&&u.parentNode.removeChild(u);else if("show"===e)u.setAttribute("visibility","visible");else if("hide"===e)u.setAttribute("visibility","hidden");else if("zIndex"===e)Object(i.c)(u,s.indexOf(t));else if("sort"===e){var h=t.get("children");h&&h.length&&Object(i.d)(t,(function(t,e){return h.indexOf(t)-h.indexOf(e)?1:0}))}else"clear"===e?u&&(u.innerHTML=""):"matrix"===e?Object(r.c)(t):"clip"===e?Object(r.a)(t,o):"attr"===e||"add"===e&&t.draw(o)}}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(49).Symbol;t.exports=r},function(t,e,n){(function(t){var r=n(49),i=n(358),o=e&&!e.nodeType&&e,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;t.exports=u}).call(this,n(155)(t))},function(t,e,n){var r=n(367),i=n(152),o=n(368),a=n(200),s=n(369),u=n(66),c=n(189),l=c(r),h=c(i),f=c(o),d=c(a),p=c(s),g=u;(r&&"[object DataView]"!=g(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=g(new i)||o&&"[object Promise]"!=g(o.resolve())||a&&"[object Set]"!=g(new a)||s&&"[object WeakMap]"!=g(new s))&&(g=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case l:return"[object DataView]";case h:return"[object Map]";case f:return"[object Promise]";case d:return"[object Set]";case p:return"[object WeakMap]"}return e}),t.exports=g},function(t,e,n){var r=n(66),i=n(51);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},function(t,e,n){"use strict";n.r(e),n.d(e,"G6GraphEvent",(function(){return u.G6GraphEvent})),n.d(e,"G6Event",(function(){return u.G6Event})),n.d(e,"Node",(function(){return u.Node})),n.d(e,"Edge",(function(){return u.Edge})),n.d(e,"Combo",(function(){return u.Combo})),n.d(e,"Hull",(function(){return u.Hull})),n.d(e,"registerNode",(function(){return u.registerNode})),n.d(e,"registerCombo",(function(){return u.registerCombo})),n.d(e,"AbstractGraph",(function(){return u.AbstractGraph})),n.d(e,"registerEdge",(function(){return u.registerEdge})),n.d(e,"registerBehavior",(function(){return u.registerBehavior})),n.d(e,"AbstractLayout",(function(){return u.AbstractLayout})),n.d(e,"AbstractEvent",(function(){return u.AbstractEvent})),n.d(e,"BaseGlobal",(function(){return u.BaseGlobal})),n.d(e,"Graph",(function(){return tu})),n.d(e,"TreeGraph",(function(){return ru})),n.d(e,"Util",(function(){return Ts})),n.d(e,"Layout",(function(){return bs})),n.d(e,"TreeLayout",(function(){return Ns})),n.d(e,"registerLayout",(function(){return js})),n.d(e,"Global",(function(){return D})),n.d(e,"Minimap",(function(){return hf})),n.d(e,"Grid",(function(){return lf})),n.d(e,"Bundling",(function(){return ff})),n.d(e,"Menu",(function(){return df})),n.d(e,"Fisheye",(function(){return pf})),n.d(e,"Algorithm",(function(){return cf})),n.d(e,"ToolBar",(function(){return gf})),n.d(e,"Tooltip",(function(){return vf})),n.d(e,"TimeBar",(function(){return mf})),n.d(e,"ImageMinimap",(function(){return yf})),n.d(e,"EdgeFilterLens",(function(){return bf})),n.d(e,"SnapLine",(function(){return xf})),n.d(e,"Legend",(function(){return wf})),n.d(e,"Arrow",(function(){return u.Arrow})),n.d(e,"Marker",(function(){return u.Marker})),n.d(e,"Shape",(function(){return u.Shape})),n.d(e,"version",(function(){return Sf}));var r={};n.r(r),n.d(r,"mixColor",(function(){return T})),n.d(r,"getColorsWithSubjectColor",(function(){return P})),n.d(r,"getColorSetsBySubjectColors",(function(){return N}));var i={};n.r(i),n.d(i,"proccessToFunc",(function(){return Ss})),n.d(i,"buildTextureData",(function(){return Es})),n.d(i,"buildTextureDataWithOneEdgeAttr",(function(){return Ms})),n.d(i,"buildTextureDataWithTwoEdgeAttr",(function(){return Os})),n.d(i,"attributesToTextureData",(function(){return As})),n.d(i,"arrayToTextureData",(function(){return ks})),n.d(i,"radialLayout",(function(){return Cs}));var o={};n.r(o),n.d(o,"gpuDetector",(function(){return Is}));var a={};n.r(a),n.d(a,"default",(function(){return oc})),n.d(a,"assign",(function(){return Gu})),n.d(a,"format",(function(){return rc})),n.d(a,"parse",(function(){return ic})),n.d(a,"defaultI18n",(function(){return Vu})),n.d(a,"setGlobalDateI18n",(function(){return Yu})),n.d(a,"setGlobalDateMasks",(function(){return nc}));var s=n(1),u=n(5),c=n(59),l=n(284),h=n(46),f=n(63),d=n(15),p=n(0),g=n(87),v=n.n(g),m=n(96),y=n.n(m),b=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function x(t,e,n){var r;return(r=Math.round(t.h)>=60&&Math.round(t.h)<=240?n?Math.round(t.h)-2*e:Math.round(t.h)+2*e:n?Math.round(t.h)+2*e:Math.round(t.h)-2*e)<0?r+=360:r>=360&&(r-=360),r}function w(t,e,n){return 0===t.h&&0===t.s?t.s:((r=n?t.s-.16*e:4===e?t.s+.16:t.s+.05*e)>1&&(r=1),n&&5===e&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function _(t,e,n){var r;return(r=n?t.v+.05*e:t.v-.15*e)>1&&(r=1),Number(r.toFixed(2))}function S(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=y()(t),i=5;i>0;i-=1){var o=r.toHsv(),a=y()({h:x(o,i,!0),s:w(o,i,!0),v:_(o,i,!0)}).toHexString();n.push(a)}n.push(r.toHexString());for(var s=1;s<=4;s+=1){var u=r.toHsv(),c=y()({h:x(u,s),s:w(u,s),v:_(u,s)}).toHexString();n.push(c)}return"dark"===e.theme?b.map((function(t){var r=t.index,i=t.opacity;return y.a.mix(e.backgroundColor||"#141414",n[r],100*i).toHexString()})):n}var E={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},M={},O={};Object.keys(E).forEach((function(t){M[t]=S(E[t]),M[t].primary=M[t][5],O[t]=S(E[t],{theme:"dark",backgroundColor:"#141414"}),O[t].primary=O[t][5]}));M.red,M.volcano,M.gold,M.orange,M.yellow,M.lime,M.green,M.cyan,M.blue,M.geekblue,M.purple,M.magenta,M.grey;var A,k,C,I,T=function(t,e,n){var r=v()(t),i=v()(e);return v()([(1-n)*r.red()+n*i.red(),(1-n)*r.green()+n*i.green(),(1-n)*r.blue()+n*i.blue()]).rgb()},P=function(t,e,n,r){return void 0===e&&(e="#fff"),void 0===n&&(n="default"),void 0===r&&(r="rgb(150, 150, 150)"),"default"===n?function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="rgb(150, 150, 150)");var r=T(e,t,.05).rgb().toString(),i=T(e,t,.1).rgb().toString(),o=T(e,t,.2).rgb().toString(),a=T(e,t,.4).rgb().toString(),s=T(e,n,.02).rgb().toString(),u=T(e,n,.05).rgb().toString(),c=T(e,n,.1).rgb().toString(),l=T(e,n,.2).rgb().toString(),h=T(e,n,.3).rgb().toString(),f=S(t,{theme:"default",backgroundColor:e}),d=v()(t).hex().toLowerCase(),p=f.indexOf(d),g=t;return-1!==p&&(g=f[p+1]),{mainStroke:t,mainFill:i,activeStroke:t,activeFill:r,inactiveStroke:a,inactiveFill:r,selectedStroke:t,selectedFill:e,highlightStroke:g,highlightFill:o,disableStroke:h,disableFill:u,edgeMainStroke:h,edgeActiveStroke:t,edgeInactiveStroke:l,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:c,comboMainStroke:h,comboMainFill:s,comboActiveStroke:t,comboActiveFill:r,comboInactiveStroke:h,comboInactiveFill:s,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:g,comboHighlightFill:s,comboDisableStroke:l,comboDisableFill:u}}(t,e,"rgb(150, 150, 150)"):function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="#777");var r=T(e,t,.2).rgb().toString(),i=T(e,t,.3).rgb().toString(),o=T(e,t,.6).rgb().toString(),a=T(e,t,.8).rgb().toString(),s=T(e,n,.2).rgb().toString(),u=T(e,n,.25).rgb().toString(),c=T(e,n,.3).rgb().toString(),l=T(e,n,.4).rgb().toString(),h=T(e,n,.5).rgb().toString(),f=S(t,{theme:"dark",backgroundColor:e}),d=v()(t).hex().toLowerCase(),p=f.indexOf(d),g=t;return-1!==p&&(g=f[p+1]),{mainStroke:a,mainFill:r,activeStroke:t,activeFill:i,inactiveStroke:a,inactiveFill:r,selectedStroke:t,selectedFill:r,highlightStroke:t,highlightFill:o,disableStroke:h,disableFill:u,edgeMainStroke:n,edgeActiveStroke:t,edgeInactiveStroke:n,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:c,comboMainStroke:l,comboMainFill:u,comboActiveStroke:t,comboActiveFill:s,comboInactiveStroke:l,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:g,comboHighlightFill:u,comboDisableStroke:l,comboDisableFill:s}}(t,e,"#777")},N=function(t,e,n,r){void 0===e&&(e="#fff"),void 0===n&&(n="default"),void 0===r&&(r="rgb(150, 150, 150)");var i=[];return t.forEach((function(t){i.push(P(t,e,n,r))})),i},j=P("rgb(95, 149, 255)","rgb(255, 255, 255)"),D={version:"0.5.0",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:j.mainStroke,fill:j.mainFill},size:20,color:j.mainStroke,linkPoints:{size:8,lineWidth:1,fill:j.activeFill,stroke:j.activeStroke}},nodeStateStyles:{active:{fill:j.activeFill,stroke:j.activeStroke,lineWidth:2,shadowColor:j.mainStroke,shadowBlur:10},selected:{fill:j.selectedFill,stroke:j.selectedStroke,lineWidth:4,shadowColor:j.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:j.highlightFill,stroke:j.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:j.inactiveFill,stroke:j.inactiveStroke,lineWidth:1},disable:{fill:j.disableFill,stroke:j.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:"rgb(0, 0, 0)",textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:j.edgeMainStroke,lineAppendWidth:2},color:j.edgeMainStroke},edgeStateStyles:{active:{stroke:j.edgeActiveStroke,lineWidth:1},selected:{stroke:j.edgeSelectedStroke,lineWidth:2,shadowColor:j.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:j.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:j.edgeInactiveStroke,lineWidth:1},disable:{stroke:j.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:"rgb(0, 0, 0)",textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:j.comboMainFill,lineWidth:1,stroke:j.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:j.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:j.comboActiveStroke,lineWidth:1,fill:j.comboActiveFill},selected:{stroke:j.comboSelectedStroke,lineWidth:2,fill:j.comboSelectedFill,shadowColor:j.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:j.comboHighlightStroke,lineWidth:2,fill:j.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:j.comboInactiveStroke,fill:j.comboInactiveFill,lineWidth:1},disable:{stroke:j.comboDisableStroke,fill:j.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"};function L(t,e,n){if(t){if("function"==typeof t.addEventListener)return t.addEventListener(e,n,!1),{remove:function(){t.removeEventListener(e,n,!1)}};if("function"==typeof t.attachEvent)return t.attachEvent("on"+e,n),{remove:function(){t.detachEvent("on"+e,n)}}}}function R(t){A||(A=document.createElement("table"),k=document.createElement("tr"),C=/^\s*<(\w+|!)[^>]*>/,I={tr:document.createElement("tbody"),tbody:A,thead:A,tfoot:A,td:k,th:k,"*":document.createElement("div")});var e=C.test(t)&&RegExp.$1;e&&e in I||(e="*");var n=I[e];t=t.replace(/(^\s*)|(\s*$)/g,""),n.innerHTML=""+t;var r=n.childNodes[0];return n.removeChild(r),r}function B(t,e){if(t)for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t}var G=u.Util.cloneEvent,F=u.Util.isViewportChanged,z=function(t){function e(e){var n=t.call(this,e)||this;return n.extendEvents=[],n.dragging=!1,n.preItem=null,n.graph=e,n.destroyed=!1,n.initEvents(),n}return Object(s.__extends)(e,t),e.prototype.initEvents=function(){var t=this.graph,e=this.extendEvents,n=void 0===e?[]:e,r=t.get("canvas"),i=r.get("el"),o=Object(p.wrapBehavior)(this,"onCanvasEvents"),a=Object(p.wrapBehavior)(this,"onExtendEvents"),s=Object(p.wrapBehavior)(this,"onWheelEvent");r.off("*").on("*",o),this.canvasHandler=o,n.push(L(i,"DOMMouseScroll",s)),n.push(L(i,"mousewheel",s)),"undefined"!=typeof window&&(n.push(L(window,"keydown",a)),n.push(L(window,"keyup",a)),n.push(L(window,"focus",a)))},e.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},e.prototype.onCanvasEvents=function(t){var n=this.graph,r=n.get("canvas"),i=t.target,o=t.type;t.canvasX=t.x,t.canvasY=t.y;var a={x:t.canvasX,y:t.canvasY},s=n.get("group").getMatrix();if(s||(s=[1,0,0,0,1,0,0,0,1]),F(s)&&(a=n.getPointByClient(t.clientX,t.clientY)),t.x=a.x,t.y=a.y,t.currentTarget=n,i===r)return"mousemove"!==o&&"mouseleave"!==o||this.handleMouseMove(t,"canvas"),t.target=r,t.item=null,n.emit(o,t),void n.emit("canvas:"+o,t);var u=e.getItemRoot(i);if(u){var c=u.get("item");if(!c.destroyed){var l=c.getType();if(t.target=i,t.item=c,t.canvasX===t.x&&t.canvasY===t.y){var h=n.getCanvasByPoint(t.x,t.y);t.canvasX=h.x,t.canvasY=h.y}n.emit(o,t),t.name&&!t.name.includes(":")?n.emit(l+":"+o,t):n.emit(t.name,t),"dragstart"===o&&(this.dragging=!0),"dragend"===o&&(this.dragging=!1),"mousemove"===o&&this.handleMouseMove(t,l)}}else n.emit(o,t)},e.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},e.prototype.onWheelEvent=function(t){Object(p.isNil)(t.wheelDelta)&&(t.wheelDelta=-t.detail),this.graph.emit("wheel",t)},e.prototype.handleMouseMove=function(t,e){var n=this.graph,r=this.preItem,i=n.get("canvas"),o=t.target===i?null:t.item;t=G(t),r&&r!==o&&!r.destroyed&&(t.item=r,this.emitCustomEvent(r.getType(),"mouseleave",t),this.dragging&&this.emitCustomEvent(r.getType(),"dragleave",t)),o&&r!==o&&(t.item=o,this.emitCustomEvent(e,"mouseenter",t),this.dragging&&this.emitCustomEvent(e,"dragenter",t)),this.preItem=o},e.prototype.emitCustomEvent=function(t,e,n){n.type=e,this.graph.emit(t+":"+e,n)},e.prototype.destroy=function(){var t=this.graph,e=this.canvasHandler,n=this.extendEvents;t.get("canvas").off("*",e),Object(p.each)(n,(function(t){t.remove()})),this.dragging=!1,this.preItem=null,this.extendEvents.length=0,this.canvasHandler=null,this.destroyed=!0},e}(u.AbstractEvent);class U{constructor(){this.nodes=[],this.edges=[],this.combos=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=()=>{}}layout(t){return this.init(t),this.execute(!0)}init(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[]}execute(t){}executeWithWorker(){}getDefaultCfg(){return{}}updateCfg(t){t&&Object.assign(this,t)}getType(){return"base"}destroy(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0}}const V=t=>"string"==typeof t,W=/-(\w)/g,Y=((t=>{const e=Object.create(null)})(t=>t.replace(W,(t,e)=>e?e.toUpperCase():"")),Array.isArray),X=t=>"number"==typeof t,H=t=>Number.isNaN(Number(t)),q=t=>null!==t&&"object"==typeof t,K=t=>{if(null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){const e=[];return t.forEach(t=>{e.push(t)}),e.map(t=>K(t))}if("object"==typeof t&&t!=={}){const e=Object.assign({},t);return Object.keys(e).forEach(t=>{e[t]=K(e[t])}),e}return t},Z=(t,e)=>{const n=t[e];return q(n)?n.cell:n},$=(t,e,n)=>{const r=[];for(let e=0;e<t;e++)r[e]=0;return n?(n.forEach(t=>{const n=Z(t,"source"),i=Z(t,"target");n&&(r[e[n]]+=1),i&&(r[e[i]]+=1)}),r):r},Q=t=>{const e=[],n=t.length;for(let r=0;r<n;r+=1){e[r]=[];for(let i=0;i<n;i+=1)r===i?e[r][i]=0:0!==t[r][i]&&t[r][i]?e[r][i]=t[r][i]:e[r][i]=1/0}for(let t=0;t<n;t+=1)for(let r=0;r<n;r+=1)for(let i=0;i<n;i+=1)e[r][i]>e[r][t]+e[t][i]&&(e[r][i]=e[r][t]+e[t][i]);return e},J=(t,e)=>{const{nodes:n,edges:r}=t,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((t,e)=>{o[t.id]=e;i.push([])}),r&&r.forEach(t=>{const n=Z(t,"source"),r=Z(t,"target"),a=o[n],s=o[r];i[a][s]=1,e||(i[s][a]=1)}),i},tt=(t,e)=>{if(t&&t.children)for(let n=t.children.length-1;n>=0;n--)if(!tt(t.children[n],e))return;return!!e(t)},et=(t,e)=>{"function"==typeof e&&tt(t,e)},nt=t=>"function"==typeof t,rt=new Map,it=(t,e)=>{if(rt.get(t)&&console.warn(`The layout with the name ${t} exists already, it will be overridden`),q(e)){class n extends U{constructor(t){super();const n=this,r={},i=n.getDefaultCfg();Object.assign(r,i,e,t),Object.keys(r).forEach(t=>{const e=r[t];n[t]=e})}}rt.set(t,n)}else rt.set(t,e);return rt.get(t)};class ot extends U{constructor(t){super(),this.begin=[0,0],this.preventOverlap=!0,this.preventOverlapPadding=10,this.condense=!1,this.sortBy="degree",this.nodeSize=30,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.row=0,this.col=0,this.cellWidth=0,this.cellHeight=0,this.cellUsed={},this.id2manPos={},this.onLayoutEnd=()=>{},this.updateCfg(t)}getDefaultCfg(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}}execute(){const t=this,e=t.nodes,n=t.edges,r=e.length,i=t.begin;if(0===r)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n};if(1===r)return e[0].x=i[0],e[0].y=i[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n};const o=[];e.forEach(t=>{o.push(t)});const a={};if(o.forEach((t,e)=>{a[t.id]=e}),("degree"===t.sortBy||!V(t.sortBy)||void 0===o[0][t.sortBy])&&(t.sortBy="degree",H(e[0].degree))){const t=$(o.length,a,n);o.forEach((e,n)=>{e.degree=t[n]})}o.sort((e,n)=>n[t.sortBy]-e[t.sortBy]),t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);const s=t.rows,u=null!=t.cols?t.cols:t.columns;if(t.cells=r,null!=s&&null!=u?(t.rows=s,t.cols=u):null!=s&&null==u?(t.rows=s,t.cols=Math.ceil(t.cells/t.rows)):null==s&&null!=u?(t.cols=u,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.cols*t.rows>t.cells){const e=t.small(),n=t.large();(e-1)*n>=t.cells?t.small(e-1):(n-1)*e>=t.cells&&t.large(n-1)}else for(;t.cols*t.rows<t.cells;){const e=t.small(),n=t.large();(n+1)*e>=t.cells?t.large(n+1):t.small(e+1)}t.cellWidth=t.width/t.cols,t.cellHeight=t.height/t.rows,t.condense&&(t.cellWidth=0,t.cellHeight=0),t.preventOverlap&&o.forEach(e=>{let n,r;e.x&&e.y||(e.x=0,e.y=0),Y(e.size)?(n=e.size[0],r=e.size[1]):X(e.size)?(n=e.size,r=e.size):q(e.size)&&(n=e.size.width,r=e.size.height),void 0!==n&&void 0!==r||(Y(t.nodeSize)?(n=t.nodeSize[0],r=t.nodeSize[1]):X(t.nodeSize)?(n=t.nodeSize,r=t.nodeSize):(n=30,r=30));const i=t.preventOverlapPadding,o=n+i,a=r+i;t.cellWidth=Math.max(t.cellWidth,o),t.cellHeight=Math.max(t.cellHeight,a)}),t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(let e=0;e<o.length;e++){const n=o[e];let r;if(t.position&&(r=t.position(n)),r&&(void 0!==r.row||void 0!==r.col)){const e={row:r.row,col:r.col};if(void 0===e.col)for(e.col=0;t.used(e.row,e.col);)e.col++;else if(void 0===e.row)for(e.row=0;t.used(e.row,e.col);)e.row++;t.id2manPos[n.id]=e,t.use(e.row,e.col)}t.getPos(n)}return t.onLayoutEnd&&t.onLayoutEnd(),{edges:n,nodes:o}}small(t){const e=this;let n;const r=e.rows||5,i=e.cols||5;if(null==t)n=Math.min(r,i);else{Math.min(r,i)===e.rows?e.rows=t:e.cols=t}return n}large(t){const e=this;let n;const r=e.rows||5,i=e.cols||5;if(null==t)n=Math.max(r,i);else{Math.max(r,i)===e.rows?e.rows=t:e.cols=t}return n}used(t,e){return this.cellUsed[`c-${t}-${e}`]||!1}use(t,e){this.cellUsed[`c-${t}-${e}`]=!0}moveToNextCell(){const t=this,e=t.cols||5;t.col++,t.col>=e&&(t.col=0,t.row++)}getPos(t){const e=this,n=e.begin,r=e.cellWidth,i=e.cellHeight;let o,a;const s=e.id2manPos[t.id];if(s)o=s.col*r+r/2+n[0],a=s.row*i+i/2+n[1];else{for(;e.used(e.row,e.col);)e.moveToNextCell();o=e.col*r+r/2+n[0],a=e.row*i+i/2+n[1],e.use(e.row,e.col),e.moveToNextCell()}t.x=o,t.y=a}getType(){return"grid"}}class at extends U{constructor(t){super(),this.center=[0,0],this.width=300,this.height=300,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.updateCfg(t)}getDefaultCfg(){return{center:[0,0],width:300,height:300}}execute(){const 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(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}}getType(){return"random"}}const st=(t,e)=>{let n;return n=t?X(t)?e=>t:t:t=>e||1,n};class ut extends U{constructor(t){super(),this.maxIteration=1e3,this.workerEnabled=!1,this.edgeStrength=200,this.nodeStrength=1e3,this.coulombDisScale=.005,this.damping=.9,this.maxSpeed=1e3,this.minMovement=.5,this.interval=.02,this.factor=1,this.linkDistance=1,this.gravity=10,this.preventOverlap=!0,this.tick=()=>{},this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.updateCfg(t)}getDefaultCfg(){return{maxIteration:500,gravity:10,enableTick:!0}}execute(){var t,e;const n=this,r=n.nodes;if(void 0!==n.timeInterval&&"undefined"!=typeof window&&window.clearInterval(n.timeInterval),!r||0===r.length)return void(null===(t=n.onLayoutEnd)||void 0===t||t.call(n));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]);const i=n.center;if(1===r.length)return r[0].x=i[0],r[0].y=i[1],void(null===(e=n.onLayoutEnd)||void 0===e||e.call(n));const o={},a={};r.forEach((t,e)=>{X(t.x)||(t.x=Math.random()*n.width),X(t.y)||(t.y=Math.random()*n.height),o[t.id]=t,a[t.id]=e}),n.nodeMap=o,n.nodeIdxMap=a,n.linkDistance=st(n.linkDistance,1),n.nodeStrength=st(n.nodeStrength,1),n.edgeStrength=st(n.edgeStrength,1);const s=n.nodeSize;let u;if(n.preventOverlap){const t=n.nodeSpacing;let e;e=X(t)?()=>t:nt(t)?t:()=>0,u=s?Y(s)?t=>(s[0]>s[1]?s[0]:s[1])+e(t):t=>s+e(t):t=>{if(t.size){if(Y(t.size)){return(t.size[0]>t.size[1]?t.size[0]:t.size[1])+e(t)}if(q(t.size)){return(t.size.width>t.size.height?t.size.width:t.size.height)+e(t)}return t.size+e(t)}return 10+e(t)}}n.nodeSize=u;const c=n.edges;n.degrees=$(r.length,n.nodeIdxMap,c),n.getMass||(n.getMass=t=>n.degrees[n.nodeIdxMap[t.id]]||1),n.run()}run(){var t;const e=this,{maxIteration:n,nodes:r,workerEnabled:i,minMovement:o}=e;if(r)if(i){for(let t=0;t<n;t++){const n=e.runOneStep(t);if(e.reachMoveThreshold(r,n,o))break}null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;let t=0;this.timeInterval=window.setInterval(()=>{var i,a;if(!r)return;const s=e.runOneStep(t)||[];e.reachMoveThreshold(r,s,o)&&(null===(i=e.onLayoutEnd)||void 0===i||i.call(e),window.clearInterval(e.timeInterval)),t++,t>=n&&(null===(a=e.onLayoutEnd)||void 0===a||a.call(e),window.clearInterval(e.timeInterval))},0)}}reachMoveThreshold(t,e,n){let r=0;return t.forEach((t,n)=>{const i=t.x-e[n].x,o=t.y-e[n].y;r+=Math.sqrt(i*i+o*o)}),r/=t.length,r<n}runOneStep(t){var e;const{nodes:n,edges:r}=this,i=[],o=[];if(!n)return;n.forEach((t,e)=>{i[2*e]=0,i[2*e+1]=0,o[2*e]=0,o[2*e+1]=0}),this.calRepulsive(i,n),r&&this.calAttractive(i,r),this.calGravity(i,n);const a=Math.max(.02,this.interval-.002*t);this.updateVelocity(i,o,a,n);const s=[];return n.forEach(t=>{s.push({x:t.x,y:t.y})}),this.updatePosition(o,a,n),null===(e=this.tick)||void 0===e||e.call(this),s}calRepulsive(t,e){const n=this.getMass,r=this.nodeStrength,i=this.factor,o=this.coulombDisScale,a=this.preventOverlap,s=this.nodeSize;e.forEach((u,c)=>{const l=n?n(u):1;e.forEach((e,h)=>{if(c>=h)return;const f=u.x-e.x,d=u.y-e.y,p=Math.sqrt(f*f+d*d)+.01,g=(p+.1)*o,v=f/p,m=d/p,y=(r(u)+r(e))/2*i/(g*g),b=n?n(e):1;if(t[2*c]+=v*y,t[2*c+1]+=m*y,t[2*h]-=v*y,t[2*h+1]-=m*y,a&&p<(s(u)+s(e))/2){const n=(r(u)+r(e))/2/(p*p);t[2*c]+=v*n/l,t[2*c+1]+=m*n/l,t[2*h]-=v*n/b,t[2*h+1]-=m*n/b}})})}calAttractive(t,e){const n=this.nodeMap,r=this.nodeIdxMap,i=this.linkDistance,o=this.edgeStrength,a=this.getMass;e.forEach((e,s)=>{const u=Z(e,"source"),c=Z(e,"target"),l=n[u],h=n[c],f=h.x-l.x,d=h.y-l.y,p=Math.sqrt(f*f+d*d)+.01,g=f/p,v=d/p,m=((i(e)||1)-p)*o(e),y=r[u],b=r[c],x=a?a(l):1,w=a?a(h):1;t[2*y]-=g*m/x,t[2*y+1]-=v*m/x,t[2*b]+=g*m/w,t[2*b+1]+=v*m/w})}calGravity(t,e){const n=this,r=n.center,i=n.gravity,o=n.degrees,a=e.length;for(let s=0;s<a;s++){const a=e[s];let u=a.x-r[0],c=a.y-r[1],l=i;if(n.getCenter){const t=n.getCenter(a,o[s]);t&&X(t[0])&&X(t[1])&&X(t[2])&&(u=a.x-t[0],c=a.y-t[1],l=t[2])}l&&(t[2*s]-=l*u,t[2*s+1]-=l*c)}}updateVelocity(t,e,n,r){const i=this,o=n*i.damping;r.forEach((n,r)=>{let a=t[2*r]*o||.01,s=t[2*r+1]*o||.01;const u=Math.sqrt(a*a+s*s);if(u>i.maxSpeed){const t=i.maxSpeed/u;a*=t,s*=t}e[2*r]=a,e[2*r+1]=s})}updatePosition(t,e,n){n.forEach((n,r)=>{if(X(n.fx)&&X(n.fy))return n.x=n.fx,void(n.y=n.fy);const i=t[2*r]*e,o=t[2*r+1]*e;n.x+=i,n.y+=o})}stop(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)}destroy(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0}getType(){return"gForce"}}function ct(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,c,l,h,f,d=t._root,p={data:r},g=t._x0,v=t._y0,m=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(o=(g+m)/2))?g=o:m=o,(l=n>=(a=(v+y)/2))?v=a:y=a,i=d,!(d=d[h=l<<1|c]))return i[h]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===s&&n===u)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(o=(g+m)/2))?g=o:m=o,(l=n>=(a=(v+y)/2))?v=a:y=a}while((h=l<<1|c)==(f=(u>=a)<<1|s>=o));return i[f]=d,i[h]=p,t}var lt=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function ht(t){return t[0]}function ft(t){return t[1]}function dt(t,e,n){var r=new pt(null==e?ht:e,null==n?ft:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function pt(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function gt(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var vt=dt.prototype=pt.prototype;vt.copy=function(){var t,e,n=new pt(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=gt(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=gt(e));return n},vt.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return ct(this.cover(e,n),e,n,t)},vt.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,c=1/0,l=-1/0,h=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<u&&(u=r),r>l&&(l=r),i<c&&(c=i),i>h&&(h=i));if(u>l||c>h)return this;for(this.cover(u,c).cover(l,h),n=0;n<o;++n)ct(this,a[n],s[n],t[n]);return this},vt.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,u=i-n||1,c=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},vt.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},vt.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]]},vt.find=function(t,e,n){var r,i,o,a,s,u,c,l=this._x0,h=this._y0,f=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new lt(g,l,h,f,d)),null==n?n=1/0:(l=t-n,h=e-n,f=t+n,d=e+n,n*=n);u=p.pop();)if(!(!(g=u.node)||(i=u.x0)>f||(o=u.y0)>d||(a=u.x1)<l||(s=u.y1)<h))if(g.length){var v=(i+a)/2,m=(o+s)/2;p.push(new lt(g[3],v,m,a,s),new lt(g[2],i,m,v,s),new lt(g[1],v,o,a,m),new lt(g[0],i,o,v,m)),(c=(e>=m)<<1|t>=v)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var y=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=y*y+b*b;if(x<n){var w=Math.sqrt(n=x);l=t-w,h=e-w,f=t+w,d=e+w,r=g.data}}return r},vt.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,c,l,h,f,d=this._root,p=this._x0,g=this._y0,v=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((c=o>=(s=(p+v)/2))?p=s:v=s,(l=a>=(u=(g+m)/2))?g=u:m=u,e=d,!(d=d[h=l<<1|c]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,f=h)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[h]=i:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[f]=d:this._root=d),this):(this._root=i,this)},vt.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},vt.root=function(){return this._root},vt.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},vt.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new lt(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var c=(r+o)/2,l=(i+a)/2;(n=u[3])&&s.push(new lt(n,c,l,o,a)),(n=u[2])&&s.push(new lt(n,r,l,c,a)),(n=u[1])&&s.push(new lt(n,c,i,o,l)),(n=u[0])&&s.push(new lt(n,r,i,c,l))}return this},vt.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new lt(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,c=e.y1,l=(a+u)/2,h=(s+c)/2;(o=i[0])&&n.push(new lt(o,a,s,l,h)),(o=i[1])&&n.push(new lt(o,l,s,u,h)),(o=i[2])&&n.push(new lt(o,a,h,l,c)),(o=i[3])&&n.push(new lt(o,l,h,u,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},vt.x=function(t){return arguments.length?(this._x=t,this):this._x},vt.y=function(t){return arguments.length?(this._y=t,this):this._y};var mt=function(t){return function(){return t}},yt=function(t){return 1e-6*(t()-.5)},bt={value:()=>{}};function xt(){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 wt(r)}function wt(t){this._=t}function _t(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function St(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Et(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=bt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}wt.prototype=xt.prototype={constructor:wt,on:function(t,e){var n,r=this._,i=_t(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=Et(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Et(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=St(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new wt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var Mt,Ot,At=xt,kt=0,Ct=0,It=0,Tt=0,Pt=0,Nt=0,jt="object"==typeof performance&&performance.now?performance:Date,Dt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Lt(){return Pt||(Dt(Rt),Pt=jt.now()+Nt)}function Rt(){Pt=0}function Bt(){this._call=this._time=this._next=null}function Gt(t,e,n){var r=new Bt;return r.restart(t,e,n),r}function Ft(){Pt=(Tt=jt.now())+Nt,kt=Ct=0;try{!function(){Lt(),++kt;for(var t,e=Mt;e;)(t=Pt-e._time)>=0&&e._call.call(null,t),e=e._next;--kt}()}finally{kt=0,function(){var t,e,n=Mt,r=1/0;for(;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:Mt=e);Ot=t,Ut(r)}(),Pt=0}}function zt(){var t=jt.now(),e=t-Tt;e>1e3&&(Nt-=e,Tt=t)}function Ut(t){kt||(Ct&&(Ct=clearTimeout(Ct)),t-Pt>24?(t<1/0&&(Ct=setTimeout(Ft,t-jt.now()-Nt)),It&&(It=clearInterval(It))):(It||(Tt=jt.now(),It=setInterval(zt,1e3)),kt=1,Dt(Ft)))}Bt.prototype=Gt.prototype={constructor:Bt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Lt():+n)+(null==e?0:+e),this._next||Ot===this||(Ot?Ot._next=this:Mt=this,Ot=this),this._call=t,this._time=n,Ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ut())}};function Vt(t){return t.x}function Wt(t){return t.y}var Yt=Math.PI*(3-Math.sqrt(5)),Xt=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=Gt(h),c=At("tick","end"),l=function(){let t=1;return()=>(t=(1664525*t+1013904223)%4294967296)/4294967296}();function h(){f(),c.call("tick",e),n<r&&(u.stop(),c.call("end",e))}function f(r){var u,c,l=t.length;void 0===r&&(r=1);for(var h=0;h<r;++h)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),u=0;u<l;++u)null==(c=t[u]).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 d(){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 i=10*Math.sqrt(.5+n),o=n*Yt;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,l),e}return null==t&&(t=[]),d(),e={tick:f,restart:function(){return u.restart(h),e},stop:function(){return u.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.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?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(l=t,s.forEach(p),e):l},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c<l;++c)(a=(i=e-(s=t[c]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}},Ht=function(){var t,e,n,r,i,o=mt(-30),a=1,s=1/0,u=.81;function c(n){var i,o=t.length,a=dt(t,Vt,Wt).visitAfter(h);for(r=n,i=0;i<o;++i)e=t[i],a.visit(f)}function l(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function h(t){var e,n,r,o,a,s=0,u=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,r+=n*e.x,o+=n*e.y);t.x=r/u,t.y=o/u}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function f(t,o,c,l){if(!t.value)return!0;var h=t.x-e.x,f=t.y-e.y,d=l-o,p=h*h+f*f;if(d*d/u<p)return p<s&&(0===h&&(p+=(h=yt(n))*h),0===f&&(p+=(f=yt(n))*f),p<a&&(p=Math.sqrt(a*p)),e.vx+=h*t.value*r/p,e.vy+=f*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===h&&(p+=(h=yt(n))*h),0===f&&(p+=(f=yt(n))*f),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=h*d,e.vy+=f*d)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,l()},c.strength=function(t){return arguments.length?(o="function"==typeof t?t:mt(+t),l(),c):o},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c.theta=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c};function qt(t){return t.index}function Kt(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}var Zt=function(t){var e,n,r,i,o,a,s=qt,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=mt(30),l=1;function h(r){for(var i=0,s=t.length;i<l;++i)for(var u,c,h,f,d,p,g,v=0;v<s;++v)c=(u=t[v]).source,f=(h=u.target).x+h.vx-c.x-c.vx||yt(a),d=h.y+h.vy-c.y-c.vy||yt(a),f*=p=((p=Math.sqrt(f*f+d*d))-n[v])/p*r*e[v],d*=p,h.vx-=f*(g=o[v]),h.vy-=d*g,c.vx+=f*(g=1-g),c.vy+=d*g}function f(){if(r){var a,u,c=r.length,l=t.length,h=new Map(r.map((t,e)=>[s(t,e,r),t]));for(a=0,i=new Array(c);a<l;++a)(u=t[a]).index=a,"object"!=typeof u.source&&(u.source=Kt(h,u.source)),"object"!=typeof u.target&&(u.target=Kt(h,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(a=0,o=new Array(l);a<l;++a)u=t[a],o[a]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);e=new Array(l),d(),n=new Array(l),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),h.initialize=function(t,e){r=t,a=e,f()},h.links=function(e){return arguments.length?(t=e,f(),h):t},h.id=function(t){return arguments.length?(s=t,h):s},h.iterations=function(t){return arguments.length?(l=+t,h):l},h.strength=function(t){return arguments.length?(u="function"==typeof t?t:mt(+t),d(),h):u},h.distance=function(t){return arguments.length?(c="function"==typeof t?t:mt(+t),p(),h):c},h};function $t(t){return t.x+t.vx}function Qt(t){return t.y+t.vy}var Jt=function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,c,l,h,f,d=e.length,p=0;p<o;++p)for(a=dt(e,$t,Qt).visitAfter(s),t=0;t<d;++t)u=e[t],h=n[u.index],f=h*h,c=u.x+u.vx,l=u.y+u.vy,a.visit(g);function g(t,e,n,o,a){var s=t.data,d=t.r,p=h+d;if(!s)return e>c+p||o<c-p||n>l+p||a<l-p;if(s.index>u.index){var g=c-s.x-s.vx,v=l-s.y-s.vy,m=g*g+v*v;m<p*p&&(0===g&&(m+=(g=yt(r))*g),0===v&&(m+=(v=yt(r))*v),m=(p-(m=Math.sqrt(m)))/m*i,u.vx+=(g*=m)*(p=(d*=d)/(f+d)),u.vy+=(v*=m)*p,s.vx-=g*(p=1-p),s.vy-=v*p)}}}function s(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 u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=mt(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,u()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:mt(+e),u(),a):t},a};function te(){function t(t){return()=>t}let e,n=t=>t.cluster,r=t(1),i=t(-1),o=t(100),a=t(.1),s=[0,0],u=[],c={},l=[],h=100,f=100,d={none:{x:0,y:0}},p=[],g="force",v=!0,m=.1;function y(t){if(!v)return y;e.tick(),x();for(let e,r=0,i=u.length,o=t*m;r<i;++r)e=u[r],e.vx+=(d[n(e)].x-e.x)*o,e.vy+=(d[n(e)].y-e.y)*o}function b(){u&&function(){if(!u||!u.length)return;if(void 0===n(u[0]))throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");const t=function(){const t=[],e=[],i={};let o=[],a={},s=[];return a=function(t){const e={};return t.forEach(t=>{const r=n(t);e[r]||(e[r]={count:0,sumforceNodeSize:0})}),t.forEach(t=>{const i=n(t),o=r(t),a=e[i];a.count=a.count+1,a.sumforceNodeSize=a.sumforceNodeSize+Math.PI*(o*o)*1.3,e[i]=a}),e}(u),s=function(t){const e={},r=[];t.forEach(t=>{const r=function(t){const e=Z(t,"source"),r=Z(t,"target"),i=n(c[e]),o=n(c[r]);return i<=o?`${i}~${o}`:`${o}~${i}`}(t);let i=0;void 0!==e[r]&&(i=e[r]),i+=1,e[r]=i});return Object.entries(e).forEach(([t,e])=>{const n=t.split("~")[0],i=t.split("~")[1];void 0!==n&&void 0!==i&&r.push({source:n,target:i,count:e})}),r}(l),o=Object.keys(a),o.forEach((e,n)=>{const r=a[e];t.push({id:e,size:r.count,r:Math.sqrt(r.sumforceNodeSize/Math.PI)}),i[e]=n}),s.forEach(t=>{const n=Z(t,"source"),r=Z(t,"target"),o=i[n],a=i[r];void 0!==o&&void 0!==a&&e.push({source:o,target:a,count:t.count})}),{nodes:t,links:e}}();e=Xt(t.nodes).force("x",function(t){var e,n,r,i=mt(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=mt(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:mt(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:mt(+e),a(),o):t},o}(h).strength(.1)).force("y",function(t){var e,n,r,i=mt(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=mt(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:mt(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:mt(+e),a(),o):t},o}(f).strength(.1)).force("collide",Jt(t=>t.r).iterations(4)).force("charge",Ht().strength(i)).force("links",Zt(t.nodes.length?t.links:[]).distance(o).strength(a)),p=e.nodes(),x()}()}function x(){return d={none:{x:0,y:0}},p.forEach(t=>{d[t.id]={x:t.x-s[0],y:t.y-s[1]}}),d}function w(t){c={},t.forEach(t=>{c[t.id]=t})}return y.initialize=t=>{u=t,b()},y.template=function(t){return arguments.length?(g=t,b(),y):g},y.groupBy=function(t){return arguments.length?"string"==typeof t?(n=e=>e[t],y):(n=t,y):n},y.enableGrouping=function(t){return arguments.length?(v=t,y):v},y.strength=function(t){return arguments.length?(m=t,y):m},y.centerX=function(t){return arguments.length?(h=t,y):h},y.centerY=function(t){return arguments.length?(f=t,y):f},y.nodes=function(t){return arguments.length?(w(t||[]),u=t||[],y):u},y.links=function(t){return arguments.length?(l=t||[],b(),y):l},y.forceNodeSize=function(e){return arguments.length?(r="function"==typeof e?e:t(+e),b(),y):r},y.nodeSize=y.forceNodeSize,y.forceCharge=function(e){return arguments.length?(i="function"==typeof e?e:t(+e),b(),y):i},y.forceLinkDistance=function(e){return arguments.length?(o="function"==typeof e?e:t(+e),b(),y):o},y.forceLinkStrength=function(e){return arguments.length?(a="function"==typeof e?e:t(+e),b(),y):a},y.offset=function(t){return arguments.length?(s=t,y):s},y.getFocis=x,y}const ee="LAYOUT_TICK",ne="GPU_LAYOUT_END";class re extends U{constructor(t){super(),this.center=[0,0],this.nodeStrength=null,this.edgeStrength=null,this.preventOverlap=!1,this.clusterNodeStrength=null,this.clusterEdgeStrength=null,this.clusterEdgeDistance=null,this.clusterNodeSize=null,this.clusterFociStrength=null,this.linkDistance=50,this.alphaDecay=.028,this.alphaMin=.001,this.alpha=.3,this.collideStrength=1,this.workerEnabled=!1,this.tick=()=>{},this.onLayoutEnd=()=>{},this.ticking=void 0,t&&this.updateCfg(t)}getDefaultCfg(){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(){},onLayoutEnd(){},workerEnabled:!1}}init(t){this.nodes=t.nodes||[];const e=t.edges||[];this.edges=e.map(t=>{const e={},n=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(t).forEach(r=>{n.indexOf(r)>-1||(e[r]=t[r])}),e}),this.ticking=!1}execute(t){const e=this,n=e.nodes,r=e.edges;if(e.ticking)return;let i=e.forceSimulation;const o=e.alphaMin,a=e.alphaDecay,s=e.alpha;if(i){if(t)if(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),i.nodes(n),r&&e.edgeForce)e.edgeForce.links(r);else if(r&&!e.edgeForce){const t=Zt().id(t=>t.id).links(r);e.edgeStrength&&t.strength(e.edgeStrength),e.linkDistance&&t.distance(e.linkDistance),e.edgeForce=t,i.force("link",t)}e.preventOverlap&&e.overlapProcess(i),i.alpha(s).restart(),this.ticking=!0}else try{const t=Ht();if(e.nodeStrength&&t.strength(e.nodeStrength),i=Xt().nodes(n),e.clustering){const t=te();t.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&t.links(r),n&&t.nodes(n),t.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=t,i.force("group",t)}if(i.force("center",function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i<a;++i)s+=(o=n[i]).x,u+=o.y;for(s=(s/a-t)*r,u=(u/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=u}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}(e.center[0],e.center[1])).force("charge",t).alpha(s).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),r){const t=Zt().id(t=>t.id).links(r);e.edgeStrength&&t.strength(e.edgeStrength),e.linkDistance&&t.distance(e.linkDistance),e.edgeForce=t,i.force("link",t)}if(e.workerEnabled&&!ie()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();const t=function(t){const e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),i=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i);for(let e=1;e<=t;e++)i.tick(),postMessage({nodes:n,currentTick:e,totalTicks:t,type:ee},void 0);e.ticking=!1}else i.on("tick",()=>{e.tick()}).on("end",()=>{e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()}),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}overlapProcess(t){const e=this.nodeSize,n=this.nodeSpacing;let r,i;const o=this.collideStrength;if(i=X(n)?()=>n:nt(n)?n:()=>0,e)if(nt(e))r=t=>e(t)+i(t);else if(Y(e)){const t=(e[0]>e[1]?e[0]:e[1])/2;r=e=>t+i(e)}else if(X(e)){const t=e/2;r=e=>t+i(e)}else r=()=>10;else r=t=>{if(t.size){if(Y(t.size)){return(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+i(t)}if(q(t.size)){return(t.size.width>t.size.height?t.size.width:t.size.height)/2+i(t)}return t.size/2+i(t)}return 10+i(t)};t.force("collisionForce",Jt(r).strength(o))}updateCfg(t){const e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.forceSimulation=null,Object.assign(e,t)}destroy(){const t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0}}function ie(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}function oe(t,e){const n=t.degree,r=e.degree;return n<r?-1:n>r?1:0}class ae extends U{constructor(t){super(),this.radius=null,this.startRadius=null,this.endRadius=null,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.divisions=1,this.ordering=null,this.angleRatio=1,this.nodes=[],this.edges=[],this.nodeMap={},this.degrees=[],this.width=300,this.height=300,this.updateCfg(t)}getDefaultCfg(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}}execute(){const t=this,e=t.nodes,n=t.edges,r=e.length;if(0===r)return void(t.onLayoutEnd&&t.onLayoutEnd());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]);const i=t.center;if(1===r)return e[0].x=i[0],e[0].y=i[1],void(t.onLayoutEnd&&t.onLayoutEnd());let o=t.radius,a=t.startRadius,s=t.endRadius;const u=t.divisions,c=t.startAngle,l=t.endAngle,h=(l-c)/r,f={};e.forEach((t,e)=>{f[t.id]=e}),t.nodeMap=f;const d=$(e.length,f,n);t.degrees=d,o||a||s?!a&&s?a=s:a&&!s&&(s=a):o=t.height>t.width?t.width/2:t.height/2;const p=h*t.angleRatio,g=t.ordering;let v=[];v="topology"===g?t.topologyOrdering():"topology-directed"===g?t.topologyOrdering(!0):"degree"===g?t.degreeOrdering():e;const m=t.clockwise,y=Math.ceil(r/u);for(let t=0;t<r;++t){let e=o;e||null===a||null===s||(e=a+t*(s-a)/(r-1)),e||(e=10+100*t/(r-1));let n=c+t%y*p+2*Math.PI/u*Math.floor(t/y);m||(n=l-t%y*p-2*Math.PI/u*Math.floor(t/y)),v[t].x=i[0]+Math.cos(n)*e,v[t].y=i[1]+Math.sin(n)*e,v[t].weight=d[t]}return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:v,edges:this.edges}}topologyOrdering(t=!1){const e=this.degrees,n=this.edges,r=this.nodes,i=K(r),o=this.nodeMap,a=[i[0]],s=[r[0]],u=[],c=r.length;u[0]=!0,function(t,e,n,r){t.forEach((e,n)=>{t[n].children=[],t[n].parent=[]}),r?e.forEach(e=>{const r=Z(e,"source"),i=Z(e,"target");let o=0;r&&(o=n[r]);let a=0;i&&(a=n[i]);const s=t[o].children,u=t[a].parent;s.push(t[a].id),u.push(t[o].id)}):e.forEach(e=>{const r=Z(e,"source"),i=Z(e,"target");let o=0;r&&(o=n[r]);let a=0;i&&(a=n[i]);const s=t[o].children,u=t[a].children;s.push(t[a].id),u.push(t[o].id)})}(i,n,o,t);let l=0;return i.forEach((t,h)=>{if(0!==h)if(h!==c-1&&e[h]===e[h+1]&&!function(t,e,n){const r=n.length;for(let i=0;i<r;i++){const r=Z(n[i],"source"),o=Z(n[i],"target");if(t.id===r&&e.id===o||e.id===r&&t.id===o)return!0}return!1}(a[l],t,n)||u[h]){const t=a[l].children;let n=!1;for(let c=0;c<t.length;c++){const l=o[t[c]];if(e[l]===e[h]&&!u[l]){a.push(i[l]),s.push(r[o[i[l].id]]),u[l]=!0,n=!0;break}}let f=0;for(;!n&&(u[f]||(a.push(i[f]),s.push(r[o[i[f].id]]),u[f]=!0,n=!0),f++,f!==c););}else a.push(t),s.push(r[o[t.id]]),u[h]=!0,l++}),s}degreeOrdering(){const t=this.nodes,e=[],n=this.degrees;return t.forEach((t,r)=>{t.degree=n[r],e.push(t)}),e.sort(oe),e}getType(){return"circular"}}var se=n(146),ue=n.n(se);class ce extends U{constructor(t){super(),this.rankdir="TB",this.nodesep=50,this.ranksep=50,this.controlPoints=!1,this.sortByCombo=!1,this.edgeLabelSpace=!0,this.keepNodeOrder=!1,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.layoutNode=t=>{const{nodes:e}=this,n=e.find(e=>e.id===t);if(n){return!1!==n.layout}return!0},this.updateCfg(t)}getDefaultCfg(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1}}execute(){const t=this,{nodes:e,nodeSize:n,rankdir:r,combos:i}=t;if(!e)return;const o=t.edges||[],a=new ue.a.graphlib.Graph({multigraph:!0,compound:!0});let s;s=n?Y(n)?()=>n:()=>[n,n]:t=>t.size?Y(t.size)?t.size:q(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40];let u=le(t.nodesepFunc,t.nodesep,50),c=le(t.ranksepFunc,t.ranksep,50);"LR"!==r&&"RL"!==r||(u=le(t.ranksepFunc,t.ranksep,50),c=le(t.nodesepFunc,t.nodesep,50)),a.setDefaultEdgeLabel(()=>({})),a.setGraph(t);const l={};e.filter(t=>!1!==t.layout).forEach(t=>{const e=s(t),n=c(t),r=u(t),i=e[0]+2*r,o=e[1]+2*n,h=t.layer;X(h)?a.setNode(t.id,{width:i,height:o,layer:h}):a.setNode(t.id,{width:i,height:o}),this.sortByCombo&&t.comboId&&(l[t.comboId]||(l[t.comboId]=!0,a.setNode(t.comboId,{})),a.setParent(t.id,t.comboId))}),this.sortByCombo&&i&&i.forEach(t=>{t.parentId&&(l[t.parentId]||(l[t.parentId]=!0,a.setNode(t.parentId,{})),a.setParent(t.id,t.parentId))}),o.forEach(t=>{const e=Z(t,"source"),n=Z(t,"target");this.layoutNode(e)&&this.layoutNode(n)&&a.setEdge(e,n,{weight:t.weight||1})});let h,f=void 0;return t.preset&&(f=new ue.a.graphlib.Graph({multigraph:!0,compound:!0}),t.preset.nodes.forEach(t=>{null==f||f.setNode(t.id,t)})),ue.a.layout(a,{prevGraph:f,edgeLabelSpace:t.edgeLabelSpace,keepNodeOrder:t.keepNodeOrder,nodeOrder:t.nodeOrder}),a.nodes().forEach(t=>{h=a.node(t);const n=e.findIndex(e=>e.id===t);e[n]&&(e[n].x=h.x,e[n].y=h.y,e[n]._order=h._order)}),a.edges().forEach(e=>{h=a.edge(e);const n=o.findIndex(t=>{const n=Z(t,"source"),r=Z(t,"target");return n===e.v&&r===e.w});t.edgeLabelSpace&&t.controlPoints&&"loop"!==o[n].type&&(o[n].controlPoints=h.points.slice(1,h.points.length-1))}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:o}}getType(){return"dagre"}}function le(t,e,n){let r;return r=t||(X(e)?()=>e:()=>n),r}const he=Object.prototype.toString;function fe(t){return he.call(t).endsWith("Array]")}var de=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!fe(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,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],s=r+1;s<o;s++)t[s]>a&&(a=t[s]);return a};var pe=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!fe(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,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],s=r+1;s<o;s++)t[s]<a&&(a=t[s]);return a};function ge(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!fe(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(!fe(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=pe(t),i=de(t);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var o=n.min,a=void 0===o?n.autoMinMax?r:0:o,s=n.max,u=void 0===s?n.autoMinMax?i:1:s;if(a>=u)throw new RangeError("min option must be smaller than max option");for(var c=(u-a)/(i-r),l=0;l<t.length;l++)e[l]=(t[l]-r)*c+a;return e}const ve=" ".repeat(2),me=" ".repeat(4);function ye(t,e={}){const{maxRows:n=15,maxColumns:r=10,maxNumSize:i=8}=e;return`${t.constructor.name} {\n${ve}[\n${me}${function(t,e,n,r){const{rows:i,columns:o}=t,a=Math.min(i,e),s=Math.min(o,n),u=[];for(let e=0;e<a;e++){let n=[];for(let i=0;i<s;i++)n.push(be(t.get(e,i),r));u.push(""+n.join(" "))}s!==o&&(u[u.length-1]+=` ... ${o-n} more columns`);a!==i&&u.push(`... ${i-e} more rows`);return u.join("\n"+me)}(t,n,r,i)}\n${ve}]\n${ve}rows: ${t.rows}\n${ve}columns: ${t.columns}\n}`}function be(t,e){const n=String(t);if(n.length<=e)return n.padEnd(e," ");const r=t.toPrecision(e-2);if(r.length<=e)return r;const i=t.toExponential(e-2),o=i.indexOf("e"),a=i.slice(o);return i.slice(0,e-a.length)+a}function xe(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 we(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 _e(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 Se(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 Ee(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for row indices");if(e.some(e=>e<0||e>=t.rows))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Me(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for column indices");if(e.some(e=>e<0||e>=t.columns))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Oe(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(ke("startRow",e),ke("endRow",n),ke("startColumn",r),ke("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function Ae(t,e=0){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function ke(t,e){if("number"!=typeof e)throw new TypeError(t+" must be a number")}function Ce(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}class Ie{static from1DArray(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");let r=new Pe(t,e);for(let i=0;i<t;i++)for(let t=0;t<e;t++)r.set(i,t,n[i*e+t]);return r}static rowVector(t){let e=new Pe(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 Pe(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 Pe(t,e)}static ones(t,e){return new Pe(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 i=new Pe(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.set(n,t,r());return i}static randInt(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{min:r=0,max:i=1e3,random:o=Math.random}=n;if(!Number.isInteger(r))throw new TypeError("min must be an integer");if(!Number.isInteger(i))throw new TypeError("max must be an integer");if(r>=i)throw new RangeError("min must be smaller than max");let a=i-r,s=new Pe(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++){let e=r+Math.round(o()*a);s.set(n,t,e)}return s}static eye(t,e,n){void 0===e&&(e=t),void 0===n&&(n=1);let r=Math.min(t,e),i=this.zeros(t,e);for(let t=0;t<r;t++)i.set(t,t,n);return i}static diag(t,e,n){let r=t.length;void 0===e&&(e=r),void 0===n&&(n=e);let i=Math.min(r,e,n),o=this.zeros(e,n);for(let e=0;e<i;e++)o.set(e,e,t[e]);return o}static min(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,i=new Pe(n,r);for(let o=0;o<n;o++)for(let n=0;n<r;n++)i.set(o,n,Math.min(t.get(o,n),e.get(o,n)));return i}static max(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,i=new this(n,r);for(let o=0;o<n;o++)for(let n=0;n<r;n++)i.set(o,n,Math.max(t.get(o,n),e.get(o,n)));return i}static checkMatrix(t){return Ie.isMatrix(t)?t:new Pe(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,i=!1;for(;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);t++}return r}isReducedEchelonForm(){let t=0,e=0,n=-1,r=!0,i=!1;for(;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!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 i=e;i<t.rows;i++)t.get(i,n)>t.get(r,n)&&(r=i);if(0===t.get(r,n))n++;else{t.swapRows(e,r);let i=t.get(e,n);for(let r=n;r<t.columns;r++)t.set(e,r,t.get(e,r)/i);for(let r=e+1;r<t.rows;r++){let i=t.get(r,n)/t.get(e,n);t.set(r,n,0);for(let o=n+1;o<t.columns;o++)t.set(r,o,t.get(r,o)-t.get(e,o)*i)}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 i=0,o=!1;for(;i<n&&!1===o;)1===t.get(r,i)?o=!0:i++;for(let n=0;n<r;n++){let o=t.get(n,i);for(let a=i;a<e;a++){let e=t.get(n,a)-o*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 Pe(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){xe(this,t);let e=[];for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}getRowVector(t){return Pe.rowVector(this.getRow(t))}setRow(t,e){xe(this,t),e=_e(this,e);for(let n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}swapRows(t,e){xe(this,t),xe(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){we(this,t);let e=[];for(let n=0;n<this.rows;n++)e.push(this.get(n,t));return e}getColumnVector(t){return Pe.columnVector(this.getColumn(t))}setColumn(t,e){we(this,t),e=Se(this,e);for(let n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}swapColumns(t,e){we(this,t),we(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=_e(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=_e(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=_e(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=_e(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=Se(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=Se(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=Se(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=Se(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){xe(this,t);for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}mulColumn(t,e){we(this,t);for(let n=0;n<this.rows;n++)this.set(n,t,this.get(n,t)*e);return this}max(){if(this.isEmpty())return NaN;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}maxIndex(){Ce(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(){if(this.isEmpty())return NaN;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}minIndex(){Ce(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(xe(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){xe(this,t),Ce(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(xe(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){xe(this,t),Ce(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(we(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){we(this,t),Ce(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(we(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){we(this,t),Ce(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){Ie.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=Pe.checkMatrix(t);let e=this.rows,n=this.columns,r=t.columns,i=new Pe(e,r),o=new Float64Array(n);for(let a=0;a<r;a++){for(let e=0;e<n;e++)o[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)*o[r];i.set(t,a,e)}}return i}strassen2x2(t){t=Pe.checkMatrix(t);let e=new Pe(2,2);const n=this.get(0,0),r=t.get(0,0),i=this.get(0,1),o=t.get(0,1),a=this.get(1,0),s=t.get(1,0),u=this.get(1,1),c=t.get(1,1),l=(n+u)*(r+c),h=(a+u)*r,f=n*(o-c),d=u*(s-r),p=(n+i)*c,g=l+d-p+(i-u)*(s+c),v=f+p,m=h+d,y=l-h+f+(a-n)*(r+o);return e.set(0,0,g),e.set(0,1,v),e.set(1,0,m),e.set(1,1,y),e}strassen3x3(t){t=Pe.checkMatrix(t);let e=new Pe(3,3);const n=this.get(0,0),r=this.get(0,1),i=this.get(0,2),o=this.get(1,0),a=this.get(1,1),s=this.get(1,2),u=this.get(2,0),c=this.get(2,1),l=this.get(2,2),h=t.get(0,0),f=t.get(0,1),d=t.get(0,2),p=t.get(1,0),g=t.get(1,1),v=t.get(1,2),m=t.get(2,0),y=t.get(2,1),b=t.get(2,2),x=(n-o)*(-f+g),w=(-n+o+a)*(h-f+g),_=(o+a)*(-h+f),S=n*h,E=(-n+u+c)*(h-d+v),M=(-n+u)*(d-v),O=(u+c)*(-h+d),A=(-i+c+l)*(g+m-y),k=(i-l)*(g-y),C=i*m,I=(c+l)*(-m+y),T=(-i+a+s)*(v+m-b),P=(i-s)*(v-b),N=(a+s)*(-m+b),j=S+C+r*p,D=(n+r+i-o-a-c-l)*g+w+_+S+A+C+I,L=S+E+O+(n+r+i-a-s-u-c)*v+C+T+N,R=x+a*(-h+f+p-g-v-m+b)+w+S+C+T+P,B=x+w+_+S+s*y,G=C+T+P+N+o*d,F=S+E+M+c*(-h+d+p-g-v-m+y)+A+k+C,z=A+k+C+I+u*f,U=S+E+M+O+l*b;return e.set(0,0,j),e.set(0,1,D),e.set(0,2,L),e.set(1,0,R),e.set(1,1,B),e.set(1,2,G),e.set(2,0,F),e.set(2,1,z),e.set(2,2,U),e}mmulStrassen(t){t=Pe.checkMatrix(t);let e=this.clone(),n=e.rows,r=e.columns,i=t.rows,o=t.columns;function a(t,e,n){let r=t.rows,i=t.columns;if(r===e&&i===n)return t;{let r=Ie.zeros(e,n);return r=r.setSubMatrix(t,0,0),r}}r!==i&&console.warn(`Multiplying ${n} x ${r} and ${i} x ${o} matrix: dimensions do not match.`);let s=Math.max(n,i),u=Math.max(r,o);return e=a(e,s,u),function t(e,n,r,i){if(r<=512||i<=512)return e.mmul(n);r%2==1&&i%2==1?(e=a(e,r+1,i+1),n=a(n,r+1,i+1)):r%2==1?(e=a(e,r+1,i),n=a(n,r+1,i)):i%2==1&&(e=a(e,r,i+1),n=a(n,r,i+1));let o=parseInt(e.rows/2,10),s=parseInt(e.columns/2,10),u=e.subMatrix(0,o-1,0,s-1),c=n.subMatrix(0,o-1,0,s-1),l=e.subMatrix(0,o-1,s,e.columns-1),h=n.subMatrix(0,o-1,s,n.columns-1),f=e.subMatrix(o,e.rows-1,0,s-1),d=n.subMatrix(o,n.rows-1,0,s-1),p=e.subMatrix(o,e.rows-1,s,e.columns-1),g=n.subMatrix(o,n.rows-1,s,n.columns-1),v=t(Ie.add(u,p),Ie.add(c,g),o,s),m=t(Ie.add(f,p),c,o,s),y=t(u,Ie.sub(h,g),o,s),b=t(p,Ie.sub(d,c),o,s),x=t(Ie.add(u,l),g,o,s),w=t(Ie.sub(f,u),Ie.add(c,h),o,s),_=t(Ie.sub(l,p),Ie.add(d,g),o,s),S=Ie.add(v,b);S.sub(x),S.add(_);let E=Ie.add(y,x),M=Ie.add(m,b),O=Ie.sub(v,m);O.add(y),O.add(w);let A=Ie.zeros(2*S.rows,2*S.columns);return A=A.setSubMatrix(S,0,0),A=A.setSubMatrix(E,S.rows,0),A=A.setSubMatrix(M,0,S.columns),A=A.setSubMatrix(O,S.rows,S.columns),A.subMatrix(0,r-1,0,i-1)}(e,t=a(t,s,u),s,u)}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 Pe(this.rows,this.columns);for(let t=0;t<this.rows;t++){const i=this.getRow(t);i.length>0&&ge(i,{min:e,max:n,output:i}),r.setRow(t,i)}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 Pe(this.rows,this.columns);for(let t=0;t<this.columns;t++){const i=this.getColumn(t);i.length&&ge(i,{min:e,max:n,output:i}),r.setColumn(t,i)}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=Pe.checkMatrix(t);let e=this.rows,n=this.columns,r=t.rows,i=t.columns,o=new Pe(e*r,n*i);for(let a=0;a<e;a++)for(let e=0;e<n;e++)for(let n=0;n<r;n++)for(let s=0;s<i;s++)o.set(r*a+n,i*e+s,this.get(a,e)*t.get(n,s));return o}kroneckerSum(t){if(t=Pe.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(Pe.eye(n,n)),i=Pe.eye(e,e).kroneckerProduct(t);return r.add(i)}transpose(){let t=new Pe(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=Te){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=Te){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,n,r){Oe(this,t,e,n,r);let i=new Pe(e-t+1,r-n+1);for(let o=t;o<=e;o++)for(let e=n;e<=r;e++)i.set(o-t,e-n,this.get(o,e));return i}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 Pe(t.length,n-e+1);for(let i=0;i<t.length;i++)for(let o=e;o<=n;o++){if(t[i]<0||t[i]>=this.rows)throw new RangeError("Row index out of range: "+t[i]);r.set(i,o-e,this.get(t[i],o))}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 Pe(n-e+1,t.length);for(let i=0;i<t.length;i++)for(let o=e;o<=n;o++){if(t[i]<0||t[i]>=this.columns)throw new RangeError("Column index out of range: "+t[i]);r.set(o-e,i,this.get(o,t[i]))}return r}setSubMatrix(t,e,n){if((t=Pe.checkMatrix(t)).isEmpty())return this;Oe(this,e,e+t.rows-1,n,n+t.columns-1);for(let r=0;r<t.rows;r++)for(let i=0;i<t.columns;i++)this.set(e+r,n+i,t.get(r,i));return this}selection(t,e){let n=function(t,e,n){return{row:Ee(t,e),column:Me(t,n)}}(this,t,e),r=new Pe(t.length,e.length);for(let t=0;t<n.row.length;t++){let e=n.row[t];for(let i=0;i<n.column.length;i++){let o=n.column[i];r.set(t,i,this.get(e,o))}}return r}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 Pe(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=Ae(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=Ae(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=Ae(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=Ae(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(!Array.isArray(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,i=t.columns,o=[];for(let a=0;a<r;a++){let r=0,s=0,u=0;for(let e=0;e<i;e++)u=t.get(a,e)-n[a],r+=u,s+=u*u;e?o.push((s-r*r/i)/(i-1)):o.push((s-r*r/i)/i)}return o}(this,n,r);case"column":if(!Array.isArray(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,i=t.columns,o=[];for(let a=0;a<i;a++){let i=0,s=0,u=0;for(let e=0;e<r;e++)u=t.get(e,a)-n[a],i+=u,s+=u*u;e?o.push((s-i*i/r)/(r-1)):o.push((s-i*i/r)/r)}return o}(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,i=t.columns,o=r*i;let a=0,s=0,u=0;for(let e=0;e<r;e++)for(let r=0;r<i;r++)u=t.get(e,r)-n,a+=u,s+=u*u;return e?(s-a*a/o)/(o-1):(s-a*a/o)/o}(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(!Array.isArray(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(!Array.isArray(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(!Array.isArray(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(!Array.isArray(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 i=0;i<t.rows;i++)n+=Math.pow(t.get(i,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 ye(this,t)}}function Te(t,e){return t-e}Ie.prototype.klass="Matrix","undefined"!=typeof Symbol&&(Ie.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return ye(this)}),Ie.random=Ie.rand,Ie.randomInt=Ie.randInt,Ie.diagonal=Ie.diag,Ie.prototype.diagonal=Ie.prototype.diag,Ie.identity=Ie.eye,Ie.prototype.negate=Ie.prototype.neg,Ie.prototype.tensorProduct=Ie.prototype.kroneckerProduct;class Pe extends Ie{constructor(t,e){if(super(),Pe.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(!Array.isArray(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");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 xe(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),xe(this,t,!0),e=Float64Array.from(_e(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){we(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),we(this,t,!0),e=Se(this,e);for(let n=0;n<this.rows;n++){const r=new Float64Array(this.columns+1);let i=0;for(;i<t;i++)r[i]=this.data[n][i];for(r[i++]=e[n];i<this.columns+1;i++)r[i]=this.data[n][i-1];this.data[n]=r}return this.columns+=1,this}}var Ne,je;je=Pe,(Ne=Ie).prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},Ne.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},Ne.prototype.addM=function(t){if(t=je.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},Ne.add=function(t,e){return new je(t).add(e)},Ne.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},Ne.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},Ne.prototype.subM=function(t){if(t=je.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},Ne.sub=function(t,e){return new je(t).sub(e)},Ne.prototype.subtract=Ne.prototype.sub,Ne.prototype.subtractS=Ne.prototype.subS,Ne.prototype.subtractM=Ne.prototype.subM,Ne.subtract=Ne.sub,Ne.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},Ne.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},Ne.prototype.mulM=function(t){if(t=je.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},Ne.mul=function(t,e){return new je(t).mul(e)},Ne.prototype.multiply=Ne.prototype.mul,Ne.prototype.multiplyS=Ne.prototype.mulS,Ne.prototype.multiplyM=Ne.prototype.mulM,Ne.multiply=Ne.mul,Ne.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},Ne.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},Ne.prototype.divM=function(t){if(t=je.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},Ne.div=function(t,e){return new je(t).div(e)},Ne.prototype.divide=Ne.prototype.div,Ne.prototype.divideS=Ne.prototype.divS,Ne.prototype.divideM=Ne.prototype.divM,Ne.divide=Ne.div,Ne.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},Ne.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},Ne.prototype.modM=function(t){if(t=je.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},Ne.mod=function(t,e){return new je(t).mod(e)},Ne.prototype.modulus=Ne.prototype.mod,Ne.prototype.modulusS=Ne.prototype.modS,Ne.prototype.modulusM=Ne.prototype.modM,Ne.modulus=Ne.mod,Ne.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},Ne.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},Ne.prototype.andM=function(t){if(t=je.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},Ne.and=function(t,e){return new je(t).and(e)},Ne.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},Ne.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},Ne.prototype.orM=function(t){if(t=je.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},Ne.or=function(t,e){return new je(t).or(e)},Ne.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},Ne.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},Ne.prototype.xorM=function(t){if(t=je.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},Ne.xor=function(t,e){return new je(t).xor(e)},Ne.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},Ne.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},Ne.prototype.leftShiftM=function(t){if(t=je.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},Ne.leftShift=function(t,e){return new je(t).leftShift(e)},Ne.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},Ne.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},Ne.prototype.signPropagatingRightShiftM=function(t){if(t=je.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},Ne.signPropagatingRightShift=function(t,e){return new je(t).signPropagatingRightShift(e)},Ne.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},Ne.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},Ne.prototype.rightShiftM=function(t){if(t=je.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},Ne.rightShift=function(t,e){return new je(t).rightShift(e)},Ne.prototype.zeroFillRightShift=Ne.prototype.rightShift,Ne.prototype.zeroFillRightShiftS=Ne.prototype.rightShiftS,Ne.prototype.zeroFillRightShiftM=Ne.prototype.rightShiftM,Ne.zeroFillRightShift=Ne.rightShift,Ne.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},Ne.not=function(t){return new je(t).not()},Ne.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},Ne.abs=function(t){return new je(t).abs()},Ne.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},Ne.acos=function(t){return new je(t).acos()},Ne.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},Ne.acosh=function(t){return new je(t).acosh()},Ne.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},Ne.asin=function(t){return new je(t).asin()},Ne.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},Ne.asinh=function(t){return new je(t).asinh()},Ne.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},Ne.atan=function(t){return new je(t).atan()},Ne.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},Ne.atanh=function(t){return new je(t).atanh()},Ne.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},Ne.cbrt=function(t){return new je(t).cbrt()},Ne.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},Ne.ceil=function(t){return new je(t).ceil()},Ne.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},Ne.clz32=function(t){return new je(t).clz32()},Ne.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},Ne.cos=function(t){return new je(t).cos()},Ne.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},Ne.cosh=function(t){return new je(t).cosh()},Ne.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},Ne.exp=function(t){return new je(t).exp()},Ne.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},Ne.expm1=function(t){return new je(t).expm1()},Ne.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},Ne.floor=function(t){return new je(t).floor()},Ne.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},Ne.fround=function(t){return new je(t).fround()},Ne.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},Ne.log=function(t){return new je(t).log()},Ne.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},Ne.log1p=function(t){return new je(t).log1p()},Ne.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},Ne.log10=function(t){return new je(t).log10()},Ne.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},Ne.log2=function(t){return new je(t).log2()},Ne.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},Ne.round=function(t){return new je(t).round()},Ne.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},Ne.sign=function(t){return new je(t).sign()},Ne.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},Ne.sin=function(t){return new je(t).sin()},Ne.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},Ne.sinh=function(t){return new je(t).sinh()},Ne.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},Ne.sqrt=function(t){return new je(t).sqrt()},Ne.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},Ne.tan=function(t){return new je(t).tan()},Ne.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},Ne.tanh=function(t){return new je(t).tanh()},Ne.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},Ne.trunc=function(t){return new je(t).trunc()},Ne.pow=function(t,e){return new je(t).pow(e)},Ne.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},Ne.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},Ne.prototype.powM=function(t){if(t=je.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};class De extends Ie{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 Le(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 Re{constructor(t,e={}){if((t=De.checkMatrix(t)).isEmpty())throw new Error("Matrix must be non-empty");let n=t.rows,r=t.columns;const{computeLeftSingularVectors:i=!0,computeRightSingularVectors:o=!0,autoTranspose:a=!1}=e;let s,u=Boolean(i),c=Boolean(o),l=!1;if(n<r)if(a){s=t.transpose(),n=s.rows,r=s.columns,l=!0;let e=u;u=c,c=e}else s=t.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else s=t.clone();let h=Math.min(n,r),f=Math.min(n+1,r),d=new Float64Array(f),p=new Pe(n,h),g=new Pe(r,r),v=new Float64Array(r),m=new Float64Array(n),y=new Float64Array(f);for(let t=0;t<f;t++)y[t]=t;let b=Math.min(n-1,r),x=Math.max(0,Math.min(r-2,n)),w=Math.max(b,x);for(let t=0;t<w;t++){if(t<b){d[t]=0;for(let e=t;e<n;e++)d[t]=Le(d[t],s.get(e,t));if(0!==d[t]){s.get(t,t)<0&&(d[t]=-d[t]);for(let e=t;e<n;e++)s.set(e,t,s.get(e,t)/d[t]);s.set(t,t,s.get(t,t)+1)}d[t]=-d[t]}for(let e=t+1;e<r;e++){if(t<b&&0!==d[t]){let r=0;for(let i=t;i<n;i++)r+=s.get(i,t)*s.get(i,e);r=-r/s.get(t,t);for(let i=t;i<n;i++)s.set(i,e,s.get(i,e)+r*s.get(i,t))}v[e]=s.get(t,e)}if(u&&t<b)for(let e=t;e<n;e++)p.set(e,t,s.get(e,t));if(t<x){v[t]=0;for(let e=t+1;e<r;e++)v[t]=Le(v[t],v[e]);if(0!==v[t]){v[t+1]<0&&(v[t]=0-v[t]);for(let e=t+1;e<r;e++)v[e]/=v[t];v[t+1]+=1}if(v[t]=-v[t],t+1<n&&0!==v[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]+=v[n]*s.get(e,n);for(let e=t+1;e<r;e++){let r=-v[e]/v[t+1];for(let i=t+1;i<n;i++)s.set(i,e,s.get(i,e)+r*m[i])}}if(c)for(let e=t+1;e<r;e++)g.set(e,t,v[e])}}let _=Math.min(r,n+1);if(b<r&&(d[b]=s.get(b,b)),n<_&&(d[_-1]=0),x+1<_&&(v[x]=s.get(x,_-1)),v[_-1]=0,u){for(let t=b;t<h;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!==d[t]){for(let e=t+1;e<h;e++){let r=0;for(let i=t;i<n;i++)r+=p.get(i,t)*p.get(i,e);r=-r/p.get(t,t);for(let i=t;i<n;i++)p.set(i,e,p.get(i,e)+r*p.get(i,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<x&&0!==v[t])for(let e=t+1;e<r;e++){let n=0;for(let i=t+1;i<r;i++)n+=g.get(i,t)*g.get(i,e);n=-n/g.get(t+1,t);for(let i=t+1;i<r;i++)g.set(i,e,g.get(i,e)+n*g.get(i,t))}for(let e=0;e<r;e++)g.set(e,t,0);g.set(t,t,1)}let S=_-1,E=0,M=Number.EPSILON;for(;_>0;){let t,e;for(t=_-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+M*Math.abs(d[t]+Math.abs(d[t+1]));if(Math.abs(v[t])<=e||Number.isNaN(v[t])){v[t]=0;break}}if(t===_-2)e=4;else{let n;for(n=_-1;n>=t&&n!==t;n--){let e=(n!==_?Math.abs(v[n]):0)+(n!==t+1?Math.abs(v[n-1]):0);if(Math.abs(d[n])<=M*e){d[n]=0;break}}n===t?e=3:n===_-1?e=1:(e=2,t=n)}switch(t++,e){case 1:{let e=v[_-2];v[_-2]=0;for(let n=_-2;n>=t;n--){let i=Le(d[n],e),o=d[n]/i,a=e/i;if(d[n]=i,n!==t&&(e=-a*v[n-1],v[n-1]=o*v[n-1]),c)for(let t=0;t<r;t++)i=o*g.get(t,n)+a*g.get(t,_-1),g.set(t,_-1,-a*g.get(t,n)+o*g.get(t,_-1)),g.set(t,n,i)}break}case 2:{let e=v[t-1];v[t-1]=0;for(let r=t;r<_;r++){let i=Le(d[r],e),o=d[r]/i,a=e/i;if(d[r]=i,e=-a*v[r],v[r]=o*v[r],u)for(let e=0;e<n;e++)i=o*p.get(e,r)+a*p.get(e,t-1),p.set(e,t-1,-a*p.get(e,r)+o*p.get(e,t-1)),p.set(e,r,i)}break}case 3:{const e=Math.max(Math.abs(d[_-1]),Math.abs(d[_-2]),Math.abs(v[_-2]),Math.abs(d[t]),Math.abs(v[t])),i=d[_-1]/e,o=d[_-2]/e,a=v[_-2]/e,s=d[t]/e,l=v[t]/e,h=((o+i)*(o-i)+a*a)/2,f=i*a*(i*a);let m=0;0===h&&0===f||(m=h<0?0-Math.sqrt(h*h+f):Math.sqrt(h*h+f),m=f/(h+m));let y=(s+i)*(s-i)+m,b=s*l;for(let e=t;e<_-1;e++){let i=Le(y,b);0===i&&(i=Number.MIN_VALUE);let o=y/i,a=b/i;if(e!==t&&(v[e-1]=i),y=o*d[e]+a*v[e],v[e]=o*v[e]-a*d[e],b=a*d[e+1],d[e+1]=o*d[e+1],c)for(let t=0;t<r;t++)i=o*g.get(t,e)+a*g.get(t,e+1),g.set(t,e+1,-a*g.get(t,e)+o*g.get(t,e+1)),g.set(t,e,i);if(i=Le(y,b),0===i&&(i=Number.MIN_VALUE),o=y/i,a=b/i,d[e]=i,y=o*v[e]+a*d[e+1],d[e+1]=-a*v[e]+o*d[e+1],b=a*v[e+1],v[e+1]=o*v[e+1],u&&e<n-1)for(let t=0;t<n;t++)i=o*p.get(t,e)+a*p.get(t,e+1),p.set(t,e+1,-a*p.get(t,e)+o*p.get(t,e+1)),p.set(t,e,i)}v[_-2]=y,E+=1;break}case 4:if(d[t]<=0&&(d[t]=d[t]<0?-d[t]:0,c))for(let e=0;e<=S;e++)g.set(e,t,-g.get(e,t));for(;t<S&&!(d[t]>=d[t+1]);){let e=d[t];if(d[t]=d[t+1],d[t+1]=e,c&&t<r-1)for(let n=0;n<r;n++)e=g.get(n,t+1),g.set(n,t+1,g.get(n,t)),g.set(n,t,e);if(u&&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++}E=0,_--}}if(l){let t=g;g=p,p=t}this.m=n,this.n=r,this.s=d,this.U=p,this.V=g}solve(t){let e=t,n=this.threshold,r=this.s.length,i=Pe.zeros(r,r);for(let t=0;t<r;t++)Math.abs(this.s[t])<=n?i.set(t,t,0):i.set(t,t,1/this.s[t]);let o=this.U,a=this.rightSingularVectors,s=a.mmul(i),u=a.rows,c=o.rows,l=Pe.zeros(u,c);for(let t=0;t<u;t++)for(let e=0;e<c;e++){let n=0;for(let i=0;i<r;i++)n+=s.get(t,i)*o.get(e,i);l.set(t,e,n)}return l.mmul(e)}solveForDiagonal(t){return this.solve(Pe.diag(t))}inverse(){let t=this.V,e=this.threshold,n=t.rows,r=t.columns,i=new Pe(n,this.s.length);for(let o=0;o<n;o++)for(let n=0;n<r;n++)Math.abs(this.s[n])>e&&i.set(o,n,t.get(o,n)/this.s[n]);let o=this.U,a=o.rows,s=o.columns,u=new Pe(n,a);for(let t=0;t<n;t++)for(let e=0;e<a;e++){let n=0;for(let r=0;r<s;r++)n+=i.get(t,r)*o.get(e,r);u.set(t,e,n)}return u}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,i=n.length;r<i;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 Pe.diag(this.s)}}class Be{constructor(t){this.distances=t.distances,this.dimension=t.dimension||2,this.linkDistance=t.linkDistance}layout(){const{dimension:t,distances:e,linkDistance:n}=this;try{const n=Pe.mul(Pe.pow(e,2),-.5),r=n.mean("row"),i=n.mean("column"),o=n.mean();n.add(o).subRowVector(r).subColumnVector(i);const a=new Re(n),s=Pe.sqrt(a.diagonalMatrix).diagonal();return a.leftSingularVectors.toJSON().map(e=>Pe.mul([e],[s]).toJSON()[0].splice(0,t))}catch(t){const r=[];for(let t=0;t<e.length;t++){const t=Math.random()*n,e=Math.random()*n;r.push([t,e])}return r}}}class Ge{constructor(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}layout(){const t=this,e=t.positions,n=[],r=t.iterations,i=t.width/10;t.maxDisplace=i,t.disp=n;for(let i=0;i<r;i++)e.forEach((t,e)=>{n[e]={x:0,y:0}}),t.getRepulsion(),t.updatePositions();return e}getRepulsion(){const t=this,e=t.positions,n=t.nodes,r=t.disp,i=t.k,o=t.radii||[];e.forEach((a,s)=>{r[s]={x:0,y:0},e.forEach((e,u)=>{if(s===u)return;if(o[s]!==o[u])return;let c=a[0]-e[0],l=a[1]-e[1],h=Math.sqrt(c*c+l*l);if(0===h){h=1;const t=s>u?1:-1;c=.01*t,l=.01*t}if(h<t.nodeSizeFunc(n[s])/2+t.nodeSizeFunc(n[u])/2){const t=i*i/h;r[s].x+=c/h*t,r[s].y+=l/h*t}})})}updatePositions(){const t=this.positions,e=this.disp,n=this.speed,r=this.strictRadial,i=this.focusID,o=this.maxDisplace||this.width/10;r&&e.forEach((e,n)=>{const r=t[n][0]-t[i][0],o=t[n][1]-t[i][1],a=Math.sqrt(r*r+o*o);let s=o/a,u=-r/a;const c=Math.sqrt(e.x*e.x+e.y*e.y);let l=Math.acos((s*e.x+u*e.y)/c);l>Math.PI/2&&(l-=Math.PI/2,s*=-1,u*=-1);const h=Math.cos(l)*c;e.x=s*h,e.y=u*h});const a=this.radii;t.forEach((s,u)=>{if(u===i)return;const c=Math.sqrt(e[u].x*e[u].x+e[u].y*e[u].y);if(c>0&&u!==i){const l=Math.min(o*(n/800),c);if(s[0]+=e[u].x/c*l,s[1]+=e[u].y/c*l,r){let e=s[0]-t[i][0],n=s[1]-t[i][1];const r=Math.sqrt(e*e+n*n);e=e/r*a[u],n=n/r*a[u],s[0]=t[i][0]+e,s[1]=t[i][1]+n}}})}}function Fe(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}class ze extends U{constructor(t){super(),this.maxIteration=1e3,this.focusNode=null,this.unitRadius=null,this.linkDistance=50,this.preventOverlap=!1,this.strictRadial=!0,this.maxPreventOverlapIteration=200,this.sortStrength=10,this.nodes=[],this.edges=[],this.updateCfg(t)}getDefaultCfg(){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}}execute(){const t=this,e=t.nodes,n=t.edges||[];if(!e||0===e.length)return void(t.onLayoutEnd&&t.onLayoutEnd());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]);const r=t.center;if(1===e.length)return e[0].x=r[0],e[0].y=r[1],void(t.onLayoutEnd&&t.onLayoutEnd());const i=t.linkDistance;let o=null;if(V(t.focusNode)){let n=!1;for(let r=0;r<e.length;r++)e[r].id===t.focusNode&&(o=e[r],t.focusNode=o,n=!0,r=e.length);n||(o=null)}else o=t.focusNode;o||(o=e[0],t.focusNode=o);const a=function(t,e){let n=-1;return t.forEach((t,r)=>{t.id===e&&(n=r)}),n}(e,o.id);t.focusIndex=a;const s=J({nodes:e,edges:n},!1),u=Q(s),c=t.maxToFocus(u,a);t.handleInfinity(u,a,c+1),t.distances=u;const l=u[a],h=t.width||500,f=t.height||500;let d=h-r[0]>r[0]?r[0]:h-r[0],p=f-r[1]>r[1]?r[1]:f-r[1];0===d&&(d=h/2),0===p&&(p=f/2);const g=p>d?d:p,v=Math.max(...l),m=[];l.forEach((e,n)=>{t.unitRadius||(t.unitRadius=g/v),m[n]=e*t.unitRadius}),t.radii=m;const y=t.eIdealDisMatrix();t.eIdealDistances=y;const b=function(t){const e=t.length,n=t[0].length,r=[];for(let i=0;i<e;i++){const e=[];for(let r=0;r<n;r++)0!==t[i][r]?e.push(1/(t[i][r]*t[i][r])):e.push(0);r.push(e)}return r}(y);t.weights=b;let x=new Be({linkDistance:i,distances:y}).layout();x.forEach(t=>{H(t[0])&&(t[0]=Math.random()*i),H(t[1])&&(t[1]=Math.random()*i)}),t.positions=x,x.forEach((t,n)=>{e[n].x=t[0]+r[0],e[n].y=t[1]+r[1]}),x.forEach(t=>{t[0]-=x[a][0],t[1]-=x[a][1]}),t.run();const w=t.preventOverlap,_=t.nodeSize;let S;const E=t.strictRadial;if(w){const n=t.nodeSpacing;let r;r=X(n)?()=>n:nt(n)?n:()=>0,S=_?Y(_)?t=>(_[0]>_[1]?_[0]:_[1])+r(t):t=>_+r(t):t=>{if(t.size){if(Y(t.size)){return(t.size[0]>t.size[1]?t.size[0]:t.size[1])+r(t)}if(q(t.size)){return(t.size.width>t.size.height?t.size.width:t.size.height)+r(t)}return t.size+r(t)}return 10+r(t)};const i={nodes:e,nodeSizeFunc:S,adjMatrix:s,positions:x,radii:m,height:f,width:h,strictRadial:E,focusID:a,iterations:t.maxPreventOverlapIteration||200,k:x.length/4.5},o=new Ge(i);x=o.layout()}return x.forEach((t,n)=>{e[n].x=t[0]+r[0],e[n].y=t[1]+r[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n}}run(){const t=this,e=t.maxIteration,n=t.positions||[],r=t.weights||[],i=t.eIdealDistances||[],o=t.radii||[];for(let a=0;a<=e;a++){const s=a/e;t.oneIteration(s,n,o,i,r)}}oneIteration(t,e,n,r,i){const o=1-t,a=this.focusIndex;e.forEach((s,u)=>{const c=Fe(s,[0,0]),l=0===c?0:1/c;if(u===a)return;let h=0,f=0,d=0;e.forEach((t,e)=>{if(u===e)return;const n=Fe(s,t),o=0===n?0:1/n,a=r[e][u];d+=i[u][e],h+=i[u][e]*(t[0]+a*(s[0]-t[0])*o),f+=i[u][e]*(t[1]+a*(s[1]-t[1])*o)});const p=0===n[u]?0:1/n[u];d*=o,d+=t*p*p,h*=o,h+=t*p*s[0]*l,s[0]=h/d,f*=o,f+=t*p*s[1]*l,s[1]=f/d})}eIdealDisMatrix(){const t=this,e=t.nodes;if(!e)return[];const n=t.distances,r=t.linkDistance,i=t.radii||[],o=t.unitRadius||50,a=[];return n&&n.forEach((n,s)=>{const u=[];n.forEach((n,a)=>{if(s===a)u.push(0);else if(i[s]===i[a])if("data"===t.sortBy)u.push(n*(Math.abs(s-a)*t.sortStrength)/(i[s]/o));else if(t.sortBy){let r=e[s][t.sortBy]||0,c=e[a][t.sortBy]||0;V(r)&&(r=r.charCodeAt(0)),V(c)&&(c=c.charCodeAt(0)),u.push(n*(Math.abs(r-c)*t.sortStrength)/(i[s]/o))}else u.push(n*r/(i[s]/o));else{const t=(r+o)/2;u.push(n*t)}}),a.push(u)}),a}handleInfinity(t,e,n){const r=t.length;for(let i=0;i<r;i++)if(t[e][i]===1/0){t[e][i]=n,t[i][e]=n;for(let o=0;o<r;o++)t[i][o]!==1/0&&t[e][o]===1/0&&(t[e][o]=n+t[i][o],t[o][e]=n+t[i][o])}for(let n=0;n<r;n++)if(n!==e)for(let i=0;i<r;i++)if(t[n][i]===1/0){let r=Math.abs(t[e][n]-t[e][i]);r=0===r?1:r,t[n][i]=r}}maxToFocus(t,e){let n=0;for(let r=0;r<t[e].length;r++)t[e][r]!==1/0&&(n=t[e][r]>n?t[e][r]:n);return n}getType(){return"radial"}}class Ue extends U{constructor(t){super(),this.nodeSize=30,this.minNodeSpacing=10,this.preventOverlap=!1,this.equidistant=!1,this.startAngle=1.5*Math.PI,this.clockwise=!0,this.sortBy="degree",this.nodes=[],this.edges=[],this.width=300,this.height=300,this.onLayoutEnd=()=>{},this.updateCfg(t)}getDefaultCfg(){return{nodeSize:30,minNodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:1.5*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}}execute(){const t=this,e=t.nodes,n=t.edges,r=e.length;if(0===r)return void(t.onLayoutEnd&&t.onLayoutEnd());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]);const i=t.center;if(1===r)return e[0].x=i[0],e[0].y=i[1],void(t.onLayoutEnd&&t.onLayoutEnd());const o=[];let a;a=Y(t.nodeSize)?Math.max(t.nodeSize[0],t.nodeSize[1]):t.nodeSize,e.forEach(t=>{o.push(t);let e=a;Y(t.size)?e=Math.max(t.size[0],t.size[1]):X(t.size)?e=t.size:q(t.size)&&(e=Math.max(t.size.width,t.size.height)),a=Math.max(a,e)}),t.clockwise=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise;const s={},u={};if(o.forEach((t,e)=>{s[t.id]=t,u[t.id]=e}),!("degree"!==t.sortBy&&V(t.sortBy)&&void 0!==o[0][t.sortBy]||(t.sortBy="degree",X(e[0].degree)))){const t=$(e.length,u,n);o.forEach((e,n)=>{e.degree=t[n]})}o.sort((e,n)=>n[t.sortBy]-e[t.sortBy]),t.maxValueNode=o[0],t.maxLevelDiff=t.maxLevelDiff||t.maxValueNode[t.sortBy]/4;const c=[[]];let l=c[0];o.forEach(e=>{if(l.length>0){const n=Math.abs(l[0][t.sortBy]-e[t.sortBy]);t.maxLevelDiff&&n>=t.maxLevelDiff&&(l=[],c.push(l))}l.push(e)});let h=a+t.minNodeSpacing;if(!t.preventOverlap){const e=c.length>0&&c[0].length>1,n=(Math.min(t.width,t.height)/2-h)/(c.length+(e?1:0));h=Math.min(h,n)}let f=0;if(c.forEach(e=>{let n=t.sweep;void 0===n&&(n=2*Math.PI-2*Math.PI/e.length);const r=e.dTheta=n/Math.max(1,e.length-1);if(e.length>1&&t.preventOverlap){const t=Math.cos(r)-Math.cos(0),e=Math.sin(r)-Math.sin(0),n=Math.sqrt(h*h/(t*t+e*e));f=Math.max(n,f)}e.r=f,f+=h}),t.equidistant){let t=0,e=0;for(let n=0;n<c.length;n++){const r=c[n].r-e;t=Math.max(t,r)}e=0,c.forEach((n,r)=>{0===r&&(e=n.r),n.r=e,e+=t})}return c.forEach(e=>{const n=e.dTheta,r=e.r;e.forEach((e,o)=>{const a=t.startAngle+(t.clockwise?1:-1)*n*o;e.x=i[0]+r*Math.cos(a),e.y=i[1]+r*Math.sin(a)})}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n}}getType(){return"concentric"}}class Ve extends U{constructor(t){super(),this.center=[0,0],this.linkDistance=50,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.updateCfg(t)}getDefaultCfg(){return{center:[0,0],linkDistance:50}}execute(){const t=this,{nodes:e,edges:n=[]}=t,r=t.center;if(!e||0===e.length)return void(t.onLayoutEnd&&t.onLayoutEnd());if(1===e.length)return e[0].x=r[0],e[0].y=r[1],void(t.onLayoutEnd&&t.onLayoutEnd());const i=t.linkDistance,o=J({nodes:e,edges:n},!1),a=Q(o);t.handleInfinity(a);const s=((t,e)=>{const n=[];return t.forEach(t=>{const r=[];t.forEach(t=>{r.push(t*e)}),n.push(r)}),n})(a,i);t.scaledDistances=s;const u=t.runMDS();return t.positions=u,u.forEach((t,n)=>{e[n].x=t[0]+r[0],e[n].y=t[1]+r[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n}}runMDS(){const t=this.scaledDistances,e=Pe.mul(Pe.pow(t,2),-.5),n=e.mean("row"),r=e.mean("column"),i=e.mean();e.add(i).subRowVector(n).subColumnVector(r);const o=new Re(e),a=Pe.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map(t=>Pe.mul([t],[a]).toJSON()[0].splice(0,2))}handleInfinity(t){let e=-999999;t.forEach(t=>{t.forEach(t=>{t!==1/0&&e<t&&(e=t)})}),t.forEach((n,r)=>{n.forEach((n,i)=>{n===1/0&&(t[r][i]=e)})})}getType(){return"mds"}}class We extends U{constructor(t){super(),this.maxIteration=1e3,this.workerEnabled=!1,this.gravity=10,this.speed=5,this.clustering=!1,this.clusterGravity=10,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.onLayoutEnd=()=>{},this.tick=()=>{},this.updateCfg(t)}getDefaultCfg(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}}execute(){var t,e;const n=this,r=n.nodes;if(void 0!==n.timeInterval&&"undefined"!=typeof window&&window.clearInterval(n.timeInterval),!r||0===r.length)return void(null===(t=n.onLayoutEnd)||void 0===t||t.call(n));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]);const i=n.center;if(1===r.length)return r[0].x=i[0],r[0].y=i[1],void(null===(e=n.onLayoutEnd)||void 0===e||e.call(n));const o={},a={};return r.forEach((t,e)=>{X(t.x)||(t.x=Math.random()*this.width),X(t.y)||(t.y=Math.random()*this.height),o[t.id]=t,a[t.id]=e}),n.nodeMap=o,n.nodeIdxMap=a,n.run()}run(){var t;const e=this,n=e.nodes;if(!n)return;const{edges:r,maxIteration:i,workerEnabled:o}=e,a=e.clustering,s={};if(a){n.forEach(t=>{if(void 0===s[t.cluster]){const e={name:t.cluster,cx:0,cy:0,count:0};s[t.cluster]=e}const e=s[t.cluster];X(t.x)&&(e.cx+=t.x),X(t.y)&&(e.cy+=t.y),e.count++});for(const t in s)s[t].cx/=s[t].count,s[t].cy/=s[t].count}if(o){for(let t=0;t<i;t++)e.runOneStep(s);null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;let t=0;this.timeInterval=window.setInterval(()=>{var n;e.runOneStep(s),t++,t>=i&&(null===(n=e.onLayoutEnd)||void 0===n||n.call(e),window.clearInterval(e.timeInterval))},0)}return{nodes:n,edges:r}}runOneStep(t){var e;const n=this,r=n.nodes;if(!r)return;const{edges:i,center:o,gravity:a,speed:s,clustering:u}=n,c=n.height*n.width,l=Math.sqrt(c)/10,h=c/(r.length+1),f=Math.sqrt(h),d=[];if(r.forEach((t,e)=>{d[e]={x:0,y:0}}),n.applyCalculate(r,i,d,f,h),u){const e=n.clusterGravity||a;r.forEach((n,r)=>{if(!X(n.x)||!X(n.y))return;const i=t[n.cluster],o=Math.sqrt((n.x-i.cx)*(n.x-i.cx)+(n.y-i.cy)*(n.y-i.cy)),a=f*e;d[r].x-=a*(n.x-i.cx)/o,d[r].y-=a*(n.y-i.cy)/o});for(const e in t)t[e].cx=0,t[e].cy=0,t[e].count=0;r.forEach(e=>{const n=t[e.cluster];X(e.x)&&(n.cx+=e.x),X(e.y)&&(n.cy+=e.y),n.count++});for(const e in t)t[e].cx/=t[e].count,t[e].cy/=t[e].count}r.forEach((t,e)=>{if(!X(t.x)||!X(t.y))return;const n=.01*f*a;d[e].x-=n*(t.x-o[0]),d[e].y-=n*(t.y-o[1])}),r.forEach((t,e)=>{if(X(t.fx)&&X(t.fy))return t.x=t.fx,void(t.y=t.fy);if(!X(t.x)||!X(t.y))return;const n=Math.sqrt(d[e].x*d[e].x+d[e].y*d[e].y);if(n>0){const r=Math.min(l*(s/800),n);t.x+=d[e].x/n*r,t.y+=d[e].y/n*r}}),null===(e=n.tick)||void 0===e||e.call(n)}applyCalculate(t,e,n,r,i){this.calRepulsive(t,n,i),e&&this.calAttractive(e,n,r)}calRepulsive(t,e,n){t.forEach((r,i)=>{e[i]={x:0,y:0},t.forEach((t,o)=>{if(i===o)return;if(!(X(r.x)&&X(t.x)&&X(r.y)&&X(t.y)))return;let a=r.x-t.x,s=r.y-t.y,u=a*a+s*s;if(0===u){u=1;const t=i>o?1:-1;a=.01*t,s=.01*t}const c=n/u;e[i].x+=a*c,e[i].y+=s*c})})}calAttractive(t,e,n){t.forEach(t=>{const r=Z(t,"source"),i=Z(t,"target");if(!r||!i)return;const o=this.nodeIdxMap[r],a=this.nodeIdxMap[i];if(o===a)return;const s=this.nodeMap[r],u=this.nodeMap[i];if(!(X(u.x)&&X(s.x)&&X(u.y)&&X(s.y)))return;const c=u.x-s.x,l=u.y-s.y,h=Math.sqrt(c*c+l*l),f=h*h/n;e[a].x-=c/h*f,e[a].y-=l/h*f,e[o].x+=c/h*f,e[o].y+=l/h*f})}stop(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)}destroy(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0}getType(){return"fruchterman"}}var Ye=n(11),Xe=n.n(Ye),He=n(7),qe=n.n(He),Ke=n(8),Ze=n.n(Ke),$e=n(12),Qe=n.n($e),Je=(n(30),n(3)),tn=n(2),en=n(6);function nn(t){return"number"==typeof t}function rn(t){return void 0===t?0:t>360||t<-360?t%360:t}function on(t,e,n){return nn(t)?tn.e.fromValues(t,e,n):3===t.length?tn.e.clone(t):tn.e.fromValues(t[0],t[1],t[2])}var an,sn,un,cn,ln,hn,fn,dn,pn,gn,vn=function(){function t(e,n){qe()(this,t),this.name=void 0,this.matrix=void 0,this.right=void 0,this.up=void 0,this.forward=void 0,this.position=void 0,this.focalPoint=void 0,this.distanceVector=void 0,this.distance=void 0,this.dollyingStep=void 0,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=e,this.matrix=tn.b.clone(n.matrix),this.right=tn.e.clone(n.right),this.up=tn.e.clone(n.up),this.forward=tn.e.clone(n.forward),this.position=tn.e.clone(n.position),this.focalPoint=tn.e.clone(n.focalPoint),this.distanceVector=tn.e.clone(n.distanceVector),this.azimuth=n.azimuth,this.elevation=n.elevation,this.roll=n.roll,this.relAzimuth=n.relAzimuth,this.relElevation=n.relElevation,this.relRoll=n.relRoll,this.dollyingStep=n.dollyingStep,this.distance=n.distance}return Ze()(t,[{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getRoll",value:function(){return this.roll}},{key:"retrieve",value:function(t){t.matrix=tn.b.copy(t.matrix,this.matrix),t.right=tn.e.copy(t.right,this.right),t.up=tn.e.copy(t.up,this.up),t.forward=tn.e.copy(t.forward,this.forward),t.position=tn.e.copy(t.position,this.position),t.focalPoint=tn.e.copy(t.focalPoint,this.focalPoint),t.distanceVector=tn.e.copy(t.distanceVector,this.distanceVector),t.azimuth=this.azimuth,t.elevation=this.elevation,t.roll=this.roll,t.relAzimuth=this.relAzimuth,t.relElevation=this.relElevation,t.relRoll=this.relRoll,t.dollyingStep=this.dollyingStep,t.distance=this.distance}}]),t}();!function(t){t.ORBITING="ORBITING",t.EXPLORING="EXPLORING",t.TRACKING="TRACKING"}(dn||(dn={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(pn||(pn={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(gn||(gn={}));var mn,yn,bn,xn,wn,_n,Sn,En=Math.PI/180,Mn=180/Math.PI,On=(an=Object(en.injectable)(),sn=Object(en.inject)(Je.IDENTIFIER.InteractorService),an((fn=hn=function(){function t(){qe()(this,t),this.matrix=tn.b.create(),this.right=tn.e.fromValues(1,0,0),this.up=tn.e.fromValues(0,1,0),this.forward=tn.e.fromValues(0,0,1),this.position=tn.e.fromValues(0,0,1),this.focalPoint=tn.e.fromValues(0,0,0),this.distanceVector=tn.e.fromValues(0,0,0),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.rotateWorld=!1,Xe()(this,"interactor",ln,this),this.fov=30,this.near=.1,this.far=1e4,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.zoom=1,this.perspective=tn.b.create(),this.view=void 0,this.following=void 0,this.type=dn.EXPLORING,this.trackingMode=pn.DEFAULT,this.projectionMode=gn.PERSPECTIVE,this.frustum=new Je.Frustum,this.landmarks=[],this.landmarkAnimationID=void 0}return Ze()(t,[{key:"clone",value:function(){var e=new t;return e.setType(this.type,void 0),e.interactor=this.interactor,e}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.perspective}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"setType",value:function(t,e){return this.type=t,this.type===dn.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===dn.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==dn.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){this.rotateWorld=t,this._getAngles()}},{key:"getViewTransform",value:function(){return tn.b.invert(tn.b.create(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===gn.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===gn.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setPerspective",value:function(t,e,n,r){return this.projectionMode=gn.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r,tn.b.perspective(this.perspective,this.fov*En,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){this.projectionMode=gn.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var a=(this.rright-this.left)/(2*this.zoom),s=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,l=u-a,h=u+a,f=c+s,d=c-s;if(void 0!==this.view&&this.view.enabled){var p=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(l+=p*this.view.offsetX)+p*this.view.width,d=(f-=g*this.view.offsetY)-g*this.view.height}return tn.b.ortho(this.perspective,l,h,f,d,i,o),this}},{key:"setPosition",value:function(t,e,n){return this._setPosition(t,e,n),this.setFocalPoint(this.focalPoint),this}},{key:"setFocalPoint",value:function(t,e,n){var r=tn.e.fromValues(0,1,0);if(this.focalPoint=on(t,e,n),this.trackingMode===pn.CINEMATIC){var i=tn.e.subtract(tn.e.create(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=tn.e.length(i),a=Math.asin(e/o)*Mn,s=90+Math.atan2(n,t)*Mn,u=tn.b.create();tn.b.rotateY(u,u,s*En),tn.b.rotateX(u,u,a*En),r=tn.e.transformMat4(tn.e.create(),[0,1,0],u)}return tn.b.invert(this.matrix,tn.b.lookAt(tn.b.create(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this}},{key:"setDistance",value:function(t){if(!(this.distance===t||t<0)){this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100;var e=tn.e.create();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this}}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"changeAzimuth",value:function(t){return this.setAzimuth(this.azimuth+t),this}},{key:"changeElevation",value:function(t){return this.setElevation(this.elevation+t),this}},{key:"changeRoll",value:function(t){return this.setRoll(this.roll+t),this}},{key:"setAzimuth",value:function(t){return this.azimuth=rn(t),this.computeMatrix(),this._getAxes(),this.type===dn.ORBITING||this.type===dn.EXPLORING?this._getPosition():this.type===dn.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=rn(t),this.computeMatrix(),this._getAxes(),this.type===dn.ORBITING||this.type===dn.EXPLORING?this._getPosition():this.type===dn.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=rn(t),this.computeMatrix(),this._getAxes(),this.type===dn.ORBITING||this.type===dn.EXPLORING?this._getPosition():this.type===dn.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,e,n){if(this.type===dn.EXPLORING){t=rn(t),e=rn(e),n=rn(n);var r=tn.c.setAxisAngle(tn.c.create(),[1,0,0],(this.rotateWorld?1:-1)*e*En),i=tn.c.setAxisAngle(tn.c.create(),[0,1,0],(this.rotateWorld?1:-1)*t*En),o=tn.c.setAxisAngle(tn.c.create(),[0,0,1],n*En),a=tn.c.multiply(tn.c.create(),i,r);a=tn.c.multiply(tn.c.create(),a,o);var s=tn.b.fromQuat(tn.b.create(),a);tn.b.translate(this.matrix,this.matrix,[0,0,-this.distance]),tn.b.multiply(this.matrix,this.matrix,s),tn.b.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+e)>90)return;this.relElevation=rn(e),this.relAzimuth=rn(t),this.relRoll=rn(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===dn.ORBITING||this.type===dn.EXPLORING?this._getPosition():this.type===dn.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=on(t,e,0),r=tn.e.clone(this.position);return tn.e.add(r,r,tn.e.scale(tn.e.create(),this.right,n[0])),tn.e.add(r,r,tn.e.scale(tn.e.create(),this.up,n[1])),this._setPosition(r),this}},{key:"dolly",value:function(t){var e=this.forward,n=tn.e.clone(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===dn.ORBITING||this.type===dn.EXPLORING?this._getDistance():this.type===dn.TRACKING&&tn.e.add(this.focalPoint,n,this.distanceVector),this}},{key:"createLandmark",value:function(t,e){var n=this.clone();n.setPosition(e.position),n.setFocalPoint(e.focalPoint),void 0!==e.roll&&n.setRoll(e.roll);var r=new vn(t,n);return this.landmarks.push(r),r}},{key:"setLandmark",value:function(t){var e=new vn(t,this);return this.landmarks.push(e),this}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,r=this.landmarks.find((function(e){return e.name===t}));if(r){if(0===n)return void r.retrieve(this);void 0!==this.landmarkAnimationID&&window.cancelAnimationFrame(this.landmarkAnimationID),this.interactor.disconnect();var i,o=r.getPosition(),a=r.getFocalPoint(),s=r.getRoll(),u=function t(r){void 0===i&&(i=r);var u,c=r-i,l=(1-Math.cos(c/n*Math.PI))/2,h=tn.e.create(),f=tn.e.create();if(tn.e.lerp(h,e.focalPoint,a,l),tn.e.lerp(f,e.position,o,l),u=e.roll*(1-l)+s*l,e.setFocalPoint(h),e.setPosition(f),e.setRoll(u),e.computeMatrix(),!(tn.e.dist(h,a)+tn.e.dist(f,o)>.01))return e.setFocalPoint(h),e.setPosition(f),e.setRoll(u),e.computeMatrix(),void e.interactor.connect();c<n&&(e.landmarkAnimationID=window.requestAnimationFrame(t))};window.requestAnimationFrame(u)}}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles()}},{key:"computeMatrix",value:function(){var t,e,n=tn.c.setAxisAngle(tn.c.create(),[0,0,1],this.roll*En);tn.b.identity(this.matrix),t=tn.c.setAxisAngle(tn.c.create(),[1,0,0],(this.rotateWorld&&this.type!==dn.TRACKING||this.type===dn.TRACKING?1:-1)*this.elevation*En),e=tn.c.setAxisAngle(tn.c.create(),[0,1,0],(this.rotateWorld&&this.type!==dn.TRACKING||this.type===dn.TRACKING?1:-1)*this.azimuth*En);var r=tn.c.multiply(tn.c.create(),e,t);r=tn.c.multiply(tn.c.create(),r,n);var i=tn.b.fromQuat(tn.b.create(),r);this.type===dn.ORBITING||this.type===dn.EXPLORING?(tn.b.translate(this.matrix,this.matrix,this.focalPoint),tn.b.multiply(this.matrix,this.matrix,i),tn.b.translate(this.matrix,this.matrix,[0,0,this.distance])):this.type===dn.TRACKING&&(tn.b.translate(this.matrix,this.matrix,this.position),tn.b.multiply(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=on(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1}},{key:"_getAxes",value:function(){tn.e.copy(this.right,on(tn.f.transformMat4(tn.f.create(),[1,0,0,0],this.matrix))),tn.e.copy(this.up,on(tn.f.transformMat4(tn.f.create(),[0,1,0,0],this.matrix))),tn.e.copy(this.forward,on(tn.f.transformMat4(tn.f.create(),[0,0,1,0],this.matrix))),tn.e.normalize(this.right,this.right),tn.e.normalize(this.up,this.up),tn.e.normalize(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=tn.e.length(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===dn.TRACKING||this.rotateWorld?(this.elevation=Math.asin(e/r)*Mn,this.azimuth=Math.atan2(-t,-n)*Mn):(this.elevation=-Math.asin(e/r)*Mn,this.azimuth=-Math.atan2(-t,-n)*Mn)}},{key:"_getPosition",value:function(){tn.e.copy(this.position,on(tn.f.transformMat4(tn.f.create(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){tn.e.transformMat3(this.distanceVector,[0,0,-this.distance],tn.a.fromMat4(tn.a.create(),this.matrix)),tn.e.add(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=tn.e.subtract(tn.e.create(),this.focalPoint,this.position),this.distance=tn.e.length(this.distanceVector),this.dollyingStep=this.distance/100}}]),t}(),hn.ProjectionMode={ORTHOGRAPHIC:"ORTHOGRAPHIC",PERSPECTIVE:"PERSPECTIVE"},cn=fn,ln=Qe()(cn.prototype,"interactor",[sn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),un=cn))||un),An=(mn=Object(en.injectable)(),yn=Object(en.inject)(Je.IDENTIFIER.GeometryComponentManager),mn((Sn=_n=function(){function t(){qe()(this,t),this.config=void 0,Xe()(this,"geometry",wn,this),this.entity=void 0,this.component=void 0}return Ze()(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.component=this.geometry.create(t),this.component.entity=t,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),t}(),_n.BOX="box",_n.SPHERE="sphere",_n.PLANE="plane",_n.MERGED="merged",xn=Sn,wn=Qe()(xn.prototype,"geometry",[yn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bn=xn))||bn),kn=n(10),Cn=n.n(kn),In=n(16),Tn=n.n(In),Pn=n(4),Nn=n.n(Pn),jn=n(9);function Dn(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}var Ln={}.toString,Rn=function(t,e){return Ln.call(t)==="[object "+e+"]"},Bn=n(43),Gn=n.n(Bn),Fn={};Fn["[object Float32Array]"]=Fn["[object Float64Array]"]=Fn["[object Int8Array]"]=Fn["[object Int16Array]"]=Fn["[object Int32Array]"]=Fn["[object Uint8Array]"]=Fn["[object Uint8ClampedArray]"]=Fn["[object Uint16Array]"]=Fn["[object Uint32Array]"]=!0,Fn["[object Arguments]"]=Fn["[object Array]"]=Fn["[object ArrayBuffer]"]=Fn["[object Boolean]"]=Fn["[object DataView]"]=Fn["[object Date]"]=Fn["[object Error]"]=Fn["[object Function]"]=Fn["[object Map]"]=Fn["[object Number]"]=Fn["[object Object]"]=Fn["[object RegExp]"]=Fn["[object Set]"]=Fn["[object String]"]=Fn["[object WeakMap]"]=!1;var zn=Object.prototype.toString;var Un,Vn,Wn,Yn,Xn,Hn,qn,Kn=function(t){return function(t){return!!t&&"object"===Gn()(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Fn[zn.call(t)]};function Zn(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 $n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zn(Object(n),!0).forEach((function(e){Nn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Qn,Jn,tr,er,nr,rr,ir,or,ar,sr,ur,cr,lr,hr,fr,dr,pr,gr,vr,mr,yr,br,xr,wr,_r,Sr,Er,Mr,Or,Ar,kr,Cr,Ir,Tr,Pr,Nr=(Un=Object(en.injectable)(),Vn=Object(en.inject)(Je.IDENTIFIER.RenderEngine),Wn=Object(en.inject)(Je.IDENTIFIER.ConfigService),Un((Xn=function(){function t(){qe()(this,t),Xe()(this,"engine",Hn,this),Xe()(this,"configService",qn,this),this.entity=Object(Je.createEntity)(),this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}var e,n,r;return Ze()(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init($n({canvas:e||Dn(),swapChainFormat:jn.TextureFormat.BGRA8Unorm,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,r=this;if("string"==typeof t){var i=nn(e)||Kn(e)||(n=e,Array.isArray?Array.isArray(n):Rn(n,"Array"));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 a=this.compiledBundle.context.uniforms.find((function(e){return e.name===t}));a&&(i?(a.data=e,a.isReferer=!1,a.storageClass===Je.STORAGE_CLASS.Uniform?this.model&&this.model.updateUniform(t,e):this.model&&this.model.updateBuffer(t,e)):(a.isReferer=!0,a.data=e))}}else Object.keys(t).forEach((function(e){r.setBinding(e,t[e])}));return this}},{key:"execute",value:(r=Tn()(Cn.a.mark((function t(){var e,n,r=this,i=arguments;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[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=Tn()(Cn.a.mark((function t(){return Cn.a.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=Tn()(Cn.a.mark((function t(){var e,n,r;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=$n({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?Je.Target.WGSL:Je.Target.GLSL450:Je.Target.GLSL100,r=this.compiledBundle.shaders[n],e.defines.filter((function(t){return t.runtime})).forEach((function(t){var e="".concat(Je.DefineValuePlaceholder).concat(t.name);r=r.replace(e,"".concat(t.value))})),e.shader=r,e.uniforms.forEach((function(t){if(!t.data&&t.storageClass===Je.STORAGE_CLASS.StorageBuffer){var n=1;t.type===Je.AST_TOKEN_TYPES.FloatArray?n=1:t.type===Je.AST_TOKEN_TYPES.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}(),Hn=Qe()(Xn.prototype,"engine",[Vn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qn=Qe()(Xn.prototype,"configService",[Wn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Yn=Xn))||Yn),jr=(Qn=Object(en.injectable)(),Jn=Object(en.inject)(Je.IDENTIFIER.MaterialComponentManager),Qn((ir=rr=function(){function t(){qe()(this,t),this.config=void 0,Xe()(this,"material",nr,this),this.entity=void 0,this.component=void 0}return Ze()(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t,e){this.entity=t,this.component=this.material.create(t),this.component.entity=t,this.component.type=e,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),t}(),rr.BASIC="basic",er=ir,nr=Qe()(er.prototype,"material",[Jn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tr=er))||tr),Dr=(or=Object(en.injectable)(),ar=Object(en.inject)(Je.IDENTIFIER.MeshComponentManager),sr=Object(en.inject)(Je.IDENTIFIER.CullableComponentManager),ur=Object(en.inject)(Je.IDENTIFIER.TransformComponentManager),cr=Object(en.inject)(Je.IDENTIFIER.Systems),lr=Object(en.named)(Je.IDENTIFIER.SceneGraphSystem),or((yr=mr=function(){function t(){qe()(this,t),this.attributes={},this.config=void 0,Xe()(this,"mesh",dr,this),Xe()(this,"cullable",pr,this),Xe()(this,"transform",gr,this),Xe()(this,"sceneGraphSystem",vr,this),this.meshComponent=void 0,this.transformComponent=void 0,this.entity=void 0}return Ze()(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getTransformComponent",value:function(){return this.transformComponent}},{key:"getMeshComponent",value:function(){return this.meshComponent}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.cullable.create(t),this.meshComponent=this.mesh.create(t),this.transformComponent=this.transform.create(t),this.onEntityCreated()}},{key:"setMaterial",value:function(t){return this.meshComponent.material=t,this}},{key:"setGeometry",value:function(t){return this.meshComponent.geometry=t,this}},{key:"setAttributes",value:function(t){var e=this;Object.keys(t).forEach((function(n){void 0!==t[n]&&t[n]!==e.attributes[n]&&(e.onAttributeChanged({name:n,data:t[n]}),e.attributes[n]=t[n])}))}},{key:"setVisible",value:function(t){var e=this;return this.meshComponent.visible=t,this.meshComponent.children.forEach((function(n){var r=e.mesh.getComponentByEntity(n);r&&(r.visible=t)})),this}},{key:"isVisible",value:function(){return this.meshComponent.visible}},{key:"attach",value:function(t){return this.sceneGraphSystem.attach(this.entity,t.entity),this}},{key:"detach",value:function(){return this.sceneGraphSystem.detach(this.entity),this}},{key:"detachChildren",value:function(){return this.sceneGraphSystem.detachChildren(this.entity),this}},{key:"onEntityCreated",value:function(){}},{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data;this.meshComponent&&this.meshComponent.material&&this.meshComponent.material.setUniform(this.convertAttributeName2UniformName(e),n)}},{key:"convertAttributeName2UniformName",value:function(t){return t}}]),t}(),mr.POINT="point",mr.LINE="line",mr.GRID="grid",fr=yr,dr=Qe()(fr.prototype,"mesh",[ar],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),pr=Qe()(fr.prototype,"cullable",[sr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),gr=Qe()(fr.prototype,"transform",[ur],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vr=Qe()(fr.prototype,"sceneGraphSystem",[cr,lr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hr=fr))||hr),Lr=n(286),Rr=n.n(Lr),Br=function(){function t(e,n){qe()(this,t),this.attribute=void 0,this.buffer=void 0;var r=n.buffer,i=n.offset,o=n.stride,a=n.normalized,s=n.size,u=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:u||0},s&&(this.attribute.size=s)}return Ze()(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}(),Gr=(br={},Nn()(br,Je.gl.POINTS,"points"),Nn()(br,Je.gl.LINES,"lines"),Nn()(br,Je.gl.LINE_LOOP,"line loop"),Nn()(br,Je.gl.LINE_STRIP,"line strip"),Nn()(br,Je.gl.TRIANGLES,"triangles"),Nn()(br,Je.gl.TRIANGLE_FAN,"triangle fan"),Nn()(br,Je.gl.TRIANGLE_STRIP,"triangle strip"),br),Fr=(xr={},Nn()(xr,Je.gl.STATIC_DRAW,"static"),Nn()(xr,Je.gl.DYNAMIC_DRAW,"dynamic"),Nn()(xr,Je.gl.STREAM_DRAW,"stream"),xr),zr=(wr={},Nn()(wr,Je.gl.BYTE,"int8"),Nn()(wr,Je.gl.UNSIGNED_INT,"int16"),Nn()(wr,Je.gl.INT,"int32"),Nn()(wr,Je.gl.UNSIGNED_BYTE,"uint8"),Nn()(wr,Je.gl.UNSIGNED_SHORT,"uint16"),Nn()(wr,Je.gl.UNSIGNED_INT,"uint32"),Nn()(wr,Je.gl.FLOAT,"float"),wr),Ur=(_r={},Nn()(_r,Je.gl.ALPHA,"alpha"),Nn()(_r,Je.gl.LUMINANCE,"luminance"),Nn()(_r,Je.gl.LUMINANCE_ALPHA,"luminance alpha"),Nn()(_r,Je.gl.RGB,"rgb"),Nn()(_r,Je.gl.RGBA,"rgba"),Nn()(_r,Je.gl.RGBA4,"rgba4"),Nn()(_r,Je.gl.RGB5_A1,"rgb5 a1"),Nn()(_r,Je.gl.RGB565,"rgb565"),Nn()(_r,Je.gl.DEPTH_COMPONENT,"depth"),Nn()(_r,Je.gl.DEPTH_STENCIL,"depth stencil"),_r),Vr=(Sr={},Nn()(Sr,Je.gl.DONT_CARE,"dont care"),Nn()(Sr,Je.gl.NICEST,"nice"),Nn()(Sr,Je.gl.FASTEST,"fast"),Sr),Wr=(Er={},Nn()(Er,Je.gl.NEAREST,"nearest"),Nn()(Er,Je.gl.LINEAR,"linear"),Nn()(Er,Je.gl.LINEAR_MIPMAP_LINEAR,"mipmap"),Nn()(Er,Je.gl.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Nn()(Er,Je.gl.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Nn()(Er,Je.gl.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),Er),Yr=(Mr={},Nn()(Mr,Je.gl.REPEAT,"repeat"),Nn()(Mr,Je.gl.CLAMP_TO_EDGE,"clamp"),Nn()(Mr,Je.gl.MIRRORED_REPEAT,"mirror"),Mr),Xr=(Or={},Nn()(Or,Je.gl.NONE,"none"),Nn()(Or,Je.gl.BROWSER_DEFAULT_WEBGL,"browser"),Or),Hr=(Ar={},Nn()(Ar,Je.gl.NEVER,"never"),Nn()(Ar,Je.gl.ALWAYS,"always"),Nn()(Ar,Je.gl.LESS,"less"),Nn()(Ar,Je.gl.LEQUAL,"lequal"),Nn()(Ar,Je.gl.GREATER,"greater"),Nn()(Ar,Je.gl.GEQUAL,"gequal"),Nn()(Ar,Je.gl.EQUAL,"equal"),Nn()(Ar,Je.gl.NOTEQUAL,"notequal"),Ar),qr=(kr={},Nn()(kr,Je.gl.FUNC_ADD,"add"),Nn()(kr,Je.gl.MIN_EXT,"min"),Nn()(kr,Je.gl.MAX_EXT,"max"),Nn()(kr,Je.gl.FUNC_SUBTRACT,"subtract"),Nn()(kr,Je.gl.FUNC_REVERSE_SUBTRACT,"reverse subtract"),kr),Kr=(Cr={},Nn()(Cr,Je.gl.ZERO,"zero"),Nn()(Cr,Je.gl.ONE,"one"),Nn()(Cr,Je.gl.SRC_COLOR,"src color"),Nn()(Cr,Je.gl.ONE_MINUS_SRC_COLOR,"one minus src color"),Nn()(Cr,Je.gl.SRC_ALPHA,"src alpha"),Nn()(Cr,Je.gl.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Nn()(Cr,Je.gl.DST_COLOR,"dst color"),Nn()(Cr,Je.gl.ONE_MINUS_DST_COLOR,"one minus dst color"),Nn()(Cr,Je.gl.DST_ALPHA,"dst alpha"),Nn()(Cr,Je.gl.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Nn()(Cr,Je.gl.CONSTANT_COLOR,"constant color"),Nn()(Cr,Je.gl.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Nn()(Cr,Je.gl.CONSTANT_ALPHA,"constant alpha"),Nn()(Cr,Je.gl.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Nn()(Cr,Je.gl.SRC_ALPHA_SATURATE,"src alpha saturate"),Cr),Zr=(Ir={},Nn()(Ir,Je.gl.NEVER,"never"),Nn()(Ir,Je.gl.ALWAYS,"always"),Nn()(Ir,Je.gl.LESS,"less"),Nn()(Ir,Je.gl.LEQUAL,"lequal"),Nn()(Ir,Je.gl.GREATER,"greater"),Nn()(Ir,Je.gl.GEQUAL,"gequal"),Nn()(Ir,Je.gl.EQUAL,"equal"),Nn()(Ir,Je.gl.NOTEQUAL,"notequal"),Ir),$r=(Tr={},Nn()(Tr,Je.gl.ZERO,"zero"),Nn()(Tr,Je.gl.KEEP,"keep"),Nn()(Tr,Je.gl.REPLACE,"replace"),Nn()(Tr,Je.gl.INVERT,"invert"),Nn()(Tr,Je.gl.INCR,"increment"),Nn()(Tr,Je.gl.DECR,"decrement"),Nn()(Tr,Je.gl.INCR_WRAP,"increment wrap"),Nn()(Tr,Je.gl.DECR_WRAP,"decrement wrap"),Tr),Qr=(Pr={},Nn()(Pr,Je.gl.FRONT,"front"),Nn()(Pr,Je.gl.BACK,"back"),Pr),Jr=function(){function t(e,n){qe()(this,t),this.buffer=void 0;var r=n.data,i=n.usage,o=n.type;this.buffer=e.buffer({data:r,usage:Fr[i||Je.gl.STATIC_DRAW],type:zr[o||Je.gl.UNSIGNED_BYTE]})}return Ze()(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}(),ti=n(28),ei=n.n(ti),ni={};ni["[object Float32Array]"]=ni["[object Float64Array]"]=ni["[object Int8Array]"]=ni["[object Int16Array]"]=ni["[object Int32Array]"]=ni["[object Uint8Array]"]=ni["[object Uint8ClampedArray]"]=ni["[object Uint16Array]"]=ni["[object Uint32Array]"]=!0,ni["[object Arguments]"]=ni["[object Array]"]=ni["[object ArrayBuffer]"]=ni["[object Boolean]"]=ni["[object DataView]"]=ni["[object Date]"]=ni["[object Error]"]=ni["[object Function]"]=ni["[object Map]"]=ni["[object Number]"]=ni["[object Object]"]=ni["[object RegExp]"]=ni["[object Set]"]=ni["[object String]"]=ni["[object WeakMap]"]=!1;var ri=Object.prototype.toString;var ii=function(t){return function(t){return!!t&&"object"===Gn()(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!ni[ri.call(t)]};function oi(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 ai(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?oi(Object(n),!0).forEach((function(e){Nn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var si=0,ui=function(){function t(e,n){var r=this;qe()(this,t),this.reGl=e,this.context=n,this.entity=Object(Je.createEntity)(),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 i={};this.context.uniforms.forEach((function(t){var e=t.name,n=t.type,o=t.data,a=t.isReferer,s=t.storageClass;if(s===Je.STORAGE_CLASS.StorageBuffer){if(a)r.textureCache[e]={data:void 0},i["".concat(e,"Size")]=function(){return o.compiledBundle.context.output.textureSize};else{r.textureCache[e]=r.calcDataTexture(e,n,o);var u=r.textureCache[e],c=u.textureWidth,l=u.isOutput;i["".concat(e,"Size")]=[c,c],l&&(r.outputTextureName=e,r.context.needPingpong&&(r.outputTextureName="".concat(e,"Output"),r.textureCache[r.outputTextureName]=r.calcDataTexture(e,n,o)))}i[e]=function(){return r.textureCache[e].texture}}else if(s===Je.STORAGE_CLASS.Uniform){if(o&&(Array.isArray(o)||ii(o))&&o.length>16)throw new Error("invalid data type ".concat(n));i[e]=function(){return t.data}}}));var o=this.getOuputDataTexture(),a=o.textureWidth,s=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=s,this.context.output.textureSize=[a,a];var u={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:i,vert:"attribute vec3 a_Position;\nattribute vec2 a_TexCoord;\n\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_Position = vec4(a_Position, 1.0);\n v_TexCoord = a_TexCoord;\n}",primitive:"triangle strip",count:4};this.computeCommand=this.reGl(u)}var e;return Ze()(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use((function(){t.computeCommand()}))}},{key:"readData",value:(e=Tn()(Cn.a.mark((function t(){var e,n,r,i,o,a,s,u,c=this;return Cn.a.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,i=n.elementsPerTexel,o=n.typedArrayConstructor,a=void 0===o?Float32Array:o,s=[],4!==i)for(u=0;u<e.length;u+=4)1===i?s.push(e[u]):2===i?s.push(e[u],e[u+1]):s.push(e[u],e[u+1],e[u+2]);else s=e;return t.abrupt("return",new a(s.slice(0,r)));case 6:return t.abrupt("return",new Float32Array);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"confirmInput",value:function(t,e){var n;this.entity===t.entity?(this.dynamicPingpong=!0,n=this):n=t,this.textureCache[e].id=n.getOuputDataTexture().id,this.textureCache[e].texture=n.getOuputDataTexture().texture}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(t,e){var n=this.context.uniforms.find((function(e){return e.name===t}));if(n){var r=this.calcDataTexture(t,n.type,e),i=r.texture,o=r.data;this.textureCache[t].data=o,this.textureCache[t].texture=i}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,n=t.textureWidth;return ai(ai({},t),{},{id:si++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===Je.AST_TOKEN_TYPES.Vector4FloatArray&&(r=4);for(var i=[],o=0;o<n.length;o+=r)1===r?i.push(n[o],0,0,0):2===r?i.push(n[o],n[o+1],0,0):3===r?i.push(n[o],n[o+1],n[o+2],0):4===r&&i.push(n[o],n[o+1],n[o+2],n[o+3]);var a=n.length,s=Math.ceil(a/r),u=Math.ceil(Math.sqrt(s)),c=u*u;s<c&&i.push.apply(i,ei()(new Array(4*(c-s)).fill(0)));var l=this.reGl.texture({width:u,height:u,data:i,type:"float"});return{id:si++,data:i,originalDataLength:a,typedArrayConstructor:ii(n)?n.constructor:void 0,textureWidth:u,texture:l,texelCount:s,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),ci=function(){function t(e,n){qe()(this,t),this.elements=void 0;var r=n.data,i=n.usage,o=n.type,a=n.count;this.elements=e.elements({data:r,usage:Fr[i||Je.gl.STATIC_DRAW],type:zr[o||Je.gl.UNSIGNED_BYTE],count:a})}return Ze()(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}(),li=function(){function t(e,n){qe()(this,t),this.framebuffer=void 0;var r=n.width,i=n.height,o=n.color,a=n.colors,s=(n.depth,n.stencil,{width:r,height:i});Array.isArray(a)&&(s.colors=a.map((function(t){return t.get()}))),o&&"boolean"!=typeof o&&(s.color=o.get()),this.framebuffer=e.framebuffer(s)}return Ze()(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}();function hi(t){var e={};return Object.keys(t).forEach((function(n){!function t(e,n,r,i){if(null===n||"number"==typeof n||"boolean"==typeof n||Array.isArray(n)&&"number"==typeof n[0]||ii(n)||""===n||void 0!==n.resize)return void(r["".concat(i&&i+".").concat(e)]=n);o=n,a=Gn()(o),null==o||"object"!==a&&"function"!==a||Object.keys(n).forEach((function(o){t(o,n[o],r,"".concat(i&&i+".").concat(e))}));var o,a;Array.isArray(n)&&n.forEach((function(n,o){Object.keys(n).forEach((function(a){t(a,n[a],r,"".concat(i&&i+".").concat(e,"[").concat(o,"]"))}))}))}(n,t[n],e,"")})),e}function fi(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 di(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fi(Object(n),!0).forEach((function(e){Nn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var pi,gi,vi=function(){function t(e,n){qe()(this,t),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=e;var r=n.vs,i=n.fs,o=n.defines,a=n.attributes,s=n.uniforms,u=n.primitive,c=n.count,l=n.elements,h=n.depth,f=n.blend,d=n.stencil,p=n.cull,g=n.instances,v=n.scissor,m=n.viewport,y={};s&&(this.uniforms=hi(s),Object.keys(s).forEach((function(t){y[t]=e.prop(t)})));var b={};Object.keys(a).forEach((function(t){b[t]=a[t].get()}));var x=o&&this.generateDefines(o)||"",w={attributes:b,frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(x,"\n").concat(i),uniforms:y,vert:"\n".concat(x,"\n").concat(r),primitive:Gr[void 0===u?Je.gl.TRIANGLES:u]};g&&(w.instances=g),c&&(w.count=c),l&&(w.elements=l.get()),v&&(w.scissor=v),m&&(w.viewport=m),this.initDepthDrawParams({depth:h},w),this.initBlendDrawParams({blend:f},w),this.initStencilDrawParams({stencil:d},w),this.initCullDrawParams({cull:p},w),this.drawCommand=e(w)}return Ze()(t,[{key:"addUniforms",value:function(t){this.uniforms=di(di({},this.uniforms),hi(t))}},{key:"draw",value:function(t){var e=di(di({},this.uniforms),hi(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=Gn()(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:Hr[n.func||Je.gl.LESS],range:n.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,e){var n=t.blend;if(n){var r=n.enable,i=n.func,o=n.equation,a=n.color,s=void 0===a?[0,0,0,0]:a;e.blend={enable:!!r,func:{srcRGB:Kr[i&&i.srcRGB||Je.gl.SRC_ALPHA],srcAlpha:Kr[i&&i.srcAlpha||Je.gl.SRC_ALPHA],dstRGB:Kr[i&&i.dstRGB||Je.gl.ONE_MINUS_SRC_ALPHA],dstAlpha:Kr[i&&i.dstAlpha||Je.gl.ONE_MINUS_SRC_ALPHA]},equation:{rgb:qr[o&&o.rgb||Je.gl.FUNC_ADD],alpha:qr[o&&o.alpha||Je.gl.FUNC_ADD]},color:s}}}},{key:"initStencilDrawParams",value:function(t,e){var n=t.stencil;if(n){var r=n.enable,i=n.mask,o=void 0===i?-1:i,a=n.func,s=void 0===a?{cmp:Je.gl.ALWAYS,ref:0,mask:-1}:a,u=n.opFront,c=void 0===u?{fail:Je.gl.KEEP,zfail:Je.gl.KEEP,zpass:Je.gl.KEEP}:u,l=n.opBack,h=void 0===l?{fail:Je.gl.KEEP,zfail:Je.gl.KEEP,zpass:Je.gl.KEEP}:l;e.stencil={enable:!!r,mask:o,func:di(di({},s),{},{cmp:Zr[s.cmp]}),opFront:{fail:$r[c.fail],zfail:$r[c.zfail],zpass:$r[c.zpass]},opBack:{fail:$r[h.fail],zfail:$r[h.zfail],zpass:$r[h.zpass]}}}}},{key:"initCullDrawParams",value:function(t,e){var n=t.cull;if(n){var r=n.enable,i=n.face,o=void 0===i?Je.gl.BACK:i;e.cull={enable:!!r,face:Qr[o]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map((function(e){return"#define ".concat(e," ").concat(Number(t[e]))})).join("\n")}}]),t}(),mi=function(){function t(e,n){qe()(this,t),this.texture=void 0,this.width=void 0,this.height=void 0;var r=n.data,i=n.type,o=void 0===i?Je.gl.UNSIGNED_BYTE:i,a=n.width,s=n.height,u=n.flipY,c=void 0!==u&&u,l=n.format,h=void 0===l?Je.gl.RGBA:l,f=n.mipmap,d=void 0!==f&&f,p=n.wrapS,g=void 0===p?Je.gl.CLAMP_TO_EDGE:p,v=n.wrapT,m=void 0===v?Je.gl.CLAMP_TO_EDGE:v,y=n.aniso,b=void 0===y?0:y,x=n.alignment,w=void 0===x?1:x,_=n.premultiplyAlpha,S=void 0!==_&&_,E=n.mag,M=void 0===E?Je.gl.NEAREST:E,O=n.min,A=void 0===O?Je.gl.NEAREST:O,k=n.colorSpace,C=void 0===k?Je.gl.BROWSER_DEFAULT_WEBGL:k;this.width=a,this.height=s;var I={width:a,height:s,type:zr[o],format:Ur[h],wrapS:Yr[g],wrapT:Yr[m],mag:Wr[M],min:Wr[A],alignment:w,flipY:c,colorSpace:Xr[C],premultiplyAlpha:S,aniso:b};r&&(I.data=r),"number"==typeof d?I.mipmap=Vr[d]:"boolean"==typeof d&&(I.mipmap=d),this.texture=e.texture(I)}return Ze()(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}(),yi=Object(en.injectable)()(pi=function(){function t(){var e=this;qe()(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=Tn()(Cn.a.mark((function t(n){return Cn.a.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=Tn()(Cn.a.mark((function t(e){var r;return Cn.a.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 vi(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 Br(e.gl,t)},this.createBuffer=function(t){return new Jr(e.gl,t)},this.createElements=function(t){return new ci(e.gl,t)},this.createTexture2D=function(t){return new mi(e.gl,t)},this.createFramebuffer=function(t){return new li(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=Tn()(Cn.a.mark((function t(n){return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new ui(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,i=t.stencil,o=t.framebuffer,a=void 0===o?null:o,s={color:n,depth:r,stencil:i};s.framebuffer=null===a?a:a.get(),e.gl.clear(s)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Je.gl.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Je.gl.SCISSOR_TEST),e.gl._refresh())},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.gl&&e.gl._gl&&(e.gl._gl.viewport(n,r,i,o),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 Ze()(t,[{key:"init",value:(e=Tn()(Cn.a.mark((function t(e){return Cn.a.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){Rr()({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}())||pi;function bi(t,e,n,r){if("undefined"!=typeof window){var i=document.getElementsByTagName("head")[0],o=document.createElement("script");o.setAttribute("type","text/javascript"),o.setAttribute("src",t),r&&(o.id=r),o.onload=function(){e&&e()},o.onerror=function(e){n&&n("Unable to load script '".concat(t,"'"),e)},i.appendChild(o)}}function xi(t,e){return new Promise((function(e,n){bi(t,(function(){e()}),(function(t,e){n(e)}))}))}var wi=function(){return _i.apply(this,arguments)};function _i(){return(_i=Tn()(Cn.a.mark((function t(){return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!gi){t.next=2;break}return t.abrupt("return",gi);case 2:return t.next=4,xi("https://preview.babylonjs.com/glslang/glslang.js");case 4:return gi=window.glslang("https://preview.babylonjs.com/glslang/glslang.wasm"),t.abrupt("return",gi);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Si=function(){function t(e,n){qe()(this,t),this.engine=e,this.options=n,this.attribute=void 0,this.buffer=void 0;var r=n,i=r.buffer,o=r.offset,a=r.stride,s=r.normalized,u=r.size,c=r.divisor,l=r.arrayStride,h=r.attributes,f=r.stepMode;this.buffer=i,this.attribute={buffer:i.get(),offset:o||0,stride:a||0,normalized:s||!1,divisor:c||0,arrayStride:l||0,attributes:h,stepMode:f||"vertex"},u&&(this.attribute.size=u)}return Ze()(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}(),Ei=function(){function t(e,n){qe()(this,t),this.engine=e,this.options=n,this.buffer=void 0;var r=n,i=r.data,o=r.usage;r.type;this.buffer=this.createBuffer(i instanceof Array?new Float32Array(i):i,o||jn.BufferUsage.Vertex|jn.BufferUsage.CopyDst)}return Ze()(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.setSubData(this.buffer,n,e instanceof Array?new Float32Array(e):e)}},{key:"createBuffer",value:function(t,e){var n=t.byteLength%4,r={size:t.byteLength+n,usage:e},i=this.engine.device.createBuffer(r);return this.setSubData(i,0,t),i}},{key:"setSubData",value:function(t,e,n){(Je.isSafari?this.engine.device.getQueue():this.engine.device.defaultQueue).writeBuffer(t,e,n)}}]),t}();var Mi,Oi,Ai,ki,Ci,Ii,Ti,Pi=function(){function t(e,n){qe()(this,t),this.engine=e,this.context=n,this.entity=Object(Je.createEntity)(),this.uniformGPUBufferLayout=[],this.uniformBuffer=void 0,this.vertexBuffers={},this.outputBuffer=void 0,this.bindGroupEntries=void 0,this.bindGroup=void 0,this.computePipeline=void 0}var e,n,r;return Ze()(t,[{key:"init",value:(r=Tn()(Cn.a.mark((function t(){var e,n,r,i,o,a,s,u=this;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.compileComputePipelineStageDescriptor(this.context.shader);case 2:e=t.sent,n=e.computeStage,r=this.context.uniforms.filter((function(t){return t.storageClass===Je.STORAGE_CLASS.StorageBuffer})),i=this.context.uniforms.filter((function(t){return t.storageClass===Je.STORAGE_CLASS.Uniform})),o=i.length?1:0,this.bindGroupEntries=[],o&&(a=0,s=[],i.forEach((function(t){if("number"==typeof t.data)u.uniformGPUBufferLayout.push({name:t.name,offset:a}),a+=4,s.push(t.data);else{var e,n=(null===(e=t.data)||void 0===e?void 0:e.length)||1;3===n&&(n=4,t.data.push(0));var r=a/4%4;if(r>0){var i=4-r;if(n>1&&n<=i)2===n&&(3===i&&(a+=4,s.push(0)),s.push.apply(s,ei()(t.data)),u.uniformGPUBufferLayout.push({name:t.name,offset:a}));else{for(var o=0;o<i;o++)a+=4,s.push(0);s.push.apply(s,ei()(t.data)),u.uniformGPUBufferLayout.push({name:t.name,offset:a})}}a+=4*n}})),this.uniformBuffer=new Ei(this.engine,{data:s instanceof Array?new Float32Array(s):s,usage:jn.BufferUsage.Uniform|jn.BufferUsage.CopyDst}),this.bindGroupEntries.push({binding:0,resource:{buffer:this.uniformBuffer.get()}})),r.forEach((function(t){var e;null!==t.data&&(t.type!==Je.AST_TOKEN_TYPES.Vector4FloatArray&&t.type!==Je.AST_TOKEN_TYPES.FloatArray||(t.name===u.context.output.name?(e=new Ei(u.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:jn.BufferUsage.Storage|jn.BufferUsage.CopyDst|jn.BufferUsage.CopySrc}),u.outputBuffer=e,u.context.output={name:t.name,length:isFinite(Number(t.data))?1:t.data.length,typedArrayConstructor:Float32Array,gpuBuffer:e.get()}):t.isReferer?t.data.model&&t.data.model.outputBuffer&&(e=t.data.model.outputBuffer):e=new Ei(u.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:jn.BufferUsage.Storage|jn.BufferUsage.CopyDst|jn.BufferUsage.CopySrc}),u.vertexBuffers[t.name]=e,u.bindGroupEntries.push({binding:o,resource:{name:t.name,refer:e?void 0:t.data,buffer:e?e.get():void 0}}),o++))})),this.computePipeline=this.engine.device.createComputePipeline({computeStage:n}),console.log(this.bindGroupEntries),this.bindGroup=this.engine.device.createBindGroup({layout:this.computePipeline.getBindGroupLayout(0),entries:this.bindGroupEntries});case 13:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"destroy",value:function(){var t=this;this.uniformBuffer&&this.uniformBuffer.destroy(),Object.keys(this.vertexBuffers).forEach((function(e){return t.vertexBuffers[e].destroy()}))}},{key:"readData",value:(n=Tn()(Cn.a.mark((function t(){var e,n,r,i,o,a,s,u,c;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=this.context.output)){t.next=16;break}if(n=e.length,r=e.typedArrayConstructor,!(i=e.gpuBuffer)){t.next=16;break}return o=n*r.BYTES_PER_ELEMENT,a=this.engine.device.createBuffer({size:o,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),(s=this.engine.device.createCommandEncoder()).copyBufferToBuffer(i,0,a,0,o),(Je.isSafari?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([s.finish()]),t.next=12,a.mapAsync(jn.MapMode.Read);case 12:return u=a.getMappedRange(),c=new r(u.slice(0)),a.unmap(),t.abrupt("return",c);case 16:return t.abrupt("return",new Float32Array);case 17:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"run",value:function(){var t;this.engine.currentComputePass&&(this.engine.currentComputePass.setPipeline(this.computePipeline),this.engine.currentComputePass.setBindGroup(0,this.bindGroup),(t=this.engine.currentComputePass).dispatch.apply(t,ei()(this.context.dispatch)))}},{key:"updateBuffer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.vertexBuffers[t];r&&r.subData({data:e,offset:n})}},{key:"updateUniform",value:function(t,e){var n=this.uniformGPUBufferLayout.find((function(e){return e.name===t}));n&&this.uniformBuffer.subData({data:Number.isFinite(e)?new Float32Array([e]):new Float32Array(e),offset:n.offset})}},{key:"confirmInput",value:function(t,e){var n=this.vertexBuffers[e],r=t.outputBuffer;if(n&&r&&n!==r){var i=this.engine.device.createCommandEncoder(),o=t.context.output,a=o.length*o.typedArrayConstructor.BYTES_PER_ELEMENT;i.copyBufferToBuffer(r.get(),0,n.get(),0,a),(Je.isSafari?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([i.finish()])}}},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"compileComputePipelineStageDescriptor",value:(e=Tn()(Cn.a.mark((function t(e){var n;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e,this.engine.options.useWGSL){t.next=6;break}return t.next=5,this.compileShaderToSpirV(e,"compute","#version 450\n");case 5:n=t.sent;case 6:return t.abrupt("return",{computeStage:{module:this.engine.device.createShaderModule({code:n,isWHLSL:Je.isSafari}),entryPoint:"main"}});case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),Ni=function(){function t(e,n){qe()(this,t),this.engine=e,this.options=n,this.indexCount=void 0,this.buffer=void 0;var r=n,i=r.data,o=(r.usage,r.type,r.count);this.indexCount=o||0,this.buffer=new Ei(e,{data:i instanceof Array?new Uint16Array(i):i,usage:jn.BufferUsage.Index|jn.BufferUsage.CopyDst})}return Ze()(t,[{key:"get",value:function(){return this.buffer}},{key:"subData",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),ji=function(){function t(e,n){qe()(this,t),this.engine=e,this.options=n,this.colorTexture=void 0,this.depthTexture=void 0,this.width=0,this.height=0;var r=n,i=(r.width,r.height,r.color),o=(r.colors,r.depth);r.stencil;i&&(this.colorTexture=i),o&&(this.depthTexture=o)}return Ze()(t,[{key:"get",value:function(){var t,e;return{color:null===(t=this.colorTexture)||void 0===t?void 0:t.get(),depth:null===(e=this.depthTexture)||void 0===e?void 0:e.get()}}},{key:"destroy",value:function(){var t,e;null===(t=this.colorTexture)||void 0===t||t.destroy(),null===(e=this.depthTexture)||void 0===e||e.destroy()}},{key:"resize",value:function(t){var e,n,r=t.width,i=t.height;r===this.width&&i===this.height||(null===(e=this.colorTexture)||void 0===e||e.resize({width:r,height:i}),null===(n=this.depthTexture)||void 0===n||n.resize({width:r,height:i}));this.width=r,this.height=i}}]),t}(),Di=(Mi={},Nn()(Mi,Je.gl.POINTS,jn.PrimitiveTopology.PointList),Nn()(Mi,Je.gl.LINES,jn.PrimitiveTopology.LineList),Nn()(Mi,Je.gl.LINE_LOOP,jn.PrimitiveTopology.LineList),Nn()(Mi,Je.gl.LINE_STRIP,jn.PrimitiveTopology.LineStrip),Nn()(Mi,Je.gl.TRIANGLES,jn.PrimitiveTopology.TriangleList),Nn()(Mi,Je.gl.TRIANGLE_FAN,jn.PrimitiveTopology.TriangleList),Nn()(Mi,Je.gl.TRIANGLE_STRIP,jn.PrimitiveTopology.TriangleStrip),Mi),Li=(Oi={},Nn()(Oi,Je.gl.NEVER,jn.CompareFunction.Never),Nn()(Oi,Je.gl.ALWAYS,jn.CompareFunction.Always),Nn()(Oi,Je.gl.LESS,jn.CompareFunction.Less),Nn()(Oi,Je.gl.LEQUAL,jn.CompareFunction.LessEqual),Nn()(Oi,Je.gl.GREATER,jn.CompareFunction.Greater),Nn()(Oi,Je.gl.GEQUAL,jn.CompareFunction.GreaterEqual),Nn()(Oi,Je.gl.EQUAL,jn.CompareFunction.Equal),Nn()(Oi,Je.gl.NOTEQUAL,jn.CompareFunction.NotEqual),Oi),Ri=(Ai={},Nn()(Ai,Je.gl.FUNC_ADD,jn.BlendOperation.Add),Nn()(Ai,Je.gl.MIN_EXT,jn.BlendOperation.Min),Nn()(Ai,Je.gl.MAX_EXT,jn.BlendOperation.Max),Nn()(Ai,Je.gl.FUNC_SUBTRACT,jn.BlendOperation.Subtract),Nn()(Ai,Je.gl.FUNC_REVERSE_SUBTRACT,jn.BlendOperation.ReverseSubtract),Ai),Bi=(ki={},Nn()(ki,Je.gl.ZERO,jn.BlendFactor.Zero),Nn()(ki,Je.gl.ONE,jn.BlendFactor.One),Nn()(ki,Je.gl.SRC_COLOR,jn.BlendFactor.SrcColor),Nn()(ki,Je.gl.ONE_MINUS_SRC_COLOR,jn.BlendFactor.OneMinusSrcColor),Nn()(ki,Je.gl.SRC_ALPHA,jn.BlendFactor.SrcAlpha),Nn()(ki,Je.gl.ONE_MINUS_SRC_ALPHA,jn.BlendFactor.OneMinusSrcAlpha),Nn()(ki,Je.gl.DST_COLOR,jn.BlendFactor.DstColor),Nn()(ki,Je.gl.ONE_MINUS_DST_COLOR,jn.BlendFactor.OneMinusDstColor),Nn()(ki,Je.gl.DST_ALPHA,jn.BlendFactor.DstAlpha),Nn()(ki,Je.gl.ONE_MINUS_DST_ALPHA,jn.BlendFactor.OneMinusDstAlpha),Nn()(ki,Je.gl.CONSTANT_COLOR,jn.BlendFactor.BlendColor),Nn()(ki,Je.gl.ONE_MINUS_CONSTANT_COLOR,jn.BlendFactor.OneMinusBlendColor),Nn()(ki,Je.gl.SRC_ALPHA_SATURATE,jn.BlendFactor.SrcAlphaSaturated),ki),Gi=(Ci={},Nn()(Ci,Je.gl.ALPHA,"r8unorm"),Nn()(Ci,Je.gl.RGBA,"rgba8unorm"),Nn()(Ci,Je.gl.DEPTH_COMPONENT,"depth32float"),Nn()(Ci,Je.gl.DEPTH_STENCIL,"depth24plus-stencil8"),Ci),Fi=(Ii={},Nn()(Ii,Je.gl.NEAREST,"nearest"),Nn()(Ii,Je.gl.LINEAR,"linear"),Ii),zi=(Ti={},Nn()(Ti,Je.gl.REPEAT,"repeat"),Nn()(Ti,Je.gl.CLAMP_TO_EDGE,"clamp-to-edge"),Nn()(Ti,Je.gl.MIRRORED_REPEAT,"mirror-repeat"),Ti);function Ui(t){var e=t.cull;return e&&e.enable?e.face?e.face===Je.gl.FRONT?jn.CullMode.Front:jn.CullMode.Back:void 0:jn.CullMode.None}function Vi(t){var e=t.depth,n=(t.stencil,{compare:jn.CompareFunction.Always,depthFailOp:jn.StencilOperation.Keep,failOp:jn.StencilOperation.Keep,passOp:jn.StencilOperation.Keep});return{depthWriteEnabled:e&&e.enable,depthCompare:Li[(null==e?void 0:e.func)||Je.gl.ALWAYS],format:jn.TextureFormat.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function Wi(t,e){var n=t.blend;return[{format:e,alphaBlend:{srcFactor:Bi[n&&n.func&&n.func.srcAlpha||Je.gl.ONE],dstFactor:Bi[n&&n.func&&n.func.dstAlpha||Je.gl.ZERO],operation:Ri[n&&n.equation&&n.equation.alpha||Je.gl.FUNC_ADD]},colorBlend:{srcFactor:Bi[n&&n.func&&n.func.srcRGB||Je.gl.ONE],dstFactor:Bi[n&&n.func&&n.func.dstRGB||Je.gl.ZERO],operation:Ri[n&&n.equation&&n.equation.rgb||Je.gl.FUNC_ADD]},writeMask:jn.ColorWrite.All}]}function Yi(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 Xi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yi(Object(n),!0).forEach((function(e){Nn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Hi(t){for(var e=0,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];e+=s.length}for(var u=new t(e),c=0,l=0,h=r;l<h.length;l++){var f=h[l];u.set(f,c),c+=f.length}return u}var qi,Ki,Zi=function(){function t(e,n){qe()(this,t),this.engine=e,this.options=n,this.pipelineLayout=void 0,this.renderPipeline=void 0,this.uniformsBindGroupLayout=void 0,this.uniformBindGroup=void 0,this.uniformBuffer=void 0,this.uniforms={},this.uniformGPUBufferLayout=[],this.attributeCache={},this.indexBuffer=void 0,this.indexCount=void 0}var e,n;return Ze()(t,[{key:"init",value:(n=Tn()(Cn.a.mark((function t(){var e,n,r,i,o,a,s,u,c,l,h,f,d,p,g,v,m=this;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.options,n=e.vs,r=e.fs,i=e.attributes,o=e.uniforms,a=e.primitive,e.count,s=e.elements,u=e.depth,c=e.blend,l=e.stencil,h=e.cull,e.instances,t.next=3,this.compilePipelineStageDescriptor(n,r,null);case 3:f=t.sent,d=f.vertexStage,p=f.fragmentStage,o&&this.buildUniformBindGroup(o),s&&(this.indexBuffer=s.get(),this.indexCount=s.indexCount),g={vertexBuffers:Object.keys(i).map((function(t,e){var n=i[t],r=n.get(),o=r.arrayStride,a=r.stepMode,s=r.attributes;return m.attributeCache[t]=n,{arrayStride:o,stepMode:a,attributes:s}}))},v={sampleCount:this.engine.mainPassSampleCount,primitiveTopology:Di[a||Je.gl.TRIANGLES],rasterizationState:Xi(Xi({},this.getDefaultRasterizationStateDescriptor()),{},{cullMode:Ui({cull:h})}),depthStencilState:Vi({depth:u,stencil:l}),colorStates:Wi({blend:c},this.engine.options.swapChainFormat),layout:this.pipelineLayout,vertexStage:d,fragmentStage:p,vertexState:g},this.renderPipeline=this.engine.device.createRenderPipeline(v);case 11:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"addUniforms",value:function(t){this.uniforms=Xi(Xi({},this.uniforms),hi(t))}},{key:"draw",value:function(t){var e=this,n=this.engine.getCurrentRenderPass(),r=Xi(Xi({},this.uniforms),hi(t.uniforms||{})),i=[];Object.keys(r).forEach((function(t){var n=Gn()(r[t]);if("boolean"===n||"number"===n||Array.isArray(r[t])||r[t].BYTES_PER_ELEMENT){var o,a=null===(o=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===o?void 0:o.offset;null!==a&&e.uniformBuffer.subData({data:r[t],offset:a})}else{var s,u=null===(s=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===s?void 0:s.offset;if(null!==u){var c=r[t].get(),l=c.color||c,h=l.texture,f=l.sampler;f&&(i.push({binding:u,resource:f}),u++),i.push({binding:u,resource:h.createView()})}}})),this.uniformBuffer&&(i[0]={binding:0,resource:{buffer:this.uniformBuffer.get()}}),this.uniformBindGroup=this.engine.device.createBindGroup({layout:this.uniformsBindGroupLayout,entries:i}),this.renderPipeline&&n.setPipeline(this.renderPipeline),n.setBindGroup(0,this.uniformBindGroup),this.indexBuffer&&n.setIndexBuffer(this.indexBuffer.get(),jn.IndexFormat.Uint32,0),Object.keys(this.attributeCache).forEach((function(t,r){n.setVertexBuffer(0+r,e.attributeCache[t].get().buffer,0)})),this.indexBuffer?n.drawIndexed(this.indexCount,this.options.instances||1,0,0,0):n.draw(this.options.count||0,this.options.instances||0,0,0)}},{key:"destroy",value:function(){throw new Error("Method not implemented.")}},{key:"compilePipelineStageDescriptor",value:(e=Tn()(Cn.a.mark((function t(e,n,r){var i,o,a;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i="#version 450\n",o=e,a=n,this.engine.options.useWGSL){t.next=10;break}return t.next=6,this.compileShaderToSpirV(e,"vertex",i);case 6:return o=t.sent,t.next=9,this.compileShaderToSpirV(n,"fragment",i);case 9:a=t.sent;case 10:return t.abrupt("return",this.createPipelineStageDescriptor(o,a));case 11:case"end":return t.stop()}}),t,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"createPipelineStageDescriptor",value:function(t,e){return{vertexStage:{module:this.engine.device.createShaderModule({code:t,isWHLSL:Je.isSafari}),entryPoint:"main"},fragmentStage:{module:this.engine.device.createShaderModule({code:e,isWHLSL:Je.isSafari}),entryPoint:"main"}}}},{key:"getDefaultRasterizationStateDescriptor",value:function(){return{frontFace:jn.FrontFace.CCW,cullMode:jn.CullMode.None,depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}}},{key:"buildUniformBindGroup",value:function(t){var e=this,n=0,r=Hi.apply(void 0,[Float32Array].concat(ei()(Object.keys(t).map((function(r){return t[r]?(e.uniformGPUBufferLayout.push({name:r,offset:n}),n+=4*(t[r].length||1),t[r]):[]}))))),i=[],o=!1;r.length&&(o=!0,i.push({binding:0,visibility:jn.ShaderStage.Fragment|jn.ShaderStage.Vertex,type:jn.BindingType.UniformBuffer})),Object.keys(t).filter((function(e){return null===t[e]})).forEach((function(t,n){e.uniformGPUBufferLayout.push({name:t,offset:2*n+(o?1:0)}),i.push({binding:2*n+(o?1:0),visibility:jn.ShaderStage.Fragment,type:jn.BindingType.Sampler},{binding:2*n+(o?1:0)+1,visibility:jn.ShaderStage.Fragment,type:jn.BindingType.SampledTexture})})),this.uniformsBindGroupLayout=this.engine.device.createBindGroupLayout({entries:i}),this.pipelineLayout=this.engine.device.createPipelineLayout({bindGroupLayouts:[this.uniformsBindGroupLayout]}),o&&(this.uniformBuffer=new Ei(this.engine,{data:r instanceof Array?new Float32Array(r):r,usage:jn.BufferUsage.Uniform|jn.BufferUsage.CopyDst}))}}]),t}(),$i=function(){function t(e,n){qe()(this,t),this.engine=e,this.options=n,this.texture=void 0,this.sampler=void 0,this.width=void 0,this.height=void 0,this.createTexture()}return Ze()(t,[{key:"get",value:function(){return{texture:this.texture,sampler:this.sampler}}},{key:"update",value:function(){}},{key:"resize",value:function(t){var e=t.width,n=t.height;e===this.width&&n===this.height||(this.destroy(),this.createTexture()),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture&&this.texture.destroy()}},{key:"createTexture",value:function(){var t=this.options,e=(t.data,t.type),n=(void 0===e&&Je.gl.UNSIGNED_BYTE,t.width),r=t.height,i=(t.flipY,t.format),o=void 0===i?Je.gl.RGBA:i,a=(t.mipmap,t.wrapS),s=void 0===a?Je.gl.CLAMP_TO_EDGE:a,u=t.wrapT,c=void 0===u?Je.gl.CLAMP_TO_EDGE:u,l=t.aniso,h=void 0===l?0:l,f=(t.alignment,t.premultiplyAlpha,t.mag),d=void 0===f?Je.gl.NEAREST:f,p=t.min,g=void 0===p?Je.gl.NEAREST:p,v=t.colorSpace,m=(void 0===v&&Je.gl.BROWSER_DEFAULT_WEBGL,t.usage);this.width=n,this.height=r,this.texture=this.engine.device.createTexture({size:[n,r,1],mipLevelCount:1,sampleCount:1,dimension:jn.TextureDimension.E2d,format:Gi[o],usage:m||jn.TextureUsage.Sampled|jn.TextureUsage.CopyDst}),(!m||m&jn.TextureUsage.Sampled)&&(this.sampler=this.engine.device.createSampler({addressModeU:zi[s],addressModeV:zi[c],addressModeW:zi[s],magFilter:Fi[d],minFilter:Fi[g],maxAnisotropy:h}))}}]),t}(),Qi=Object(en.injectable)()(qi=function(){function t(){var e=this;qe()(this,t),this.supportWebGPU=!0,this.useWGSL=!1,this.options=void 0,this.canvas=void 0,this.context=void 0,this.glslang=void 0,this.adapter=void 0,this.device=void 0,this.swapChain=void 0,this.mainPassSampleCount=void 0,this.mainTexture=void 0,this.depthTexture=void 0,this.mainColorAttachments=void 0,this.mainTextureExtends=void 0,this.mainDepthAttachment=void 0,this.uploadEncoder=void 0,this.renderEncoder=void 0,this.computeEncoder=void 0,this.renderTargetEncoder=void 0,this.commandBuffers=new Array(4).fill(void 0),this.currentRenderPass=null,this.mainRenderPass=null,this.currentRenderTargetViewDescriptor=void 0,this.currentComputePass=null,this.bundleEncoder=void 0,this.tempBuffers=[],this.currentRenderTarget=null,this.uploadEncoderDescriptor={label:"upload"},this.renderEncoderDescriptor={label:"render"},this.renderTargetEncoderDescriptor={label:"renderTarget"},this.computeEncoderDescriptor={label:"compute"},this.pipelines={},this.computePipelines={},this.defaultSampleCount=4,this.clearDepthValue=1,this.clearStencilValue=0,this.transientViewport={x:1/0,y:0,width:0,height:0},this.cachedViewport={x:0,y:0,width:0,height:0},this.clear=function(t){t.framebuffer;var n=t.color,r=t.depth,i=t.stencil;e.options.supportCompute&&e.startComputePass(),e.currentRenderTarget?(e.currentRenderPass&&e.endRenderTargetRenderPass(),e.startRenderTargetRenderPass(e.currentRenderTarget,n||null,!!r,!!i)):(e.mainColorAttachments[0].loadValue=n||jn.LoadOp.Load,e.mainDepthAttachment.depthLoadValue=r||jn.LoadOp.Load,e.mainDepthAttachment.stencilLoadValue=i?e.clearStencilValue:jn.LoadOp.Load,e.mainRenderPass&&e.endMainRenderPass(),e.startMainRenderPass())},this.createModel=function(){var t=Tn()(Cn.a.mark((function t(n){var r;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Zi(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new Si(e,t)},this.createBuffer=function(t){return new Ei(e,t)},this.createElements=function(t){return new Ni(e,t)},this.createTexture2D=function(t){return new $i(e,t)},this.createFramebuffer=function(t){return new ji(e,t)},this.useFramebuffer=function(t,n){e.currentRenderTarget&&e.unbindFramebuffer(e.currentRenderTarget),e.currentRenderTarget=t,e.currentRenderTargetViewDescriptor={dimension:jn.TextureViewDimension.E2d,arrayLayerCount:1,aspect:jn.TextureAspect.All},e.currentRenderPass=null,n()},this.createComputeModel=function(){var t=Tn()(Cn.a.mark((function t(n){var r;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Pi(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getCanvas=function(){return e.canvas},this.getGLContext=function(){throw new Error("Method not implemented.")},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;if(e.currentRenderPass){if(e.transientViewport.x!==1/0){e.getCurrentRenderPass().setViewport(e.transientViewport.x,e.transientViewport.y,e.transientViewport.width,e.transientViewport.height,0,1)}else if(n!==e.cachedViewport.x||r!==e.cachedViewport.y||i!==e.cachedViewport.width||o!==e.cachedViewport.height){e.cachedViewport={x:n,y:r,width:i,height:o},e.getCurrentRenderPass().setViewport(n,r,i,o,0,1)}}else e.transientViewport={x:n,y:r,width:i,height:o}},this.readPixels=function(t){throw new Error("Method not implemented.")}}var e,n;return Ze()(t,[{key:"isFloatSupported",value:function(){return!0}},{key:"init",value:(n=Tn()(Cn.a.mark((function t(e){return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.canvas=e.canvas,this.options=e,this.useWGSL=!!e.useWGSL,this.mainPassSampleCount=e.antialiasing?this.defaultSampleCount:1,t.next=6,this.initGlslang();case 6:this.initContextAndSwapChain(),this.initMainAttachments();case 8:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"setScissor",value:function(t){throw new Error("Method not implemented.")}},{key:"destroy",value:function(){this.mainTexture&&this.mainTexture.destroy(),this.depthTexture&&this.depthTexture.destroy(),this.tempBuffers.forEach((function(t){return t.destroy()})),this.tempBuffers=[]}},{key:"beginFrame",value:function(){this.uploadEncoder=this.device.createCommandEncoder(this.uploadEncoderDescriptor),this.renderEncoder=this.device.createCommandEncoder(this.renderEncoderDescriptor),this.renderTargetEncoder=this.device.createCommandEncoder(this.renderTargetEncoderDescriptor),this.options.supportCompute&&(this.computeEncoder=this.device.createCommandEncoder(this.computeEncoderDescriptor))}},{key:"endFrame",value:function(){this.options.supportCompute&&this.endComputePass(),this.endMainRenderPass(),this.commandBuffers[0]=this.uploadEncoder.finish(),this.commandBuffers[1]=this.renderEncoder.finish(),this.options.supportCompute&&(this.commandBuffers[2]=this.computeEncoder.finish()),this.commandBuffers[3]=this.renderTargetEncoder.finish(),Je.isSafari?this.device.getQueue().submit(this.commandBuffers.filter((function(t){return t}))):this.device.defaultQueue.submit(this.commandBuffers.filter((function(t){return t})))}},{key:"getCurrentRenderPass",value:function(){return this.currentRenderTarget&&!this.currentRenderPass?this.startRenderTargetRenderPass(this.currentRenderTarget,null,!1,!1):this.currentRenderPass||this.startMainRenderPass(),this.currentRenderPass}},{key:"initGlslang",value:(e=Tn()(Cn.a.mark((function t(){var e,n;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,wi();case 2:return this.glslang=t.sent,t.next=5,null===(e=navigator)||void 0===e||null===(n=e.gpu)||void 0===n?void 0:n.requestAdapter();case 5:return this.adapter=t.sent,t.next=8,this.adapter.requestDevice();case 8:this.device=t.sent;case 9:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"initContextAndSwapChain",value:function(){this.context=this.canvas.getContext(Je.isSafari?"gpu":"gpupresent"),this.swapChain=this.context.configureSwapChain({device:this.device,format:this.options.swapChainFormat,usage:jn.TextureUsage.OutputAttachment|jn.TextureUsage.CopySrc})}},{key:"initMainAttachments",value:function(){if(this.mainTextureExtends={width:this.canvas.width,height:this.canvas.height,depth:1},this.options.antialiasing){var t={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:jn.TextureDimension.E2d,format:jn.TextureFormat.BGRA8Unorm,usage:jn.TextureUsage.OutputAttachment};this.mainTexture&&this.mainTexture.destroy(),this.mainTexture=this.device.createTexture(t),this.mainColorAttachments=[{attachment:Je.isSafari?this.mainTexture.createDefaultView():this.mainTexture.createView(),loadValue:[0,0,0,1],storeOp:jn.StoreOp.Store}]}else this.mainColorAttachments=[{attachment:Je.isSafari?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),loadValue:[0,0,0,1],storeOp:jn.StoreOp.Store}];var e={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:jn.TextureDimension.E2d,format:Je.isSafari?"depth32float-stencil8":jn.TextureFormat.Depth24PlusStencil8,usage:jn.TextureUsage.OutputAttachment};this.depthTexture&&this.depthTexture.destroy(),this.depthTexture=this.device.createTexture(e),this.mainDepthAttachment={attachment:Je.isSafari?this.depthTexture.createDefaultView():this.depthTexture.createView(),depthLoadValue:this.clearDepthValue,depthStoreOp:jn.StoreOp.Store,stencilLoadValue:this.clearStencilValue,stencilStoreOp:jn.StoreOp.Store}}},{key:"startComputePass",value:function(){this.currentComputePass&&this.endComputePass(),this.currentComputePass=this.computeEncoder.beginComputePass()}},{key:"startMainRenderPass",value:function(){this.currentRenderPass&&!this.currentRenderTarget&&this.endMainRenderPass(),this.options.antialiasing?this.mainColorAttachments[0].resolveTarget=Je.isSafari?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView():this.mainColorAttachments[0].attachment=Je.isSafari?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),this.currentRenderPass=this.renderEncoder.beginRenderPass({colorAttachments:this.mainColorAttachments,depthStencilAttachment:this.mainDepthAttachment}),this.mainRenderPass=this.currentRenderPass,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"startRenderTargetRenderPass",value:function(t,e,n){var r,i,o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=null===(r=t.get().color)||void 0===r?void 0:r.texture;s&&(o=s.createView(this.currentRenderTargetViewDescriptor));var u,c=null===(i=t.get().depth)||void 0===i?void 0:i.texture;c&&(u=c.createView());var l=this.renderTargetEncoder.beginRenderPass({colorAttachments:[{attachment:o,loadValue:null!==e?e:jn.LoadOp.Load,storeOp:jn.StoreOp.Store}],depthStencilAttachment:c&&u?{attachment:u,depthLoadValue:n?this.clearDepthValue:jn.LoadOp.Load,depthStoreOp:jn.StoreOp.Store,stencilLoadValue:a?this.clearStencilValue:jn.LoadOp.Load,stencilStoreOp:jn.StoreOp.Store}:void 0});this.currentRenderPass=l,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"endMainRenderPass",value:function(){this.currentRenderPass===this.mainRenderPass&&null!==this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport(),this.currentRenderPass=null,this.mainRenderPass=null)}},{key:"endComputePass",value:function(){this.currentComputePass&&(this.currentComputePass.endPass(),this.currentComputePass=null)}},{key:"endRenderTargetRenderPass",value:function(){this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport())}},{key:"resetCachedViewport",value:function(){this.cachedViewport={x:0,y:0,width:0,height:0}}},{key:"unbindFramebuffer",value:function(t){this.currentRenderPass&&this.currentRenderPass!==this.mainRenderPass&&this.endRenderTargetRenderPass(),this.transientViewport.x=1/0,this.currentRenderTarget=null,this.currentRenderPass=this.mainRenderPass}}]),t}())||qi,Ji=n(62),to=n.n(Ji),eo=n(24),no=n.n(eo),ro=n(25),io=n.n(ro),oo=n(19),ao=n.n(oo);function so(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ao()(t);if(e){var i=ao()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return io()(this,n)}}var uo,co=Object(en.injectable)()(Ki=function(t){no()(n,t);var e=so(n);function n(){return qe()(this,n),e.apply(this,arguments)}return Ze()(n,[{key:"onEntityCreated",value:function(){var t=this.config,e=t.widthSegments,n=void 0===e?1:e,r=t.heightSegments,i=void 0===r?1:r,o=t.depthSegments,a=void 0===o?1:o,s=t.halfExtents,u=void 0===s?tn.e.fromValues(.5,.5,.5):s,c=n,l=i,h=a,f=to()(u,3),d=f[0],p=f[1],g=f[2],v=[tn.e.fromValues(-d,-p,g),tn.e.fromValues(d,-p,g),tn.e.fromValues(d,p,g),tn.e.fromValues(-d,p,g),tn.e.fromValues(d,-p,-g),tn.e.fromValues(-d,-p,-g),tn.e.fromValues(-d,p,-g),tn.e.fromValues(d,p,-g)],m=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],y=[[0,0,1],[0,0,-1],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],b=1,x=2,w=3,_=4,S=5,E=[],M=[],O=[],A=[],k=[],C=0,I=function(t,e,n){var r,i,o,a;for(o=0;o<=e;o++)for(a=0;a<=n;a++){var s=tn.e.create(),u=tn.e.create(),c=tn.e.create(),l=tn.e.create();tn.e.lerp(s,v[m[t][0]],v[m[t][1]],o/e),tn.e.lerp(u,v[m[t][0]],v[m[t][2]],a/n),tn.e.sub(c,u,v[m[t][0]]),tn.e.add(l,s,c),r=o/e,i=a/n,E.push(l[0],l[1],l[2]),M.push(y[t][0],y[t][1],y[t][2]),O.push(r,i),r=.875*(r/=3)+4/64,i=.875*(i/=3)+4/64,r+=t%3/3,i+=Math.floor(t/3)/3,A.push(r,i),o<e&&a<n&&(k.push(C+n+1,C+1,C),k.push(C+n+1,C+n+2,C+1)),C++}};I(0,c,l),I(b,c,l),I(x,c,h),I(w,c,h),I(_,h,l),I(S,h,l);var T=Object(Je.generateAABBFromVertices)(E),P=this.getComponent();P.indices=Uint32Array.from(k),P.aabb=T,P.vertexCount=C,P.attributes=[{dirty:!0,name:"position",data:Float32Array.from(E),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(M),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(O),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),n}(An))||Ki;function lo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ao()(t);if(e){var i=ao()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return io()(this,n)}}var ho,fo=Object(en.injectable)()(uo=function(t){no()(n,t);var e=lo(n);function n(){return qe()(this,n),e.apply(this,arguments)}return Ze()(n,[{key:"onEntityCreated",value:function(){var t=this.config.geometries,e=void 0===t?[]:t,n=this.getComponent();n.aabb=new Je.AABB;var r=[],i=[],o=0;e.forEach((function(t){var e=t.aabb,a=t.indices,s=t.vertexCount,u=t.attributes;n.aabb.add(e),n.vertexCount+=s,a&&i.push.apply(i,ei()(a.map((function(t){return t+o})))),o+=s,u.forEach((function(t,e){r[e]?t.data&&(nn(t.data)?r[e].push(t.data):Kn(t.data)?r[e].data=function(t,e){if(!t&&!e)throw new Error("Please specify valid arguments for parameters a and b.");if(!e||0===e.length)return t;if(!t||0===t.length)return e;if(Object.prototype.toString.call(t)!==Object.prototype.toString.call(e))throw new Error("The types of the two arguments passed for parameters a and b do not match.");var n=new t.constructor(t.length+e.length);return n.set(t),n.set(e,t.length),n}(r[e].data,t.data):r[e].data=r[e].data.concat(t.data)):(r[e]=t,r[e].dirty=!0)}))})),n.attributes=r,n.indices=Uint32Array.from(i),n.dirty=!0}}]),n}(An))||uo;function po(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ao()(t);if(e){var i=ao()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return io()(this,n)}}var go,vo=Object(en.injectable)()(ho=function(t){no()(n,t);var e=po(n);function n(){return qe()(this,n),e.apply(this,arguments)}return Ze()(n,[{key:"onEntityCreated",value:function(){for(var t=this.config,e=t.halfExtents,n=void 0===e?[.5,.5]:e,r=t.widthSegments,i=void 0===r?5:r,o=t.lengthSegments,a=void 0===o?5:o,s=[],u=[],c=[],l=[],h=0,f=0;f<=i;f++)for(var d=0;d<=a;d++){var p=-n[0]+2*n[0]*f/i,g=-(-n[1]+2*n[1]*d/a),v=f/i,m=d/a;s.push(p,0,g),u.push(0,1,0),c.push(v,m),f<i&&d<a&&(l.push(h+a+1,h+1,h),l.push(h+a+1,h+a+2,h+1)),h++}var y=Object(Je.generateAABBFromVertices)(s),b=this.getComponent();b.indices=Uint32Array.from(l),b.aabb=y,b.vertexCount=h,b.attributes=[{dirty:!0,name:"position",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(u),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(c),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),n}(An))||ho;function mo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ao()(t);if(e){var i=ao()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return io()(this,n)}}var yo,bo,xo,wo,_o,So,Eo,Mo=Object(en.injectable)()(go=function(t){no()(n,t);var e=mo(n);function n(){return qe()(this,n),e.apply(this,arguments)}return Ze()(n,[{key:"onEntityCreated",value:function(){for(var t=this.config,e=t.radius,n=void 0===e?.5:e,r=t.latitudeBands,i=void 0===r?16:r,o=t.longitudeBands,a=void 0===o?16:o,s=[],u=[],c=[],l=[],h=0;h<=i;h++)for(var f=h*Math.PI/i,d=Math.sin(f),p=Math.cos(f),g=0;g<=a;g++){var v=2*g*Math.PI/a-Math.PI/2,m=Math.sin(v),y=Math.cos(v)*d,b=p,x=m*d,w=1-g/a,_=1-h/i;s.push(y*n,b*n,x*n),u.push(y,b,x),c.push(w,_)}for(var S=0;S<i;++S)for(var E=0;E<a;++E){var M=S*(a+1)+E,O=M+a+1;l.push(M+1,O,M),l.push(M+1,O+1,O)}var A=Object(Je.generateAABBFromVertices)(s),k=this.getComponent();k.indices=Uint32Array.from(l),k.aabb=A,k.vertexCount=s.length/3,k.attributes=[{dirty:!0,name:"position",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(u),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(c),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),n}(An))||go,Oo=n(23),Ao=n.n(Oo);function ko(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ao()(t);if(e){var i=ao()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return io()(this,n)}}var Co,Io,To,Po,No,jo,Do,Lo,Ro,Bo,Go,Fo=(yo=Object(en.injectable)(),bo=Object(en.inject)(Je.IDENTIFIER.RenderEngine),xo=Object(en.inject)(Je.IDENTIFIER.ShaderModuleService),yo((_o=function(t){no()(n,t);var e=ko(n);function n(){var t;qe()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Xe()(t,"engine",So,Ao()(t)),Xe()(t,"shaderModuleService",Eo,Ao()(t)),t}return Ze()(n,[{key:"onEntityCreated",value:function(){var t=this.getComponent(),e=this.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform Uniforms {\n vec4 color;\n mat4 projectionMatrix;\n mat4 modelViewMatrix;\n} uniforms;\n\nlayout(location = 0) in vec3 position;\n// layout(location = 1) in vec3 barycentric;\n\nlayout(location = 0) out vec4 fragColor;\n// layout(location = 1) out vec3 v_Barycentric;\n\nvoid main() {\n gl_Position = uniforms.projectionMatrix * uniforms.modelViewMatrix * vec4(position, 1.0);\n fragColor = uniforms.color;\n // v_Barycentric = barycentric;\n}":'attribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform vec4 color;\n\nvarying vec4 fragColor;\n\n#pragma include "uv.vert.declaration"\n\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n fragColor = color;\n\n #pragma include "uv.vert.main"\n}',n=this.engine.supportWebGPU?"// layout(set = 0, binding = 1) uniform WireframeUniforms {\n// float lineWidth;\n// vec4 lineColor;\n// } wireframe;\n\nlayout(location = 0) in vec4 fragColor;\n// layout(location = 1) in vec3 v_Barycentric;\n\nlayout(location = 0) out vec4 outColor;\n\n// wireframe\n// float edgeFactor() {\n// vec3 d = fwidth(v_Barycentric);\n// vec3 a3 = smoothstep(vec3(0.0), d * wireframe.lineWidth, v_Barycentric);\n// return min(min(a3.x, a3.y), a3.z);\n// }\n\nvoid main() {\n // outColor = mix(fragColor, wireframe.lineColor, (1.0 - edgeFactor()));\n outColor = fragColor;\n}":'varying vec4 fragColor;\n\n#pragma include "uv.frag.declaration"\n#pragma include "map.frag.declaration"\n\nvoid main() {\n vec4 diffuseColor = fragColor;\n\n #pragma include "map.frag.main"\n\n gl_FragColor = diffuseColor;\n}';this.shaderModuleService.registerModule("material-basic",{vs:e,fs:n});var r=this.shaderModuleService.getModule("material-basic"),i=r.vs,o=r.fs,a=r.uniforms;t.vertexShaderGLSL=i,t.fragmentShaderGLSL=o,t.setUniform(a),this.config.map&&(t.setDefines({USE_UV:1,USE_MAP:1}),t.setUniform({map:this.config.map,uvTransform:tn.a.create()}))}}]),n}(jr),So=Qe()(_o.prototype,"engine",[bo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Eo=Qe()(_o.prototype,"shaderModuleService",[xo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wo=_o))||wo);function zo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ao()(t);if(e){var i=ao()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return io()(this,n)}}var Uo=(Co=Object(en.injectable)(),Io=Object(en.inject)(Je.IDENTIFIER.Systems),To=Object(en.named)(Je.IDENTIFIER.MaterialSystem),Po=Object(en.inject)(Je.IDENTIFIER.Systems),No=Object(en.named)(Je.IDENTIFIER.GeometrySystem),jo=Object(en.inject)(Je.IDENTIFIER.ShaderModuleService),Co((Lo=function(t){no()(n,t);var e=zo(n);function n(){var t;qe()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Xe()(t,"materialSystem",Ro,Ao()(t)),Xe()(t,"geometrySystem",Bo,Ao()(t)),Xe()(t,"shaderModuleService",Go,Ao()(t)),t}return Ze()(n,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();r&&r.material&&("gridColor"===e?(r.material.setUniform("u_GridColor",n),r.material.setUniform("u_GridColor2",n)):"gridSize"===e&&(r.material.setUniform("u_GridSize",n),r.material.setUniform("u_GridSize2",n)))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:"attribute vec3 a_Position;\n\nvarying vec3 v_Position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvoid main() {\n v_Position = a_Position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_Position, 1.);\n}",fs:"// generate grid, borrow from clay.gl viewer\n// @see https://github.com/pissang/clay-viewer/blob/master/src/graphic/ground.glsl\n#extension GL_OES_standard_derivatives : enable\n\nvarying vec3 v_Position;\n// varying vec3 v_Normal;\n\nuniform float u_GridSize : 5;\nuniform float u_GridSize2 : .5;\nuniform vec4 u_GridColor : [0, 0, 0, 1];\nuniform vec4 u_GridColor2 : [0.3, 0.3, 0.3, 1];\nuniform bool u_GridEnabled : true;\n\n// uniform vec3 u_LightDirection;\n// uniform vec3 u_LightColor;\n// uniform vec3 u_Camera;\n\nvoid main() {\n // vec3 n = v_Normal;\n // vec3 l = normalize(u_LightDirection);\n // float NdotL = clamp(dot(n, l), 0.001, 1.0);\n\n gl_FragColor = vec4(1.);\n\n if (u_GridEnabled) {\n float wx = v_Position.x;\n float wz = v_Position.z;\n // float x0 = abs(fract(wx / u_GridSize - 0.5) - 0.5) / fwidth(wx) * u_GridSize / 2.0;\n // float z0 = abs(fract(wz / u_GridSize - 0.5) - 0.5) / fwidth(wz) * u_GridSize / 2.0;\n\n float x1 = abs(fract(wx / u_GridSize2 - 0.5) - 0.5) / fwidth(wx) * u_GridSize2;\n float z1 = abs(fract(wz / u_GridSize2 - 0.5) - 0.5) / fwidth(wz) * u_GridSize2;\n\n // float v0 = 1.0 - clamp(min(x0, z0), 0.0, 1.0);\n float v1 = 1.0 - clamp(min(x1, z1), 0.0, 1.0);\n // if (v0 > 0.1) {\n // gl_FragColor = mix(gl_FragColor, u_GridColor, v0);\n // }\n // else {\n gl_FragColor = mix(gl_FragColor, u_GridColor2, v1);\n // }\n }\n\n // float shadowFactor = calcShadow(u_ShadowMap, v_PositionFromLight, l, n);\n // vec3 diffuseColor = u_LightColor * NdotL * shadowFactor;\n\n // gl_FragColor.rgb *= diffuseColor;\n}"});var t=this.shaderModuleService.getModule("grid"),e=t.vs,n=t.fs,r=t.uniforms,i=this.materialSystem.createShaderMaterial({vertexShader:e,fragmentShader:n});this.setMaterial(i);var o=this.geometrySystem.createBufferGeometry({vertexCount:4});this.setGeometry(o),i.setCull({enable:!1,face:Je.gl.BACK}).setDepth({enable:!0,func:Je.gl.LESS}),i.setUniform(r),this.setAttributes({gridColor:this.config.gridColor,gridSize:this.config.gridSize}),o.setIndex([0,3,2,2,1,0]),o.setAttribute("a_Position",Float32Array.from([-4,-1,-4,4,-1,-4,4,-1,4,-4,-1,4]),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})}}]),n}(Dr),Ro=Qe()(Lo.prototype,"materialSystem",[Io,To],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Bo=Qe()(Lo.prototype,"geometrySystem",[Po,No],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Go=Qe()(Lo.prototype,"shaderModuleService",[jo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Do=Lo))||Do),Vo=n(97),Wo=n(64);function Yo(t,e,n,r,i){Xo(e,r,-i),Xo(e,r,i),t.push(n),t.push(n)}function Xo(t,e,n){t.push([[e[0],e[1]],n])}var Ho,qo,Ko,Zo,$o,Qo,Jo,ta,ea,na,ra;function ia(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ao()(t);if(e){var i=ao()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return io()(this,n)}}var oa,aa,sa,ua,ca,la,ha,fa,da,pa,ga,va=(Ho=Object(en.injectable)(),qo=Object(en.inject)(Je.IDENTIFIER.Systems),Ko=Object(en.named)(Je.IDENTIFIER.MaterialSystem),Zo=Object(en.inject)(Je.IDENTIFIER.Systems),$o=Object(en.named)(Je.IDENTIFIER.GeometrySystem),Qo=Object(en.inject)(Je.IDENTIFIER.ShaderModuleService),Ho((ta=function(t){no()(n,t);var e=ia(n);function n(){var t;qe()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Xe()(t,"materialSystem",ea,Ao()(t)),Xe()(t,"geometrySystem",na,Ao()(t)),Xe()(t,"shaderModuleService",ra,Ao()(t)),t.vertexCount=void 0,t}return Ze()(n,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();if(r&&r.material)switch(e){case"dashArray":r.material.setUniform("u_dash_array",n);break;case"dashOffset":r.material.setUniform("u_dash_offset",n);break;case"dashRatio":r.material.setUniform("u_dash_ratio",n);break;case"thickness":r.material.setUniform("u_thickness",n);break;case"color":var i=new Array(this.vertexCount).fill(void 0).map((function(){return n})).reduce((function(t,e){return[].concat(ei()(t),ei()(e))}),[]);r.geometry.setAttribute("a_color",Float32Array.from(i),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]})}}},{key:"onEntityCreated",value:function(){var t=this;this.shaderModuleService.registerModule("line",{vs:"attribute vec2 a_pos;\nattribute vec4 a_color;\nattribute float a_line_miter;\nattribute vec2 a_line_normal;\nattribute float a_counters;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float u_thickness : 0.02;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n v_color = a_color;\n v_counters = a_counters;\n\n vec3 normal = normalize(vec3(a_line_normal, 0.0));\n\n vec4 offset = vec4(normal * u_thickness / 2.0 * a_line_miter, 0.0);\n\n v_normal = vec2(normal * sign(a_line_miter));\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_pos, 0.0, 1.0) + offset;\n}\n",fs:"uniform float u_dash_array : 0.02;\nuniform float u_dash_offset : 0;\nuniform float u_dash_ratio : 0;\nuniform float u_thickness : 0.02;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n float blur = 1. - smoothstep(0.98, 1., length(v_normal));\n\n gl_FragColor = v_color;\n gl_FragColor.a *= blur * ceil(mod(v_counters + u_dash_offset, u_dash_array) - (u_dash_array * u_dash_ratio));\n}"});var e=this.shaderModuleService.getModule("line"),n=e.vs,r=e.fs,i=e.uniforms,o=this.materialSystem.createShaderMaterial({vertexShader:n,fragmentShader:r}),a=function(t,e,n){var r=[0,0],i=[0,0],o=[0,0],a=[0,0],s=-1,u=!1,c=null,l=Object(Vo.create)(),h=n||0,f=[],d=[],p=[],g=[0,0];e&&(t=t.slice()).push(t[0]);for(var v=t.length,m=1;m<v;m++){var y=h,b=t[m-1],x=t[m],w=m<t.length-1?t[m+1]:null;if(g.push(m/v,m/v),Object(Wo.direction)(r,x,b),c||(c=[0,0],Object(Wo.normal)(c,r)),u||(u=!0,Yo(d,f,b,c,1)),p.push([y+0,y+1,y+2]),w){Object(Wo.direction)(i,w,x);var _=Object(Wo.computeMiter)(o,a,r,i,1),S=Object(Vo.dot)(o,c)<0?-1:1,E=_>3;if(!isFinite(_)){Object(Wo.normal)(c,r),Yo(d,f,x,c,1),p.push(1===s?[y,y+2,y+3]:[y+2,y+1,y+3]),h+=2,s=S;continue}E?(_=3,g.push(m/v),Xo(f,c,-S),d.push(x),Xo(f,a,_*S),d.push(x),p.push(s!==-S?[y,y+2,y+3]:[y+2,y+1,y+3]),p.push([y+2,y+3,y+4]),Object(Wo.normal)(l,i),Object(Vo.copy)(c,l),Xo(f,c,-S),d.push(x),h+=3):(Yo(d,f,x,a,_),p.push(1===s?[y,y+2,y+3]:[y+2,y+1,y+3]),S=-1,Object(Vo.copy)(c,a),h+=2),s=S}else Object(Wo.normal)(c,r),Yo(d,f,x,c,1),p.push(1===s?[y,y+2,y+3]:[y+2,y+1,y+3]),h+=2}return{normals:f,attrIndex:p,attrPos:d,attrCounters:g}}(this.config.points,!1),s=a.normals,u=a.attrIndex,c=a.attrPos,l=a.attrCounters,h=c.length;this.vertexCount=h;var f=this.geometrySystem.createBufferGeometry({vertexCount:h});this.setMaterial(o),this.setGeometry(f),o.setCull({enable:!1,face:Je.gl.BACK}).setUniform(i),this.setAttributes({dashArray:this.config.dashArray,dashOffset:this.config.dashOffset,dashRatio:this.config.dashRatio,thickness:this.config.thickness});var d=[],p=[];s.forEach((function(t){var e=t[0],n=t[1];d.push([e[0],e[1]]),p.push(n)})),f.setIndex(u.reduce((function(t,e){return[].concat(ei()(t),ei()(e))}),[])),f.setAttribute("a_pos",Float32Array.from(c.reduce((function(t,e){return[].concat(ei()(t),ei()(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]});var g=new Array(h).fill(void 0).map((function(){return ei()(t.config.color)})).reduce((function(t,e){return[].concat(ei()(t),ei()(e))}),[]);f.setAttribute("a_color",Float32Array.from(g),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]}),f.setAttribute("a_line_miter",Float32Array.from(p),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float"}]}),f.setAttribute("a_line_normal",Float32Array.from(d.reduce((function(t,e){return[].concat(ei()(t),ei()(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:3,offset:0,format:"float2"}]}),f.setAttribute("a_counters",Float32Array.from(l),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:4,offset:0,format:"float"}]})}}]),n}(Dr),ea=Qe()(ta.prototype,"materialSystem",[qo,Ko],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),na=Qe()(ta.prototype,"geometrySystem",[Zo,$o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ra=Qe()(ta.prototype,"shaderModuleService",[Qo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Jo=ta))||Jo);function ma(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 ya(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ao()(t);if(e){var i=ao()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return io()(this,n)}}var ba,xa,wa,_a,Sa,Ea,Ma,Oa,Aa,ka=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],Ca=(oa=Object(en.injectable)(),aa=Object(en.inject)(Je.IDENTIFIER.Systems),sa=Object(en.named)(Je.IDENTIFIER.MaterialSystem),ua=Object(en.inject)(Je.IDENTIFIER.Systems),ca=Object(en.named)(Je.IDENTIFIER.GeometrySystem),la=Object(en.inject)(Je.IDENTIFIER.ShaderModuleService),oa((fa=function(t){no()(n,t);var e=ya(n);function n(){var t;qe()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Xe()(t,"materialSystem",da,Ao()(t)),Xe()(t,"geometrySystem",pa,Ao()(t)),Xe()(t,"shaderModuleService",ga,Ao()(t)),t}return Ze()(n,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();r&&r.material&&("strokeWidth"===e?r.material.setUniform("u_stroke_width",n):"strokeColor"===e?r.material.setUniform("u_stroke_color",n):"strokeOpacity"===e?r.material.setUniform("u_stroke_opacity",n):"opacity"===e?r.material.setUniform("u_opacity",n):"blur"===e&&r.material.setUniform("u_blur",n))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:'attribute vec2 position;\nattribute vec4 color;\nattribute float shape;\nattribute vec2 offset;\nattribute float size;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nuniform float u_stroke_width : 0.01;\nuniform float u_device_pixel_ratio;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include "picking"\n\nvoid main() {\n v_color = color;\n v_radius = size;\n\n lowp float antialiasblur = 1.0 / u_device_pixel_ratio * (size + u_stroke_width);\n\n // construct point coords\n v_data = vec4(position, antialiasblur, shape);\n\n gl_Position = projectionMatrix * modelViewMatrix\n * vec4(position * size + offset, 0.0, 1.0);\n\n setPickingColor(a_PickingColor);\n}',fs:"uniform float u_blur : 0.05;\nuniform float u_opacity : 0.7;\nuniform float u_stroke_width : 0.01;\nuniform vec4 u_stroke_color : [0, 0, 0, 0];\nuniform float u_stroke_opacity : 1;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include \"sdf2d\"\n#pragma include \"picking\"\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n float antialiasblur = v_data.z;\n float antialiased_blur = -max(u_blur, antialiasblur);\n float r = v_radius / (v_radius + u_stroke_width);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n // if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n // } else if (shape == 1) {\n // outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n // inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n // } else if (shape == 2) {\n // outer_df = sdBox(v_data.xy, vec2(1.));\n // inner_df = sdBox(v_data.xy, vec2(r));\n // } else if (shape == 3) {\n // outer_df = sdPentagon(v_data.xy, 0.8);\n // inner_df = sdPentagon(v_data.xy, r * 0.8);\n // } else if (shape == 4) {\n // outer_df = sdHexagon(v_data.xy, 0.8);\n // inner_df = sdHexagon(v_data.xy, r * 0.8);\n // } else if (shape == 5) {\n // outer_df = sdOctogon(v_data.xy, 1.0);\n // inner_df = sdOctogon(v_data.xy, r);\n // } else if (shape == 6) {\n // outer_df = sdHexagram(v_data.xy, 0.52);\n // inner_df = sdHexagram(v_data.xy, r * 0.52);\n // } else if (shape == 7) {\n // outer_df = sdRhombus(v_data.xy, vec2(1.0));\n // inner_df = sdRhombus(v_data.xy, vec2(r));\n // } else if (shape == 8) {\n // outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n // inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n // }\n\n float opacity_t = smoothstep(0.0, antialiased_blur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n inner_df\n );\n vec4 strokeColor = u_stroke_color == vec4(0) ? v_color : u_stroke_color;\n\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);\n gl_FragColor.a = gl_FragColor.a * opacity_t;\n\n gl_FragColor = filterColor(gl_FragColor);\n}"});var t=this.shaderModuleService.getModule("grid"),e=t.vs,n=t.fs,r=t.uniforms,i=this.materialSystem.createShaderMaterial({vertexShader:e,fragmentShader:n,cull:{enable:!1},depth:{enable:!1},blend:{enable:!0,func:{srcRGB:Je.gl.SRC_ALPHA,dstRGB:Je.gl.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}});i.setUniform(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ma(Object(n),!0).forEach((function(e){Nn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ma(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({u_device_pixel_ratio:window.devicePixelRatio},r));var o=this.buildAttributes(),a=this.geometrySystem.createInstancedBufferGeometry({maxInstancedCount:o.instancedOffsets.length/2,vertexCount:6});a.setIndex([0,2,1,0,3,2]),a.setAttribute("position",Float32Array.from(o.positions),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]}),a.setAttribute("offset",Float32Array.from(o.instancedOffsets),{arrayStride:8,stepMode:"instance",attributes:[{shaderLocation:1,offset:0,format:"float2"}]}),a.setAttribute("color",Float32Array.from(o.instancedColors),{arrayStride:16,stepMode:"instance",attributes:[{shaderLocation:2,offset:0,format:"float4"}]}),a.setAttribute("size",Float32Array.from(o.instancedSizes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:3,offset:0,format:"float"}]}),a.setAttribute("shape",Float32Array.from(o.instancedShapes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:4,offset:0,format:"float"}]}),a.setAttribute("a_PickingColor",Float32Array.from(o.instancedPickingColors),{arrayStride:12,stepMode:"instance",attributes:[{shaderLocation:6,offset:0,format:"float3"}]}),this.setMaterial(i),this.setGeometry(a)}},{key:"buildAttribute",value:function(t,e,n){var r,i,o,a,s;(r=e.instancedPickingColors).push.apply(r,ei()([(s=t.id||n)+1&255,s+1>>8&255,s+1>>8>>8&255])),e.instancedShapes.push(ka.indexOf(t.shape||"circle")),(i=e.instancedColors).push.apply(i,ei()(t.color||[1,0,0,1])),(o=e.instancedOffsets).push.apply(o,ei()(t.position||[0,0])),(a=e.instancedSizes).push.apply(a,ei()(t.size||[.2,.2]))}},{key:"buildAttributes",value:function(){var t=this,e={positions:[1,1,1,-1,-1,-1,-1,1],instancedOffsets:[],instancedColors:[],instancedSizes:[],instancedShapes:[],instancedPickingColors:[]};return Array.isArray(this.config)?this.config.forEach((function(n,r){t.buildAttribute(n,e,r)})):this.buildAttribute(this.config,e,0),e}}]),n}(Dr),da=Qe()(fa.prototype,"materialSystem",[aa,sa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),pa=Qe()(fa.prototype,"geometrySystem",[ua,ca],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ga=Qe()(fa.prototype,"shaderModuleService",[la],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ha=fa))||ha);function Ia(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ta(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ta(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Ta(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}var Pa,Na,ja,Da,La,Ra,Ba,Ga,Fa,za=(ba=Object(en.injectable)(),xa=Object(en.inject)(Je.IDENTIFIER.RenderEngine),wa=Object(en.inject)(Je.IDENTIFIER.ShaderModuleService),_a=Object(en.inject)(Je.IDENTIFIER.ConfigService),ba((Ea=function(){function t(){qe()(this,t),this.container=void 0,Xe()(this,"engine",Ma,this),Xe()(this,"shaderModule",Oa,this),Xe()(this,"configService",Aa,this),this.inited=!1,this.rendering=!1,this.pendings=[],this.views=[],this.size=void 0}var e,n;return Ze()(t,[{key:"init",value:(n=Tn()(Cn.a.mark((function t(){var e,n,r,i,o;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.shaderModule.registerBuiltinModules(),this.shaderModule.registerModule("uv.vert.declaration",{vs:"#ifdef USE_UV\n attribute vec2 uv;\n\t#ifdef UVS_VERTEX_ONLY\n vec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif"}),this.shaderModule.registerModule("uv.vert.main",{vs:"#ifdef USE_UV\n vUv = (uvTransform * vec3(uv, 1)).xy;\n#endif"}),this.shaderModule.registerModule("uv.frag.declaration",{fs:"#if (defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ))\n varying vec2 vUv;\n#endif"}),this.shaderModule.registerModule("map.frag.declaration",{fs:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif"}),this.shaderModule.registerModule("map.frag.main",{fs:"#ifdef USE_MAP\n vec4 texelColor = texture2D(map, vUv);\n // texelColor = mapTexelToLinear(texelColor);\n diffuseColor *= texelColor;\n#endif"}),e=this.container.getAll(Je.IDENTIFIER.Systems),!(n=this.configService.get()).canvas){t.next=30;break}return t.next=11,this.engine.init({canvas:n.canvas,swapChainFormat:jn.TextureFormat.BGRA8Unorm,antialiasing:!1});case 11:r=Ia(e),t.prev=12,r.s();case 14:if((i=r.n()).done){t.next=21;break}if(!(o=i.value).initialize){t.next=19;break}return t.next=19,o.initialize();case 19:t.next=14;break;case 21:t.next=26;break;case 23:t.prev=23,t.t0=t.catch(12),r.e(t.t0);case 26:return t.prev=26,r.f(),t.finish(26);case 29:this.inited=!0;case 30:case"end":return t.stop()}}),t,this,[[12,23,26,29]])}))),function(){return n.apply(this,arguments)})},{key:"render",value:(e=Tn()(Cn.a.mark((function t(){var e,n,r,i,o,a,s,u=arguments;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.inited&&!this.rendering){t.next=2;break}return t.abrupt("return");case 2:for(this.pendings.length&&this.pendings.forEach((function(t){t()})),this.rendering=!0,this.engine.beginFrame(),e=this.container.getAll(Je.IDENTIFIER.Systems),n=u.length,r=new Array(n),i=0;i<n;i++)r[i]=u[i];o=Ia(e),t.prev=8,o.s();case 10:if((a=o.n()).done){t.next=17;break}if(!(s=a.value).execute){t.next=15;break}return t.next=15,s.execute(r);case 15:t.next=10;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(8),o.e(t.t0);case 22:return t.prev=22,o.f(),t.finish(22);case 25:this.engine.endFrame(),this.rendering=!1;case 27:case"end":return t.stop()}}),t,this,[[8,19,22,25]])}))),function(){return e.apply(this,arguments)})},{key:"clear",value:function(t){var e=this;return this.inited?this.engine.clear(t):this.pendings.unshift((function(){e.engine.clear(t),e.pendings.shift()})),this}},{key:"setSize",value:function(t){var e=t.width,n=t.height,r=this.engine.getCanvas();return this.size={width:e,height:n},r.width=e,r.height=n,this}},{key:"getSize",value:function(){return this.size}}]),t}(),Ma=Qe()(Ea.prototype,"engine",[xa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Oa=Qe()(Ea.prototype,"shaderModule",[wa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Aa=Qe()(Ea.prototype,"configService",[_a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Sa=Ea))||Sa),Ua=Object(en.injectable)()(Pa=function(){function t(){qe()(this,t),this.entities=[]}return Ze()(t,[{key:"getEntities",value:function(){return this.entities}},{key:"addRenderable",value:function(t){return this.addEntity(t.getEntity()),this}},{key:"removeRenderable",value:function(t){return this.removeEntity(t.getEntity()),this}},{key:"addLight",value:function(){}},{key:"addEntity",value:function(t){return-1===this.entities.indexOf(t)&&this.entities.push(t),this}},{key:"removeEntity",value:function(t){var e=this.entities.indexOf(t);return this.entities.splice(e,1),this}}]),t}())||Pa,Va=Object(en.injectable)()(Na=function(){function t(){qe()(this,t),this.cache={}}return Ze()(t,[{key:"get",value:function(t){return this.cache[t]}},{key:"set",value:function(t,e){this.cache[t]=e}}]),t}())||Na;function Wa(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 Ya(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wa(Object(n),!0).forEach((function(e){Nn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wa(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Xa,Ha,qa,Ka,Za,$a,Qa,Ja,ts,es,ns,rs=(ja=Object(en.injectable)(),Da=Object(en.inject)(Va),La=Object(en.inject)(Je.IDENTIFIER.RenderEngine),ja((Ba=function(){function t(){qe()(this,t),Xe()(this,"textureCache",Ga,this),Xe()(this,"engine",Fa,this),this.config=void 0,this.loaded=!1,this.texture=void 0}var e;return Ze()(t,[{key:"setConfig",value:function(t){this.config=t}},{key:"isLoaded",value:function(){return this.loaded}},{key:"load",value:(e=Tn()(Cn.a.mark((function t(){var e=this;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.config.url){t.next=4;break}return t.abrupt("return",new Promise((function(t,n){var r=e.textureCache.get(e.config.url);if(r)t(r);else{var i=new Image;i.crossOrigin="Anonymous",i.src=e.config.url,i.onload=function(){var n=e.engine.createTexture2D(Ya(Ya({},e.config),{},{data:i,width:i.width,height:i.height,flipY:!0}));e.textureCache.set(e.config.url,n),e.texture=n,e.loaded=!0,t(n)},i.onerror=function(){n()}}})));case 4:return this.loaded=!0,this.texture=this.engine.createTexture2D(this.config),t.abrupt("return",this.texture);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),Ga=Qe()(Ba.prototype,"textureCache",[Da],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fa=Qe()(Ba.prototype,"engine",[La],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ra=Ba))||Ra),is=(Xa=Object(en.injectable)(),Ha=Object(en.inject)(Je.IDENTIFIER.Systems),qa=Object(en.named)(Je.IDENTIFIER.RendererSystem),Xa((Za=function(){function t(){qe()(this,t),Xe()(this,"rendererSystem",$a,this),this.camera=void 0,this.scene=void 0,this.viewport={x:0,y:0,width:0,height:0},this.clearColor=[1,1,1,1]}return Ze()(t,[{key:"getCamera",value:function(){return this.camera}},{key:"getScene",value:function(){return this.scene}},{key:"getViewport",value:function(){return this.viewport}},{key:"getClearColor",value:function(){return this.clearColor}},{key:"setCamera",value:function(t){return this.camera=t,this}},{key:"setScene",value:function(t){return this.scene=t,this}},{key:"setViewport",value:function(t){return this.viewport=t,this}},{key:"setClearColor",value:function(t){return this.clearColor=t,this}},{key:"pick",value:function(t){return this.rendererSystem.pick(t,this)}}]),t}(),$a=Qe()(Za.prototype,"rendererSystem",[Ha,qa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ka=Za))||Ka);function os(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 as(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?os(Object(n),!0).forEach((function(e){Nn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):os(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ss=(Qa=Object(en.injectable)(),Ja=Object(en.inject)(Je.IDENTIFIER.ConfigService),Qa((es=function(){function t(){qe()(this,t),Xe()(this,"configService",ns,this),this.container=void 0}var e;return Ze()(t,[{key:"getEngine",value:(e=Tn()(Cn.a.mark((function t(){var e,n,r,i;return Cn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.container.get(Je.IDENTIFIER.RenderEngine),n=this.configService.get(),r=n.canvas,i=n.engineOptions,t.next=4,e.init(as({canvas:r||Dn(),swapChainFormat:jn.TextureFormat.BGRA8Unorm,antialiasing:!1},i));case 4:return t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getTransformComponent",value:function(t){return this.container.get(Je.IDENTIFIER.TransformComponentManager).getComponentByEntity(t)}},{key:"getMeshComponent",value:function(t){return this.container.get(Je.IDENTIFIER.MeshComponentManager).getComponentByEntity(t)}},{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setContainer",value:function(t){this.container=t}},{key:"getContainer",value:function(){return this.container}},{key:"createEntity",value:function(){return Object(Je.createEntity)()}},{key:"createScene",value:function(){return this.container.get(Ua)}},{key:"createCamera",value:function(){return this.container.get(On)}},{key:"createView",value:function(){return this.container.get(is)}},{key:"createRenderable",value:function(t,e){var n=t?this.container.getNamed(Je.IDENTIFIER.Renderable,t):this.container.get(Dr),r=Object(Je.createEntity)();return n.setConfig(e||{}),n.setEntity(r),n}},{key:"createGeometry",value:function(t,e){var n=this.container.getNamed(Je.IDENTIFIER.Geometry,t),r=Object(Je.createEntity)();return n.setConfig(e||{}),n.setEntity(r),n.getComponent()}},{key:"createMaterial",value:function(t,e){var n=this.container.getNamed(Je.IDENTIFIER.Material,t),r=Object(Je.createEntity)();return n.setConfig(e||{}),n.setEntity(r,t),n.getComponent()}},{key:"createTexture2D",value:function(t){var e=this.container.get(rs);return e.setConfig(t),e}},{key:"createBufferGeometry",value:function(t){return this.container.getNamed(Je.IDENTIFIER.Systems,Je.IDENTIFIER.GeometrySystem).createBufferGeometry(t)}},{key:"createInstancedBufferGeometry",value:function(t){return this.container.getNamed(Je.IDENTIFIER.Systems,Je.IDENTIFIER.GeometrySystem).createInstancedBufferGeometry(t)}},{key:"createShaderMaterial",value:function(t){return this.container.getNamed(Je.IDENTIFIER.Systems,Je.IDENTIFIER.MaterialSystem).createShaderMaterial(t)}},{key:"createKernel",value:function(t){var e=this.container.get(Nr);return"string"==typeof t?e.setBundle(JSON.parse(t)):e.setBundle(t),e.init(),e}},{key:"createRenderer",value:function(){var t=this.container.get(za);return t.container=this.container,t.init(),t}},{key:"destroy",value:function(){this.container.getAll(Je.IDENTIFIER.Systems).forEach((function(t){t.tearDown&&t.tearDown()})),this.container.get(Je.IDENTIFIER.RenderEngine).destroy(),this.container.get(Je.IDENTIFIER.InteractorService).destroy()}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object(Je.createWorldContainer)(),r=navigator.gpu?Qi:yi;n.isBound(Je.IDENTIFIER.RenderEngine)||n.bind(Je.IDENTIFIER.RenderEngine).to(r).inSingletonScope(),n.bind(za).toSelf(),n.bind(Nr).toSelf(),n.bind(Dr).toSelf(),n.bind(is).toSelf(),n.bind(On).toSelf(),n.bind(Ua).toSelf(),n.bind(t).toSelf(),n.bind(Va).toSelf(),n.bind(rs).toSelf(),n.bind(Je.IDENTIFIER.Geometry).to(co).whenTargetNamed(An.BOX),n.bind(Je.IDENTIFIER.Geometry).to(Mo).whenTargetNamed(An.SPHERE),n.bind(Je.IDENTIFIER.Geometry).to(vo).whenTargetNamed(An.PLANE),n.bind(Je.IDENTIFIER.Geometry).to(fo).whenTargetNamed(An.MERGED),n.bind(Je.IDENTIFIER.Material).to(Fo).whenTargetNamed(jr.BASIC),n.bind(Je.IDENTIFIER.Renderable).to(Ca).whenTargetNamed(Dr.POINT),n.bind(Je.IDENTIFIER.Renderable).to(va).whenTargetNamed(Dr.LINE),n.bind(Je.IDENTIFIER.Renderable).to(Uo).whenTargetNamed(Dr.GRID);var i=n.get(t);return i.setContainer(n),i.setConfig(e),i}}]),t}(),ns=Qe()(es.prototype,"configService",[Ja],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ts=es))||ts);const us=(t,e)=>{let n;return n=t?X(t)?()=>t:t:()=>e||1,n},cs=t=>{const e=[],n=t.length,r=t[0].length;for(let i=0;i<r;i++)t.forEach((t,r)=>{if(e.push(t[i]),r===n-1)for(;e.length%4!=0;)e.push(0)});return new Float32Array(e)};var ls=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};class hs extends U{constructor(t){super(),this.maxIteration=1e3,this.gravity=10,this.speed=1,this.clustering=!1,this.clusterField="cluster",this.clusterGravity=10,this.workerEnabled=!1,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.updateCfg(t)}getDefaultCfg(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}}execute(){return ls(this,void 0,void 0,(function*(){const t=this,e=t.nodes;if(!e||0===e.length)return void(t.onLayoutEnd&&t.onLayoutEnd());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]);const n=t.center;if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());const r={},i={};e.forEach((t,e)=>{X(t.x)||(t.x=Math.random()*this.width),X(t.y)||(t.y=Math.random()*this.height),r[t.id]=t,i[t.id]=e}),t.nodeMap=r,t.nodeIdxMap=i,yield t.run()}))}executeWithWorker(t,e){return ls(this,void 0,void 0,(function*(){const n=this.nodes,r=this.center;if(!n||0===n.length)return;if(1===n.length)return n[0].x=r[0],void(n[0].y=r[1]);const i={},o={};n.forEach((t,e)=>{X(t.x)||(t.x=Math.random()*this.width),X(t.y)||(t.y=Math.random()*this.height),i[t.id]=t,o[t.id]=e}),this.nodeMap=i,this.nodeIdxMap=o,yield this.run(t,e)}))}run(t,e){return ls(this,void 0,void 0,(function*(){const n=this.nodes,r=this.edges,i=this.maxIteration,o=this.center,a=this.height*this.width;let s=Math.sqrt(a)/10;const u=a/(n.length+1),c=Math.sqrt(u),l=this.speed,h=this.clustering,{array:f,count:d}=((t,e)=>{const n=[],r=t.length,i={};return e.forEach(e=>{t.forEach((t,o)=>{if(void 0===i[e[t]]&&(i[e[t]]=Object.keys(i).length),n.push(i[e[t]]),o===r-1)for(;n.length%4!=0;)n.push(0)})}),{array:new Float32Array(n),count:Object.keys(i).length}})([this.clusterField],n);n.forEach((t,e)=>{let n=0,r=0;X(t.fx)&&X(t.fy)&&(n=t.fx||.001,r=t.fy||.001),f[4*e+1]=n,f[4*e+2]=r});const p=n.length,{maxEdgePerVetex:g,array:v}=((t,e)=>{const n=[],r=[],i={};let o=0;for(o=0;o<t.length;o++){const e=t[o];i[e.id]=o,n.push(e.x),n.push(e.y),n.push(0),n.push(0),r.push([])}for(o=0;o<e.length;o++){const t=e[o],n=Z(t,"source"),a=Z(t,"target");r[i[n]].push(i[a]),r[i[a]].push(i[n])}let a=0;for(o=0;o<t.length;o++){const t=n.length,e=r[o],i=e.length;n[4*o+2]=t,n[4*o+3]=e.length,a=Math.max(a,e.length);for(let t=0;t<i;++t){const r=e[t];n.push(+r)}}for(;n.length%4!=0;)n.push(0);return{maxEdgePerVetex:a,array:new Float32Array(n)}})(n,r);let m;m=this.workerEnabled?ss.create({canvas:t,engineOptions:{supportCompute:!0}}):ss.create({engineOptions:{supportCompute:!0}});const y=this.onLayoutEnd,b=[];for(let t=0;t<d;t++)b.push(0,0,0,0);const x=m.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_K : f32;\\n [[offset 4]] u_K2 : f32;\\n [[offset 8]] u_Center : vec2<f32>;\\n [[offset 16]] u_Gravity : f32;\\n [[offset 20]] u_ClusterGravity : f32;\\n [[offset 24]] u_Speed : f32;\\n [[offset 28]] u_MaxDisplace : f32;\\n [[offset 32]] u_Clustering : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AttributeArray : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar param : f32 = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx = dx + param * xDist;\\ndy = dy + param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < j);\\ndx = dx + param * std::sign;\\ndy = dy + param * std::sign;}}}}\\nreturn vec2<f32>(dx, dy);}\\nfn calcGravity(currentNode : vec4<f32>, nodeAttributes : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar vx : f32 = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nvar vy : f32 = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nvar gf : f32 = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {var clusterIdx : i32 = i32(nodeAttributes.x);\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nvar cvx : f32 = currentNode.x - center.x;\\nvar cvy : f32 = currentNode.y - center.y;\\nvar dist : f32 = std::sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nvar parma : f32 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx = dx + parma * cvx;\\ndy = dy + parma * cvy;}\\nreturn vec2<f32>(dx, dy);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar arr_offset : i32 = i32(std::floor(currentNode.z + 0.5));\\nvar length : i32 = i32(std::floor(currentNode.w + 0.5));\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + i32(p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = select(node_buffer.x, select(node_buffer.y, select(node_buffer.z, node_buffer.w, buf_offset == 2), buf_offset == 1), buf_offset == 0);\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar attractiveF : f32 = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx = dx - xDist * attractiveF;\\ndy = dy - yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < i32(float_j));\\ndx = dx - std::sign * attractiveF;\\ndy = dy - std::sign * attractiveF;}}}\\nreturn vec2<f32>(dx, dy);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nif (i >= __DefineValuePlaceholder__VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes : vec4<f32> = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\ndx = dx + repulsive.x;\\ndy = dy + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode);\\ndx = dx + attractive.x;\\ndy = dy + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(currentNode, nodeAttributes);\\ndx = dx - gravity.x;\\ndy = dy - gravity.y;\\ndx = dx * gWebGPUUniformParams.u_Speed;\\ndy = dy * gWebGPUUniformParams.u_Speed;\\nvar distLength : f32 = std::sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {var limitedDist : f32 = std::min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_K;\\n float u_K2;\\n vec2 u_Center;\\n float u_Gravity;\\n float u_ClusterGravity;\\n float u_Speed;\\n float u_MaxDisplace;\\n float u_Clustering;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AttributeArray[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nvec2 calcRepulsive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = gWebGPUUniformParams.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) {float dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nfloat vy = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nfloat gf = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = gWebGPUBuffer2.u_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 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {float 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 = gWebGPUBuffer0.u_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 = gWebGPUBuffer0.u_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 / gWebGPUUniformParams.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() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = 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 *= gWebGPUUniformParams.u_Speed;\\ndy *= gWebGPUUniformParams.u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}}\\n","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([p,1,1]).setBinding({u_Data:v,u_K:c,u_K2:u,u_Gravity:this.gravity,u_ClusterGravity:this.clusterGravity||this.gravity||1,u_Speed:l,u_MaxDisplace:s,u_Clustering:h?1:0,u_Center:o,u_AttributeArray:f,u_ClusterCenters:b,MAX_EDGE_PER_VERTEX:g,VERTEX_COUNT:p});let w;h&&(w=m.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\n\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 0, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_NodeAttributes : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[i];\\nvar sumx : f32 = 0.0;\\nvar sumy : f32 = 0.0;\\nvar count : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var attributes : vec4<f32> = gWebGPUBuffer1.u_NodeAttributes[j];\\nvar clusterIdx : i32 = i32(attributes.x);\\nvar vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx = sumx + vertex.x;\\nsumy = sumy + vertex.y;\\ncount = count + 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4<f32>(sumx / count, sumy / count, count, i);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\n\\nlayout(std430, set = 0, binding = 0) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer1 {\\n vec4 u_NodeAttributes[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {int i = globalInvocationID.x;\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[i];\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = gWebGPUBuffer1.u_NodeAttributes[j];\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);}\\n","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([d,1,1]).setBinding({u_Data:v,u_NodeAttributes:f,u_ClusterCenters:b,VERTEX_COUNT:p,CLUSTER_COUNT:d}));yield(()=>ls(this,void 0,void 0,(function*(){for(let t=0;t<i;t++)yield x.execute(),h&&(w.setBinding({u_Data:x}),yield w.execute(),x.setBinding({u_ClusterCenters:w})),x.setBinding({u_MaxDisplace:s*=.99});const r=yield x.getOutput();t?e.postMessage({type:ne,vertexEdgeData:r}):n.forEach((t,e)=>{const n=r[4*e],i=r[4*e+1];t.x=n,t.y=i}),y&&y()})))()}))}getType(){return"fruchterman-gpu"}}var fs=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};class ds extends U{constructor(t){super(),this.maxIteration=1e3,this.edgeStrength=200,this.nodeStrength=1e3,this.coulombDisScale=.005,this.damping=.9,this.maxSpeed=1e3,this.minMovement=.5,this.interval=.02,this.factor=1,this.linkDistance=1,this.gravity=10,this.workerEnabled=!1,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.updateCfg(t)}getDefaultCfg(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}}execute(){return fs(this,void 0,void 0,(function*(){const t=this,e=t.nodes;if(!e||0===e.length)return void(t.onLayoutEnd&&t.onLayoutEnd());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]);const n=t.center;if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());const r={},i={};e.forEach((e,n)=>{X(e.x)||(e.x=Math.random()*t.width),X(e.y)||(e.y=Math.random()*t.height),r[e.id]=e,i[e.id]=n}),t.nodeMap=r,t.nodeIdxMap=i,t.nodeStrength=us(t.nodeStrength,1),t.edgeStrength=us(t.edgeStrength,1),yield t.run()}))}executeWithWorker(t,e){const n=this,r=n.nodes,i=n.center;if(!r||0===r.length)return;if(1===r.length)return r[0].x=i[0],void(r[0].y=i[1]);const o={},a={};r.forEach((t,e)=>{X(t.x)||(t.x=Math.random()*n.width),X(t.y)||(t.y=Math.random()*n.height),o[t.id]=t,a[t.id]=e}),n.nodeMap=o,n.nodeIdxMap=a,n.nodeStrength=us(n.nodeStrength,1),n.edgeStrength=us(n.edgeStrength,1),n.run(t,e)}run(t,e){return fs(this,void 0,void 0,(function*(){const n=this,r=n.nodes,i=n.edges,o=n.maxIteration;n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight);const a=r.length;n.linkDistance=us(n.linkDistance),n.edgeStrength=us(n.edgeStrength);const{maxEdgePerVetex:s,array:u}=((t,e,n,r)=>{const i=[],o=[],a={};let s=0;for(s=0;s<t.length;s++){const e=t[s];a[e.id]=s,i.push(e.x),i.push(e.y),i.push(0),i.push(0),o.push([])}for(s=0;s<e.length;s++){const t=e[s],i=Z(t,"source"),u=Z(t,"target");o[a[i]].push(a[u]),o[a[i]].push(n(t)),o[a[i]].push(r(t)),o[a[i]].push(0),o[a[u]].push(a[i]),o[a[u]].push(n(t)),o[a[u]].push(r(t)),o[a[u]].push(0)}let u=0;for(s=0;s<t.length;s++){const t=i.length,e=o[s],n=e.length;i[4*s+2]=t+1048576*n/4,i[4*s+3]=0,u=Math.max(u,n/4);for(let t=0;t<n;++t){const n=e[t];i.push(+n)}}for(;i.length%4!=0;)i.push(0);return{maxEdgePerVetex:u,array:new Float32Array(i)}})(r,i,n.linkDistance,n.edgeStrength);n.degrees=$(r.length,n.nodeIdxMap,i);const c=[],l=[],h=[],f=[],d=[],p=[],g=[];n.getMass||(n.getMass=t=>n.degrees[n.nodeIdxMap[t.id]]||1);const v=n.gravity,m=n.center;r.forEach((t,e)=>{c.push(n.getMass(t)),l.push(n.nodeStrength(t)),n.degrees[e]||(n.degrees[e]=0);let r=[m[0],m[1],v];if(n.getCenter){const i=n.getCenter(t,n.degrees[e]);i&&X(i[0])&&X(i[1])&&X(i[2])&&(r=i)}h.push(r[0]),f.push(r[1]),d.push(r[2]),X(t.fx)&&X(t.fy)?(p.push(t.fx||.001),g.push(t.fy||.001)):(p.push(0),g.push(0))});const y=cs([c,n.degrees,l,p]),b=cs([h,f,d,g]);let x;x=n.workerEnabled?ss.create({canvas:t,engineOptions:{supportCompute:!0}}):ss.create({engineOptions:{supportCompute:!0}});const w=n.onLayoutEnd,_=[];u.forEach(t=>{_.push(t)});for(let t=0;t<4;t++)_.push(0);const S=x.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_damping : f32;\\n [[offset 4]] u_maxSpeed : f32;\\n [[offset 8]] u_minMovement : f32;\\n \\n [[offset 12]] u_coulombDisScale : f32;\\n [[offset 16]] u_factor : f32;\\n \\n \\n [[offset 20]] u_interval : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray1 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\ntype GWebGPUBuffer3 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray2 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 4, set 0]] var<storage_buffer> gWebGPUBuffer3 : GWebGPUBuffer3;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn unpack_float(packedValue : f32) -> vec2<i32> {var packedIntValue : i32 = i32(packedValue);\\nvar v0 : i32 = packedIntValue / 1048576;\\nreturn vec2<i32>(v0, packedIntValue - (v0 * 1048576));}\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar vx : f32 = currentNode.x - nextNode.x;\\nvar vy : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar n_dist : f32 = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar attributesi : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar attributesj : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nvar massi : f32 = attributesi.x;\\nvar nodeStrengthi : f32 = attributesi.z;\\nvar nodeStrengthj : f32 = attributesj.z;\\nvar nodeStrength : f32 = (nodeStrengthi + nodeStrengthj) / 2.0;\\nvar param : f32 = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax = ax + direx * param;\\nay = ay + direy * param;}}\\nreturn vec2<f32>(ax, ay);}\\nfn calcGravity(i : i32, currentNode : vec4<f32>, attributes2 : vec4<f32>) -> vec2<f32> {var vx : f32 = currentNode.x - attributes2.x;\\nvar vy : f32 = currentNode.y - attributes2.y;\\nvar ax : f32 = vx * attributes2.z;\\nvar ay : f32 = vy * attributes2.z;\\nreturn vec2<f32>(ax, ay);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>, attributes1 : vec4<f32>) -> vec2<f32> {var mass : f32 = attributes1.x;\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nvar compressed : vec2<i32> = unpack_float(currentNode.z);\\nvar length : i32 = compressed.x;\\nvar arr_offset : i32 = compressed.y;\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + (4 * p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = node_buffer.x;\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar vx : f32 = nextNode.x - currentNode.x;\\nvar vy : f32 = nextNode.y - currentNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar edgeLength : f32 = node_buffer.y;\\nvar edgeStrength : f32 = node_buffer.z;\\nvar diff : f32 = edgeLength - dist;\\nvar param : f32 = (diff * edgeStrength) / mass;\\nax = ax - direx * param;\\nay = ay - direy * param;}\\nreturn vec2<f32>(ax, ay);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar movement : vec4<f32> = gWebGPUBuffer1.u_AveMovement[0];\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nif ((i >= __DefineValuePlaceholder__VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes1 : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar nodeAttributes2 : vec4<f32> = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\nax = ax + repulsive.x;\\nay = ay + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode, nodeAttributes1);\\nax = ax + attractive.x;\\nay = ay + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(i, currentNode, nodeAttributes2);\\nax = ax - gravity.x;\\nay = ay - gravity.y;\\nvar param : f32 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nvar vx : f32 = ax * param;\\nvar vy : f32 = ay * param;\\nvar vlength : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {var param2 : f32 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nvar distx : f32 = vx * gWebGPUUniformParams.u_interval;\\nvar disty : f32 = vy * gWebGPUUniformParams.u_interval;\\nvar distLength : f32 = std::sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_damping;\\n float u_maxSpeed;\\n float u_minMovement;\\n \\n float u_coulombDisScale;\\n float u_factor;\\n \\n \\n float u_interval;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_NodeAttributeArray1[];\\n} gWebGPUBuffer2;\\n\\nlayout(std430, set = 0, binding = 4) buffer readonly GWebGPUBuffer3 {\\n vec4 u_NodeAttributeArray2[];\\n} gWebGPUBuffer3;\\n\\n\\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\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nivec2 unpack_float(float packedValue) {int packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {float ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_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) * gWebGPUUniformParams.u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 attributesj = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {float 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) {float 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 = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = gWebGPUBuffer0.u_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() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nvec4 movement = gWebGPUBuffer1.u_AveMovement[0];\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes1 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 nodeAttributes2 = gWebGPUBuffer3.u_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 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {float param2 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * gWebGPUUniformParams.u_interval;\\nfloat disty = vy * gWebGPUUniformParams.u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}}\\n","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;}\\nfloat distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {gl_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([a,1,1]).setBinding({u_Data:u,u_damping:n.damping,u_maxSpeed:n.maxSpeed,u_minMovement:n.minMovement,u_coulombDisScale:n.coulombDisScale,u_factor:n.factor,u_NodeAttributeArray1:y,u_NodeAttributeArray2:b,MAX_EDGE_PER_VERTEX:s,VERTEX_COUNT:a,u_AveMovement:_,u_interval:n.interval}),E=x.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_iter : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var movement : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nmovement = movement + vertex.w;}\\nmovement = movement / f32(__DefineValuePlaceholder__VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4<f32>(movement, 0.0, 0.0, 0.0);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_iter;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {float movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = gWebGPUBuffer0.u_Data[j];\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);}\\n","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:u,VERTEX_COUNT:a,u_AveMovement:[0,0,0,0]});yield(()=>fs(this,void 0,void 0,(function*(){for(let t=0;t<o;t++){yield S.execute(),E.setBinding({u_Data:S}),yield E.execute();const e=Math.max(.02,n.interval-.002*t);S.setBinding({u_interval:e,u_AveMovement:E})}const i=yield S.getOutput();t?e.postMessage({type:ne,vertexEdgeData:i}):r.forEach((t,e)=>{const n=i[4*e],r=i[4*e+1];t.x=n,t.y=r}),w&&w()})))()}))}getType(){return"gForce-gpu"}}class ps extends U{constructor(t){super(),this.center=[0,0],this.maxIteration=100,this.gravity=10,this.comboGravity=10,this.linkDistance=10,this.alpha=1,this.alphaMin=.001,this.alphaDecay=1-Math.pow(this.alphaMin,1/300),this.alphaTarget=0,this.velocityDecay=.6,this.edgeStrength=.6,this.nodeStrength=30,this.preventOverlap=!1,this.preventNodeOverlap=!1,this.preventComboOverlap=!1,this.collideStrength=void 0,this.nodeCollideStrength=.5,this.comboCollideStrength=.5,this.comboSpacing=20,this.comboPadding=10,this.optimizeRangeFactor=1,this.onTick=()=>{},this.onLayoutEnd=()=>{},this.depthAttractiveForceScale=1,this.depthRepulsiveForceScale=2,this.nodes=[],this.edges=[],this.combos=[],this.comboTrees=[],this.width=300,this.height=300,this.bias=[],this.nodeMap={},this.oriComboMap={},this.indexMap={},this.comboMap={},this.previousLayouted=!1,this.updateCfg(t)}getDefaultCfg(){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}}execute(){const 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()}run(){const 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);const r=t.center,i=t.velocityDecay,o=t.comboMap;t.previousLayouted||t.initPos(o);for(let r=0;r<n;r++){const n=[];e.forEach((t,e)=>{n[e]={x:0,y:0}}),t.applyCalculate(n),t.applyComboCenterForce(n),e.forEach((t,e)=>{X(t.x)&&X(t.y)&&(t.x+=n[e].x*i,t.y+=n[e].y*i)}),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()}const a=[0,0];e.forEach(t=>{X(t.x)&&X(t.y)&&(a[0]+=t.x,a[1]+=t.y)}),a[0]/=e.length,a[1]/=e.length;const s=[r[0]-a[0],r[1]-a[1]];e.forEach((t,e)=>{X(t.x)&&X(t.y)&&(t.x+=s[0],t.y+=s[1])}),t.combos.forEach(t=>{const e=o[t.id];e&&e.empty&&(t.x=e.cx||t.x,t.y=e.cy||t.y)}),t.previousLayouted=!0}initVals(){const t=this,e=t.edges,n=t.nodes,r=t.combos,i={},o={},a={};n.forEach((t,e)=>{o[t.id]=t,a[t.id]=e}),t.nodeMap=o,t.indexMap=a;const s={};r.forEach(t=>{s[t.id]=t}),t.oriComboMap=s,t.comboMap=t.getComboMap();const u=t.preventOverlap;t.preventComboOverlap=t.preventComboOverlap||u,t.preventNodeOverlap=t.preventNodeOverlap||u;const c=t.collideStrength;c&&(t.comboCollideStrength=c,t.nodeCollideStrength=c),t.comboCollideStrength=t.comboCollideStrength?t.comboCollideStrength:0,t.nodeCollideStrength=t.nodeCollideStrength?t.nodeCollideStrength:0;for(let t=0;t<e.length;++t){const n=Z(e[t],"source"),r=Z(e[t],"target");i[n]?i[n]++:i[n]=1,i[r]?i[r]++:i[r]=1}const l=[];for(let t=0;t<e.length;++t){const n=Z(e[t],"source"),r=Z(e[t],"target");l[t]=i[n]/(i[n]+i[r])}this.bias=l;const h=t.nodeSize,f=t.nodeSpacing;let d,p;if(p=X(f)?()=>f:nt(f)?f:()=>0,this.nodeSpacing=p,h)if(nt(h))d=t=>h(t);else if(Y(h)){const t=(h[0]>h[1]?h[0]:h[1])/2;d=e=>t}else{const t=h/2;d=e=>t}else d=t=>{if(t.size){if(Y(t.size)){return(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2}if(q(t.size)){return(t.size.width>t.size.height?t.size.width:t.size.height)/2}return t.size/2}return 10};this.nodeSize=d;const g=t.comboSpacing;let v;v=X(g)?()=>g:nt(g)?g:()=>0,this.comboSpacing=v;const m=t.comboPadding;let y;y=X(m)?()=>m:Y(m)?()=>Math.max.apply(null,m):nt(m)?m:()=>0,this.comboPadding=y;let b,x=this.linkDistance;x||(x=10),b=X(x)?t=>x:x,this.linkDistance=b;let w,_=this.edgeStrength;_||(_=1),w=X(_)?t=>_:_,this.edgeStrength=w;let S,E=this.nodeStrength;E||(E=30),S=X(E)?t=>E:E,this.nodeStrength=S}initPos(t){this.nodes.forEach((e,n)=>{const r=e.comboId,i=t[r];r&&i?(e.x=i.cx+100/(n+1),e.y=i.cy+100/(n+1)):(e.x=100/(n+1),e.y=100/(n+1))})}getComboMap(){const t=this,e=t.nodeMap,n=t.indexMap,r=t.comboTrees,i=t.oriComboMap,o={};return(r||[]).forEach(r=>{const a=[];et(r,r=>{if("node"===r.itemType)return!0;if(!i[r.id])return!0;if(void 0===o[r.id]){const e={id:r.id,name:r.id,cx:0,cy:0,count:0,depth:t.oriComboMap[r.id].depth||0,children:[]};o[r.id]=e}const s=r.children;s&&s.forEach(t=>{if(!o[t.id]&&!e[t.id])return!0;a.push(t)});const u=o[r.id];if(u.cx=0,u.cy=0,0===a.length){u.empty=!0;const o=i[r.id],s=Object.keys(e).length,c=`${r.id}-visual-child-${s}`,l={id:c,x:o.x,y:o.y,depth:u.depth+1,itemType:"node"};t.nodes.push(l),e[c]=l,n[c]=s,u.cx=o.x,u.cy=o.y,a.push(l)}return a.forEach(t=>{if(u.count++,"node"!==t.itemType){const e=o[t.id];return X(e.cx)&&(u.cx+=e.cx),void(X(e.cy)&&(u.cy+=e.cy))}const n=e[t.id];n&&(X(n.x)&&(u.cx+=n.x),X(n.y)&&(u.cy+=n.y))}),u.cx/=u.count,u.cy/=u.count,u.children=a,!0})}),o}applyComboCenterForce(t){const e=this.gravity,n=this.comboGravity||e,r=this.alpha,i=this.comboTrees,o=this.indexMap,a=this.nodeMap,s=this.comboMap;(i||[]).forEach(e=>{et(e,e=>{if("node"===e.itemType)return!0;if(!s[e.id])return!0;const i=s[e.id],u=(i.depth+1)/10*.5,c=i.cx,l=i.cy;return i.cx=0,i.cy=0,i.children.forEach(e=>{if("node"!==e.itemType){const t=s[e.id];return t&&X(t.cx)&&(i.cx+=t.cx),void(t&&X(t.cy)&&(i.cy+=t.cy))}const h=a[e.id],f=h.x-c||.005,d=h.y-l||.005,p=Math.sqrt(f*f+d*d),g=o[h.id],v=n*r/p*u;t[g].x-=f*v,t[g].y-=d*v,X(h.x)&&(i.cx+=h.x),X(h.y)&&(i.cy+=h.y)}),i.cx/=i.count,i.cy/=i.count,!0})})}applyCalculate(t){const e=this.comboMap,n=this.nodes,r={};n.forEach((t,e)=>{n.forEach((n,i)=>{if(e<i)return;const o=t.x-n.x||.005,a=t.y-n.y||.005;let s=o*o+a*a;const u=Math.sqrt(s);s<1&&(s=u),r[`${t.id}-${n.id}`]={vx:o,vy:a,vl2:s,vl:u},r[`${n.id}-${t.id}`]={vl2:s,vl:u,vx:-o,vy:-a}})}),this.updateComboSizes(e),this.calRepulsive(t,r),this.calAttractive(t,r);this.preventComboOverlap&&this.comboNonOverlapping(t,e)}updateComboSizes(t){const e=this,n=e.comboTrees,r=e.nodeMap,i=e.nodeSize,o=e.comboSpacing,a=e.comboPadding;(n||[]).forEach(n=>{const s=[];et(n,n=>{if("node"===n.itemType)return!0;const u=t[n.id];if(!u)return!1;const c=n.children;c&&c.forEach(e=>{(t[e.id]||r[e.id])&&s.push(e)}),u.minX=1/0,u.minY=1/0,u.maxX=-1/0,u.maxY=-1/0,s.forEach(t=>{if("node"!==t.itemType)return!0;const e=r[t.id];if(!e)return!0;const n=i(e),o=e.x-n,a=e.y-n,s=e.x+n,c=e.y+n;u.minX>o&&(u.minX=o),u.minY>a&&(u.minY=a),u.maxX<s&&(u.maxX=s),u.maxY<c&&(u.maxY=c)});let l=e.oriComboMap[n.id].size||10;Y(l)&&(l=l[0]);const h=Math.max(u.maxX-u.minX,u.maxY-u.minY,l);return u.r=h/2+o(u)/2+a(u),!0})})}comboNonOverlapping(t,e){const n=this.comboTree,r=this.comboCollideStrength,i=this.indexMap,o=this.nodeMap;et(n,n=>{if(!e[n.id]&&!o[n.id]&&"comboTreeRoot"!==n.id)return!1;const a=n.children;return a&&a.length>1&&a.forEach((n,s)=>{if("node"===n.itemType)return!1;const u=e[n.id];u&&a.forEach((a,c)=>{if(s<=c)return!1;if("node"===a.itemType)return!1;const l=e[a.id];if(!l)return!1;const h=u.cx-l.cx||.005,f=u.cy-l.cy||.005,d=h*h+f*f,p=u.r||1,g=l.r||1,v=p+g,m=g*g,y=p*p;if(d<v*v){const e=n.children;if(!e||0===e.length)return!1;const s=a.children;if(!s||0===s.length)return!1;const u=Math.sqrt(d),c=(v-u)/u*r,l=h*c,p=f*c,g=m/(y+m),b=1-g;e.forEach(e=>{if("node"!==e.itemType)return!1;if(!o[e.id])return;const n=i[e.id];s.forEach(e=>{if("node"!==e.itemType)return!1;if(!o[e.id])return!1;const r=i[e.id];t[n].x+=l*g,t[n].y+=p*g,t[r].x-=l*b,t[r].y-=p*b})})}})}),!0})}calRepulsive(t,e){const n=this,r=n.nodes,i=n.width*n.optimizeRangeFactor,o=n.nodeStrength,a=n.alpha,s=n.nodeCollideStrength,u=n.preventNodeOverlap,c=n.nodeSize,l=n.nodeSpacing,h=n.depthRepulsiveForceScale,f=n.center;r.forEach((d,p)=>{if(d.x&&d.y){if(f){const e=n.gravity,r=d.x-f[0]||.005,i=d.y-f[1]||.005,o=Math.sqrt(r*r+i*i);t[p].x-=r*e*a/o,t[p].y-=i*e*a/o}r.forEach((n,r)=>{if(p===r)return;if(!n.x||!n.y)return;const{vl2:f,vl:g}=e[`${d.id}-${n.id}`];if(g>i)return;const{vx:v,vy:m}=e[`${d.id}-${n.id}`];let y=Math.log(Math.abs(n.depth-d.depth)/10)+1||1;y=y<1?1:y,n.comboId!==d.comboId&&(y+=1);const b=y?Math.pow(h,y):1,x=o(n)*a/f*b;if(t[p].x+=v*x,t[p].y+=m*x,p<r&&u){const e=c(d)+l(d)||1,i=c(n)+l(n)||1,o=e+i;if(f<o*o){const n=(o-g)/g*s,a=i*i;let u=a/(e*e+a);const c=v*n,l=m*n;t[p].x+=c*u,t[p].y+=l*u,u=1-u,t[r].x-=c*u,t[r].y-=l*u}}})}})}calAttractive(t,e){const n=this,r=n.edges,i=n.linkDistance,o=n.alpha,a=n.edgeStrength,s=n.bias,u=n.depthAttractiveForceScale;r.forEach((r,c)=>{const l=Z(r,"source"),h=Z(r,"target");if(!l||!h||l===h)return;const f=n.indexMap[l],d=n.indexMap[h],p=n.nodeMap[l],g=n.nodeMap[h];if(!p||!g)return;let v=p.depth===g.depth?0:Math.log(Math.abs(p.depth-g.depth)/10);p.comboId===g.comboId&&(v/=2);let m=v?Math.pow(u,v):1;if(p.comboId!==g.comboId&&1===m?m=u/2:p.comboId===g.comboId&&(m=2),!(X(g.x)&&X(p.x)&&X(g.y)&&X(p.y)))return;const{vl:y,vx:b,vy:x}=e[`${h}-${l}`],w=(y-i(r))/y*o*a(r)*m,_=b*w,S=x*w,E=s[c];t[d].x-=_*E,t[d].y-=S*E,t[f].x+=_*(1-E),t[f].y+=S*(1-E)})}getType(){return"comboForce"}}class gs{constructor(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}distanceTo(t){const e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)}setPos(t,e){this.rx=t,this.ry=e}resetForce(){this.fx=0,this.fy=0}addForce(t){const e=t.rx-this.rx,n=t.ry-this.ry;let r=Math.hypot(e,n);r=r<1e-4?1e-4:r;const i=this.g*(this.degree+1)*(t.degree+1)/r;this.fx+=i*e/r,this.fy+=i*n/r}in(t){return t.contains(this.rx,this.ry)}add(t){const e=this.mass+t.mass,n=(this.rx*this.mass+t.rx*t.mass)/e,r=(this.ry*this.mass+t.ry*t.mass)/e,i=this.degree+t.degree;return new gs({rx:n,ry:r,mass:e,degree:i})}}class vs{constructor(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}getLength(){return this.length}contains(t,e){const n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n}NW(){const t=this.xmid-this.length/4,e=this.ymid+this.length/4,n=this.length/2;return new vs({xmid:t,ymid:e,length:n})}NE(){const t=this.xmid+this.length/4,e=this.ymid+this.length/4,n=this.length/2;return new vs({xmid:t,ymid:e,length:n})}SW(){const t=this.xmid-this.length/4,e=this.ymid-this.length/4,n=this.length/2;return new vs({xmid:t,ymid:e,length:n})}SE(){const t=this.xmid+this.length/4,e=this.ymid-this.length/4,n=this.length/2;return new vs({xmid:t,ymid:e,length:n})}}class ms{constructor(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)}insert(t){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new ms(this.quad.NW()),this.NE=new ms(this.quad.NE()),this.SW=new ms(this.quad.SW()),this.SE=new ms(this.quad.SE())),this._putBody(this.body),this._putBody(t),this.body=this.body.add(t)):(this.body=this.body.add(t),this._putBody(t)):this.body=t}_putBody(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))}_isExternal(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE}updateForce(t){if(null!=this.body&&t!==this.body)if(this._isExternal())t.addForce(this.body);else{(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))}}}class ys extends U{constructor(t){super(),this.center=[0,0],this.width=300,this.height=300,this.nodes=[],this.edges=[],this.kr=5,this.kg=1,this.mode="normal",this.preventOverlap=!1,this.dissuadeHubs=!1,this.barnesHut=void 0,this.maxIteration=0,this.ks=.1,this.ksmax=10,this.tao=.1,this.onLayoutEnd=()=>{},this.prune=void 0,this.updateCfg(t)}getDefaultCfg(){return{}}execute(){const t=this,{nodes:e,onLayoutEnd:n,prune:r}=t;let i=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);const o=[],a=e.length;for(let n=0;n<a;n+=1){const r=e[n];let i=10,a=10;X(r.size)&&(i=r.size,a=r.size),Y(r.size)?(isNaN(r.size[0])||(i=r.size[0]),isNaN(r.size[1])||(a=r.size[1])):q(r.size)&&(i=r.size.width,a=r.size.height),t.getWidth&&!isNaN(t.getWidth(r))&&(a=t.getWidth(r)),t.getHeight&&!isNaN(t.getHeight(r))&&(i=t.getHeight(r));const s=Math.max(i,a);o.push(s)}void 0===t.barnesHut&&a>250&&(t.barnesHut=!0),void 0===t.prune&&a>100&&(t.prune=!0),0!==this.maxIteration||t.prune?0===this.maxIteration&&r&&(i=100,a<=200&&a>100?i=500:a>200&&(i=950),this.maxIteration=i):(i=250,a<=200&&a>100?i=1e3:a>200&&(i=1200),this.maxIteration=i),t.kr||(t.kr=50,a>100&&a<=500?t.kr=20:a>500&&(t.kr=1)),t.kg||(t.kg=20,a>100&&a<=500?t.kg=10:a>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(o),n()}updateNodesByForces(t){const e=this,{edges:n,maxIteration:r}=e;let i=e.nodes;const o=n.filter(t=>Z(t,"source")!==Z(t,"target")),a=i.length,s=o.length,u=[],c={},l={},h=[];for(let t=0;t<a;t+=1)c[i[t].id]=t,u[t]=0,(void 0===i[t].x||isNaN(i[t].x))&&(i[t].x=1e3*Math.random()),(void 0===i[t].y||isNaN(i[t].y))&&(i[t].y=1e3*Math.random()),h.push({x:i[t].x,y:i[t].y});for(let t=0;t<s;t+=1){let e,n,r=0,s=0;for(let u=0;u<a;u+=1){const a=Z(o[t],"source"),c=Z(o[t],"target");i[u].id===a?(e=i[u],r=u):i[u].id===c&&(n=i[u],s=u),l[t]={sourceIdx:r,targetIdx:s}}e&&(u[c[e.id]]+=1),n&&(u[c[n.id]]+=1)}let f=r;if(i=this.iterate(f,c,l,s,u,t),e.prune){for(let t=0;t<s;t+=1)u[l[t].sourceIdx]<=1?(i[l[t].sourceIdx].x=i[l[t].targetIdx].x,i[l[t].sourceIdx].y=i[l[t].targetIdx].y):u[l[t].targetIdx]<=1&&(i[l[t].targetIdx].x=i[l[t].sourceIdx].x,i[l[t].targetIdx].y=i[l[t].sourceIdx].y);e.prune=!1,e.barnesHut=!1,f=100,i=this.iterate(f,c,l,s,u,t)}return i}iterate(t,e,n,r,i,o){const a=this;let{nodes:s}=a;const{kr:u,preventOverlap:c}=a,{barnesHut:l}=a,h=s.length;let f=0;let d=t;let p=[];const g=[],v=[];for(let t=0;t<h;t+=1)if(p[2*t]=0,p[2*t+1]=0,l){const e={id:t,rx:s[t].x,ry:s[t].y,mass:1,g:u,degree:i[t]};v[t]=new gs(e)}for(;d>0;){for(let t=0;t<h;t+=1)g[2*t]=p[2*t],g[2*t+1]=p[2*t+1],p[2*t]=0,p[2*t+1]=0;p=this.getAttrForces(d,50,r,e,n,i,o,p),p=l&&(c&&d>50||!c)?this.getOptRepGraForces(p,v,i):this.getRepGraForces(d,50,p,100,o,i);const t=this.updatePos(p,g,f,i);s=t.nodes,f=t.sg,d--,a.tick&&a.tick()}return s}getAttrForces(t,e,n,r,i,o,a,s){const{nodes:u,preventOverlap:c,dissuadeHubs:l,mode:h,prune:f}=this;for(let d=0;d<n;d+=1){const n=u[i[d].sourceIdx],p=i[d].sourceIdx,g=u[i[d].targetIdx],v=i[d].targetIdx;if(f&&(o[p]<=1||o[v]<=1))continue;const m=[g.x-n.x,g.y-n.y];let y=Math.hypot(m[0],m[1]);y=y<1e-4?1e-4:y,m[0]=m[0]/y,m[1]=m[1]/y,c&&t<e&&(y=y-a[p]-a[v]);let b=y,x=b;"linlog"===h&&(b=Math.log(1+y),x=b),l&&(b=y/o[p],x=y/o[v]),c&&t<e&&y<=0?(b=0,x=0):c&&t<e&&y>0&&(b=y,x=y),s[2*r[n.id]]+=b*m[0],s[2*r[g.id]]-=x*m[0],s[2*r[n.id]+1]+=b*m[1],s[2*r[g.id]+1]-=x*m[1]}return s}getRepGraForces(t,e,n,r,i,o){const{nodes:a,preventOverlap:s,kr:u,kg:c,center:l,prune:h}=this,f=a.length;for(let d=0;d<f;d+=1){for(let c=d+1;c<f;c+=1){if(h&&(o[d]<=1||o[c]<=1))continue;const l=[a[c].x-a[d].x,a[c].y-a[d].y];let f=Math.hypot(l[0],l[1]);f=f<1e-4?1e-4:f,l[0]=l[0]/f,l[1]=l[1]/f,s&&t<e&&(f=f-i[d]-i[c]);let p=u*(o[d]+1)*(o[c]+1)/f;s&&t<e&&f<0?p=r*(o[d]+1)*(o[c]+1):s&&t<e&&0===f?p=0:s&&t<e&&f>0&&(p=u*(o[d]+1)*(o[c]+1)/f),n[2*d]-=p*l[0],n[2*c]+=p*l[0],n[2*d+1]-=p*l[1],n[2*c+1]+=p*l[1]}const p=[a[d].x-l[0],a[d].y-l[1]],g=Math.hypot(p[0],p[1]);p[0]=p[0]/g,p[1]=p[1]/g;const v=c*(o[d]+1);n[2*d]-=v*p[0],n[2*d+1]-=v*p[1]}return n}getOptRepGraForces(t,e,n){const{nodes:r,kg:i,center:o,prune:a}=this,s=r.length;let u=9e10,c=-9e10,l=9e10,h=-9e10;for(let t=0;t<s;t+=1)a&&n[t]<=1||(e[t].setPos(r[t].x,r[t].y),r[t].x>=c&&(c=r[t].x),r[t].x<=u&&(u=r[t].x),r[t].y>=h&&(h=r[t].y),r[t].y<=l&&(l=r[t].y));const f=Math.max(c-u,h-l),d=new vs({xmid:(c+u)/2,ymid:(h+l)/2,length:f,massCenter:o,mass:s}),p=new ms(d);for(let t=0;t<s;t+=1)a&&n[t]<=1||e[t].in(d)&&p.insert(e[t]);for(let u=0;u<s;u+=1){if(a&&n[u]<=1)continue;e[u].resetForce(),p.updateForce(e[u]),t[2*u]-=e[u].fx,t[2*u+1]-=e[u].fy;const s=[r[u].x-o[0],r[u].y-o[1]];let c=Math.hypot(s[0],s[1]);c=c<1e-4?1e-4:c,s[0]=s[0]/c,s[1]=s[1]/c;const l=i*(n[u]+1);t[2*u]-=l*s[0],t[2*u+1]-=l*s[1]}return t}updatePos(t,e,n,r){const{nodes:i,ks:o,tao:a,prune:s,ksmax:u}=this,c=i.length,l=[],h=[];let f=0,d=0;for(let n=0;n<c;n+=1){if(s&&r[n]<=1)continue;const i=[t[2*n]-e[2*n],t[2*n+1]-e[2*n+1]],o=Math.hypot(i[0],i[1]),a=[t[2*n]+e[2*n],t[2*n+1]+e[2*n+1]],u=Math.hypot(a[0],a[1]);l[n]=o,h[n]=u/2,f+=(r[n]+1)*l[n],d+=(r[n]+1)*h[n]}const p=n;n=a*d/f,0!==p&&(n=n>1.5*p?1.5*p:n);for(let e=0;e<c;e+=1){if(s&&r[e]<=1)continue;let a=o*n/(1+n*Math.sqrt(l[e])),c=Math.hypot(t[2*e],t[2*e+1]);c=c<1e-4?1e-4:c;const h=u/c;a=a>h?h:a;const f=a*t[2*e],d=a*t[2*e+1];i[e].x+=f,i[e].y+=d}return{nodes:i,sg:n}}}const bs={force:re,fruchterman:We,forceAtlas2:ys,gForce:ut,dagre:ce,circular:ae,radial:ze,concentric:Ue,grid:ot,mds:Ve,comboForce:ps,random:at,"gForce-gpu":ds,"fruchterman-gpu":hs};var xs=n(86),ws=n.n(xs),_s=u.Util.traverseTree,Ss=function(t,e){return t?Object(p.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},Es=function(t,e){var n=[],r=[],i={},o=0;for(o=0;o<t.length;o++){var a=t[o];i[a.id]=o,n.push(a.x),n.push(a.y),n.push(0),n.push(0),r.push([])}for(o=0;o<e.length;o++){var s=e[o];r[i[s.source]].push(i[s.target]),r[i[s.target]].push(i[s.source])}var u=0;for(o=0;o<t.length;o++){var c=n.length,l=r[o],h=l.length;n[4*o+2]=c,n[4*o+3]=l.length,u=Math.max(u,l.length);for(var f=0;f<h;++f){var d=l[f];n.push(+d)}}for(;n.length%4!=0;)n.push(0);return{array:new Float32Array(n),maxEdgePerVetex:u}},Ms=function(t,e,n){var r=[],i=[],o={},a=0;for(a=0;a<t.length;a++){var s=t[a];o[s.id]=a,r.push(s.x),r.push(s.y),r.push(0),r.push(0),i.push([])}for(a=0;a<e.length;a++){var u=e[a];i[o[u.source]].push(o[u.target]),i[o[u.source]].push(n(u)),i[o[u.target]].push(o[u.source]),i[o[u.target]].push(n(u))}var c=0;for(a=0;a<t.length;a++){var l=r.length,h=i[a],f=h.length;r[4*a+2]=l,r[4*a+3]=f/2,c=Math.max(c,f/2);for(var d=0;d<f;++d){var p=h[d];r.push(+p)}}for(;r.length%4!=0;)r.push(0);return{array:new Float32Array(r),maxEdgePerVetex:c}},Os=function(t,e,n,r){var i=[],o=[],a={},s=0;for(s=0;s<t.length;s++){var u=t[s];a[u.id]=s,i.push(u.x),i.push(u.y),i.push(0),i.push(0),o.push([])}for(s=0;s<e.length;s++){var c=e[s];o[a[c.source]].push(a[c.target]),o[a[c.source]].push(n(c)),o[a[c.source]].push(r(c)),o[a[c.source]].push(0),o[a[c.target]].push(a[c.source]),o[a[c.target]].push(n(c)),o[a[c.target]].push(r(c)),o[a[c.target]].push(0)}var l=0;for(s=0;s<t.length;s++){var h=i.length,f=o[s],d=f.length;i[4*s+2]=h+1048576*d/4,i[4*s+3]=0,l=Math.max(l,d/4);for(var p=0;p<d;++p){var g=f[p];i.push(+g)}}for(;i.length%4!=0;)i.push(0);return{array:new Float32Array(i),maxEdgePerVetex:l}},As=function(t,e){var n=[],r=t.length,i={};return e.forEach((function(e){t.forEach((function(t,o){if(void 0===i[e[t]]&&(i[e[t]]=Object.keys(i).length),n.push(i[e[t]]),o===r-1)for(;n.length%4!=0;)n.push(0)}))})),{array:new Float32Array(n),count:Object.keys(i).length}},ks=function(t){for(var e=[],n=t.length,r=t[0].length,i=function(r){t.forEach((function(t,i){if(e.push(t[r]),i===n-1)for(;e.length%4!=0;)e.push(0)}))},o=0;o<r;o++)i(o);return new Float32Array(e)},Cs=function(t,e){var n={x:1/0,y:1/0},r={x:-1/0,y:-1/0},i="x",o="y";e&&["V","TB","BT"].indexOf(e)>=0&&(o="x",i="y");var a=0;_s(t,(function(t){return a++,t.x>r.x&&(r.x=t.x),t.x<n.x&&(n.x=t.x),t.y>r.y&&(r.y=t.y),t.y<n.y&&(n.y=t.y),!0}));var s=2*Math.PI/a,u=r[o]-n[o];return 0===u||_s(t,(function(e){var r=(e[o]-n[o])/u*(2*Math.PI-s)+s,a=Math.abs("x"===i?e.x-t.x:e.y-t.y);return e.x=a*Math.cos(r),e.y=a*Math.sin(r),!0})),t},Is=function t(){return"undefined"==typeof window||"undefined"==typeof document?{}:{canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var t=document.createElement("div");return t.id="webgl-error-message",t.style.fontFamily="monospace",t.style.fontSize="13px",t.style.fontWeight="normal",t.style.textAlign="center",t.style.background="#fff",t.style.color="#000",t.style.padding="1.5em",t.style.width="400px",t.style.margin="5em auto 0",this.webgl||(t.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br />','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join("\n"):['Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br/>','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join("\n")),t},addGetWebGLMessage:function(e){var n=void 0!==(e=e||{}).parent?e.parent:document.body,r=void 0!==e.id?e.id:"oldie",i=t().getWebGLErrorMessage();i.id=r,n.appendChild(i)}}},Ts=Object(s.__assign)(Object(s.__assign)(Object(s.__assign)(Object(s.__assign)({},u.Util),r),i),o),Ps=Ts.radialLayout,Ns=function(){function t(t){this.type=t.type,this.radial=t.radial,this.config=t}return t.prototype.init=function(t){var e=this;this.data=t,this.radial?this.layoutMethod=function(t){var n=ws.a[e.type](t,e.config);return Ps(n),n}:this.layoutMethod=function(t){return ws.a[e.type](t,e.config)}},t.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},t.prototype.layout=function(t){return this.init(t),this.execute()},t}();it("grid",ot),it("random",at),it("force",re),it("circular",ae),it("dagre",ce),it("radial",ze),it("concentric",Ue),it("mds",Ve),it("fruchterman",We),it("fruchterman-gpu",hs),it("gForce",ut),it("gForce-gpu",ds),it("comboForce",ps),it("forceAtlas2",ys);var js=function(t,e){e.isCustomLayout=!0,bs[t]=it(t,e)},Ds=function(t,e){var n=t.toString(),r=new Blob(["importScripts('"+e+"');("+n+")()"],{type:"text/javascript"});return new Worker(URL.createObjectURL(r))},Ls=function(t){return void 0===t&&(t="https://unpkg.com/@antv/layout@latest/dist/layout.min.js"),new Ds((function(){var t="LAYOUT_RUN",e="LAYOUT_END",n="LAYOUT_ERROR",r="GPU_LAYOUT_RUN";layout.registerLayout("grid",layout.GridLayout),layout.registerLayout("random",layout.RandomLayout),layout.registerLayout("force",layout.ForceLayout),layout.registerLayout("circular",layout.CircularLayout),layout.registerLayout("dagre",layout.DagreLayout),layout.registerLayout("radial",layout.RadialLayout),layout.registerLayout("concentric",layout.ConcentricLayout),layout.registerLayout("mds",layout.MDSLayout),layout.registerLayout("fruchterman",layout.FruchtermanLayout),layout.registerLayout("fruchterman-gpu",layout.FruchtermanGPULayout),layout.registerLayout("gForce",layout.GForceLayout),layout.registerLayout("gForce-gpu",layout.GForceGPULayout),layout.registerLayout("comboForce",layout.ComboForceLayout),layout.registerLayout("forceAtlas2",layout.ForceAtlas2Layout),onmessage=function(i){(function(e){var n=e.data.type;return n===t||n===r})(i)&&function(i){var o=this;switch(i.data.type){case t:var a,s=i.data,u=s.nodes,c=s.edges,l=s.layoutCfg,h=(v=void 0===l?{}:l).type;if(!(f=layout.getLayoutByName(h))){this.postMessage({type:n,message:"layout "+h+" not found"});break}v.onLayoutEnd=function(){o.postMessage({type:e,nodes:u}),null==a||a.destroy()},(a=new f(v)).init({nodes:u,edges:c}),a.execute();break;case r:var f,d=i.data,p=d.nodes,g=(c=d.edges,d.layoutCfg),v=void 0===g?{}:g,m=d.canvas;h=v.type;if(!(f=layout.getLayoutByName(h))){this.postMessage({type:n,message:"layout "+h+" not found"});break}if("gpu"!==h.split("-")[1]){this.postMessage({type:n,message:"layout "+h+" does not support GPU"});break}var y=new f(v);y.init({nodes:p,edges:c}),y.executeWithWorker(m,this)}}(i)}}),t)},Rs="LAYOUT_RUN",Bs="LAYOUT_END",Gs="LAYOUT_ERROR",Fs="LAYOUT_TICK",zs="GPU_LAYOUT_RUN",Us="GPU_LAYOUT_END";function Vs(t){return(Vs="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)}var Ws=function(t){return setTimeout(t,16)},Ys=function(t){return clearTimeout(t)},Xs=function(t){return("undefined"!=typeof window&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||Ws)(t)},Hs=function(t){return("undefined"!=typeof window&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||Ys)(t)},qs=["fruchterman","gForce"],Ks=["force","grid","circular"],Zs=function(t){function e(e){var n=t.call(this,e)||this;return n.graph=e,n.layoutCfg=e.get("layout")||{},n.layoutType=n.getLayoutType(),n.worker=null,n.workerData={},n.initLayout(),n}return Object(s.__extends)(e,t),e.prototype.initLayout=function(){},e.prototype.getWorker=function(){return this.worker||("undefined"==typeof Worker?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=Ls(this.layoutCfg.workerScriptURL)),this.worker},e.prototype.stopWorker=function(){var t=this.workerData;this.worker&&(this.worker.terminate(),this.worker=null,t.requestId&&(Hs(t.requestId),t.requestId=null),t.requestId2&&(Hs(t.requestId2),t.requestId2=null))},e.prototype.execLayoutMethod=function(t,e){var n=this;return new Promise((function(r,i){return Object(s.__awaiter)(n,void 0,void 0,(function(){var n,o,a,u,c,l,h;return Object(s.__generator)(this,(function(s){switch(s.label){case 0:if(!(n=this.graph)||n.get("destroyed"))return[2];o=t.type,t.onLayoutEnd=function(){n.emit("aftersublayout",{type:o}),r()},o&&this.isGPU&&(this.hasGPUVersion(o)?o+="-gpu":console.warn("The '"+o+"' layout does not support GPU calculation for now, it will run in CPU.")),"force"===o||"g6force"===o||"gForce"===o?(a=t.onTick,l=function(){a&&a(),n.refreshPositions()},t.tick=l):"comboForce"===t.type&&(t.comboTrees=n.get("comboTrees")),!1;try{u=new bs[o](t)}catch(t){console.warn("The layout method: '"+o+"' does not exist! Please specify it first."),i()}return u.enableTick&&(c=t.onTick,l=function(){c&&c(),n.refreshPositions()},u.tick=l),function(t,e){var n;if(!(null===(n=null==t?void 0:t.nodes)||void 0===n?void 0:n.length))return;t.nodes.forEach((function(t){t.layoutOrder=e}))}(h=this.filterLayoutData(this.data,t),e),u.init(h),n.emit("beforesublayout",{type:o}),[4,u.execute()];case 1:return s.sent(),u.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),this.layoutMethods[e]=u,[2]}}))}))}))},e.prototype.updateLayoutMethod=function(t,e){var n=this;return new Promise((function(r,i){return Object(s.__awaiter)(n,void 0,void 0,(function(){var n,i,o;return Object(s.__generator)(this,(function(a){switch(a.label){case 0:return n=this.graph,i=null==e?void 0:e.type,e.onLayoutEnd=function(){n.emit("aftersublayout",{type:i}),r()},o=this.filterLayoutData(this.data,e),t.init(o),t.updateCfg(e),n.emit("beforesublayout",{type:i}),[4,t.execute()];case 1:return a.sent(),t.isCustomLayout&&e.onLayoutEnd&&e.onLayoutEnd(),[2]}}))}))}))},e.prototype.layout=function(t){var e=this,n=this.graph;this.data=this.setDataFromGraph();var r=this.data,i=r.nodes,o=r.hiddenNodes;if(!i)return!1;var a=n.get("width"),u=n.get("height"),c={};Object.assign(c,{width:a,height:u,center:[a/2,u/2]},this.layoutCfg),this.layoutCfg=c,this.destoryLayoutMethods(),n.emit("beforelayout"),this.initPositions(c.center,i),this.initPositions(c.center,o);var l=c.type;l&&"gpu"===l.split("-")[1]&&(l=l.split("-")[0],c.gpuEnabled=!0);var h=!1;c.gpuEnabled&&(h=!0,Is().webgl||(console.warn("Your browser does not support webGL or GPGPU. The layout will run in CPU."),h=!1)),this.isGPU=h;var f=c.onLayoutEnd,d=c.layoutEndFormatted,p=c.adjust;if(d||(c.layoutEndFormatted=!0,c.onAllLayoutEnd=function(){return Object(s.__awaiter)(e,void 0,void 0,(function(){return Object(s.__generator)(this,(function(t){switch(t.label){case 0:return f&&f(),this.refreshLayout(),p&&c.pipes?[4,this.adjustPipesBox(this.data,p)]:[3,2];case 1:t.sent(),this.refreshLayout(),t.label=2;case 2:return n.emit("afterlayout"),[2]}}))}))}),this.stopWorker(),c.workerEnabled&&this.layoutWithWorker(this.data))return!0;var g=Promise.resolve();return c.type?g=g.then((function(){return Object(s.__awaiter)(e,void 0,void 0,(function(){return Object(s.__generator)(this,(function(t){switch(t.label){case 0:return[4,this.execLayoutMethod(c,0)];case 1:return[2,t.sent()]}}))}))})):c.pipes&&c.pipes.forEach((function(t,n){g=g.then((function(){return Object(s.__awaiter)(e,void 0,void 0,(function(){return Object(s.__generator)(this,(function(e){switch(e.label){case 0:return[4,this.execLayoutMethod(t,n)];case 1:return[2,e.sent()]}}))}))}))})),g.then((function(){c.onAllLayoutEnd&&c.onAllLayoutEnd(),t&&t()})).catch((function(t){console.warn("graph layout failed,",t)})),!1},e.prototype.layoutWithWorker=function(t){var e=this,n=this.layoutCfg,r=this.graph,i=this.getWorker(),o=this.workerData;if(!i)return!1;o.requestId=null,o.requestId2=null,o.currentTick=null,o.currentTickData=null,r.emit("beforelayout");var a=Promise.resolve();if(n.type)a=a.then((function(){return e.runWebworker(i,t,n)}));else if(n.pipes)for(var s=function(n){a=a.then((function(){return e.runWebworker(i,t,n)}))},u=0,c=n.pipes;u<c.length;u++){s(c[u])}return a.then((function(){n.onAllLayoutEnd&&n.onAllLayoutEnd()})).catch((function(t){console.error("layout failed",t)})),!0},e.prototype.runWebworker=function(t,e,n){var r=this,i=this.isGPU,o=this.filterLayoutData(e,n),a=o.nodes,s=o.edges,u=document.createElement("canvas"),c=i&&"undefined"!=typeof window&&window.navigator&&!navigator.gpu&&"OffscreenCanvas"in window&&"transferControlToOffscreen"in u,l=function(t,e){var n={};if(t&&"object"===Vs(t))return Object.keys(t).forEach((function(r){t.hasOwnProperty(r)&&e(t[r])&&(n[r]=t[r])})),n;return t}(n,(function(t){return"function"!=typeof t}));if(c){var h=u.transferControlToOffscreen();l.type=l.type+"-gpu",t.postMessage({type:zs,nodes:a,edges:s,layoutCfg:l,canvas:h},[h])}else t.postMessage({type:Rs,nodes:a,edges:s,layoutCfg:l});return new Promise((function(e,i){t.onmessage=function(t){r.handleWorkerMessage(e,i,t,o,n)}}))},e.prototype.handleWorkerMessage=function(t,e,n,r,i){var o=this.graph,a=this.workerData,s=n.data,u=s.type,c=function(){i.onTick&&i.onTick()};switch(u){case Fs:a.currentTick=s.currentTick,a.currentTickData=s,a.requestId||(a.requestId=Xs((function(){$s(r,s),o.refreshPositions(),c(),s.currentTick===s.totalTicks?t():a.currentTick===s.totalTicks&&(a.requestId2=Xs((function(){$s(r,a.currentTickData),o.refreshPositions(),a.requestId2=null,c(),t()}))),a.requestId=null})));break;case Bs:null==a.currentTick&&($s(r,s),t());break;case Us:null==a.currentTick&&(!function(t,e){for(var n=t.nodes,r=e.vertexEdgeData,i=n.length,o=0;o<i;o++){var a=n[o],s=r[4*o],u=r[4*o+1];a.x=s,a.y=u}}(r,s),t());break;case Gs:console.warn("Web-Worker layout error!",s.message),e();break;default:e()}},e.prototype.updateLayoutCfg=function(t){var e=this,n=this.graph,r=this.layoutMethods,i=Object(p.mix)({},this.layoutCfg,t);if(this.layoutCfg=i,null==r?void 0:r.length){if(this.data=this.setDataFromGraph(),this.stopWorker(),!t.workerEnabled||!this.layoutWithWorker(this.data)){n.emit("beforelayout");var o=Promise.resolve();1===r.length?o=o.then((function(){return Object(s.__awaiter)(e,void 0,void 0,(function(){return Object(s.__generator)(this,(function(t){switch(t.label){case 0:return[4,this.updateLayoutMethod(r[0],i)];case 1:return[2,t.sent()]}}))}))})):null==r||r.forEach((function(t,n){var r=i.pipes[n];o=o.then((function(){return Object(s.__awaiter)(e,void 0,void 0,(function(){return Object(s.__generator)(this,(function(e){switch(e.label){case 0:return[4,this.updateLayoutMethod(t,r)];case 1:return[2,e.sent()]}}))}))}))})),o.then((function(){i.onAllLayoutEnd&&i.onAllLayoutEnd()})).catch((function(t){console.warn("layout failed",t)}))}}else this.layout()},e.prototype.adjustPipesBox=function(t,e){var n=this;return new Promise((function(r){var i=t.nodes;(null==i?void 0:i.length)||r(),Ks.includes(e)||(console.warn("The adjust type "+e+" is not supported yet, please assign it with 'force', 'grid', or 'circular'."),r());var o={center:n.layoutCfg.center,nodeSize:function(t){return Math.max(t.height,t.width)},preventOverlap:!0,onLayoutEnd:function(){}},a=n.getLayoutBBox(i),s=a.groupNodes,u=a.layoutNodes,c=Object(p.clone)(u);o.onLayoutEnd=function(){null==u||u.forEach((function(t,e){var n,r,i,o=t.x-(null===(n=c[e])||void 0===n?void 0:n.x),a=t.y-(null===(r=c[e])||void 0===r?void 0:r.y);null===(i=s[e])||void 0===i||i.forEach((function(t){t.x+=o,t.y+=a}))})),r()},new bs[e](o).layout({nodes:u})}))},e.prototype.hasGPUVersion=function(t){return qs.includes(t)},e.prototype.destroy=function(){this.destoryLayoutMethods();var t=this.worker;t&&(t.terminate(),this.worker=null),this.destroyed=!0,this.graph.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0,this.graph=null},e}(u.AbstractLayout);function $s(t,e){for(var n=t.nodes,r=e.nodes,i=n.length,o=0;o<i;o++){var a=n[o];a.x=r[o].x,a.y=r[o].y}}var Qs,Js=d.ext.transform,tu=function(t){function e(e){var n=t.call(this,e)||this,r=n.get("defaultNode");return r||n.set("defaultNode",{type:"circle"}),r.type||(r.type="circle",n.set("defaultNode",r)),n.destroyed=!1,n}return Object(s.__extends)(e,t),e.prototype.initLayoutController=function(){var t=new Zs(this);this.set({layoutController:t})},e.prototype.initEventController=function(){var t=new z(this);this.set({eventController:t})},e.prototype.initCanvas=function(){var t=this.get("container");if("string"==typeof t&&(t=document.getElementById(t),this.set("container",t)),!t)throw new Error("invalid container");var e,n=t.clientWidth,r=t.clientHeight,i=this.get("width")||n,o=this.get("height")||r;if(this.get("width")||this.get("height")||(this.set("width",n),this.set("height",r)),"svg"===this.get("renderer"))e=new f.Canvas({container:t,width:i,height:o});else{var a={container:t,width:i,height:o},s=this.get("pixelRatio");s&&(a.pixelRatio=s),e=new h.Canvas(a)}this.set("canvas",e)},e.prototype.initPlugins=function(){var t=this;Object(p.each)(t.get("plugins"),(function(e){!e.destroyed&&e.initPlugin&&e.initPlugin(t)}))},e.prototype.downloadImageWatermark=function(t,e,n,r){return Object(s.__awaiter)(this,void 0,void 0,(function(){var i,o,a;return Object(s.__generator)(this,(function(s){switch(s.label){case 0:return i=t.style.backgroundImage,o=i.slice(5,i.length-2),(a=new Image).src=o,[4,new Promise((function(t){a.onload=function(){var i=e.createPattern(a,"repeat");e.rect(0,0,n,r),e.fillStyle=i,e.fill(),t("")}}))];case 1:return s.sent(),[2]}}))}))},e.prototype.asyncToDataUrl=function(t,e,n,r,i,o){var a=this,u=document.querySelector(".g6-graph-watermarker"),c=this.get("canvas"),l=c.getRenderer(),h=o||c.get("el"),f="";t||(t="image/png"),setTimeout((function(){return Object(s.__awaiter)(a,void 0,void 0,(function(){var o,a,c,d,p,g,v,m,y,b;return Object(s.__generator)(this,(function(s){switch(s.label){case 0:return"svg"!==l?[3,1]:(o=h.cloneNode(!0),a=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),(c=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",a)).replaceChild(o,c.documentElement),d=(new XMLSerializer).serializeToString(c),f="data:image/svg+xml;charset=utf8,"+encodeURIComponent(d),[3,4]);case 1:return p=void 0,g=h.getContext("2d"),v=r||this.get("width"),m=i||this.get("height"),y=void 0,u?[4,this.downloadImageWatermark(u,g,v,m)]:[3,3];case 2:s.sent(),s.label=3;case 3:if(e){b="undefined"!=typeof window?window.devicePixelRatio:1;try{p=g.getImageData(0,0,v*b,m*b),y=g.globalCompositeOperation,g.globalCompositeOperation="destination-over",g.fillStyle=e,g.fillRect(0,0,v,m)}catch(t){console.error("Download image failed. Out of memory at ImageData creation")}}f=h.toDataURL(t),e&&(g.clearRect(0,0,v,m),g.putImageData(p,0,0),g.globalCompositeOperation=y),s.label=4;case 4:return n&&n(f),[2]}}))}))}),16)},e.prototype.toDataURL=function(t,e){var n=this.get("canvas"),r=n.getRenderer(),i=n.get("el");t||(t="image/png");var o="";if("svg"===r){var a=i.cloneNode(!0),s=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),u=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",s);u.replaceChild(a,u.documentElement);var c=(new XMLSerializer).serializeToString(u);o="data:image/svg+xml;charset=utf8,"+encodeURIComponent(c)}else{var l=void 0,h=i.getContext("2d"),f=this.get("width"),d=this.get("height"),p=void 0;if(e){var g="undefined"!=typeof window?window.devicePixelRatio:1;try{l=h.getImageData(0,0,f*g,d*g),p=h.globalCompositeOperation,h.globalCompositeOperation="destination-over",h.fillStyle=e,h.fillRect(0,0,f,d)}catch(t){console.error("Download image failed. Out of memory at ImageData creation")}}o=i.toDataURL(t),e&&(h.clearRect(0,0,f,d),h.putImageData(l,0,0),h.globalCompositeOperation=p)}return o},e.prototype.toFullDataURL=function(t,e,n){var r=this.get("group").getCanvasBBox(),i=r.height,o=r.width,a=this.get("renderer"),s=R('<id="virtual-image"></div>'),u=n?n.backgroundColor:void 0,c=n?n.padding:void 0;c?Object(p.isNumber)(c)&&(c=[c,c,c,c]):c=[0,0,0,0];var l=i+c[0]+c[2],d=o+c[1]+c[3],g={container:s,height:l,width:d,quickHit:!0},v="svg"===a?new f.Canvas(g):new h.Canvas(g),m=this.get("group").clone(),y=Object(p.clone)(m.getMatrix());y||(y=[1,0,0,0,1,0,0,0,1]);var b=(r.maxX+r.minX)/2,x=(r.maxY+r.minY)/2;y=Js(y,[["t",-b,-x],["t",o/2+c[3],i/2+c[0]]]),m.resetMatrix(),m.setMatrix(y),v.add(m);var w=v.get("el"),_="";e||(e="image/png"),setTimeout((function(){if("svg"===a){var n=w.cloneNode(!0),r=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",r);i.replaceChild(n,i.documentElement);var o=(new XMLSerializer).serializeToString(i);_="data:image/svg+xml;charset=utf8,"+encodeURIComponent(o)}else{var s=void 0,c=w.getContext("2d"),h=void 0;if(u){var f="undefined"!=typeof window?window.devicePixelRatio:1;try{s=c.getImageData(0,0,d*f,l*f),h=c.globalCompositeOperation,c.globalCompositeOperation="destination-over",c.fillStyle=u,c.fillRect(0,0,d,l)}catch(t){console.error("Download image failed. Out of memory at ImageData creation")}}_=w.toDataURL(e),u&&(c.clearRect(0,0,d,l),c.putImageData(s,0,0),c.globalCompositeOperation=h)}t&&t(_)}),16)},e.prototype.downloadFullImage=function(t,e,n){var r=this,i=this.get("group").getCanvasBBox(),o=i.height,a=i.width,s=this.get("renderer"),u=R('<id="virtual-image"></div>'),c=document.querySelector(".g6-graph-watermarker"),l=n?n.backgroundColor:void 0,d=n?n.padding:void 0;d?Object(p.isNumber)(d)&&(d=[d,d,d,d]):d=[0,0,0,0];var g=o+d[0]+d[2],v=a+d[1]+d[3];if(c){var m=this.get("graphWaterMarker").cfg||{},y=m.width,b=m.height;g=Math.ceil(g/b)*b,v=Math.ceil(v/y)*y}var x={container:u,height:g,width:v},w="svg"===s?new f.Canvas(x):new h.Canvas(x),_=this.get("group").clone(),S=Object(p.clone)(_.getMatrix());S||(S=[1,0,0,0,1,0,0,0,1]);var E=(i.maxX+i.minX)/2,M=(i.maxY+i.minY)/2;S=Js(S,[["t",-E,-M],["t",a/2+d[3],o/2+d[0]]]),_.resetMatrix(),_.setMatrix(S),w.add(_);var O=w.get("el");e||(e="image/png"),this.asyncToDataUrl(e,l,(function(n){var i=document.createElement("a"),o=(t||"graph")+("svg"===s?".svg":"."+e.split("/")[1]);r.dataURLToImage(n,s,i,o);var a=document.createEvent("MouseEvents");a.initEvent("click",!1,!1),i.dispatchEvent(a)}),v,g,O)},e.prototype.downloadImage=function(t,e,n){var r=this;this.isAnimating()&&this.stopAnimate();var i=this.get("canvas").getRenderer();e||(e="image/png");var o=(t||"graph")+("svg"===i?".svg":e.split("/")[1]),a=document.createElement("a");this.asyncToDataUrl(e,n,(function(t){r.dataURLToImage(t,i,a,o);var e=document.createEvent("MouseEvents");e.initEvent("click",!1,!1),a.dispatchEvent(e)}))},e.prototype.dataURLToImage=function(t,e,n,r){if(t&&"data:"!==t){if("undefined"!=typeof window)if(window.Blob&&window.URL&&"svg"!==e){var i=t.split(","),o="";if(i&&i.length>0){var a=i[0].match(/:(.*?);/);a&&a.length>=2&&(o=a[1])}for(var s=atob(i[1]),u=s.length,c=new Uint8Array(u);u--;)c[u]=s.charCodeAt(u);var l=new Blob([c],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(l,r):n.addEventListener("click",(function(){n.download=r,n.href=window.URL.createObjectURL(l)}))}else n.addEventListener("click",(function(){n.download=r,n.href=t}))}else console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items")},e.prototype.addPlugin=function(t){t.destroyed||(this.get("plugins").push(t),t.initPlugin(this))},e.prototype.removePlugin=function(t){var e=this.get("plugins"),n=e.indexOf(t);n>=0&&(t.destroyPlugin(),e.splice(n,1))},e.prototype.setImageWaterMarker=function(t,e){void 0===t&&(t=D.waterMarkerImage);var n=this.get("container");Object(p.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=Object(p.deepMix)({},D.imageWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.image;if(!r){var c={container:n,width:o,height:a,capture:!1},l=this.get("pixelRatio");l&&(c.pixelRatio=l),r=new h.Canvas(c),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var f=r.get("context"),d=u.rotate,g=u.x,v=u.y;f.rotate(-d*Math.PI/180);var m=new Image;m.crossOrigin="anonymous",m.src=t,m.onload=function(){if(f.drawImage(m,g,v,u.width,u.height),f.rotate(d*Math.PI/180),s)n.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;";else{var t=document.querySelector(".g6-graph-watermarker");t||((t=document.createElement("div")).className="g6-graph-watermarker"),t.className="g6-graph-watermarker",r.destroyed||(t.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;",n.appendChild(t))}}},e.prototype.setTextWaterMarker=function(t,e){var n=this.get("container");Object(p.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=Object(p.deepMix)({},D.textWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.text;if(!r){var c={container:n,width:o,height:a,capture:!1},l=this.get("pixelRatio");l&&(c.pixelRatio=l),r=new h.Canvas(c),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var f=r.get("context"),d=u.rotate,g=u.fill,v=u.fontFamily,m=u.fontSize,y=u.baseline,b=u.x,x=u.y,w=u.lineHeight;f.rotate(-d*Math.PI/180),f.font=m+"px "+v,f.fillStyle=g,f.textBaseline=y;for(var _=t.length-1;_>=0;_--)f.fillText(t[_],b,x+_*w);if(f.rotate(d*Math.PI/180),s)n.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;";else{var S=document.querySelector(".g6-graph-watermarker");S||((S=document.createElement("div")).className="g6-graph-watermarker"),S.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;",n.appendChild(S)}},e.prototype.destroy=function(){var e,n,r,i;Object(p.each)(this.get("plugins"),(function(t){t.destroyPlugin()}));var o=this.get("tooltips");if(o)for(var a=0;a<o.length;a++){var s=o[a];if(s){var u=s.parentElement;u&&u.removeChild(s)}}null===(e=this.get("eventController"))||void 0===e||e.destroy(),null===(n=this.get("layoutController"))||void 0===n||n.destroy(),null===(r=this.get("graphWaterMarker"))||void 0===r||r.destroy(),null===(i=document.querySelector(".g6-graph-watermarker"))||void 0===i||i.remove(),t.prototype.destroy.call(this)},e}(u.AbstractGraph),eu=Ts.radialLayout,nu=Ts.traverseTree,ru=function(t){function e(e){var n=t.call(this,e)||this;return n.layoutAnimating=!1,n.set("removeList",[]),n.set("layoutMethod",n.getLayout()),n}return Object(s.__extends)(e,t),e.prototype.getLayout=function(){var t=this.get("layout");return t?"function"==typeof t?t:(t.type||(t.type="dendrogram"),t.direction||(t.direction="TB"),t.radial?function(e){var n=ws.a[t.type](e,t);return eu(n),n}:function(e){return ws.a[t.type](e,t)}):null},e.indexOfChild=function(t,e){var n=-1;return Object(p.each)(t,(function(t,r){if(e===t.id)return n=r,!1})),n},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.animate=!0,e},e.prototype.innerAddChild=function(t,e,n){var r=this,i=t.data;i&&(i.x=t.x,i.y=t.y,i.depth=t.depth);var o=r.addItem("node",i,!1);if(e){if(o.set("parent",e),n){var a=e.get("originAttrs");if(a)o.set("originAttrs",a);else{var s=e.getModel();o.set("originAttrs",{x:s.x,y:s.y})}}var u=e.get("children");u?u.push(o):e.set("children",[o]),r.addItem("edge",{source:e.get("id"),target:o.get("id"),id:e.get("id")+":"+o.get("id")},!1)}return Object(p.each)(t.children||[],(function(t){r.innerAddChild(t,o,n)})),r.emit("afteraddchild",{item:o,parent:e}),o},e.prototype.innerUpdateChild=function(t,n,r){var i=this,o=i.findById(t.id);if(o){Object(p.each)(t.children||[],(function(t){i.innerUpdateChild(t,o,r)}));var a,s,u=o.get("children");if(u)if(u.length>0)for(var c=u.length-1;c>=0;c--){var l=u[c].getModel();-1===e.indexOfChild(t.children||[],l.id)&&(i.innerRemoveChild(l.id,{x:t.x,y:t.y},r),u.splice(c,1))}o.get("originAttrs")&&(a=o.get("originAttrs").x,s=o.get("originAttrs").y);var h=o.getModel();r&&o.set("originAttrs",{x:h.x,y:h.y}),o.set("model",t.data),a===t.x&&s===t.y||o.updatePosition({x:t.x,y:t.y})}else i.innerAddChild(t,n,r)},e.prototype.innerRemoveChild=function(t,e,n){var r=this,i=r.findById(t);if(i)if(Object(p.each)(i.get("children"),(function(t){r.innerRemoveChild(t.getModel().id,e,n)})),n){var o=i.getModel();i.set("to",e),i.set("originAttrs",{x:o.x,y:o.y}),r.get("removeList").push(i)}else r.removeItem(i,!1)},e.prototype.changeData=function(t){var e=this;this.getNodes().map((function(t){return e.clearItemStates(t)})),this.getEdges().map((function(t){return e.clearItemStates(t)})),t?(e.data(t),e.render()):e.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");this.updateLayout(t)},e.prototype.updateLayout=function(t){t?(this.set("layout",t),this.set("layoutMethod",this.getLayout()),this.layout()):console.warn("layout cannot be null")},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");this.layout(t)},e.prototype.layout=function(t){var e=this.get("data"),n=this.get("layoutMethod"),r=n?n(e,this.get("layout")):e,i=this.get("animate");(this.emit("beforerefreshlayout",{data:e,layoutData:r}),this.emit("beforelayout"),this.innerUpdateChild(r,void 0,i),t)&&this.get("viewController").fitView();i?this.layoutAnimate(r):(this.refresh(),this.paint()),this.emit("afterrefreshlayout",{data:e,layoutData:r}),this.emit("afterlayout")},e.prototype.addChild=function(t,e){this.emit("beforeaddchild",{model:t,parent:e}),Object(p.isString)(e)||(e=e.get("id"));var n=this.findDataById(e);n&&(n.children||(n.children=[]),n.children.push(t),this.changeData())},e.prototype.updateChildren=function(t,e){e&&this.findById(e)?(this.findDataById(e).children=t,this.changeData()):console.warn("Update children failed! There is no node with id '"+e+"'")},e.prototype.updateChild=function(t,n){if(n&&this.findById(n)){var r=this.findDataById(n),i=this.findById(t.id);if(r.children||(r.children=[]),i){var o=e.indexOfChild(r.children,t.id);r.children[o]=t}else r.children.push(t);this.changeData()}else this.changeData(t)},e.prototype.removeChild=function(t){var n=this.findById(t);if(n){var r=n.get("parent");if(r&&!r.destroyed){var i=this.findDataById(r.get("id")),o=i&&i.children||[],a=n.getModel(),s=e.indexOfChild(o,a.id);o.splice(s,1)}this.changeData()}},e.prototype.findDataById=function(t,e){var n=this;if(e||(e=n.get("data")),t===e.id)return e;var r=null;return Object(p.each)(e.children||[],(function(e){return e.id===t?(r=e,!1):!(r=n.findDataById(t,e))&&void 0})),r},e.prototype.layoutAnimate=function(t,e){var n=this,r=this.get("animateCfg");n.emit("beforeanimate",{data:t}),n.getEdges().forEach((function(t){var e=t.get("model");e.sourceAnchor||(e.sourceAnchor=t.get("sourceAnchorIndex"))})),this.get("canvas").animate((function(r){nu(t,(function(i){var o=n.findById(i.id);if(o){var a=o.get("originAttrs"),s=o.get("model");if(a||(a={x:s.x,y:s.y},o.set("originAttrs",a)),e){var u=e(o,r,a,t);o.set("model",Object.assign(s,u))}else s.x=a.x+(i.x-a.x)*r,s.y=a.y+(i.y-a.y)*r}return!0})),Object(p.each)(n.get("removeList"),(function(t){var e=t.getModel(),n=t.get("originAttrs"),i=t.get("to");e.x=n.x+(i.x-n.x)*r,e.y=n.y+(i.y-n.y)*r})),n.refreshPositions()}),{duration:r.duration,easing:r.ease,callback:function(){Object(p.each)(n.getNodes(),(function(t){t.set("originAttrs",null)})),Object(p.each)(n.get("removeList"),(function(t){n.removeItem(t)})),n.set("removeList",[]),r.callback&&r.callback(),n.emit("afteranimate",{data:t})},delay:r.delay})},e.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},e.prototype.isLayoutAnimating=function(){return this.layoutAnimating},e.prototype.render=function(){var t=this.get("data");if(!t||!Object(p.isObject)(t)||!Object.keys(t).length)throw new Error("data must be defined first");this.clear(),this.emit("beforerender"),this.layout(this.get("fitView")),this.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e}(tu),iu=function(){function t(t){this._cfgs=Object(p.deepMix)(this.getDefaultCfgs(),t),this._events={},this.destroyed=!1}return t.prototype.getDefaultCfgs=function(){return{}},t.prototype.initPlugin=function(t){var e=this;e.set("graph",t);var n=e.getEvents(),r={};Object(p.each)(n,(function(n,i){var o=Object(p.wrapBehavior)(e,n);r[i]=o,t.on(i,o)})),this._events=r,this.init()},t.prototype.getEvents=function(){return{}},t.prototype.get=function(t){var e;return null===(e=this._cfgs)||void 0===e?void 0:e[t]},t.prototype.set=function(t,e){this._cfgs[t]=e},t.prototype.destroy=function(){},t.prototype.destroyPlugin=function(){this.destroy();var t=this.get("graph"),e=this._events;Object(p.each)(e,(function(e,n){t.off(n,e)})),this._events=null,this._cfgs=null,this.destroyed=!0},t}(),ou=(Qs=function(t,e){return(Qs=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)},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}Qs(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),au="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",su=function(t){function e(e){return t.call(this,e)||this}return ou(e,t),e.prototype.getDefaultCfgs=function(){return{img:au,follow:!0}},e.prototype.init=function(){var t=this.get("graph"),e=t.get("container"),n=t.get("canvas").get("el"),r=this.get("img")||au,i=R("<div class='g6-grid-container' style=\"position:absolute;overflow:hidden;z-index: -1;\"></div>"),o=R("<div\n class='g6-grid'\n style='position:absolute;\n background-image: "+r+";\n user-select: none\n '></div>");this.set("container",i),this.set("gridContainer",o),this.positionInit(),i.appendChild(o),e.insertBefore(i,n)},e.prototype.positionInit=function(){var t=this.get("graph"),e=t.get("minZoom"),n=t.get("width"),r=t.get("height");B(this.get("container"),{width:n+"px",height:r+"px"});var i=80*n/e,o=80*r/e;B(this.get("gridContainer"),{width:i+"px",height:o+"px",left:"-"+i/2+"px",top:"-"+o/2+"px"})},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var e=this.get("gridContainer"),n=t.matrix;n||(n=[1,0,0,0,1,0,0,0,1]);var r=this.get("follow");B(e,{transform:"matrix("+n[0]+", "+n[1]+", "+n[3]+", "+n[4]+", "+(r?n[6]:"0")+", "+(r?n[7]:"0")+")"})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph").get("container"),e=this.get("container");t.removeChild(e)},e}(iu),uu=n(84),cu=n.n(uu),lu=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])})(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)}}();"undefined"!=typeof document&&cu()("\n .g6-component-contextmenu {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .g6-contextmenu-ul {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n");var hu=function(t){function e(e){return t.call(this,e)||this}return lu(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(t){return"\n <ul class='g6-contextmenu-ul'>\n <li>菜单项1</li>\n <li>菜单项2</li>\n </ul>\n "},shouldBegin:function(t){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{click:"onMenuShow"}:{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=R("<div class="+(this.get("className")||"g6-component-contextmenu")+"></div>");B(t,{top:"0px",position:"absolute",visibility:"hidden"});var e=this.get("container");e||(e=this.get("graph").get("container")),Object(p.isString)(e)&&(e=document.getElementById(e)),e.appendChild(t),this.set("menu",t)},e.prototype.onMenuShow=function(t){var e=this;t.preventDefault();var n=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&-1===n.indexOf(t.item.getType()))return void e.onMenuHide()}else if(-1===n.indexOf("canvas"))return void e.onMenuHide();if(this.get("shouldBegin")(t)){var r=this.get("menu"),i=this.get("getContent"),o=this.get("graph"),a=i(t,o);Object(p.isString)(a)?r.innerHTML=a:r.innerHTML=a.outerHTML,this.removeMenuEventListener();var s=this.get("handleMenuClick");if(s){var u=function(e){s(e.target,t.item,o)};this.set("handleMenuClickWrapper",u),r.addEventListener("click",u)}var c=o.get("width"),l=o.get("height"),h=r.getBoundingClientRect(),f=this.get("offsetX")||0,d=this.get("offsetY")||0,g=o.getContainer().offsetTop,v=o.getContainer().offsetLeft,m=t.canvasX+v+f,y=t.canvasY+g+d;m+h.width>c&&(m=t.canvasX-h.width-f+v),y+h.height>l&&(y=t.canvasY-h.height-d+g),B(r,{top:y+"px",left:m+"px",visibility:"visible"});var b="click"===this.get("trigger"),x=function(t){b?b=!1:e.onMenuHide()};document.body.addEventListener("click",x),this.set("handler",x)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),e=this.get("handler");t&&(this.get("menu").removeEventListener("click",t),this.set("handleMenuClickWrapper",null));e&&document.body.removeEventListener("click",e)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&B(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var e=this.get("container");e||(e=this.get("graph").get("container")),Object(p.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(iu),fu=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])})(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)}}(),du=function(){return(du=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},pu=Math.max,gu=d.ext.transform,vu=function(t){function e(e){var n=t.call(this,e)||this;return n.handleUpdateCanvas=Object(p.debounce)((function(t){var e=n;e.destroyed||e.updateCanvas()}),100,!1),n}return fu(e,t),e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",type:"default",padding:50,size:[200,120],delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,e=this._cfgs,n=e.size,r=e.graph;if(!this.destroyed){var i=this.get("canvas").get("container"),o=R("\n <div\n class="+e.viewportClassName+"\n style='position:absolute;\n left:0;\n top:0;\n box-sizing:border-box;\n outline: 2px solid #1980ff'\n draggable=true>\n </div>"),a=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,s=0,u=0,c=!1,l=0,h=0,f=0,d=0,g=0,v=0;o.addEventListener("dragstart",(function(i){var a,p;if(i.dataTransfer){var m=new Image;m.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",null===(p=(a=i.dataTransfer).setDragImage)||void 0===p||p.call(a,m,0,0);try{i.dataTransfer.setData("text/html","view-port-minimap")}catch(t){i.dataTransfer.setData("text","view-port-minimap")}}if(e.refresh=!1,i.target===o){var y=o.style;l=parseInt(y.left,10),h=parseInt(y.top,10),f=parseInt(y.width,10),d=parseInt(y.height,10),f>n[0]||d>n[1]||(v=r.getZoom(),g=t.get("ratio"),c=!0,s=i.clientX,u=i.clientY)}}),!1),o.addEventListener(a?"dragover":"drag",(function(t){if(c&&!Object(p.isNil)(t.clientX)&&!Object(p.isNil)(t.clientY)){var e=s-t.clientX,i=u-t.clientY;(l-e<0||l-e+f>=n[0])&&(e=0),(h-i<0||h-i+d>=n[1])&&(i=0),B(o,{left:(l-=e)+"px",top:(h-=i)+"px"}),r.translate(e*v/g,i*v/g),s=t.clientX,u=t.clientY}}),!1),o.addEventListener("dragend",(function(){c=!1,e.refresh=!0}),!1),this.set("viewport",o),i.appendChild(o)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=(this.get("dx"),this.get("dy"),this.get("totaldx")),n=this.get("totaldy"),r=this.get("graph"),i=this.get("size"),o=r.get("width"),a=r.get("height"),s=r.getPointByCanvas(0,0),u=r.getPointByCanvas(o,a),c=this.get("viewport");c||this.initViewport();var l=(u.x-s.x)*t,h=(u.y-s.y)*t,f=s.x*t+e,d=s.y*t+n,p=f+l,g=d+h;f<0&&(l+=f,f=0),p>i[0]&&(l-=p-i[0]),d<0&&(h+=d,d=0),g>i[1]&&(h-=g-i[1]),this.set("ratio",t),B(c,{left:f+"px",top:d+"px",width:l+"px",height:h+"px"})}},e.prototype.updateGraphShapes=function(){var t=this._cfgs.graph,e=this.get("canvas"),n=t.get("group");if(!n.destroyed){var r=n.clone();r.resetMatrix(),e.clear(),e.add(r),"svg"===t.get("renderer")&&this.updateVisible(r)}},e.prototype.updateVisible=function(t){var e=this;if(t.isGroup()||t.get("visible")){var n=t.get("children");if(!n||!n.length)return;n.forEach((function(t){t.get("visible")||t.hide(),e.updateVisible(t)}))}else t.hide()},e.prototype.updateKeyShapes=function(){var t=this,e=this._cfgs.graph,n=this.get("canvas"),r=n.get("children")[0]||n.addGroup();Object(p.each)(e.getEdges(),(function(e){t.updateOneEdgeKeyShape(e,r)})),Object(p.each)(e.getNodes(),(function(e){t.updateOneNodeKeyShape(e,r)}));var i=e.getCombos();if(i&&i.length){var o=r.find((function(t){return"comboGroup"===t.get("name")}))||r.addGroup({name:"comboGroup"});setTimeout((function(){t.destroyed||(Object(p.each)(i,(function(e){t.updateOneComboKeyShape(e,o)})),null==o||o.sort(),null==o||o.toBack(),t.updateCanvas())}),250)}this.clearDestroyedShapes()},e.prototype.updateOneComboKeyShape=function(t,e){if(!this.destroyed){var n=this.get("itemMap")||{},r=n[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};r?s=Object.assign(a,s):(r=o,e.add(r));var u=r.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),r.attr(s),t.isVisible()?r.show():r.hide(),r.exist=!0;var c=t.getModel().depth;isNaN(c)||r.set("zIndex",c),n[t.get("id")]=r,this.set("itemMap",n)}},e.prototype.updateOneNodeKeyShape=function(t,e){var n=this.get("itemMap")||{},r=n[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};r?s=Object.assign(a,s):(r=o,e.add(r));var u=r.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),r.attr(s),t.isVisible()?r.show():r.hide(),r.exist=!0;var c=t.getModel().depth;isNaN(c)||r.set("zIndex",c),n[t.get("id")]=r,this.set("itemMap",n)},e.prototype.updateDelegateShapes=function(){var t=this,e=this._cfgs.graph,n=this.get("canvas"),r=n.get("children")[0]||n.addGroup();Object(p.each)(e.getEdges(),(function(e){t.updateOneEdgeKeyShape(e,r)})),Object(p.each)(e.getNodes(),(function(e){t.updateOneNodeDelegateShape(e,r)}));var i=e.getCombos();if(i&&i.length){var o=r.find((function(t){return"comboGroup"===t.get("name")}))||r.addGroup({name:"comboGroup"});setTimeout((function(){t.destroyed||(Object(p.each)(i,(function(e){t.updateOneComboKeyShape(e,o)})),null==o||o.sort(),null==o||o.toBack(),t.updateCanvas())}),250)}this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},e=Object.keys(t);if(e&&0!==e.length)for(var n=e.length-1;n>=0;n--){var r=t[e[n]],i=r.exist;r.exist=!1,i||(r.remove(),delete t[e[n]])}},e.prototype.updateOneEdgeKeyShape=function(t,e){var n=this.get("itemMap")||{},r=n[t.get("id")];if(r){var i=t.get("keyShape").attr("path");r.attr("path",i)}else r=t.get("keyShape").clone(),e.add(r);t.isVisible()?r.show():r.hide(),r.exist=!0,n[t.get("id")]=r,this.set("itemMap",n)},e.prototype.updateOneNodeDelegateShape=function(t,e){var n=this.get("delegateStyle"),r=this.get("itemMap")||{},i=r[t.get("id")],o=t.getBBox();if(i){var a={x:o.minX,y:o.minY,width:o.width,height:o.height};i.attr(a)}else i=e.addShape("rect",{attrs:du({x:o.minX,y:o.minY,width:o.width,height:o.height},n),name:"minimap-node-shape"});t.isVisible()?i.show():i.hide(),i.exist=!0,r[t.get("id")]=i,this.set("itemMap",r)},e.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},e.prototype.initContainer=function(){var t=this.get("graph"),e=this.get("size"),n=this.get("className"),r=this.get("container"),i=R("<div class='"+n+"' style='width: "+e[0]+"px; height: "+e[1]+"px; overflow: hidden'></div>");Object(p.isString)(r)&&(r=document.getElementById(r)),r?r.appendChild(i):t.get("container").appendChild(i),this.set("container",i);var o,a=R('<div class="g6-minimap-container" style="position: relative;"></div>');i.appendChild(a),a.addEventListener("dragenter",(function(t){t.preventDefault()})),a.addEventListener("dragover",(function(t){t.preventDefault()})),o="svg"===t.get("renderer")?new f.Canvas({container:a,width:e[0],height:e[1]}):new h.Canvas({container:a,width:e[0],height:e[1]}),this.set("canvas",o),this.updateCanvas()},e.prototype.updateCanvas=function(){if(!this.destroyed&&this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("size"),n=this.get("canvas"),r=this.get("type"),i=this.get("padding");if(!n.destroyed){switch(r){case"default":this.updateGraphShapes();break;case"keyShape":this.updateKeyShapes();break;case"delegate":this.updateDelegateShapes()}var o=n.get("children")[0];if(o){o.resetMatrix();var a=o.getCanvasBBox(),s=t.get("canvas").getCanvasBBox(),u=t.getZoom()||1,c=s.width/u,l=s.height/u;Number.isFinite(a.width)&&(c=pu(a.width,c),l=pu(a.height,l)),c+=2*i,l+=2*i;var h=Math.min(e[0]/c,e[1]/l),f=[1,0,0,0,1,0,0,0,1],d=0,p=0;Number.isFinite(a.minX)&&(d=-a.minX),Number.isFinite(a.minY)&&(p=-a.minY);var g=(e[0]-(c-2*i)*h)/2,v=(e[1]-(l-2*i)*h)/2;f=gu(f,[["t",d,p],["s",h,h],["t",g,v]]),o.setMatrix(f),this.set("ratio",h),this.set("totaldx",g+d*h),this.set("totaldy",v+p*h),this.set("dx",g),this.set("dy",v),this.updateViewport()}}}}},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){this.get("canvas").destroy();var t=this.get("container");t.parentNode.removeChild(t)},e}(iu),mu=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])})(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 yu(t,e,n){var r=t.x-e.x,i=t.y-e.y;return!n||Math.abs(r)>n||Math.abs(i)>n?Math.sqrt(r*r+i*i):n}function bu(t,e){var n=(e.source.y-e.target.y)/(e.source.x-e.target.x),r=(n*n*e.source.x+n*(t.y-e.source.y)+t.x)/(n*n+1);return{x:r,y:n*(r-e.source.x)+e.source.y}}var xu=function(t){function e(e){return t.call(this,e)||this}return mu(e,t),e.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},e.prototype.init=function(){var t=this.get("graph"),e=this.get("onTick");this.set("tick",(function(){e&&e(),t.refreshPositions()}))},e.prototype.bundling=function(t){var e=this;if(e.set("data",t),!e.isTicking()){var n=t.edges||[],r=t.nodes||[],i={},o=!1;if(r.forEach((function(t){null!==t.x&&null!==!t.y&&void 0!==t.x&&void 0!==!t.y||(o=!0),i[t.id]=t})),o)throw new Error("please layout the graph or assign x and y for nodes first");e.set("nodeIdMap",i);var a=e.get("divisions"),s=e.get("divRate"),u=e.divideEdges(a);e.set("edgePoints",u);var c=e.getEdgeBundles();e.set("edgeBundles",c);for(var l=e.get("cycles"),h=e.get("iterations"),f=e.get("iterRate"),d=e.get("lambda"),p=0;p<l;p++){for(var g=function(t){var r=[];n.forEach((function(t,n){if(t.source!==t.target){var o=i[t.source],s=i[t.target];r[n]=e.getEdgeForces({source:o,target:s},n,a,d);for(var c=0;c<a+1;c++)u[n][c].x+=r[n][c].x,u[n][c].y+=r[n][c].y}}))},v=0;v<h;v++)g();d/=2,a*=s,h*=f,u=e.divideEdges(a),e.set("edgePoints",u)}n.forEach((function(t,e){t.source!==t.target&&(t.type="polyline",t.controlPoints=u[e].slice(1,u[e].length-1))})),e.get("graph").refresh()}},e.prototype.updateBundling=function(t){var e=this,n=t.data;if(n&&e.set("data",n),e.get("ticking")&&e.set("ticking",!1),Object.keys(t).forEach((function(n){e.set(n,t[n])})),t.onTick){var r=this.get("graph");e.set("tick",(function(){t.onTick(),r.refresh()}))}e.bundling(n)},e.prototype.divideEdges=function(t){var e=this,n=e.get("data").edges,r=e.get("nodeIdMap"),i=e.get("edgePoints");return i&&void 0!==i||(i=[]),n.forEach((function(n,o){i[o]&&void 0!==i[o]||(i[o]=[]);var a=r[n.source],s=r[n.target];if(1===t)i[o].push({x:a.x,y:a.y}),i[o].push({x:.5*(a.x+s.x),y:.5*(a.y+s.y)}),i[o].push({x:s.x,y:s.y});else{var u=(i[o]&&i[o]!==[]?e.getEdgeLength(i[o]):yu({x:a.x,y:a.y},{x:s.x,y:s.y}))/(t+1),c=u,l=[{x:a.x,y:a.y}];i[o].forEach((function(t,e){if(0!==e){for(var n=yu(t,i[o][e-1]);n>c;){var r=c/n,a={x:i[o][e-1].x,y:i[o][e-1].y};a.x+=r*(t.x-i[o][e-1].x),a.y+=r*(t.y-i[o][e-1].y),l.push(a),n-=c,c=u}c-=n}})),l.push({x:s.x,y:s.y}),i[o]=l}})),i},e.prototype.getEdgeLength=function(t){var e=0;return t.forEach((function(n,r){0!==r&&(e+=yu(n,t[r-1]))})),e},e.prototype.getEdgeBundles=function(){var t=this,e=t.get("data").edges||[],n=t.get("bundleThreshold"),r=t.get("nodeIdMap"),i=t.get("edgeBundles");return i||(i=[]),e.forEach((function(t,e){i[e]&&void 0!==i[e]||(i[e]=[])})),e.forEach((function(o,a){var s=r[o.source],u=r[o.target];e.forEach((function(e,o){if(!(o<=a)){var c=r[e.source],l=r[e.target];t.getBundleScore({source:s,target:u},{source:c,target:l})>=n&&(i[a].push(o),i[o].push(a))}}))})),i},e.prototype.getBundleScore=function(t,e){return t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,e.vx=e.target.x-e.source.x,e.vy=e.target.y-e.source.y,t.length=yu({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),e.length=yu({x:e.source.x,y:e.source.y},{x:e.target.x,y:e.target.y}),this.getAngleScore(t,e)*this.getScaleScore(t,e)*this.getPositionScore(t,e)*this.getVisibilityScore(t,e)},e.prototype.getAngleScore=function(t,e){return function(t,e){return t.x*e.x+t.y*e.y}({x:t.vx,y:t.vy},{x:e.vx,y:e.vy})/(t.length*e.length)},e.prototype.getScaleScore=function(t,e){var n=(t.length+e.length)/2;return 2/(n/Math.min(t.length,e.length)+Math.max(t.length,e.length)/n)},e.prototype.getPositionScore=function(t,e){var n=(t.length+e.length)/2;return n/(n+yu({x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},{x:(e.source.x+e.target.x)/2,y:(e.source.y+e.target.y)/2}))},e.prototype.getVisibilityScore=function(t,e){var n=this.getEdgeVisibility(t,e),r=this.getEdgeVisibility(e,t);return n<r?n:r},e.prototype.getEdgeVisibility=function(t,e){var n=bu(e.source,t),r=bu(e.target,t),i={x:(n.x+r.x)/2,y:(n.y+r.y)/2},o={x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2};return Math.max(0,1-2*yu(i,o)/yu(n,r))},e.prototype.getEdgeForces=function(t,e,n,r){for(var i=this.get("edgePoints"),o=this.get("K")/(yu(t.source,t.target)*(n+1)),a=[{x:0,y:0}],s=1;s<n;s++){var u={x:0,y:0},c=this.getSpringForce({pre:i[e][s-1],cur:i[e][s],next:i[e][s+1]},o),l=this.getElectrostaticForce(s,e);u.x=r*(c.x+l.x),u.y=r*(c.y+l.y),a.push(u)}return a.push({x:0,y:0}),a},e.prototype.getSpringForce=function(t,e){var n=t.pre.x+t.next.x-2*t.cur.x,r=t.pre.y+t.next.y-2*t.cur.y;return{x:n*=e,y:r*=e}},e.prototype.getElectrostaticForce=function(t,e){var n=this.get("eps"),r=this.get("edgeBundles"),i=this.get("edgePoints"),o=r[e],a={x:0,y:0};return o.forEach((function(r){var o={x:i[r][t].x-i[e][t].x,y:i[r][t].y-i[e][t].y};if(Math.abs(o.x)>n||Math.abs(o.y)>n){var s=1/yu(i[r][t],i[e][t]);a.x+=o.x*s,a.y+=o.y*s}})),a},e.prototype.isTicking=function(){return this.get("ticking")},e.prototype.getSimulation=function(){return this.get("forceSimulation")},e.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),t.prototype.destroy.call(this)},e}(iu),wu=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])})(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)}}(),_u=function(){return(_u=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},Su={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:.1,fill:"#ccc"},Eu=function(t){function e(e){return t.call(this,e)||this}return wu(e,t),e.prototype.getDefaultCfgs=function(){return{trigger:"mousemove",d:1.5,r:300,delegateStyle:Object(p.clone)(Su),showLabel:!1,maxD:5,minD:0,scaleRBy:"unset",scaleDBy:"unset",showDPercent:!0}},e.prototype.getEvents=function(){var t;switch(this.get("trigger")){case"click":t={click:"magnify"};break;case"drag":t={click:"createDelegate"};break;default:t={mousemove:"magnify"}}return t},e.prototype.init=function(){var t=this.get("r");this.set("cachedMagnifiedModels",[]),this.set("cachedOriginPositions",{}),this.set("r2",t*t);var e=this.get("d");this.set("molecularParam",(e+1)*t)},e.prototype.createDelegate=function(t){var e=this,n=this,r=n.get("delegate");r&&!r.destroyed||(n.magnify(t),(r=n.get("delegate")).on("dragstart",(function(t){n.set("delegateCenterDiff",{x:r.attr("x")-t.x,y:r.attr("y")-t.y})})),r.on("drag",(function(t){n.magnify(t)})),"wheel"===this.get("scaleDBy")&&r.on("mousewheel",(function(t){e.scaleDByWheel(t)})),"wheel"===this.get("scaleRBy")&&r.on("mousewheel",(function(t){n.scaleRByWheel(t)})))},e.prototype.scaleRByWheel=function(t){if(t&&t.originalEvent){t.preventDefault&&t.preventDefault();var e,n=this.get("graph"),r=this.get("delegate"),i=(r?{x:r.attr("x"),y:r.attr("y")}:void 0)||n.getPointByClient(t.clientX,t.clientY);e=t.originalEvent.wheelDelta<0?.95:1/.95;var o=this.get("maxR"),a=this.get("minR"),s=this.get("r");(s>(o||n.get("height"))&&e>1||s<(a||.05*n.get("height"))&&e<1)&&(e=1),s*=e,this.set("r",s),this.set("r2",s*s);var u=this.get("d");this.set("molecularParam",(u+1)*s),this.set("delegateCenterDiff",void 0),this.magnify(t,i)}},e.prototype.scaleRByDrag=function(t){if(t){var e,n=this.get("dragPrePos"),r=this.get("graph"),i=r.getPointByClient(t.clientX,t.clientY);e=t.x-n.x<0?.95:1/.95;var o=this.get("maxR"),a=this.get("minR"),s=this.get("r");(s>(o||r.get("height"))&&e>1||s<(a||.05*r.get("height"))&&e<1)&&(e=1),s*=e,this.set("r",s),this.set("r2",s*s);var u=this.get("d");this.set("molecularParam",(u+1)*s),this.magnify(t,i),this.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){if(t||t.originalEvent){t.preventDefault&&t.preventDefault();var e=0;e=t.originalEvent.wheelDelta<0?-.1:.1;var n=this.get("d")+e,r=this.get("maxD"),i=this.get("minD");if(n<r&&n>i){this.set("d",n);var o=this.get("r");this.set("molecularParam",(n+1)*o);var a=this.get("delegate"),s=a?{x:a.attr("x"),y:a.attr("y")}:void 0;this.set("delegateCenterDiff",void 0),this.magnify(t,s)}}},e.prototype.scaleDByDrag=function(t){var e=this.get("dragPrePos"),n=t.x-e.x>0?.1:-.1,r=this.get("d")+n,i=this.get("maxD"),o=this.get("minD");if(r<i&&r>o){this.set("d",r);var a=this.get("r");this.set("molecularParam",(r+1)*a),this.magnify(t)}this.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,e){this.restoreCache();var n=this.get("graph"),r=this.get("cachedMagnifiedModels"),i=this.get("cachedOriginPositions"),o=this.get("showLabel"),a=this.get("r"),s=this.get("r2"),u=this.get("d"),c=this.get("molecularParam"),l=n.getNodes(),h=l.length,f=e?{x:e.x,y:e.y}:{x:t.x,y:t.y};!this.get("dragging")||"mousemove"!==this.get("trigger")&&"click"!==this.get("trigger")||(f=this.get("cacheCenter"));var d=this.get("delegateCenterDiff");d&&(f.x+=d.x,f.y+=d.y),this.updateDelegate(f,a);for(var p=0;p<h;p++){var g=l[p].getModel(),v=g.x,m=g.y;if(!isNaN(v)&&!isNaN(m)){var y=(v-f.x)*(v-f.x)+(m-f.y)*(m-f.y);if(!isNaN(y)&&y<s&&0!==y){var b=Math.sqrt(y),x=c*b/(u*b+a),w=(v-f.x)/b,_=(m-f.y)/b;if(g.x=w*x+f.x,g.y=_*x+f.y,i[g.id]||(i[g.id]={x:v,y:m,texts:[]}),r.push(g),o&&2*b<a)for(var S=l[p].getContainer().getChildren(),E=S.length,M=0;M<E;M++){var O=S[M];"text"===O.get("type")&&(i[g.id].texts.push({visible:O.get("visible"),shape:O}),O.set("visible",!0))}}}}n.refreshPositions()},e.prototype.restoreCache=function(){for(var t=this.get("cachedMagnifiedModels"),e=this.get("cachedOriginPositions"),n=t.length,r=0;r<n;r++){var i=t[r],o=e[i.id];i.x=o.x,i.y=o.y;for(var a=o.texts.length,s=0;s<a;s++){var u=o.texts[s];u.shape.set("visible",u.visible)}}this.set("cachedMagnifiedModels",[]),this.set("cachedOriginPositions",{})},e.prototype.updateParams=function(t){var e=t.r,n=t.d,r=t.trigger,i=t.minD,o=t.maxD,a=t.minR,s=t.maxR,u=t.scaleDBy,c=t.scaleRBy;isNaN(t.r)||(this.set("r",e),this.set("r2",e*e)),isNaN(n)||this.set("d",n),isNaN(o)||this.set("maxD",o),isNaN(i)||this.set("minD",i),isNaN(s)||this.set("maxR",s),isNaN(a)||this.set("minR",a);var l,h=this.get("d"),f=this.get("r");(this.set("molecularParam",(h+1)*f),"mousemove"!==r&&"click"!==r&&"drag"!==r||this.set("trigger",r),"drag"===u||"wheel"===u||"unset"===u)&&(this.set("scaleDBy",u),this.get("delegate").remove(),this.get("delegate").destroy(),(l=this.get("dPercentText"))&&(l.remove(),l.destroy()));"drag"!==c&&"wheel"!==c&&"unset"!==c||(this.set("scaleRBy",c),this.get("delegate").remove(),this.get("delegate").destroy(),(l=this.get("dPercentText"))&&(l.remove(),l.destroy()))},e.prototype.updateDelegate=function(t,e){var n=this,r=this,i=r.get("graph"),o=r.get("delegate");if(!o||o.destroyed){var a=i.get("group"),s=r.get("delegateStyle")||Su;o=a.addShape("circle",{attrs:_u({r:e/1.5,x:t.x,y:t.y},s),name:"lens-shape",draggable:!0}),"drag"!==this.get("trigger")&&("wheel"===this.get("scaleRBy")?o.on("mousewheel",(function(t){r.scaleRByWheel(t)})):"drag"===this.get("scaleRBy")&&(o.on("dragstart",(function(t){r.set("dragging",!0),r.set("cacheCenter",{x:t.x,y:t.y}),r.set("dragPrePos",{x:t.x,y:t.y})})),o.on("drag",(function(t){r.scaleRByDrag(t)})),o.on("dragend",(function(t){r.set("dragging",!1)}))),"wheel"===this.get("scaleDBy")?o.on("mousewheel",(function(t){n.scaleDByWheel(t)})):"drag"===this.get("scaleDBy")&&(o.on("dragstart",(function(t){r.set("dragging",!0),r.set("cacheCenter",{x:t.x,y:t.y}),r.set("dragPrePos",{x:t.x,y:t.y})})),o.on("drag",(function(t){n.scaleDByDrag(t)})),o.on("dragend",(function(t){r.set("dragging",!1)}))))}else o.attr({x:t.x,y:t.y,r:e/1.5});if(r.get("showDPercent")){var u=Math.round((r.get("d")-r.get("minD"))/(r.get("maxD")-r.get("minD"))*100),c=r.get("dPercentText"),l=t.y+e/1.5+16;if(!c||c.destroyed)c=i.get("group").addShape("text",{attrs:{text:u+"%",x:t.x,y:l,fill:"#aaa",stroke:"#fff",lineWidth:1,fontSize:12}}),r.set("dPercentText",c);else c.attr({text:u+"%",x:t.x,y:l})}r.set("delegate",o)},e.prototype.clear=function(){var t=this.get("graph");this.restoreCache(),t.refreshPositions();var e=this.get("delegate");e&&!e.destroyed&&(e.remove(),e.destroy());var n=this.get("dPercentText");n&&!n.destroyed&&(n.remove(),n.destroy())},e.prototype.destroy=function(){this.clear()},e}(iu),Mu=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])})(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)}}();"undefined"!=typeof document&&cu()("\n .g6-component-toolbar {\n position: absolute;\n list-style-type: none;\n padding: 6px;\n left: 0px;\n top: 0px;\n background-color: rgba(255, 255, 255, 0.9);\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n margin: 0;\n }\n .g6-component-toolbar li {\n float: left;\n text-align: center;\n width: 35px;\n height: 24px;\n cursor: pointer;\n\t\tlist-style-type:none;\n list-style: none;\n margin-left: 0px;\n }\n .g6-component-toolbar li .icon {\n opacity: 0.7;\n }\n .g6-component-toolbar li .icon:hover {\n opacity: 1;\n }\n");var Ou=function(t){function e(e){return t.call(this,e)||this}return Mu(e,t),e.prototype.getDefaultCfgs=function(){return{handleClick:void 0,getContent:function(t){return'\n <ul class=\'g6-component-toolbar\'>\n <li code=\'redo\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n <path d="M256 682.666667c0-102.741333 66.730667-213.333333 213.333333-213.333334 107.008 0 190.762667 56.576 230.570667 125.354667L611.968 682.666667H853.333333v-241.365334l-91.562666 91.562667C704.768 448.469333 601.130667 384 469.333333 384c-196.096 0-298.666667 150.229333-298.666666 298.666667h85.333333z" fill="" p-id="2041"></path>\n </svg>\n </li>\n <li code=\'undo\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n <path d="M170.666667 682.666667h241.365333l-87.936-87.978667C363.904 525.909333 447.658667 469.333333 554.666667 469.333333c146.602667 0 213.333333 110.592 213.333333 213.333334h85.333333c0-148.437333-102.570667-298.666667-298.666666-298.666667-131.797333 0-235.392 64.469333-292.48 148.821333L170.666667 441.301333V682.666667z" fill="" p-id="2764"></path>\n </svg>\n </li>\n <li code=\'zoomOut\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n <path d="M658.432 428.736a33.216 33.216 0 0 1-33.152 33.152H525.824v99.456a33.216 33.216 0 0 1-66.304 0V461.888H360.064a33.152 33.152 0 0 1 0-66.304H459.52V296.128a33.152 33.152 0 0 1 66.304 0V395.52H625.28c18.24 0 33.152 14.848 33.152 33.152z m299.776 521.792a43.328 43.328 0 0 1-60.864-6.912l-189.248-220.992a362.368 362.368 0 0 1-215.36 70.848 364.8 364.8 0 1 1 364.8-364.736 363.072 363.072 0 0 1-86.912 235.968l192.384 224.64a43.392 43.392 0 0 1-4.8 61.184z m-465.536-223.36a298.816 298.816 0 0 0 298.432-298.432 298.816 298.816 0 0 0-298.432-298.432A298.816 298.816 0 0 0 194.24 428.8a298.816 298.816 0 0 0 298.432 298.432z"></path>\n </svg>\n </li>\n <li code=\'zoomIn\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n <path d="M639.936 416a32 32 0 0 1-32 32h-256a32 32 0 0 1 0-64h256a32 32 0 0 1 32 32z m289.28 503.552a41.792 41.792 0 0 1-58.752-6.656l-182.656-213.248A349.76 349.76 0 0 1 480 768 352 352 0 1 1 832 416a350.4 350.4 0 0 1-83.84 227.712l185.664 216.768a41.856 41.856 0 0 1-4.608 59.072zM479.936 704c158.784 0 288-129.216 288-288S638.72 128 479.936 128a288.32 288.32 0 0 0-288 288c0 158.784 129.216 288 288 288z" p-id="3853"></path>\n </svg>\n </li>\n <li code=\'realZoom\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">\n <path d="M384 320v384H320V320h64z m256 0v384H576V320h64zM512 576v64H448V576h64z m0-192v64H448V384h64z m355.968 576H92.032A28.16 28.16 0 0 1 64 931.968V28.032C64 12.608 76.608 0 95.168 0h610.368L896 192v739.968a28.16 28.16 0 0 1-28.032 28.032zM704 64v128h128l-128-128z m128 192h-190.464V64H128v832h704V256z"></path>\n </svg>\n </li>\n <li code=\'autoZoom\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">\n <path d="M684.288 305.28l0.128-0.64-0.128-0.64V99.712c0-19.84 15.552-35.904 34.496-35.712a35.072 35.072 0 0 1 34.56 35.776v171.008h170.944c19.648 0 35.84 15.488 35.712 34.432a35.072 35.072 0 0 1-35.84 34.496h-204.16l-0.64-0.128a32.768 32.768 0 0 1-20.864-7.552c-1.344-1.024-2.816-1.664-3.968-2.816-0.384-0.32-0.512-0.768-0.832-1.088a33.472 33.472 0 0 1-9.408-22.848zM305.28 64a35.072 35.072 0 0 0-34.56 35.776v171.008H99.776A35.072 35.072 0 0 0 64 305.216c0 18.944 15.872 34.496 35.84 34.496h204.16l0.64-0.128a32.896 32.896 0 0 0 20.864-7.552c1.344-1.024 2.816-1.664 3.904-2.816 0.384-0.32 0.512-0.768 0.768-1.088a33.024 33.024 0 0 0 9.536-22.848l-0.128-0.64 0.128-0.704V99.712A35.008 35.008 0 0 0 305.216 64z m618.944 620.288h-204.16l-0.64 0.128-0.512-0.128c-7.808 0-14.72 3.2-20.48 7.68-1.28 1.024-2.752 1.664-3.84 2.752-0.384 0.32-0.512 0.768-0.832 1.088a33.664 33.664 0 0 0-9.408 22.912l0.128 0.64-0.128 0.704v204.288c0 19.712 15.552 35.904 34.496 35.712a35.072 35.072 0 0 0 34.56-35.776V753.28h170.944c19.648 0 35.84-15.488 35.712-34.432a35.072 35.072 0 0 0-35.84-34.496z m-593.92 11.52c-0.256-0.32-0.384-0.768-0.768-1.088-1.088-1.088-2.56-1.728-3.84-2.688a33.088 33.088 0 0 0-20.48-7.68l-0.512 0.064-0.64-0.128H99.84a35.072 35.072 0 0 0-35.84 34.496 35.072 35.072 0 0 0 35.712 34.432H270.72v171.008c0 19.84 15.552 35.84 34.56 35.776a35.008 35.008 0 0 0 34.432-35.712V720l-0.128-0.64 0.128-0.704a33.344 33.344 0 0 0-9.472-22.848zM512 374.144a137.92 137.92 0 1 0 0.128 275.84A137.92 137.92 0 0 0 512 374.08z"></path>\n </svg>\n </li>\n </ul>\n '},zoomSensitivity:2}},e.prototype.init=function(){var t=this,e=this.get("graph"),n=this.get("getContent")(e),r=n;Object(p.isString)(n)&&(r=R(n));var i=this.get("className");r.setAttribute("class",i||"g6-component-toolbar");var o=this.get("container");o||(o=this.get("graph").get("container")),Object(p.isString)(o)&&(o=document.getElementById(o)),o.appendChild(r),this.set("toolBar",r);var a=this.get("handleClick");r.addEventListener("click",(function(n){var r=function(t){if(!t)return[];if(t.composedPath)return t.composedPath();for(var e=[],n=t.target;n;){if(e.push(n),"HTML"===n.tagName)return e.push(document,window),e;n=n.parentElement}return e}(n).filter((function(t){return"LI"===t.nodeName}));if(0!==r.length){var i=r[0].getAttribute("code");i&&(a?a(i,e):t.handleDefaultOperator(i,e))}}));var s=this.get("position");s&&B(r,{top:s.y+"px",left:s.x+"px"}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=this.get("graph"),e=document.querySelector('.g6-component-toolbar li[code="undo"]'),n=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),r=document.querySelector('.g6-component-toolbar li[code="redo"]'),i=document.querySelector('.g6-component-toolbar li[code="redo"] svg');e&&n&&r&&i&&t.on("stackchange",(function(t){var o=t.undoStack,a=t.redoStack,s=o.length,u=a.length;1===s?(e.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4")):(e.removeAttribute("style"),n.removeAttribute("style")),0===u?(r.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(r.removeAttribute("style"),i.removeAttribute("style"))}))},e.prototype.undo=function(){var t=this.get("graph"),e=t.getUndoStack();if(e&&1!==e.length){var n=e.pop();if(n){var r=n.action;t.pushStack(r,Object(p.clone)(n.data),"redo");var i=n.data.before;if("add"===r&&(i=n.data.after),!i)return;switch(r){case"visible":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);e.visible?t.showItem(n,!1):t.hideItem(n,!1)}))}));break;case"render":case"update":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateItem(e.id,e,!1)}))}));break;case"changedata":t.changeData(i,!1);break;case"delete":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=e.itemType;delete e.itemType,t.addItem(n,e,!1)}))}));break;case"add":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.removeItem(e.id,!1)}))}));break;case"updateComboTree":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateComboTree(e.id,e.parentId,!1)}))}))}}}},e.prototype.redo=function(){var t=this.get("graph"),e=t.getRedoStack();if(e&&0!==e.length){var n=e.pop();if(n){var r=n.action,i=n.data.after;if(t.pushStack(r,Object(p.clone)(n.data)),"delete"===r&&(i=n.data.before),!i)return;switch(r){case"visible":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);e.visible?t.showItem(n,!1):t.hideItem(n,!1)}))}));break;case"render":case"update":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateItem(e.id,e,!1)}))}));break;case"changedata":t.changeData(i,!1);break;case"delete":i.edges&&i.edges.forEach((function(e){t.removeItem(e.id,!1)})),i.nodes&&i.nodes.forEach((function(e){t.removeItem(e.id,!1)})),i.combos&&i.combos.forEach((function(e){t.removeItem(e.id,!1)}));break;case"add":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=e.itemType;delete e.itemType,t.addItem(n,e,!1)}))}));break;case"updateComboTree":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateComboTree(e.id,e.parentId,!1)}))}))}}}},e.prototype.handleDefaultOperator=function(t,e){var n=e.getZoom();switch(t){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":var r=1/(1-.05*this.get("zoomSensitivity"));if(r*n>(this.get("maxZoom")||e.get("maxZoom")))return;e.zoomTo(n*r);break;case"zoomIn":var i=1-.05*this.get("zoomSensitivity");if(i*n<(this.get("minZoom")||e.get("minZoom")))return;e.zoomTo(n*i);break;case"realZoom":e.zoomTo(1);break;case"autoZoom":e.fitView([20,20])}},e.prototype.destroy=function(){var t=this.get("toolBar");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),Object(p.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}var n=this.get("handleClick");n&&t.removeEventListener("click",n)},e}(iu),Au=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])})(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)}}();"undefined"!=typeof document&&cu()("\n .g6-component-tooltip {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .tooltip-type {\n padding: 0;\n margin: 0;\n }\n .tooltip-id {\n color: #531dab;\n }\n");var ku=function(t){function e(e){return t.call(this,e)||this}return Au(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(t){return"\n <h4 class='tooltip-type'>类型:"+t.item.getType()+"</h4>\n <span class='tooltip-id'>ID:"+t.item.getID()+"</span>\n "},shouldBegin:function(t){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{"node:click":"onClick","edge:click":"onClick","combo:click":"onClick","canvas:click":"onMouseLeave",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave",drag:"onMouseLeave"}:{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},e.prototype.init=function(){var t=this,e=R("<div class="+(t.get("className")||"g6-component-tooltip")+"></div>"),n=t.get("container");n||(n=t.get("graph").get("container")),Object(p.isString)(n)&&(n=document.getElementById(n)),B(e,{position:"absolute",visibility:"hidden",display:"none"}),n.appendChild(e),"click"!==t.get("trigger")&&(e.addEventListener("mouseenter",(function(t){B(e,{visibility:"visible",display:"unset"})})),e.addEventListener("mouseleave",(function(e){t.hideTooltip()}))),t.set("tooltip",e)},e.prototype.onClick=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var n=t.item,r=this.get("graph");this.currentTarget===n?(this.currentTarget=null,this.hideTooltip(),r.emit("tooltipchange",{item:t.item,action:"hide"})):(this.currentTarget=n,this.showTooltip(t),r.emit("tooltipchange",{item:t.item,action:"show"}))}},e.prototype.onMouseEnter=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var n=t.item,r=this.get("graph");this.currentTarget=n,this.showTooltip(t),r.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var e=this.get("itemTypes");t.item&&t.item.getType&&-1===e.indexOf(t.item.getType())||this.currentTarget&&t.item===this.currentTarget&&this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip(),this.get("graph").emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.showTooltip=function(t){if(t.item){var e=this.get("itemTypes");if(!t.item.getType||-1!==e.indexOf(t.item.getType())){var n=this.get("tooltip"),r=this.get("getContent")(t);Object(p.isString)(r)?n.innerHTML=r:n.innerHTML=r.outerHTML,this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&B(t,{visibility:"hidden",display:"none"})},e.prototype.updatePosition=function(t){var e=this.get("shouldBegin"),n=this.get("tooltip");if(e(t)){var r=this.get("graph"),i=r.get("width"),o=r.get("height"),a=this.get("offsetX")||0,s=this.get("offsetY")||0,u=r.getPointByClient(t.clientX,t.clientY),c=this.get("fixToNode"),l=t.item;if(l.getType&&"node"===l.getType()&&c&&Object(p.isArray)(c)&&c.length>=2){var h=l.getBBox();u={x:h.minX+h.width*c[0],y:h.minY+h.height*c[1]}}var f=r.getCanvasByPoint(u.x,u.y),d=f.x,g=f.y,v=r.getContainer(),m={x:d+v.offsetLeft+a,y:g+v.offsetTop+s};B(n,{visibility:"visible",display:"unset"});var y=n.getBoundingClientRect();d+y.width+a>i&&(m.x-=y.width+a),g+y.height+s>o&&(m.y-=y.height+s),B(n,{left:m.x+"px",top:m.y+"px"})}else B(n,{visibility:"hidden",display:"none"})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),Object(p.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(iu),Cu=n(39),Iu={};function Tu(t,e){Iu[t]=e}var Pu=function(){function t(t){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=t,this.initCfg(),this.init()}return t.prototype.translate=function(t){return t},t.prototype.change=function(t){Object(p.assign)(this.__cfg__,t),this.init()},t.prototype.clone=function(){return this.constructor(this.__cfg__)},t.prototype.getTicks=function(){var t=this;return Object(p.map)(this.ticks,(function(e,n){return Object(p.isObject)(e)?e:{text:t.getText(e,n),tickValue:e,value:t.scale(e)}}))},t.prototype.getText=function(t,e){var n=this.formatter,r=n?n(t,e):t;return Object(p.isNil)(r)||!Object(p.isFunction)(r.toString)?"":r.toString()},t.prototype.getConfig=function(t){return this.__cfg__[t]},t.prototype.init=function(){Object(p.assign)(this,this.__cfg__),this.setDomain(),Object(p.isEmpty)(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},t.prototype.initCfg=function(){},t.prototype.setDomain=function(){},t.prototype.calculateTicks=function(){var t=this.tickMethod,e=[];if(Object(p.isString)(t)){var n=Iu[t];if(!n)throw new Error("There is no method to to calculate ticks!");e=n(this)}else Object(p.isFunction)(t)&&(e=t(this));return e},t.prototype.rangeMin=function(){return this.range[0]},t.prototype.rangeMax=function(){return this.range[1]},t.prototype.calcPercent=function(t,e,n){return Object(p.isNumber)(t)?(t-e)/(n-e):NaN},t.prototype.calcValue=function(t,e,n){return e+t*(n-e)},t}(),Nu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cat",e.isCategory=!0,e}return Object(s.__extends)(e,t),e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;t<this.values.length;t++)this.translateIndexMap.set(this.values[t],t)}},e.prototype.translate=function(t){this.buildIndexMap();var e=this.translateIndexMap.get(t);return void 0===e&&(e=Object(p.isNumber)(t)?t:NaN),e},e.prototype.scale=function(t){var e=this.translate(t),n=this.calcPercent(e,this.min,this.max);return this.calcValue(n,this.rangeMin(),this.rangeMax())},e.prototype.invert=function(t){var e=this.max-this.min,n=this.calcPercent(t,this.rangeMin(),this.rangeMax()),r=Math.round(e*n)+this.min;return r<this.min||r>this.max?NaN:this.values[r]},e.prototype.getText=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=e;return Object(p.isNumber)(e)&&!this.values.includes(e)&&(i=this.values[i]),t.prototype.getText.apply(this,Object(s.__spreadArray)([i],n,!1))},e.prototype.initCfg=function(){this.tickMethod="cat"},e.prototype.setDomain=function(){if(Object(p.isNil)(this.getConfig("min"))&&(this.min=0),Object(p.isNil)(this.getConfig("max"))){var t=this.values.length;this.max=t>1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(Pu),ju=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Du="[^\\s]+",Lu=/\[([^]*?)\]/gm;function Ru(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}var Bu=function(t){return function(e,n){var r=n[t].map((function(t){return t.toLowerCase()})).indexOf(e.toLowerCase());return r>-1?r:null}};function Gu(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var Fu=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],zu=["January","February","March","April","May","June","July","August","September","October","November","December"],Uu=Ru(zu,3),Vu={dayNamesShort:Ru(Fu,3),dayNames:Fu,monthNamesShort:Uu,monthNames:zu,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}},Wu=Gu({},Vu),Yu=function(t){return Wu=Gu(Wu,t)},Xu=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Hu=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},qu={D:function(t){return String(t.getDate())},DD:function(t){return Hu(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Hu(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return Hu(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return Hu(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Hu(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Hu(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Hu(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Hu(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Hu(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Hu(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Hu(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Hu(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Hu(Math.floor(Math.abs(e)/60),2)+":"+Hu(Math.abs(e)%60,2)}},Ku=function(t){return+t-1},Zu=[null,"[1-9]\\d?"],$u=[null,Du],Qu=["isPm",Du,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],Ju=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var n=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?n:-n}return 0}],tc={D:["day","[1-9]\\d?"],DD:["day","\\d\\d"],Do:["day","[1-9]\\d?"+Du,function(t){return parseInt(t,10)}],M:["month","[1-9]\\d?",Ku],MM:["month","\\d\\d",Ku],YY:["year","\\d\\d",function(t){var e=+(""+(new Date).getFullYear()).substr(0,2);return+(""+(+t>68?e-1:e)+t)}],h:["hour","[1-9]\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","[1-9]\\d?"],HH:["hour","\\d\\d"],m:["minute","[1-9]\\d?"],mm:["minute","\\d\\d"],s:["second","[1-9]\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(t){return 100*+t}],SS:["millisecond","\\d\\d",function(t){return 10*+t}],SSS:["millisecond","\\d{3}"],d:Zu,dd:Zu,ddd:$u,dddd:$u,MMM:["month",Du,Bu("monthNamesShort")],MMMM:["month",Du,Bu("monthNames")],a:Qu,A:Qu,ZZ:Ju,Z:Ju},ec={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},nc=function(t){return Gu(ec,t)},rc=function(t,e,n){if(void 0===e&&(e=ec.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=ec[e]||e).replace(Lu,(function(t,e){return r.push(e),"@@@"}));var i=Gu(Gu({},Wu),n);return(e=e.replace(ju,(function(e){return qu[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))};function ic(t,e,n){if(void 0===n&&(n={}),"string"!=typeof e)throw new Error("Invalid format in fecha parse");if(e=ec[e]||e,t.length>1e3)return null;var r={year:(new Date).getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],o=[],a=e.replace(Lu,(function(t,e){return o.push(Xu(e)),"@@@"})),s={},u={};a=Xu(a).replace(ju,(function(t){var e=tc[t],n=e[0],r=e[1],o=e[3];if(s[n])throw new Error("Invalid format. "+n+" specified twice in format");return s[n]=!0,o&&(u[o]=!0),i.push(e),"("+r+")"})),Object.keys(u).forEach((function(t){if(!s[t])throw new Error("Invalid format. "+t+" is required in specified format")})),a=a.replace(/@@@/g,(function(){return o.shift()}));var c=t.match(new RegExp(a,"i"));if(!c)return null;for(var l=Gu(Gu({},Wu),n),h=1;h<c.length;h++){var f=i[h-1],d=f[0],p=f[2],g=p?p(c[h],l):+c[h];if(null==g)return null;r[d]=g}1===r.isPm&&null!=r.hour&&12!=+r.hour?r.hour=+r.hour+12:0===r.isPm&&12==+r.hour&&(r.hour=0);for(var v=new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond),m=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],y=(h=0,m.length);h<y;h++)if(s[m[h][0]]&&r[m[h][0]]!==v[m[h][1]]())return null;return null==r.timezoneOffset?v:new Date(Date.UTC(r.year,r.month,r.day,r.hour,r.minute-r.timezoneOffset,r.second,r.millisecond))}var oc={format:rc,parse:ic,defaultI18n:Vu,setGlobalDateI18n:Yu,setGlobalDateMasks:nc};function ac(t,e){return(a.format||oc.format)(t,e)}function sc(t){return Object(p.isString)(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),Object(p.isDate)(t)&&(t=t.getTime()),t}var uc=36e5,cc=24*uc,lc=31*cc,hc=[["HH:mm:ss",1e3],["HH:mm:ss",1e4],["HH:mm:ss",3e4],["HH:mm",6e4],["HH:mm",6e5],["HH:mm",18e5],["HH",uc],["HH",6*uc],["HH",12*uc],["YYYY-MM-DD",cc],["YYYY-MM-DD",4*cc],["YYYY-WW",7*cc],["YYYY-MM",lc],["YYYY-MM",4*lc],["YYYY-MM",6*lc],["YYYY",380*cc]];function fc(t,e,n){var r,i=(r=function(t){return t[1]},function(t,e,n,i){for(var o=Object(p.isNil)(n)?0:n,a=Object(p.isNil)(i)?t.length:i;o<a;){var s=o+a>>>1;r(t[s])>e?a=s:o=s+1}return o})(hc,(e-t)/n)-1,o=hc[i];return i<0?o=hc[0]:i>=hc.length&&(o=Object(p.last)(hc)),o}var dc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return Object(s.__extends)(e,t),e.prototype.translate=function(t){t=sc(t);var e=this.values.indexOf(t);return-1===e&&(e=Object(p.isNumber)(t)&&t<this.values.length?t:NaN),e},e.prototype.getText=function(t,e){var n=this.translate(t);if(n>-1){var r=this.values[n],i=this.formatter;return r=i?i(r,e):ac(r,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;Object(p.each)(e,(function(t,n){e[n]=sc(t)})),e.sort((function(t,e){return t-e})),t.prototype.setDomain.call(this)},e}(Nu),pc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return Object(s.__extends)(e,t),e.prototype.scale=function(t){if(Object(p.isNil)(t))return NaN;var e=this.rangeMin(),n=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(n-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,n=Object(p.head)(e),r=Object(p.last)(e);n<this.min&&(this.min=n),r>this.max&&(this.max=r),Object(p.isNil)(this.minLimit)||(this.min=n),Object(p.isNil)(this.maxLimit)||(this.max=r)},e.prototype.setDomain=function(){var t=Object(p.getRange)(this.values),e=t.min,n=t.max;Object(p.isNil)(this.min)&&(this.min=e),Object(p.isNil)(this.max)&&(this.max=n),this.min>this.max&&(this.min=e,this.max=n)},e.prototype.calculateTicks=function(){var e=this,n=t.prototype.calculateTicks.call(this);return this.nice||(n=Object(p.filter)(n,(function(t){return t>=e.min&&t<=e.max}))),n},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;return(t-n)/(e-n)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(Pu),gc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return Object(s.__extends)(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(pc);function vc(t,e){var n=Math.E;return e>=0?Math.pow(n,Math.log(e)/t):-1*Math.pow(n,Math.log(-e)/t)}function mc(t,e){return 1===t?1:Math.log(e)/Math.log(t)}function yc(t,e,n){Object(p.isNil)(n)&&(n=Math.max.apply(null,t));var r=n;return Object(p.each)(t,(function(t){t>0&&t<r&&(r=t)})),r===n&&(r=n/e),r>1&&(r=1),r}var bc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return Object(s.__extends)(e,t),e.prototype.invert=function(t){var e,n=this.base,r=mc(n,this.max),i=this.rangeMin(),o=this.rangeMax()-i,a=this.positiveMin;if(a){if(0===t)return 0;var s=1/(r-(e=mc(n,a/n)))*o;if(t<s)return t/s*a}else e=mc(n,this.min);var u=(t-i)/o*(r-e)+e;return Math.pow(n,u)},e.prototype.initCfg=function(){this.tickMethod="log",this.base=10,this.tickCount=6,this.nice=!0},e.prototype.setDomain=function(){t.prototype.setDomain.call(this);var e=this.min;if(e<0)throw new Error("When you use log scale, the minimum value must be greater than zero!");0===e&&(this.positiveMin=yc(this.values,this.base,this.max))},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;if(t<=0)return 0;var r=this.base,i=this.positiveMin;return i&&(n=1*i/r),t<i?t/i/(mc(r,e)-mc(r,n)):(mc(r,t)-mc(r,n))/(mc(r,e)-mc(r,n))},e}(pc),xc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="pow",e}return Object(s.__extends)(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t),n=this.exponent,r=vc(n,this.max),i=vc(n,this.min),o=e*(r-i)+i,a=o>=0?1:-1;return Math.pow(o,n)*a},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;var r=this.exponent;return(vc(r,t)-vc(r,n))/(vc(r,e)-vc(r,n))},e}(pc),wc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return Object(s.__extends)(e,t),e.prototype.getText=function(t,e){var n=this.translate(t),r=this.formatter;return r?r(n,e):ac(n,this.mask)},e.prototype.scale=function(e){var n=e;return(Object(p.isString)(n)||Object(p.isDate)(n))&&(n=this.translate(n)),t.prototype.scale.call(this,n)},e.prototype.translate=function(t){return sc(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),n=this.getConfig("max");if(Object(p.isNil)(e)&&Object(p.isNumber)(e)||(this.min=this.translate(this.min)),Object(p.isNil)(n)&&Object(p.isNumber)(n)||(this.max=this.translate(this.max)),t&&t.length){var r=[],i=1/0,o=i,a=0;Object(p.each)(t,(function(t){var e=sc(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t+" in time scale!");i>e?(o=i,i=e):o>e&&(o=e),a<e&&(a=e),r.push(e)})),t.length>1&&(this.minTickInterval=o-i),Object(p.isNil)(e)&&(this.min=i),Object(p.isNil)(n)&&(this.max=a)}},e}(gc),_c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return Object(s.__extends)(e,t),e.prototype.invert=function(t){var e=this.ticks,n=e.length,r=this.getInvertPercent(t),i=Math.floor(r*(n-1));if(i>=n-1)return Object(p.last)(e);if(i<0)return Object(p.head)(e);var o=e[i],a=i/(n-1);return o+(r-a)/((i+1)/(n-1)-a)*(e[i+1]-o)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||(Object(p.last)(e)!==this.max&&e.push(this.max),Object(p.head)(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(t<Object(p.head)(e))return 0;if(t>Object(p.last)(e))return 1;var n=0;return Object(p.each)(e,(function(e,r){if(!(t>=e))return!1;n=r})),n/(e.length-1)},e}(pc),Sc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return Object(s.__extends)(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(_c),Ec={};function Mc(t,e){if(function(t){return Ec[t]}(t))throw new Error("type '"+t+"' existed.");Ec[t]=e}var Oc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return Object(s.__extends)(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&Object(p.isNumber)(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return t<e[0]||t>e[1]?NaN:this.values[0]},e}(Pu);function Ac(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}var kc=[1,5,2,2.5,4,3],Cc=100*Number.EPSILON;function Ic(t,e,n,r,i,o){var a=Object(p.size)(e),s=Object(p.indexOf)(e,t),u=0,c=function(t,e){return(t%e+e)%e}(r,o);return(c<Cc||o-c<Cc)&&r<=0&&i>=0&&(u=1),1-s/(a-1)-n+u}function Tc(t,e,n){var r=Object(p.size)(e);return 1-Object(p.indexOf)(e,t)/(r-1)-n+1}function Pc(t,e,n,r,i,o){var a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function Nc(t,e){return t>=e?2-(t-1)/(e-1):1}function jc(t,e,n,r){var i=e-t;return 1-.5*(Math.pow(e-r,2)+Math.pow(t-n,2))/Math.pow(.1*i,2)}function Dc(t,e,n){var r=e-t;if(n>r){var i=(n-r)/2;return 1-Math.pow(i,2)/Math.pow(.1*r,2)}return 1}function Lc(t,e,n,r,i,o){void 0===n&&(n=5),void 0===r&&(r=!0),void 0===i&&(i=kc),void 0===o&&(o=[.25,.2,.5,.05]);var a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return{min:0,max:0,ticks:[]};if(e-t<1e-15||1===a)return{min:t,max:e,ticks:[t]};for(var s={score:-2,lmin:0,lmax:0,lstep:0},u=1;u<1/0;){for(var c=0;c<i.length;c+=1){var l=i[c],h=Tc(l,i,u);if(o[0]*h+o[1]+o[2]+o[3]<s.score){u=1/0;break}for(var f=2;f<1/0;){var d=Nc(f,a);if(o[0]*h+o[1]+o[2]*d+o[3]<s.score)break;for(var g=(e-t)/(f+1)/u/l,v=Math.ceil(Math.log10(g));v<1/0;){var m=u*l*Math.pow(10,v),y=Dc(t,e,m*(f-1));if(o[0]*h+o[1]*y+o[2]*d+o[3]<s.score)break;var b=Math.floor(e/m)*u-(f-1)*u,x=Math.ceil(t/m)*u;if(b<=x)for(var w=x-b,_=0;_<=w;_+=1){var S=(b+_)*(m/u),E=S+m*(f-1),M=m,O=Ic(l,i,u,S,E,M),A=jc(t,e,S,E),k=Pc(f,a,t,e,S,E),C=o[0]*O+o[1]*A+o[2]*k+1*o[3];C>s.score&&(!r||S<=t&&E>=e)&&(s.lmin=S,s.lmax=E,s.lstep=M,s.score=C)}v+=1}f+=1}}u+=1}var I=Ac(s.lmax),T=Ac(s.lmin),P=Ac(s.lstep),N=Math.floor(function(t){return Math.round(1e12*t)/1e12}((I-T)/P))+1,j=new Array(N);j[0]=Ac(T);for(c=1;c<N;c++)j[c]=Ac(j[c-1]+P);return{min:Math.min(t,Object(p.head)(j)),max:Math.max(e,Object(p.last)(j)),ticks:j}}function Rc(t){var e=t.values,n=t.tickInterval,r=t.tickCount,i=e;if(Object(p.isNumber)(n))return Object(p.filter)(i,(function(t,e){return e%n==0}));var o=t.min,a=t.max;if(Object(p.isNil)(o)&&(o=0),Object(p.isNil)(a)&&(a=e.length-1),Object(p.isNumber)(r)&&r<a-o){var s=Lc(o,a,r,!1,[1,2,5,3,4,7,6,8,9]).ticks;return Object(p.filter)(s,(function(t){return t>=o&&t<=a})).map((function(t){return e[t]}))}return e.slice(o,a+1)}var Bc=Math.sqrt(50),Gc=Math.sqrt(10),Fc=Math.sqrt(2),zc=function(){function t(){this._domain=[0,1]}return t.prototype.domain=function(t){return t?(this._domain=Array.from(t,Number),this):this._domain.slice()},t.prototype.nice=function(t){var e,n;void 0===t&&(t=5);var r,i=this._domain.slice(),o=0,a=this._domain.length-1,s=this._domain[o],u=this._domain[a];return u<s&&(s=(e=[u,s])[0],u=e[1],o=(n=[a,o])[0],a=n[1]),(r=Uc(s,u,t))>0?r=Uc(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,t):r<0&&(r=Uc(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,t)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(u/r)*r,this.domain(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(u*r)/r,this.domain(i)),this},t.prototype.ticks=function(t){return void 0===t&&(t=5),function(t,e,n){var r,i,o,a,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];(r=e<t)&&(i=t,t=e,e=i);if(0===(a=Uc(t,e,n))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(t+s)*a;else for(t=Math.floor(t*a),e=Math.ceil(e*a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(t-s)/a;r&&o.reverse();return o}(this._domain[0],this._domain[this._domain.length-1],t||5)},t}();function Uc(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=Bc?10:o>=Gc?5:o>=Fc?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Bc?10:o>=Gc?5:o>=Fc?2:1)}function Vc(t,e,n){return("ceil"===n?Math.ceil(t/e):"floor"===n?Math.floor(t/e):Math.round(t/e))*e}function Wc(t,e,n){var r=Vc(t,n,"floor"),i=Vc(e,n,"ceil");r=Object(p.fixedBase)(r,n),i=Object(p.fixedBase)(i,n);for(var o=[],a=r;a<=i;a+=n){var s=Object(p.fixedBase)(a,n);o.push(s)}return{min:r,max:i,ticks:o}}function Yc(t,e,n){var r,i=t.minLimit,o=t.maxLimit,a=t.min,s=t.max,u=t.tickCount,c=void 0===u?5:u,l=Object(p.isNil)(i)?Object(p.isNil)(e)?a:e:i,h=Object(p.isNil)(o)?Object(p.isNil)(n)?s:n:o;if(l>h&&(h=(r=[l,h])[0],l=r[1]),c<=2)return[l,h];for(var f=(h-l)/(c-1),d=[],g=0;g<c;g++)d.push(l+f*g);return d}function Xc(t,e,n){if(void 0===n&&(n=5),t===e)return{max:e,min:t,ticks:[t]};var r=n<0?0:Math.round(n);if(0===r)return{max:e,min:t,ticks:[]};var i=(e-t)/r,o=Math.pow(10,Math.floor(Math.log10(i))),a=o;2*o-i<1.5*(i-a)&&5*o-i<2.75*(i-(a=2*o))&&10*o-i<1.5*(i-(a=5*o))&&(a=10*o);for(var s=Math.ceil(e/a),u=Math.floor(t/a),c=Math.max(s*a,e),l=Math.min(u*a,t),h=Math.floor((c-l)/a)+1,f=new Array(h),d=0;d<h;d++)f[d]=Ac(l+d*a);return{min:l,max:c,ticks:f}}function Hc(t,e){var n=t.length*e;return 1===e?t[t.length-1]:0===e?t[0]:n%1!=0?t[Math.ceil(n)-1]:t.length%2==0?(t[n-1]+t[n])/2:t[n]}function qc(t){return new Date(t).getFullYear()}function Kc(t){return new Date(t,0,1).getTime()}function Zc(t){return new Date(t).getMonth()}function $c(t,e){return new Date(t,e,1).getTime()}Tu("cat",Rc),Tu("time-cat",(function(t){var e=Rc(t),n=Object(p.last)(t.values);return n!==Object(p.last)(e)&&e.push(n),e})),Tu("wilkinson-extended",(function(t){var e=t.min,n=t.max,r=t.tickCount,i=t.nice,o=t.tickInterval,a=t.minLimit,s=t.maxLimit,u=Lc(e,n,r,i).ticks;return Object(p.isNil)(a)&&Object(p.isNil)(s)?o?Wc(e,n,o).ticks:u:Yc(t,Object(p.head)(u),Object(p.last)(u))})),Tu("r-pretty",(function(t){var e=t.min,n=t.max,r=t.tickCount,i=t.tickInterval,o=t.minLimit,a=t.maxLimit,s=Xc(e,n,r).ticks;return Object(p.isNil)(o)&&Object(p.isNil)(a)?i?Wc(e,n,i).ticks:s:Yc(t,Object(p.head)(s),Object(p.last)(s))})),Tu("time",(function(t){var e=t.min,n=t.max,r=t.minTickInterval,i=t.tickInterval,o=t.tickCount;if(i)o=Math.ceil((n-e)/i);else{var a=(n-e)/(i=fc(e,n,o)[1])/o;a>1&&(i*=Math.ceil(a)),r&&i<r&&(i=r)}for(var s=[],u=e;u<n+i;u+=i)s.push(u);return s})),Tu("time-pretty",(function(t){var e=t.min,n=t.max,r=t.minTickInterval,i=t.tickCount,o=t.tickInterval,a=[];o||(o=(n-e)/i,r&&o<r&&(o=r));var s=qc(e);if(o>31536e6)for(var u=qc(n),c=Math.ceil(o/31536e6),l=s;l<=u+c;l+=c)a.push(Kc(l));else if(o>lc){var h=Math.ceil(o/lc),f=Zc(e),d=function(t,e){var n=qc(t),r=qc(e),i=Zc(t);return 12*(r-n)+(Zc(e)-i)%12}(e,n);for(l=0;l<=d+h;l+=h)a.push($c(s,l+f))}else if(o>cc){var p=(b=new Date(e)).getFullYear(),g=b.getMonth(),v=b.getDate(),m=Math.ceil(o/cc),y=function(t,e){return Math.ceil((e-t)/cc)}(e,n);for(l=0;l<y+m;l+=m)a.push(new Date(p,g,v+l).getTime())}else if(o>uc){p=(b=new Date(e)).getFullYear(),g=b.getMonth(),m=b.getDate();var b,x=b.getHours(),w=Math.ceil(o/uc),_=function(t,e){return Math.ceil((e-t)/uc)}(e,n);for(l=0;l<=_+w;l+=w)a.push(new Date(p,g,m,x+l).getTime())}else if(o>6e4){var S=function(t,e){return Math.ceil((e-t)/6e4)}(e,n),E=Math.ceil(o/6e4);for(l=0;l<=S+E;l+=E)a.push(e+6e4*l)}else{var M=o;M<1e3&&(M=1e3);var O=1e3*Math.floor(e/1e3),A=Math.ceil((n-e)/1e3),k=Math.ceil(M/1e3);for(l=0;l<A+k;l+=k)a.push(O+1e3*l)}return a.length>=512&&console.warn("Notice: current ticks length("+a.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+o+") is too small, increase the value to solve the problem!"),a})),Tu("log",(function(t){var e,n=t.base,r=t.tickCount,i=t.min,o=t.max,a=t.values,s=mc(n,o);if(i>0)e=Math.floor(mc(n,i));else{var u=yc(a,n,o);e=Math.floor(mc(n,u))}for(var c=s-e,l=Math.ceil(c/r),h=[],f=e;f<s+l;f+=l)h.push(Math.pow(n,f));return i<=0&&h.unshift(0),h})),Tu("pow",(function(t){var e=t.exponent,n=t.tickCount,r=Math.ceil(vc(e,t.max));return Xc(Math.floor(vc(e,t.min)),r,n).ticks.map((function(t){var n=t>=0?1:-1;return Math.pow(t,e)*n}))})),Tu("quantile",(function(t){var e=t.tickCount,n=t.values;if(!n||!n.length)return[];for(var r=n.slice().sort((function(t,e){return t-e})),i=[],o=0;o<e;o++){var a=o/(e-1);i.push(Hc(r,a))}return i})),Tu("d3-linear",(function(t){var e=t.min,n=t.max,r=t.tickInterval,i=t.minLimit,o=t.maxLimit,a=function(t){var e=t.min,n=t.max,r=t.nice,i=t.tickCount,o=new zc;return o.domain([e,n]),r&&o.nice(i),o.ticks(i)}(t);return Object(p.isNil)(i)&&Object(p.isNil)(o)?r?Wc(e,n,r).ticks:a:Yc(t,Object(p.head)(a),Object(p.last)(a))})),Mc("cat",Nu),Mc("category",Nu),Mc("identity",Oc),Mc("linear",gc),Mc("log",bc),Mc("pow",xc),Mc("time",wc),Mc("timeCat",dc),Mc("quantize",_c),Mc("quantile",Sc);var Qc=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function Jc(t){return function(t){return Object(p.map)(t,(function(t,e){return[0===e?"M":"L",t[0],t[1]]}))}(t)}function tl(t,e,n,r){void 0===r&&(r=!0);var i=new gc({values:t}),o=new Nu({values:Object(p.map)(t,(function(t,e){return e}))}),a=Object(p.map)(t,(function(t,r){return[o.scale(r)*e,n-i.scale(t)*n]}));return r?function(t){if(t.length<=2)return Jc(t);var e=[];Object(p.each)(t,(function(t){Object(p.isEqual)(t,e.slice(e.length-2))||e.push(t[0],t[1])}));var n=Cu.a(e,!1),r=Object(p.head)(t),i=r[0],o=r[1];return n.unshift(["M",i,o]),n}(a):Jc(a)}function el(t,e,n,r){void 0===r&&(r=5);for(var i=new gc({values:t}),o=new Nu({values:Object(p.map)(t,(function(t,e){return e}))}),a=Object(p.map)(t,(function(t,r){return[o.scale(r)*e,n-i.scale(t)*n]})),s=[],u=0;u<a.length;u++){var c=a[u],l=rl({x:c[0],y:c[1],y0:n,size:r});s.push.apply(s,l)}return function(t,e){void 0===e&&(e=!0);var n=[],r=t[0];n.push(["M",r.x,r.y]);for(var i=1,o=t.length;i<o;i++)n.push(["L",t[i].x,t[i].y]);e&&(n.push(["L",r.x,r.y]),n.push(["z"]));return n}(s)}function nl(t,e,n,r){var i=Qc([],t,!0),o=function(t,e){var n=new gc({values:t}),r=Math.max(0,n.min);return e-n.scale(r)*e}(r,n);return i.push(["L",e,o]),i.push(["L",0,o]),i.push(["Z"]),i}function rl(t){var e,n,r,i,o=t.x,a=t.y,s=t.y0,u=t.size;Object(p.isArray)(a)?(e=a[0],n=a[1]):(e=s,n=a),Object(p.isArray)(o)?(r=o[0],i=o[1]):(r=o-u/2,i=o+u/2);var c=[{x:r,y:e},{x:r,y:n}];return c.push({x:i,y:n},{x:i,y:e}),c}var il=function(){return(il=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},ol={stroke:"#C5C5C5",strokeOpacity:.85},al={fill:"#CACED4",opacity:.85},sl=function(){function t(t){var e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.width,a=void 0===o?200:o,s=t.height,u=void 0===s?26:s,c=t.smooth,l=void 0===c||c,h=t.isArea,f=void 0!==h&&h,d=t.data,p=void 0===d?[]:d,g=t.lineStyle,v=t.areaStyle,m=t.group,y=t.interval,b=void 0===y?null:y;this.group=m,this.x=n,this.y=i,this.width=a,this.height=u,this.data=p,this.smooth=l,this.isArea=f,this.lineStyle=Object.assign({},ol,g),this.areaStyle=Object.assign({},al,v),this.intervalConfig=b,this.renderLine()}return t.prototype.renderLine=function(){var t=this,e=t.x,n=t.y,r=t.width,i=t.height,o=(t.barWidth,t.data),a=t.smooth,s=t.isArea,u=t.lineStyle,c=t.areaStyle,l=this.group.addGroup({name:"trend-group"});if(o){var h=tl(o,r,i,a);if(l.addShape("path",{attrs:il({path:h},u)}),s){var f=nl(h,r,i,o);l.addShape("path",{attrs:il({path:f},c)})}}this.intervalConfig&&l.addShape("path",{attrs:il({path:el(this.intervalConfig.data,r,i,this.intervalConfig.style.barWidth)},this.intervalConfig.style)}),l.move(e,n)},t.prototype.destory=function(){this.group.destroy()},t}(),ul=function(){return(ul=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},cl={fill:"#1890ff",stroke:"#1890ff",type:"trend",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#0050b3"},ll={fill:"#fff",stroke:"#1890ff",radius:2,opacity:1,cursor:"ew-resize"},hl=function(){function t(t){var e=t.group,n=t.name,r=t.type,i=t.x,o=void 0===i?0:i,a=t.y,s=void 0===a?0:a,u=t.width,c=void 0===u?2:u,l=t.height,h=void 0===l?24:l,f=t.style,d=void 0===f?{}:f;this.group=e,this.name=n,this.handleType=r,this.x=o,this.y=s,this.width=c,this.height=h,"trend"===r?this.style=ul(ul({},cl),d):"simple"===r&&(this.style=ul(ul({},ll),d)),this.renderHandle()}return t.prototype.setX=function(t){this.setXY(t,void 0)},t.prototype.setY=function(t){this.setXY(void 0,t)},t.prototype.setXY=function(t,e){Object(p.isNumber)(t)&&(this.x=t),Object(p.isNumber)(e)&&(this.y=e),this.updateXY()},t.prototype.renderHandle=function(){var t=this.width,e=this.height,n=this.style,r=this.name,i=n.fill,o=n.stroke,a=n.radius,s=n.opacity,u=n.cursor;this.handleGroup=this.group.addGroup(),"trend"===this.handleType?(this.verticalLine=this.handleGroup.addShape("rect",{attrs:{x:0,y:0,width:t,height:e,fill:i,stroke:o,radius:a,opacity:s,cursor:u},name:r+"-handler"}),this.topCircle=this.handleGroup.addShape("circle",{attrs:{x:t/2,y:0,r:2*t,fill:i,stroke:o,radius:a,opacity:s,cursor:u},name:r+"-handler"}),this.bottomCircle=this.handleGroup.addShape("circle",{attrs:{x:t/2,y:e,r:2*t,fill:i,stroke:o,radius:a,opacity:s,cursor:u},name:r+"-handler"})):"simple"===this.handleType&&(this.topCircle=this.handleGroup.addShape("circle",{attrs:{x:t/2,y:e/2,r:2*t,fill:i,stroke:o,radius:a,opacity:s,cursor:u,lineWidth:2},name:r+"-handler"})),this.updateXY(),"trend"===this.handleType?this.bindTrendEvents():"simple"===this.handleType&&this.bindSimpleEvents()},t.prototype.bindSimpleEvents=function(){var t=this,e=this.name;this.handleGroup.on(e+"-handler:mouseenter",(function(){var e=t.style.highLightFill;t.topCircle.attr("fill",e)})),this.handleGroup.on(e+"-handler:mouseleave",(function(){var e=t.style.fill;t.topCircle.attr("fill",e)}))},t.prototype.bindTrendEvents=function(){var t=this,e=this.name;this.handleGroup.on(e+"-handler:mouseenter",(function(){var e=t.style.highLightFill;t.verticalLine.attr("fill",e),t.topCircle.attr("fill",e),t.bottomCircle.attr("fill",e)})),this.handleGroup.on(e+"-handler:mouseleave",(function(){var e=t.style.fill;t.verticalLine.attr("fill",e),t.topCircle.attr("fill",e),t.bottomCircle.attr("fill",e)}))},t.prototype.show=function(){this.handleGroup.show()},t.prototype.hide=function(){this.handleGroup.hide()},t.prototype.updateXY=function(){this.handleGroup.setMatrix([1,0,0,0,1,0,this.x,this.y,1])},t}(),fl=function(){return(fl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},dl=function(){function t(t){this.config=Object(p.deepMix)({},t),this.init()}return t.prototype.update=function(t){this.config=Object(p.deepMix)({},this.config,t),this.updateElement(),this.renderMarker()},t.prototype.init=function(){this.initElement(),this.renderMarker()},t.prototype.initElement=function(){var t=this.config,e=t.group,n=t.style,r=n.scale,i=void 0===r?1:r,o=n.offsetX,a=void 0===o?0:o,s=n.offsetY,u=void 0===s?0:s,c=this.config.x+a,l=this.config.y+u,h=e.addGroup({name:"playPauseBtn"});this.startMarkerGroup=h.addGroup({name:"playPauseBtn"}),this.circle=e.addShape("circle",{attrs:fl({x:c,y:l,r:this.config.r*i},n),name:"playPauseBtn"}),this.startMarker=this.startMarkerGroup.addShape("path",{attrs:{path:this.getStartMarkerPath(c,l,i),fill:n.stroke||"#aaa"}}),this.pauseMarkerGroup=h.addGroup({name:"playPauseBtn"});var f=.25*this.config.r*i,d=.5*this.config.r*Math.sqrt(3)*i;this.pauseLeftMarker=this.pauseMarkerGroup.addShape("rect",{attrs:{x:c-.375*this.config.r*i,y:l-d/2,width:f,height:d,fill:n.stroke||"#aaa",lineWidth:0}}),this.pauseRightMarker=this.pauseMarkerGroup.addShape("rect",{attrs:{x:c+1/8*this.config.r*i,y:l-d/2,width:f,height:d,fill:n.stroke||"#aaa",lineWidth:0}})},t.prototype.updateElement=function(){var t=this.config.style,e=t.scale,n=void 0===e?1:e,r=t.offsetX,i=void 0===r?0:r,o=t.offsetY,a=void 0===o?0:o,s=this.config.x+i,u=this.config.y+a;this.circle.attr("x",s),this.circle.attr("y",u),this.circle.attr("r",this.config.r*n),this.startMarker.attr("path",this.getStartMarkerPath(s,u,n));var c=.25*this.config.r*n,l=.5*this.config.r*Math.sqrt(3)*n;this.pauseLeftMarker.attr("x",s-.375*this.config.r*n),this.pauseLeftMarker.attr("y",u-l/2),this.pauseLeftMarker.attr("width",c),this.pauseLeftMarker.attr("height",l),this.pauseRightMarker.attr("x",s+1/8*this.config.r*n),this.pauseRightMarker.attr("y",u-l/2),this.pauseRightMarker.attr("width",c),this.pauseRightMarker.attr("height",l)},t.prototype.renderMarker=function(){this.config.isPlay?(this.startMarkerGroup.hide(),this.pauseMarkerGroup.show()):(this.startMarkerGroup.show(),this.pauseMarkerGroup.hide())},t.prototype.getStartMarkerPath=function(t,e,n){var r=.5*this.config.r*Math.sqrt(3)*n;return[["M",t-r/Math.sqrt(3)/2,e-r/2],["L",t+r/Math.sqrt(3),e],["L",t-r/Math.sqrt(3)/2,e+r/2]]},t}(),pl=function(){return(pl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},gl=d.ext.transform,vl={fill:"#aaa",fillOpacity:.35,stroke:"#aaa"},ml={fill:"#fff"},yl={fill:"green"},bl={pointer:{fill:"#aaa",lineWidth:0},scroller:{stroke:"#aaa",fill:"#aaa",lineWidth:1,lineAppendWidth:5,cursor:"pointer"},text:{fill:"#aaa",textBaseline:"top"}},xl={check:{stroke:"green",lineWidth:3},box:{fill:"#fff",stroke:"#aaa",lineWidth:2,radius:3,width:12,height:12},text:{fill:"#aaa",fontSize:12,textBaseline:"top"}},wl={speed:1,loop:!1,fill:"#fff",stroke:"#fff",hideTimeTypeController:!1,preBtnStyle:{fill:"#aaa",stroke:"#aaa"},nextBtnStyle:{fill:"#aaa",stroke:"#aaa"},playBtnStyle:{fill:"#aaa",stroke:"#aaa",fillOpacity:.05},speedControllerStyle:bl,timeTypeControllerStyle:xl},_l=function(){function t(t){this.controllerCfg=Object(p.deepMix)({},wl,t),this.group=t.group,this.controllerGroup=this.group.addGroup({name:"controller-group"}),this.speedAxisY=[],this.currentSpeed=this.controllerCfg.speed,this.currentType="range",this.fontFamily=t.fontFamily||"Arial, sans-serif",this.init()}return t.prototype.init=function(){this.renderPlayButton()},t.prototype.getNextMarkerPath=function(t,e,n){return[["M",t,e-n],["L",t+n,e],["L",t,e+n],["Z",t,e-n],["M",t,e],["L",t-n,e-n],["L",t-n,e+n],["Z"]]},t.prototype.getPreMarkerPath=function(t,e,n){return[["M",t,e-n],["L",t-n,e],["L",t,e+n],["L",t,e-n],["M",t,e],["L",t+n,e-n],["L",t+n,e+n],["Z"]]},t.prototype.renderPlayButton=function(){var t=this.controllerCfg,e=t.width,n=t.height,r=t.x,i=t.y,o=t.hideTimeTypeController,a=t.fill,s=void 0===a?"#aaa":a,u=t.stroke,c=void 0===u?"green":u,l=pl(pl({},vl),t.playBtnStyle||{}),h=pl(pl({},ml),t.preBtnStyle||{}),f=pl(pl({},yl),t.nextBtnStyle||{}),d=n/2-5,p=i+10,g=this.controllerGroup.addShape("rect",{attrs:{x:r,y:p,width:e,height:n,stroke:c,fill:s},name:"container-rect"});this.playButton?this.playButton.update({x:e/2,y:p,r:d}):this.playButton=new dl({group:this.controllerGroup,x:e/2,y:p+d+5,r:d,isPlay:this.isPlay,style:l});var v=h.offsetX||0,m=h.offsetY||0,y=(h.scale||1)*d;this.controllerGroup.addShape("path",{attrs:pl({path:this.getPreMarkerPath(e/2-5*d+v,p+d+5+m,.5*y)},h),name:"preStepBtn"});var b=f.offsetX||0,x=f.offsetY||0,w=(f.scale||1)*d;this.controllerGroup.addShape("path",{attrs:pl({path:this.getNextMarkerPath(e/2+5*d+b,p+d+5+x,.5*w)},f),name:"nextStepBtn"}),g.toBack(),this.renderSpeedBtn(),o||this.renderToggleTime(),this.bindEvent();var _=this.controllerCfg.scale,S=void 0===_?1:_,E=this.controllerGroup.getCanvasBBox(),M=(E.maxX+E.minX)/2,O=(E.maxY+E.minY)/2,A=gl([1,0,0,0,1,0,0,0,1],[["t",-M,-O],["s",S,S],["t",M,O]]);this.controllerGroup.setMatrix(A)},t.prototype.renderSpeedBtn=function(){var t=this.controllerCfg,e=t.y,n=t.width,r=t.hideTimeTypeController,i=pl(pl({},bl),this.controllerCfg.speedControllerStyle||{}),o=i.scroller,a=void 0===o?{}:o,s=i.text,u=void 0===s?{}:s,c=i.pointer,l=void 0===c?{}:c,h=i.scale,f=void 0===h?1:h,d=i.offsetX,p=void 0===d?0:d,g=i.offsetY,v=void 0===g?0:g,m=this.controllerGroup.addGroup({name:"speed-group"});this.speedGroup=m;var y=[],b=5;this.speedAxisY=[19,22,26,32,39];for(var x=0;x<5;x++){var w=e+this.speedAxisY[x],_=n-(r?50:110);m.addShape("line",{attrs:pl({x1:_,x2:_+15,y1:w,y2:w},a),speed:b,name:"speed-rect"}),this.speedAxisY[x]=w,y.push(b),b-=1}this.speedText=m.addShape("text",{attrs:pl({x:n-(r?50:110)+20,y:this.speedAxisY[0]+4,text:"1.0X",fontFamily:this.fontFamily||"Arial, sans-serif"},u)}),this.speedPoint=m.addShape("path",{attrs:pl({path:this.getPointerPath(n-(r?50:110),0),matrix:[1,0,0,0,1,0,0,this.speedAxisY[4],1]},l)});var S=this.speedGroup.getCanvasBBox(),E=(S.maxX+S.minX)/2,M=(S.maxY+S.minY)/2,O=this.speedGroup.getMatrix()||[1,0,0,0,1,0,0,0,1];O=gl(O,[["t",-E,-M],["s",f,f],["t",E+p*f,M+v*f]]),this.speedGroup.setMatrix(O)},t.prototype.getPointerPath=function(t,e){return[["M",t,e],["L",t-10,e-4],["L",t-10,e+4],["Z"]]},t.prototype.renderToggleTime=function(){var t,e=this.controllerCfg.width,n=pl(pl({},xl),this.controllerCfg.timeTypeControllerStyle||{}),r=n.scale,i=void 0===r?1:r,o=n.offsetX,a=void 0===o?0:o,s=n.offsetY,u=void 0===s?0:s,c=n.box,l=void 0===c?{}:c,h=n.check,f=void 0===h?{}:h,d=n.text,p=void 0===d?{}:d;this.toggleGroup=this.controllerGroup.addGroup({name:"toggle-group"}),this.toggleGroup.addShape("rect",{attrs:pl({x:e-50,y:this.speedAxisY[0]+3.5},l),isChecked:!1,name:"toggle-model"}),this.checkedIcon=this.toggleGroup.addShape("path",{attrs:pl({path:[["M",e-50+3,this.speedAxisY[1]+6],["L",e-50+7,this.speedAxisY[1]+10],["L",e-50+12,this.speedAxisY[1]+4]]},f),capture:!1}),this.checkedIcon.hide(),this.checkedText=this.toggleGroup.addShape("text",{attrs:pl({text:(null===(t=this.controllerCfg)||void 0===t?void 0:t.timePointControllerText)||"单一时间",x:e-50+15,y:this.speedAxisY[0]+4,fontFamily:"undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},p)});var g=this.toggleGroup.getCanvasBBox(),v=(g.maxX+g.minX)/2,m=(g.maxY+g.minY)/2,y=this.toggleGroup.getMatrix()||[1,0,0,0,1,0,0,0,1];y=gl(y,[["t",-v,-m],["s",i,i],["t",v+a*i,m+u*i]]),this.toggleGroup.setMatrix(y)},t.prototype.bindEvent=function(){var t=this;this.speedGroup.on("speed-rect:click",(function(e){var n=e.target.attr("y1"),r=t.speedPoint.attr("matrix"),i=t.speedAxisY.indexOf(r[7]||0),o=t.speedAxisY.indexOf(n),a=t.speedAxisY[o]-t.speedAxisY[i];r=gl(r,[["t",0,a]]),t.speedPoint.setMatrix(r),t.currentSpeed=t.speedAxisY.length-o,t.speedText.attr("text",t.currentSpeed+".0X"),t.group.emit("timebarConfigChanged",{speed:t.currentSpeed,type:t.currentType})})),this.speedGroup.on("mousewheel",(function(e){e.preventDefault();var n=t.speedPoint.attr("matrix")||[1,0,0,0,1,0,0,0,1],r=n[7],i=t.speedAxisY.indexOf(r);if(-1===i){var o=1/0;t.speedAxisY.forEach((function(t,e){var n=Math.abs(t-r);o>n&&(o=n,i=e)}))}i=e.originalEvent.deltaY>0?Math.max(0,i-1):Math.min(t.speedAxisY.length-1,i+1);var a=t.speedAxisY[i]-r;n=gl(n,[["t",0,a]]),t.speedPoint.setMatrix(n),t.currentSpeed=t.speedAxisY.length-i,t.speedText.attr("text",t.currentSpeed+".0X"),t.group.emit("timebarConfigChanged",{speed:t.currentSpeed,type:t.currentType})})),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",(function(e){var n,r,i=e.target.get("isChecked");i?(t.checkedIcon.hide(),t.checkedText.attr("text",(null===(r=t.controllerCfg)||void 0===r?void 0:r.timePointControllerText)||"单一时间"),t.currentType="range"):(t.checkedIcon.show(),t.checkedText.attr("text",(null===(n=t.controllerCfg)||void 0===n?void 0:n.timeRangeControllerText)||"时间范围"),t.currentType="single"),e.target.set("isChecked",!i),t.group.emit("timebarConfigChanged",{type:t.currentType,speed:t.currentSpeed})}))},t.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},t}(),Sl=function(){return(Sl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},El={fill:"#416180",opacity:.05},Ml={fill:"#416180",opacity:.15,radius:5},Ol={fill:"#5B8FF9",opacity:.3,cursor:"grab"},Al={width:2,height:24},kl={textBaseline:"middle",fill:"#000",opacity:.45},Cl={textAlign:"center",textBaseline:"top",fill:"#607889",opacity:.35},Il={lineWidth:1,stroke:"#ccc"},Tl=function(){function t(t){var e=this;this.prevX=0,this.onMouseDown=function(t){return function(n){e.currentHandler=t;var r=n.originalEvent;r.stopPropagation(),r.preventDefault(),e.prevX=Object(p.get)(r,"touches.0.pageX",r.pageX);var i=e.canvas.get("container");i.addEventListener("mousemove",e.onMouseMove),i.addEventListener("mouseup",e.onMouseUp),i.addEventListener("mouseleave",e.onMouseUp),i.addEventListener("touchmove",e.onMouseMove),i.addEventListener("touchend",e.onMouseUp),i.addEventListener("touchcancel",e.onMouseUp)}},this.onMouseMove=function(t){t.stopPropagation(),t.preventDefault();var n=Object(p.get)(t,"touches.0.pageX",t.pageX),r=n-e.prevX,i=e.adjustOffsetRange(r/e.width);e.updateStartEnd(i),e.updateUI(),e.prevX=n},this.onMouseUp=function(){e.currentHandler&&(e.currentHandler=void 0);var t=e.canvas.get("container");t&&(t.removeEventListener("mousemove",e.onMouseMove),t.removeEventListener("mouseup",e.onMouseUp),t.removeEventListener("mouseleave",e.onMouseUp),t.removeEventListener("touchmove",e.onMouseMove),t.removeEventListener("touchend",e.onMouseUp),t.removeEventListener("touchcancel",e.onMouseUp))};var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.width,s=void 0===a?100:a,u=t.height,c=t.padding,l=void 0===c?10:c,h=t.trendCfg,f=t.controllerCfg,d=void 0===f?{speed:1}:f,g=t.backgroundStyle,v=void 0===g?{}:g,m=t.foregroundStyle,y=void 0===m?{}:m,b=t.handlerStyle,x=void 0===b?{}:b,w=t.textStyle,_=void 0===w?{}:w,S=t.start,E=void 0===S?0:S,M=t.end,O=void 0===M?1:M,A=t.minText,k=void 0===A?"":A,C=t.maxText,I=void 0===C?"":C,T=t.group,P=t.graph,N=t.canvas,j=t.tick,D=void 0===j?{tickLabelStyle:{},tickLineStyle:{},tickLabelFormatter:function(t){return t},ticks:[]}:j,L=t.type;this.graph=P,this.canvas=N,this.group=T,this.timeBarType=L,this.x=r,this.y=o,this.width=s,this.height=u,this.padding=l,this.ticks=D.ticks,this.trendCfg=h,this.controllerCfg=d,this.currentSpeed=d.speed||1,this.tickLabelFormatter=D.tickLabelFormatter,"trend"===L?this.backgroundStyle=Sl(Sl({},El),v):"simple"===L&&(this.backgroundStyle=Sl(Sl({},Ml),v)),this.foregroundStyle=Sl(Sl({},Ol),y),this.handlerStyle=Sl(Sl({},Al),x),this.textStyle=Sl(Sl({},kl),_),this.tickLabelStyle=Sl(Sl({},Cl),D.tickLabelStyle),this.tickLineStyle=Sl(Sl({},Il),D.tickLineStyle),this.currentMode="range",this.start=E,this.end=O,this.minText=k,this.maxText=I,this.fontFamily="undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif",this.renderSlider()}return t.prototype.update=function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.minText,a=t.maxText,s=t.start,u=t.end;this.start=Math.min(1,Math.max(s,0)),this.end=Math.min(1,Math.max(u,0)),Object(p.assign)(this,{x:e,y:n,width:r,height:i,minText:o,maxText:a}),this.updateUI()},t.prototype.setText=function(t,e){this.minTextShape.attr("text",t),this.maxTextShape.attr("text",e)},t.prototype.renderSlider=function(){var t=this,e=this.width,n=this.height,r=this.timeBarType;if("trend"===r&&Object(p.size)(Object(p.get)(this.trendCfg,"data"))){var i=new sl(Sl(Sl({x:this.x,y:this.y,width:e,height:n},this.trendCfg),{group:this.group}));this.trendComponent=i}var o=this.group.addGroup({name:"slider-group"});o.addShape("rect",{attrs:Sl({x:0,y:0,width:e,height:n},this.backgroundStyle)});var a=this.group.addGroup();"trend"===r?(this.minTextShape=a.addShape("text",{attrs:Sl({x:0,y:n/2+this.y,textAlign:"right",text:this.minText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif"},this.textStyle),capture:!1}),this.maxTextShape=a.addShape("text",{attrs:Sl({y:n/2+this.y,textAlign:"left",text:this.maxText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif"},this.textStyle),capture:!1})):(this.minTextShape=a.addShape("text",{attrs:Sl({x:0,y:this.y-10,textAlign:"center",text:this.minText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif"},this.textStyle),capture:!1}),this.maxTextShape=a.addShape("text",{attrs:Sl({y:this.y-10,textAlign:"center",text:this.maxText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif"},this.textStyle),capture:!1})),this.foregroundShape=this.group.addGroup().addShape("rect",{attrs:Sl({x:0,y:this.y,height:n},this.foregroundStyle)}),this.foregroundShape.on("mousedown",(function(t){t.target.attr("cursor","grabbing")})),this.foregroundShape.on("mouseup",(function(e){e.target.attr("cursor",t.foregroundStyle.cursor||"grab")}));var s=Object(p.get)(this.handlerStyle,"width",2),u=Object(p.get)(this.handlerStyle,"height",24),c=this.group.addGroup({name:"minHandlerShape"});this.minHandlerShape=new hl({name:"minHandlerShape",group:c,type:r,x:this.x,y:this.y,width:s,height:u,style:this.handlerStyle});var l=this.group.addGroup({name:"maxHandlerShape"});this.maxHandlerShape=new hl({name:"maxHandlerShape",group:l,type:r,x:this.x,y:this.y,width:s,height:u,style:this.handlerStyle});var h=this.ticks,f=e/(h.length-1);this.tickPosList=[],this.textList&&this.textList.length&&this.textList.forEach((function(t){t.destroy()}));var d=-1/0;this.textList=h.map((function(e,r){var i;t.tickPosList.push(t.x+r*f),t.tickLabelFormatter?(i=t.tickLabelFormatter(e),!Object(p.isString)(i)&&i&&(i=e.date)):i=e.date;var o=t.group.addShape("text",{attrs:Sl({x:t.x+r*f,y:t.y+n+5,text:i,fontFamily:t.fontFamily||"Arial, sans-serif"},t.tickLabelStyle)}),a=t.group.addShape("line",{attrs:Sl({x1:t.x+r*f,y1:t.y+n+2,x2:t.x+r*f,y2:t.y+n+6},t.tickLineStyle)});a.toBack();var s=o.getBBox();return s.minX>d?(o.show(),a.show(),d=s.minX+s.width+10):(o.hide(),a.hide()),o})),this.controllerBtnGroup=new _l(Sl({group:this.group,x:this.x,y:this.y+n+25,width:e,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),o.move(this.x,this.y),this.bindEvents()},t.prototype.bindEvents=function(){var t=this,e=this.group.find((function(t){return"minHandlerShape"===t.get("name")}));e&&(e.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),e.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var n=this.group.find((function(t){return"maxHandlerShape"===t.get("name")}));n&&(n.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),n.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("playPauseBtn:click",(function(){t.isPlay=!t.isPlay,t.currentHandler=t.maxHandlerShape,t.changePlayStatus()})),this.group.on("nextStepBtn:click",(function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(.01),t.updateUI()})),this.group.on("preStepBtn:click",(function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(-.01),t.updateUI()})),this.group.on("timebarConfigChanged",(function(e){var n=e.type,r=e.speed;t.currentSpeed=r,t.currentMode=n,"single"===n?(t.minHandlerShape.hide(),t.foregroundShape.hide(),t.minTextShape.hide()):"range"===n&&(t.minHandlerShape.show(),t.foregroundShape.show(),t.minTextShape.show())}))},t.prototype.adjustTickIndex=function(t){for(var e=0;e<this.tickPosList.length-1;e++)if(this.tickPosList[e]<=t&&t<=this.tickPosList[e+1])return Math.abs(this.tickPosList[e]-t)<Math.abs(t-this.tickPosList[e+1])?e:e+1;return 0},t.prototype.adjustOffsetRange=function(t){switch(this.currentHandler){case this.minHandlerShape:var e=0-this.start,n=1-this.start;return Math.min(n,Math.max(e,t));case this.maxHandlerShape:e=0-this.end,n=1-this.end;return Math.min(n,Math.max(e,t));case this.foregroundShape:e=0-this.start,n=1-this.end;return Math.min(n,Math.max(e,t));default:return 0}},t.prototype.updateStartEnd=function(t){var e=this.ticks[this.adjustTickIndex(this.start*this.width)],n=this.ticks[this.adjustTickIndex(this.end*this.width)];if(!this.currentHandler)return this.minText=this.tickLabelFormatter?this.tickLabelFormatter(e):e.date,void(this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(n):n.date);switch(this.currentHandler){case this.minHandlerShape:this.maxText=this.maxTextShape.attr("text"),this.start+=t,this.minText=this.tickLabelFormatter?this.tickLabelFormatter(e):e.date;break;case this.maxHandlerShape:this.minText=this.minTextShape.attr("text"),this.end+=t,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(n):n.date;break;case this.foregroundShape:this.start+=t,this.end+=t,this.minText=this.tickLabelFormatter?this.tickLabelFormatter(e):e.date,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(n):n.date}},t.prototype.updateUI=function(){var t=this;this.start<0&&(this.start=0),this.end>1&&(this.end=1);var e=this.x+this.start*this.width,n=this.x+this.end*this.width;this.foregroundShape.attr("x",e),this.foregroundShape.attr("width",n-e);var r=Object(p.get)(this.handlerStyle,"width",2);this.setText(this.minText,this.maxText);var i=this.dodgeText([e,n]),o=i[0],a=i[1];this.minHandlerShape.setX(e-r/2),Object(p.each)(o,(function(e,n){return t.minTextShape.attr(n,e)})),this.maxHandlerShape.setX(n-r/2),Object(p.each)(a,(function(e,n){return t.maxTextShape.attr(n,e)})),"range"===this.currentMode?this.graph.emit("valuechange",{value:[this.start,this.end].sort()}):"single"===this.currentMode&&this.graph.emit("valuechange",{value:[this.end,this.end]})},t.prototype.dodgeText=function(t){var e,n,r=Object(p.get)(this.handlerStyle,"width",2),i=this.minTextShape,o=this.maxTextShape,a=t[0],s=t[1],u=!1;a>s&&(a=(e=[s,a])[0],s=e[1],i=(n=[o,i])[0],o=n[1],u=!0);var c=i.getBBox(),l=o.getBBox(),h=null,f=null;return"trend"===this.timeBarType?(h=a-c.width<this.x+2?{x:a+r/2+2,textAlign:"left"}:{x:a-r/2-2,textAlign:"right"},f=s+l.width>this.x+this.width?{x:s-r/2-2,textAlign:"right"}:{x:s+r/2+2,textAlign:"left"}):"simple"===this.timeBarType&&(h=c.width>a-2?{x:a+r/2+2,textAlign:"center"}:{x:a-r/2-2,textAlign:"center"},f=l.width>this.width-s-2?{x:s-r/2-2,textAlign:"center"}:{x:s+r/2+2,textAlign:"center"}),u?[f,h]:[h,f]},t.prototype.startPlay=function(){var t=this;return"undefined"!=typeof window?window.requestAnimationFrame((function(){var e=t,n=e.ticks,r=e.width,i=t.currentSpeed,o=r/n.length/(1e3*(10-i)/60),a=t.adjustOffsetRange(o/t.width);t.updateStartEnd(a),t.updateUI(),t.isPlay&&(t.playHandler=t.startPlay())})):void 0},t.prototype.changePlayStatus=function(t){void 0===t&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit("timebarstartplay",null)):this.playHandler&&("undefined"!=typeof window&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit("timebarendplay",null))},t.prototype.destory=function(){this.graph.off("valuechange");var t=this.group,e=t.find((function(t){return"minHandlerShape"===t.get("name")}));e&&(e.off("minHandlerShape-handler:mousedown"),e.off("minHandlerShape-handler:touchstart"),e.destroy());var n=t.find((function(t){return"maxHandlerShape"===t.get("name")}));n&&(n.off("maxHandlerShape-handler:mousedown"),n.off("maxHandlerShape-handler:touchstart"),n.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),t.off("playPauseBtn:click"),t.off("nextStepBtn:click"),t.off("preStepBtn:click"),t.off("timebarConfigChanged"),t.destroy(),this.trendComponent&&this.trendComponent.destory()},t}(),Pl=function(){function t(t){var e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.container,a=t.text,s=t.padding,u=void 0===s?[4,4,4,4]:s,c=t.className,l=void 0===c?"g6-component-timebar-tooltip":c,h=t.backgroundColor,f=void 0===h?"#000":h,d=t.textColor,p=void 0===d?"#fff":d,g=t.opacity,v=void 0===g?.8:g,m=t.fontSize,y=void 0===m?12:m;this.container=o,this.className=l,this.backgroundColor=f,this.textColor=p,this.x=n,this.y=i,this.text=a,this.padding=u,this.opacity=v,this.fontSize=y,this.render()}return t.prototype.render=function(){var t=this.className,e=(this.x,this.y,this.backgroundColor),n=this.textColor,r=this.text,i=this.padding,o=this.opacity,a=this.fontSize,s=this.container,u=R("<div class='"+t+"' style=\"position: absolute; width: fit-content; height: fit-content; opacity: "+o+'"></div>');Object(p.isString)(s)&&(s=document.getElementById(s)),s.appendChild(u),this.parentHeight=s.offsetHeight,this.parentWidth=s.offsetWidth,B(u,{visibility:"hidden",top:0,left:0});var c=R("\n <div style='position: absolute; white-space:nowrap; background-color: "+e+"; font-size: "+a+"px; border-radius: 4px; width: fit-content; height: fit-content; color: "+n+"; padding: "+i[0]+"px "+i[1]+"px "+i[2]+"px "+i[3]+"px'></div>");c.innerHTML=r,u.appendChild(c),this.backgroundDOM=c;var l=R("<div style='position: absolute; width: 0px; height: 0px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 10px solid "+e+"'></div>");u.appendChild(l),this.arrowDOM=l,this.container=u},t.prototype.show=function(t){var e=t.text,n=t.x;t.y,t.clientX,t.clientY;this.backgroundDOM.innerHTML=e;var r=this.backgroundDOM.offsetWidth,i=this.backgroundDOM.offsetHeight,o=this.arrowDOM.offsetWidth,a=this.arrowDOM.offsetHeight;B(this.container,{top:-i-a+"px",left:n+"px",visibility:"visible"}),B(this.backgroundDOM,{marginLeft:-r/2+"px"}),B(this.arrowDOM,{marginLeft:-o/2+"px",top:i+"px"});var s=n-r/2,u=n+r/2;s<0?B(this.backgroundDOM,{marginLeft:-r/2-s+"px"}):u>this.parentWidth&&B(this.backgroundDOM,{marginLeft:-r/2-u+this.parentWidth+12+"px"})},t.prototype.hide=function(){B(this.container,{top:0,left:0,visibility:"hidden"})},t}(),Nl=function(){return(Nl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},jl={fill:"#5B8FF9"},Dl={fill:"#e6e8e9"},Ll=function(){function t(t){this.frameCount=0,this.fontFamily="Arial, sans-serif";var e=t.graph,n=t.canvas,r=t.group,i=t.width,o=t.height,a=t.padding,s=t.data,u=t.start,c=t.end,l=t.x,h=void 0===l?0:l,f=t.y,d=void 0===f?0:f,p=t.tickLabelFormatter,g=t.selectedTickStyle,v=void 0===g?jl:g,m=t.unselectedTickStyle,y=void 0===m?Dl:m,b=t.tooltipBackgroundColor,x=t.tooltipFomatter;this.graph=e,this.group=r,this.sliceGroup=r.addGroup({name:"slice-group"}),this.canvas=n,this.width=i,this.height=o,this.padding=a,this.data=s,this.start=u,this.end=c,this.tickLabelFormatter=p,this.selectedTickStyle=v,this.unselectedTickStyle=y,this.x=h,this.y=d,this.tooltipBackgroundColor=b,this.tooltipFomatter=x,this.fontFamily="undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif",this.renderSlices(),this.initEvent()}return t.prototype.renderSlices=function(){var t=this,e=this,n=e.width,r=e.height,i=e.padding,o=e.data,a=e.start,s=e.end,u=e.tickLabelFormatter,c=e.selectedTickStyle,l=e.unselectedTickStyle,h=n-2*i,f=r-(3*i+4+10)-2*i,d=o.length,g=(h-2*(d-1))/d;this.tickWidth=g;var v=this.sliceGroup,m=[],y=[],b=Math.round(d*a),x=Math.round(d*s);this.startTickRectId=b,this.endTickRectId=x,o.forEach((function(e,r){var o=r>=b&&r<=x?c:l,a=v.addShape("rect",{attrs:Nl({x:i+r*(g+2),y:i,width:g,height:f},o),draggable:!0,name:"tick-rect-"+r}),s=v.addShape("rect",{attrs:{x:i+r*g+2*(2*r-1)/2,y:i,width:0===r||r===d-1?g+1:g+2,height:f,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-"+r});s.toFront();var h,w=a.getBBox(),_=(w.minX+w.maxX)/2;if(m.push({rect:a,pickRect:s,value:e.date,x:_,y:w.minY}),u?(h=u(e),!Object(p.isString)(h)&&h&&(h=e.date)):r%Math.round(d/10)==0&&(h=e.date),h){y.push(h);var S=w.maxY+2*i;v.addShape("line",{attrs:{stroke:"#BFBFBF",x1:_,y1:S,x2:_,y2:S+4}});var E=S+4+i,M=v.addShape("text",{attrs:{fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:_,y:E,textAlign:"center",text:h,textBaseline:"top",fontSize:10,fontFamily:t.fontFamily||"Arial, sans-serif"},capture:!1}),O=M.getBBox();O.maxX>n?M.attr("textAlign","right"):O.minX<0&&M.attr("textAlign","left")}})),this.tickRects=m;var w=this.group;this.currentSpeed=1,this.controllerBtnGroup=new _l({group:w,x:this.x,y:this.y+r+5,width:n,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"})},t.prototype.initEvent=function(){var t=this,e=this.sliceGroup;e.on("click",(function(e){var n=e.target;if("rect"===n.get("type")&&n.get("name")){var r=parseInt(n.get("name").split("-")[2],10);if(!isNaN(r)){var i=t.tickRects,o=t.unselectedTickStyle;i.forEach((function(t){t.rect.attr(o)}));var a=t.selectedTickStyle;i[r].rect.attr(a),t.startTickRectId=r,t.endTickRectId=r;var s=r/i.length;t.graph.emit("valuechange",{value:[s,s]})}}})),e.on("dragstart",(function(e){var n=t.tickRects,r=t.unselectedTickStyle;n.forEach((function(t){t.rect.attr(r)}));var i=e.target,o=parseInt(i.get("name").split("-")[2],10),a=t.selectedTickStyle;n[o].rect.attr(a),t.startTickRectId=o;var s=o/n.length;t.graph.emit("valuechange",{value:[s,s]}),t.dragging=!0})),e.on("dragover",(function(e){if(t.dragging&&"rect"===e.target.get("type")){for(var n=parseInt(e.target.get("name").split("-")[2],10),r=t.startTickRectId,i=t.tickRects,o=t.selectedTickStyle,a=t.unselectedTickStyle,s=0;s<i.length;s++){var u=s>=r&&s<=n?o:a;i[s].rect.attr(u)}var c=i.length;t.endTickRectId=n;var l=r/c,h=n/c;t.graph.emit("valuechange",{value:[l,h]})}})),e.on("drop",(function(e){if(t.dragging&&(t.dragging=!1,"rect"===e.target.get("type"))){var n=t.startTickRectId,r=parseInt(e.target.get("name").split("-")[2],10);if(!(r<n)){var i=t.selectedTickStyle,o=t.tickRects;o[r].rect.attr(i),t.endTickRectId=r;var a=o.length,s=n/a,u=r/a;t.graph.emit("valuechange",{value:[s,u]})}}}));var n=this.tooltipBackgroundColor,r=this.tooltipFomatter,i=this.canvas,o=new Pl({container:i.get("container"),backgroundColor:n}),a=this.tickRects;a.forEach((function(t){var e=t.pickRect;e.on("mouseenter",(function(t){var e=t.target;if("rect"===e.get("type")){var n=parseInt(e.get("name").split("-")[2],10),s=i.getClientByPoint(a[n].x,a[n].y);o.show({x:a[n].x,y:a[n].y,clientX:s.x,clientY:s.y,text:r?r(a[n].value):a[n].value})}})),e.on("mouseleave",(function(t){o.hide()}))}));var s=this.group;s.on("playPauseBtn:click",(function(){t.isPlay=!t.isPlay,t.changePlayStatus()})),s.on("nextStepBtn:click",(function(){t.updateStartEnd(1)})),s.on("preStepBtn:click",(function(){t.updateStartEnd(-1)})),s.on("timebarConfigChanged",(function(e){e.type;var n=e.speed;t.currentSpeed=n}))},t.prototype.changePlayStatus=function(t){void 0===t&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit("timebarstartplay",null)):this.playHandler&&("undefined"!=typeof window&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit("timebarendplay",null))},t.prototype.startPlay=function(){var t=this;return"undefined"!=typeof window?window.requestAnimationFrame((function(){var e=t.currentSpeed;t.frameCount%(60/e)==0&&(t.frameCount=0,t.updateStartEnd(1)),t.frameCount++,t.isPlay&&(t.playHandler=t.startPlay())})):void 0},t.prototype.updateStartEnd=function(t){var e=this.tickRects,n=e.length,r=this.unselectedTickStyle,i=this.selectedTickStyle,o=this.endTickRectId;if(t>0?this.endTickRectId++:(e[this.endTickRectId].rect.attr(r),this.endTickRectId--),o!==this.startTickRectId)this.endTickRectId<this.startTickRectId&&(this.startTickRectId=this.endTickRectId);else{for(var a=this.startTickRectId;a<=this.endTickRectId-1;a++)e[a].rect.attr(r);this.startTickRectId=this.endTickRectId}if(e[this.endTickRectId]){e[this.endTickRectId].rect.attr(i);var s=this.startTickRectId/n,u=this.endTickRectId/n;this.graph.emit("valuechange",{value:[s,u]})}},t.prototype.destory=function(){this.graph.off("valuechange");var t=this.sliceGroup;t.off("click"),t.off("dragstart"),t.off("dragover"),t.off("drop"),this.tickRects.forEach((function(t){var e=t.pickRect;e.off("mouseenter"),e.off("mouseleave")})),this.tickRects.length=0,t.off("playPauseBtn:click"),t.off("nextStepBtn:click"),t.off("preStepBtn:click"),t.off("timebarConfigChanged"),this.sliceGroup.destroy()},t}(),Rl=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])})(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)}}(),Bl=function(){return(Bl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},Gl=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},Fl=function(t){function e(e){return t.call(this,e)||this}return Rl(e,t),e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-component-timebar",padding:10,type:"trend",trend:{data:[],isArea:!1,smooth:!0},controllerCfg:{speed:1,loop:!1},slider:{start:.1,end:.9,minText:"min",maxText:"max"},tick:{start:.1,end:.9,data:[]},textStyle:{},filterEdge:!1}},e.prototype.initContainer=function(){var t,e,n=this.get("graph"),r=this._cfgs,i=r.width,o=r.height,a=this.get("className")||"g6-component-timebar",s=this.get("container"),u=this.get("graph").get("container");s?(Object(p.isString)(s)&&(s=document.getElementById(s)),t=s):B(t=R("<div class='"+a+"'></div>"),{position:"relative"}),u.appendChild(t),this.set("timeBarContainer",t),e="SVG"===n.get("renderer")?new f.Canvas({container:t,width:i,height:o}):new h.Canvas({container:t,width:i,height:o}),this.set("canvas",e)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas").addGroup({name:"timebar-group"});this.set("timeBarGroup",t),this.renderTrend(),this.initEvent();var e="undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",e)},e.prototype.renderTrend=function(){var t=this._cfgs,e=t.width,n=t.x,r=t.y,i=t.padding,o=t.type,a=t.trend,s=t.slider,u=t.controllerCfg,c=t.textStyle,l=t.tick,h=t.backgroundStyle,f=t.foregroundStyle,d=a.data,p=Gl(a,["data"]),g=e-2*i,v="trend"===o?26:4,m=this.get("graph"),y=this.get("timeBarGroup"),b=this.get("canvas"),x=null;"trend"===o||"simple"===o?x=new Tl(Bl(Bl({graph:m,canvas:b,group:y,type:o,x:n+i,y:"trend"===o?r+i:r+i+15,width:g,height:v,padding:i,backgroundStyle:h,foregroundStyle:f,trendCfg:Bl(Bl({},p),{data:d.map((function(t){return t.value}))})},s),{tick:{ticks:d,tickLabelFormatter:l.tickLabelFormatter,tickLabelStyle:l.tickLabelStyle,tickLineStyle:l.tickLineStyle},handlerStyle:Bl(Bl({},s.handlerStyle),{height:s.height||v}),controllerCfg:u,textStyle:c})):"tick"===o&&(x=new Ll(Bl({graph:m,canvas:b,group:y,x:n+i,y:r+i},l))),this.set("timebar",x)},e.prototype.filterData=function(t){var e,n=t.value,r=null,i=this._cfgs.type;if("trend"===i||"simple"===i?r=this._cfgs.trend.data:"tick"===i&&(r=this._cfgs.tick.data),r&&0!==r.length){var o=this.get("rangeChange"),a=this.get("graph"),s=Math.round(r.length*n[0]),u=Math.round(r.length*n[1]);u=u>=r.length?r.length-1:u,s=s>=r.length?r.length-1:s;var c=null===(e=this._cfgs.tick)||void 0===e?void 0:e.tickLabelFormatter,l=c?c(r[s]):r[s].date,h=c?c(r[u]):r[u].date;if("tick"!==i)this.get("timebar").setText(l,h);if(o)o(a,l,h);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&0===this.cacheGraphData.nodes.length)&&(this.cacheGraphData=a.get("data"));var f=this.cacheGraphData.nodes.filter((function(t){return t.date>=r[s].date&&t.date<=r[u].date})),d=f.map((function(t){return t.id})),p=[];this.cacheGraphData.edges&&(p=this.cacheGraphData.edges.filter((function(t){return d.includes(t.source)&&d.includes(t.target)})),this.get("filterEdge")&&(p=p.filter((function(t){return t.date>=r[s].date&&t.date<=r[u].date})))),a.changeData({nodes:f,edges:p})}}else console.warn("请配置 TimeBar 组件的数据")},e.prototype.initEvent=function(){var t=this,e=0,n=0,r=this._cfgs.type;r&&"trend"!==r&&"simple"!==r?"tick"===r&&(e=this._cfgs.tick.start,n=this._cfgs.tick.end):(e=this._cfgs.slider.start,n=this._cfgs.slider.end);var i=this.get("graph");i.on("afterrender",(function(r){t.filterData({value:[e,n]})})),i.on("valuechange",Object(p.throttle)((function(e){t.filterData(e)}),200,{trailing:!0,leading:!0}))},e.prototype.destroy=function(){var e=this.get("timebar");e&&e.destory&&e.destory(),t.prototype.destroy.call(this);var n=this.get("timeBarContainer");if(n){var r=this.get("container");r||(r=this.get("graph").get("container")),Object(p.isString)(r)&&(r=document.getElementById(r)),r.removeChild(n)}},e}(iu),zl=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])})(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)}}(),Ul=u.Util.applyMatrix;var Vl=function(t){function e(e){return t.call(this,e)||this}return zl(e,t),e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,e=this._cfgs,n=e.graph;if(!this.destroyed){var r=this.get("container");Object(p.isString)(r)&&(r=document.getElementById(r));var i=R("<div class="+e.viewportClassName+"\n style='position:absolute;\n left:0;\n top:0;\n box-sizing:border-box;\n border: 2px solid #1980ff'>\n </div>"),o=0,a=0,s=!1,u=0,c=0,l=0,h=0,f=0,d=0;r.addEventListener("mousedown",(function(r){if(e.refresh=!1,r.target===i){var u=i.style;l=parseInt(u.width,10),h=parseInt(u.height,10);var c=t.get("width"),p=t.get("height");l>c||h>p||(d=n.getZoom(),f=t.get("ratio"),s=!0,o=r.clientX,a=r.clientY)}}),!1),r.addEventListener("mousemove",(function(e){if(s&&!Object(p.isNil)(e.clientX)&&!Object(p.isNil)(e.clientY)){var r=t.get("width"),g=t.get("height"),v=i.style;u=parseInt(v.left,10),c=parseInt(v.top,10),l=parseInt(v.width,10),h=parseInt(v.height,10);var m=o-e.clientX,y=a-e.clientY;u-m<0?m=u:u-m+l>=r&&(m=0),c-y<0?y=c:c-y+h>=g&&(y=0),B(i,{left:(u-=m)+"px",top:(c-=y)+"px"}),n.translate(m*d/f,y*d/f),o=e.clientX,a=e.clientY}}),!1),r.addEventListener("mouseleave",(function(){s=!1,e.refresh=!0}),!1),r.addEventListener("mouseup",(function(){s=!1,e.refresh=!0}),!1),this.set("viewport",i),r.appendChild(i)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("width"),n=this.get("height"),r=this.get("graph"),i=r.get("width"),o=i/r.get("height"),a=r.getGroup(),s=a.getCanvasBBox(),u=[(s.minX+s.maxX)/2,(s.minY+s.maxY)/2],c=[s.maxX-s.minX,s.maxY-s.minY],l={centerX:u[0],centerY:u[1],width:0,height:0,minX:0,minY:0};s[0]/s[1]>o?(l.width=c[0],l.height=l.width/o):(l.height=c[1],l.width=l.height*o),l.minX=u[0]-l.width/2,l.minY=u[1]-l.height/2;var h=a.getMatrix();h||(h=[1,0,0,0,1,0,0,0,1]);var f=d.mat3.invert([1,0,0,0,1,0,0,0,1],h),p=Ul({x:l.minX,y:l.minY},f),g=r.getCanvasByPoint(p.x,p.y),v=this.get("viewport");v||this.initViewport();var m=i/l.width,y=m*e,b=m*n,x=e*-g.x/l.width,w=n*-g.y/l.height,_=x+y,S=w+b;x<0&&(y+=x,x=0),_>e&&(y-=_-e),w<0&&(b+=w,w=0),S>n&&(b-=S-n),this.set("ratio",t),B(v,{left:x+"px",top:w+"px",width:y+"px",height:b+"px"})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this.get("graph"),e=t.get("width"),n=t.get("height")/e,r=this.get("className"),i=this.get("container"),o=this.get("width"),a=this.get("height");o||a||(o=200),o?(a=n*o,this.set("height",a)):(o=1/n*a,this.set("width",o));var s=R("<div class='"+r+"' style='width: "+o+"px; height: "+a+"px; overflow: hidden; position: relative;'></div>");Object(p.isString)(i)&&(i=document.getElementById(i)),i?i.appendChild(s):t.get("container").appendChild(s),this.set("container",s);var u=R('<div class="g6-minimap-container" style="position: relative; width: 100%; height: 100%; text-align: center; display: table;"></div>');s.appendChild(u);var c=R('<span style="display: table-cell; vertical-align: middle; "></span>');u.appendChild(c),this.set("containerDOM",u),this.set("containerSpan",c);var l=R('<img alt="" src="'+this.get("graphImg")+'" style="display: inline-block; user-select: none;" draggable="false" />');this.set("imgDOM",l),this.updateImgSize(),c.appendChild(l),this.updateCanvas()},e.prototype.updateImgSize=function(){var t=this.get("imgDOM"),e=this.get("width"),n=this.get("height");t.onload=function(){var r=function(t,e){var n,r;if(t.naturalWidth)n=t.naturalWidth,r=t.naturalHeight;else{var i=new Image;i.src=t.src,i.onload=function(){e&&e(i.width,i.height)}}return[n,r]}(t);r[0]>r[1]?t.width=e:t.height=n}},e.prototype.updateCanvas=function(){if(this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("width")/t.get("canvas").getCanvasBBox().width;this.set("ratio",e),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){this.get("imgDOM").remove(),this.set("graphImg",t);var e=R('<img alt="" src="'+t+'" style="display: inline-block;" ondragstart="return false;" onselectstart="return false;"/>');this.set("imgDOM",e),e.src=t,this.updateImgSize(),this.get("containerSpan").appendChild(e),this.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(iu),Wl=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])})(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)}}(),Yl=function(){return(Yl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},Xl=u.Util.distance,Hl={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:1,fill:"#fff"},ql=function(t){function e(e){return t.call(this,e)||this}return Wl(e,t),e.prototype.getDefaultCfgs=function(){return{type:"both",trigger:"mousemove",r:60,delegateStyle:Object(p.clone)(Hl),showLabel:"edge",scaleRBy:"wheel"}},e.prototype.getEvents=function(){var t;switch(this.get("trigger")){case"click":t={click:"filter"};break;case"drag":t={click:"createDelegate"};break;default:t={mousemove:"filter"}}return t},e.prototype.init=function(){var t=this.get("showLabel"),e="node"===t||"both"===t,n="edge"===t||"both"===t;this.set("showNodeLabel",e),this.set("showEdgeLabel",n),this.get("shouldShow")||this.set("shouldShow",(function(){return!0}))},e.prototype.createDelegate=function(t){var e=this,n=e.get("delegate");n&&!n.destroyed||(e.filter(t),(n=e.get("delegate")).on("dragstart",(function(t){})),n.on("drag",(function(t){e.filter(t)})),"wheel"===this.get("scaleRBy")&&n.on("mousewheel",(function(t){e.scaleRByWheel(t)})))},e.prototype.scaleRByWheel=function(t){if(t&&t.originalEvent){t.preventDefault&&t.preventDefault();var e,n=this.get("graph"),r=this.get("delegate");(r?{x:r.attr("x"),y:r.attr("y")}:void 0)||n.getPointByClient(t.clientX,t.clientY);e=t.originalEvent.wheelDelta<0?.95:1/.95;var i=this.get("maxR"),o=this.get("minR"),a=this.get("r");(a>(i||n.get("height"))&&e>1||a<(o||.05*n.get("height"))&&e<1)&&(e=1),a*=e,this.set("r",a),this.filter(t)}},e.prototype.filter=function(t){var e=this.get("graph"),n=e.getNodes(),r={},i=this.get("r"),o=this.get("type"),a={x:t.x,y:t.y};this.updateDelegate(a,i);var s=this.get("shouldShow"),u=this.get("vShapes");u&&u.forEach((function(t){t.remove(),t.destroy()})),u=[],n.forEach((function(t){var e=t.getModel(),n=e.x,o=e.y;Xl({x:n,y:o},a)<i&&(r[e.id]=t)}));var c=e.getEdges(),l=[];c.forEach((function(t){var e=t.getModel(),n=e.source,i=e.target;s(e)&&("only-source"===o||"one"===o?r[n]&&!r[i]&&l.push(t):"only-target"===o||"one"===o?r[i]&&!r[n]&&l.push(t):"both"===o&&r[n]&&r[i]&&l.push(t))}));var h=this.get("showNodeLabel"),f=this.get("showEdgelabel"),d=e.get("group");l.forEach((function(t){t.get("group").get("children").forEach((function(t){var e=t.get("type"),n=d.addShape(e,{attrs:t.attr()});u.push(n),h&&"text"===e&&n.set("visible",!0)}))})),Object.keys(r).forEach((function(t){var e=r[t].get("group").clone();if(d.add(e),u.push(e),f)for(var n=e.get("children"),i=0;i<n.length;i++){var o=n[i];"text"===o.get("type")&&o.set("visible",!0)}})),this.set("vShapes",u)},e.prototype.updateParams=function(t){var e=t.r,n=t.trigger,r=t.minR,i=t.maxR,o=t.scaleRBy,a=t.showLabel,s=t.shouldShow;if(isNaN(t.r)||this.set("r",e),isNaN(i)||this.set("maxR",i),isNaN(r)||this.set("minR",r),"mousemove"!==n&&"click"!==n||this.set("trigger",n),"wheel"===o||"unset"===o){this.set("scaleRBy",o),this.get("delegate").remove(),this.get("delegate").destroy();var u=this.get("dPercentText");u&&(u.remove(),u.destroy())}"node"!==a&&"both"!==a||this.set("showNodeLabel",!0),"edge"!==a&&"both"!==a||this.set("showEdgeLabel",!0),s&&this.set("shouldShow",s)},e.prototype.updateDelegate=function(t,e){var n=this,r=n.get("graph"),i=n.get("delegate");if(!i||i.destroyed){var o=r.get("group"),a=n.get("delegateStyle")||Hl;i=o.addShape("circle",{attrs:Yl({r:e,x:t.x,y:t.y},a),name:"lens-shape",draggable:!0}),"drag"!==this.get("trigger")&&"wheel"===this.get("scaleRBy")&&i.on("mousewheel",(function(t){n.scaleRByWheel(t)}))}else i.attr({x:t.x,y:t.y,r:e});n.set("delegate",i)},e.prototype.clear=function(){var t=this.get("vShapes");t&&t.forEach((function(t){t.remove(),t.destroy()})),t=[],this.set("vShapes",t);var e=this.get("delegate");e&&!e.destroyed&&(e.remove(),e.destroy())},e.prototype.destroy=function(){this.clear()},e}(iu),Kl=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])})(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)}}(),Zl=u.Util.pointLineDistance,$l={stroke:"#FA8C16",lineWidth:1},Ql=function(t){function e(e){return t.call(this,e)||this}return Kl(e,t),e.prototype.getDefaultCfgs=function(){return{line:$l,itemAlignType:"center",tolerance:5,horizontalLines:{},verticalLines:{},alignLines:[]}},e.prototype.init=function(){},e.prototype.getEvents=function(){return{"node:dragstart":"onDragStart","node:drag":"onDrag","node:dragend":"onDragEnd"}},e.prototype.onDragStart=function(){this.initBoxLine()},e.prototype.onDrag=function(t){var e=t.item,n=(e.get("delegateShape")||e).getBBox(),r=e.getModel(),i=r.x-n.x,o=r.y-n.y;this.show({x:n.minX+i,y:n.minY+o},{width:n.width,height:n.height})},e.prototype.onDragEnd=function(){this.destory()},e.prototype.initBoxLine=function(){var t=this._cfgs,e=t.horizontalLines,n=t.verticalLines,r=t.itemAlignType;this.get("graph").getNodes().forEach((function(t){var i=t.getBBox(),o=t.get("id");!0===r||"horizontal"===r?(e[o+"tltr"]=[i.minX,i.minY,i.maxX,i.minY,t],e[o+"lcrc"]=[i.minX,i.centerY,i.maxX,i.centerY,t],e[o+"blbr"]=[i.minX,i.maxY,i.maxX,i.maxY,t]):"center"===r&&(e[o+"lcrc"]=[i.minX,i.centerY,i.maxX,i.centerY,t]),!0===r||"vertical"===r?(n[o+"tlbl"]=[i.minX,i.minY,i.minX,i.maxY,t],n[o+"tcbc"]=[i.centerX,i.minY,i.centerX,i.maxY,t],n[o+"trbr"]=[i.maxX,i.minY,i.maxX,i.maxY,t]):"center"===r&&(n[o+"tcbc"]=[i.centerX,i.minY,i.centerX,i.maxY,t])}))},e.prototype.show=function(t,e){var n=Object(p.mix)({},t);return this.itemAlign(t,e,n),t},e.prototype.itemAlign=function(t,e,n){var r=this,i=this._cfgs,o=i.horizontalLines,a=i.verticalLines,s=i.tolerance,u={x:n.x+e.width/2,y:n.y},c={x:n.x+e.width/2,y:n.y+e.height/2},l={x:n.x+e.width/2,y:n.y+e.height},h={x:n.x,y:n.y+e.height/2},f={x:n.x+e.width,y:n.y+e.height/2},d=[],g=[],v=null;if(this.clearAlignLine(),Object(p.each)(o,(function(t){t[4].isVisible&&(d.push(r.getLineDisObject(t,u)),d.push(r.getLineDisObject(t,c)),d.push(r.getLineDisObject(t,l)))})),Object(p.each)(a,(function(t){t[4].isVisible&&(g.push(r.getLineDisObject(t,h)),g.push(r.getLineDisObject(t,c)),g.push(r.getLineDisObject(t,f)))})),d.sort((function(t,e){return t.dis-e.dis})),g.sort((function(t,e){return t.dis-e.dis})),0!==d.length&&d[0].dis<s){t.y=d[0].line[1]-d[0].point.y+n.y,v={type:"item",horizontals:[d[0]]};for(var m=1;m<3;m++)d[0].dis===d[m].dis&&v.horizontals.push(d[m])}if(0!==g.length&&g[0].dis<s){t.x=g[0].line[0]-g[0].point.x+n.x,v?v.verticals=[g[0]]:v={type:"item",verticals:[g[0]]};for(m=1;m<3;m++)g[0].dis===g[m].dis&&v.verticals.push(g[m])}v&&(v.bbox=e,this.addAlignLine(v))},e.prototype.addAlignLine=function(t){var e=t.bbox,n=t.type,r=t.horizontals,i=t.verticals,o=this._cfgs,a=o.line,s=o.alignLines,u=this.get("graph").get("group");"item"===n&&(r&&Object(p.each)(r,(function(t){var n,r,i=t.line,o=t.point,c=(i[0]+i[2])/2;o.x<c?(n=o.x-e.width/2,r=Math.max(i[0],i[2])):(n=o.x+e.width/2,r=Math.min(i[0],i[2]));var l=Object(p.mix)({x1:n,y1:i[1],x2:r,y2:i[1]},a),h=u.addShape("line",{attrs:l,capture:!1});s.push(h)})),i&&Object(p.each)(i,(function(t){var n,r,i=t.line,o=t.point,c=(i[1]+i[3])/2;o.y<c?(n=o.y-e.height/2,r=Math.max(i[1],i[3])):(n=o.y+e.height/2,r=Math.min(i[1],i[3]));var l=Object(p.mix)({x1:i[0],y1:n,x2:i[0],y2:r},a),h=u.addShape("line",{attrs:l,capture:!1});s.push(h)})))},e.prototype.getLineDisObject=function(t,e){return{line:t,point:e,dis:Zl(t,e)}},e.prototype.getContainer=function(){return this.get("container")},e.prototype.clearAlignLine=function(){var t=this._cfgs.alignLines;Object(p.each)(t,(function(t){t.remove()})),t.length=0},e.prototype.destory=function(){var t=this._cfgs,e=t.horizontalLines,n=t.verticalLines;this.get("graph").getNodes().forEach((function(t){var r=t.get("id");delete e[r+"tltr"],delete e[r+"lcrc"],delete e[r+"blbr"],delete n[r+"tlbl"],delete n[r+"tcbc"],delete n[r+"trbr"]})),this.clearAlignLine()},e}(iu),Jl=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])})(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)}}(),th=function(){return(th=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},eh=["click","mouseenter"],nh={PluginBase:iu,Menu:hu,Grid:su,Minimap:vu,Bundling:xu,ToolBar:Ou,Tooltip:ku,Fisheye:Eu,TimeBar:Fl,ImageMinimap:Vl,EdgeFilterLens:ql,SnapLine:Ql,Legend:function(t){function e(e){return t.call(this,e)||this}return Jl(e,t),e.prototype.getDefaultCfgs=function(){return{data:{},position:"top",padding:8,margin:8,offsetX:0,offsetY:0,layout:"horizontal",flipPage:!1,containerStyle:{},align:void 0,horiSep:8,vertiSep:8,filter:{enable:!1,trigger:"click"}}},e.prototype.init=function(){this.formatArray("padding"),this.formatArray("margin");var t=this.get("filter")||{};t.multiple&&"mouseenter"===t.trigger&&this.set("multiple",!1);var e=this.get("align");if(!e){var n=this.get("position").split("-");n.includes("left")&&(e="left"),e=n.includes("right")?"right":"center",this.set("align",e)}var r=this.get("graph").get("container"),i=R("<div class='g6-legend-container' style=\"position: absolute;\"></div>");r.appendChild(i),this.set("container",i);var o=this.render();B(i,this.getContainerPos(o)),this.bindEvents()},e.prototype.getContainerPos=function(t){void 0===t&&(t=[0,0]);var e=this.get("graph"),n=this.get("offsetX"),r=this.get("offsetY"),i=this.get("margin"),o=this.get("position").split("-"),a={top:0,right:1,bottom:2,left:3},s={left:(e.getWidth()-t[0])/2+0,top:(e.getHeight()-t[1])/2+0};return o.forEach((function(n){var r=i[a[n]],o=n;switch(n){case"top":case"left":r+=0;break;case"bottom":r=e.getHeight()-t[1]-r+0,o="top";break;default:r=e.getWidth()-t[0]-r+0,o="left"}s[o]=r})),s.top+=r+e.getContainer().offsetTop,s.left+=n+e.getContainer().offsetLeft,Object.keys(s).forEach((function(t){s[t]=s[t]+"px"})),s},e.prototype.bindEvents=function(){var t=this,e=t.get("filter");if(e&&e.enable){var n=e.trigger||"click";eh.includes(n)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),n="click");var r=t.get("legendCanvas");"mouseenter"===n?(r.on("node-container:mouseenter",(function(e){return t.filterData(e)})),r.on("node-container:mouseleave",(function(e){t.clearFilter(),t.clearActiveLegend()}))):(r.on("node-container:click",(function(e){return t.filterData(e)})),r.on("click",(function(e){e.target&&e.target.isCanvas&&e.target.isCanvas()&&(t.clearFilter(),t.clearActiveLegend())})))}},e.prototype.changeData=function(t){this.set("data",t);var e=this.render();B(this.get("container"),this.getContainerPos(e))},e.prototype.activateLegend=function(t){var e=this.get("filter");(null==e?void 0:e.multiple)||this.clearActiveLegend();var n=t.get("parent");n.get("active")?(n.set("active",!1),this.findLegendItemsByState("active").length&&n.set("inactive",!0)):(n.set("inactive",!1),n.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach((function(t){t.set("inactive",!0)})):this.clearActiveLegend();var r=(null==e?void 0:e.lengedStateStyles)||{},i=(null==r?void 0:r.inactive)||{opacity:.5,"text-shape":{opacity:.5}},o=i["text-shape"]||{};this.findLegendItemsByState("inactive").forEach((function(t){var e=t.get("children"),n=e[0],r=e[1];n.attr(th(th({},n.get("oriAttrs")),i)),r.attr(th(th({},r.get("oriAttrs")),o))}));var a=(null==r?void 0:r.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},s=a["text-shape"]||{};this.findLegendItemsByState("active").forEach((function(t){var e=t.get("children"),n=e[0],r=e[1];n.attr(th(th({},n.get("oriAttrs")),a)),r.attr(th(th({},r.get("oriAttrs")),s))}))},e.prototype.findLegendItemsByState=function(t,e,n){void 0===e&&(e="all"),void 0===n&&(n=!0);var r=this.get("legendCanvas").find((function(t){return"root"===t.get("name")})),i=r.find((function(t){return"node-group"===t.get("name")})),o=r.find((function(t){return"edge-group"===t.get("name")}));return"node"===e?i.get("children").filter((function(e){return!!e.get(t)===n})):"edge"===e?o.get("children").filter((function(e){return!!e.get(t)===n})):i.get("children").filter((function(e){return!!e.get(t)===n})).concat(o.get("children").filter((function(e){return!!e.get(t)===n})))},e.prototype.clearActiveLegend=function(){var t=this.get("legendCanvas").find((function(t){return"root"===t.get("name")}));[t.find((function(t){return"node-group"===t.get("name")})),t.find((function(t){return"edge-group"===t.get("name")}))].forEach((function(t){t.get("children").forEach((function(t){t.set("active",!1),t.set("inactive",!1);var e=t.get("children"),n=e[0],r=e[1];n.attr(n.get("oriAttrs")),r.attr(r.get("oriAttrs"))}))}))},e.prototype.filterData=function(t){var e=this.get("filter"),n=null==e?void 0:e.filterFunctions;if(e&&n){var r=this.get("legendCanvas"),i=this.get("graph"),o=e.graphActiveState||"active",a=e.graphInactiveState||"inactive",s=e.multiple;this.clearFilter(),s||this.clearActiveLegend(),this.activateLegend(t.target);var u=r.find((function(t){return"root"===t.get("name")})),c=u.find((function(t){return"node-group"===t.get("name")})),l=u.find((function(t){return"edge-group"===t.get("name")})),h=c.get("children").filter((function(t){return t.get("active")})),f=l.get("children").filter((function(t){return t.get("active")})),d=0,p=["getNodes","getEdges"];p.forEach((function(t){i[t]().forEach((function(e){var r=!1;("getNodes"===t?h:f).forEach((function(t){var i=n[t.get("id")];r=r||i(e.getModel())})),r?(i.setItemState(e,a,!1),i.setItemState(e,o,!0),d++):(i.setItemState(e,o,!1),i.setItemState(e,a,!0))}))})),d||p.forEach((function(t){i[t]().forEach((function(t){i.clearItemStates(t,[a])}))}))}},e.prototype.clearFilter=function(){var t=this.get("graph"),e=this.get("filter");if(e){var n=e.graphActiveState||"active",r=e.graphInactiveState||"inactive";t.getNodes().forEach((function(e){t.clearItemStates(e,[n,r])})),t.getEdges().forEach((function(e){t.clearItemStates(e,[n,r])}))}},e.prototype.render=function(){var t=this;this.processData();var e=this.get("legendCanvas");if(!e){var n=(e=new h.Canvas({container:this.get("container"),width:200,height:200})).addGroup({name:"root"});n.addGroup({name:"node-group"}),n.addGroup({name:"edge-group"}),this.set("legendCanvas",e)}var r=e.find((function(t){return"root"===t.get("name")})),i=r.find((function(t){return"node-group"===t.get("name")})),o=r.find((function(t){return"edge-group"===t.get("name")})),a=this.get("itemsData"),s=[i,o];["nodes","edges"].forEach((function(e,n){a[e].forEach((function(r){var i,o,a=s[n].addGroup({id:r.id,name:"node-container"}),u=r.type,c=t.getShapeSize(r),l=c.width,h=c.height,f=c.r,d=t.getStyle(e.substr(0,4),r);switch(r.type){case"circle":o={r:f,x:0,y:0};break;case"rect":o={width:l,height:h,x:-l/2,y:-h/2};break;case"ellipse":o={r1:l,r2:h,x:0,y:0};break;case"line":o={x1:-l/2,y1:0,x2:l/2,y2:0},u="line";break;case"quadratic":o={path:[["M",-l/2,0],["Q",0,l/2,l/2,0]]},u="path";break;case"cubic":o={path:[["M",-l/2,0],["C",-l/6,l/2,l/6,-l/2,l/2,0]]},u="path";break;default:o={r:f,x:0,y:0}}var p=a.addShape(u,{attrs:th(th({},o),d),name:r.type+"-node-keyShape",oriAttrs:th({opacity:1},d)});if(r.label){var g=p.getBBox(),v=(null===(i=r.labelCfg)||void 0===i?void 0:i.style)||{},m=th({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},v);a.addShape("text",{attrs:th({x:g.maxX+4,y:0,text:r.label},m),className:"legend-label",name:r.type+"-node-text",oriAttrs:m})}}))}));var c,l=this.get("padding"),f=r.find((function(t){return"title-container"===t.get("name")})),d={height:0,maxY:0,width:0};if(this.get("title")){f||(f=r.addGroup({name:"title-container"}));var p={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:l[0]},g=this.get("titleConfig")||{},v=Object.assign(p,g.style||{});c=f.addShape("text",{attrs:th({text:this.get("title")},v)}),d=f.getCanvasBBox(),f.setMatrix([1,0,0,0,1,0,g.offsetX,g.offsetY,1])}this.layoutItems();var m=r.getCanvasBBox(),y=i.getCanvasBBox(),b=y.minX<0?Math.abs(y.minX)+l[3]:l[3],x=d.maxY<y.minY?Math.abs(d.maxY-y.minY)+l[0]:d.maxY+l[0],w=[1,0,0,0,1,0,b,x,1];i.setMatrix(w);var _=[(m=r.getCanvasBBox()).minX+m.width+l[1],m.minY+m.height+l[2]];if(c){g=th({position:"center",offsetX:0,offsetY:0},this.get("titleConfig"));d=f.getCanvasBBox();var S=f.getMatrix()||[1,0,0,0,1,0,0,0,1];"center"===g.position?S[6]=_[0]/2+g.offsetX:"right"===g.position?(S[6]=_[0]-l[3]+g.offsetX,c.attr({textAlign:"right"})):(S[6]=l[3]+g.offsetX,c.attr({textAlign:"left"})),f.setMatrix(S),d=f.getCanvasBBox(),w=[1,0,0,0,1,0,b=y.minX<0?Math.abs(y.minX)+l[3]:l[3],x=y.minY<d.maxY?Math.abs(d.maxY-y.minY)+l[0]:d.maxY+l[0],1],i.setMatrix(w);var E=[1,0,0,0,1,0,b,x,1];"vertical"===this.get("layout")?E[6]+=y.maxX+this.get("horiSep"):E[7]+=y.maxY+this.get("vertiSep"),o.setMatrix(E)}else{y=i.getCanvasBBox();var M=[1,0,0,0,1,0,0,0,1];"vertical"===this.get("layout")?M[6]+=w[6]+y.maxX+this.get("horiSep"):M[7]+=w[7]+y.maxY+this.get("vertiSep"),o.setMatrix(M)}m=r.getCanvasBBox(),y=i.getCanvasBBox(),w=i.getMatrix()||[1,0,0,0,1,0,0,0,1];var O=o.getMatrix()||[1,0,0,0,1,0,0,0,1],A=o.getCanvasBBox();_=[Math.max(y.width+w[6],A.width+O[6])+l[1],Math.max(y.height+w[7],A.height+O[7])+l[2]],e.changeSize(_[0],_[1]);var k=this.get("containerStyle"),C=r.getMatrix()||[1,0,0,0,1,0,0,0,1],I=u.Util.invertMatrix({x:0,y:0},C);return r.addShape("rect",{attrs:th({x:I.x+(k.lineWidth||1),y:I.y+(k.lineWidth||1),width:_[0]-2*(k.lineWidth||1),height:_[1]-2*(k.lineWidth||1),fill:"#f00",stroke:"#000",lineWidth:1,opacity:.5},k),name:"legend-back-rect",capture:!1}).toBack(),_},e.prototype.layoutItems=function(){var t=this.get("legendCanvas"),e=this.get("horiSep"),n=this.get("vertiSep"),r=this.get("layout"),i=this.get("align"),o=[0,0],a=t.find((function(t){return"root"===t.get("name")})),s=a.find((function(t){return"node-group"===t.get("name")})),u=a.find((function(t){return"edge-group"===t.get("name")})),c={min:0,max:-1/0},l=-1/0;s.get("children").forEach((function(t,i){0===i&&(c.min=o[0]);var a=t.get("children")[0],s=t.getCanvasBBox(),u=a.getBBox(),h=u.width,f=u.height,d=0,p=0,g=0;"vertical"===r?(p=o[1],g=o[0]+h/2,o[0]=g+s.height+n,d=s.maxX+p+h/2):(p=o[0]+h/2,g=o[1],o[0]=p+s.width+e,d=s.maxY+g+f/2),o[0]>c.max&&(c.max=o[0]),d>l&&(l=d),t.setMatrix([1,0,0,0,1,0,p,g,1])}));var h=c.max-c.min,f={min:0,max:-1/0},d=s.getCanvasBBox();o[0]=0,o[1]="vertical"===r?d.maxX+e:d.maxY+n,u.get("children").forEach((function(t,i){0===i&&(f.min=o[0]);var a=t.get("children")[0],s=t.getCanvasBBox(),u=a.getBBox(),c=u.width,l=u.height,h=0,d=0;"vertical"===r?(h=o[1],d=o[0],o[0]=d+s.height+n,t.setMatrix([1,0,0,0,1,0,0,d+l/2,1])):(h=o[0],d=o[1],o[0]=h+s.width+e,t.setMatrix([1,0,0,0,1,0,h+c/2,0,1])),o[0]>f.max&&(f.max=o[0])}));var p=f.max-f.min;if(i&&""!==i&&"left"!==i){var g=h-p,v="center"===i?Math.abs(g)/2:Math.abs(g);(g<0?s:u).get("children").forEach((function(t){var e=t.getMatrix()||[1,0,0,0,1,0,0,0,1];"vertical"===r?e[7]+=v:e[6]+=v,t.setMatrix(e)}))}},e.prototype.processData=function(){var t=this.get("data"),e={nodes:[],edges:[]};t.nodes&&(t.nodes.sort((function(t,e){return t.order-e.order})),t.nodes.forEach((function(t){var n,r,i,o,a,s=t.size||[(null===(n=t.style)||void 0===n?void 0:n.width)||(null===(r=t.style)||void 0===r?void 0:r.r)||8,(null===(i=t.style)||void 0===i?void 0:i.height)||(null===(o=t.style)||void 0===o?void 0:o.r)||8],u=(null===(a=t.labelCfg)||void 0===a?void 0:a.style)||{};e.nodes.push({id:t.id||Object(p.uniqueId)(),type:t.type||"circle",style:th({},t.style),order:t.order,label:t.label,itemType:"node",size:s,labelCfg:{position:"right",style:th({fontFamily:"Arial"},u)}})}))),t.edges&&(t.edges.sort((function(t,e){return t.order-e.order})),t.edges.forEach((function(t){var n,r,i=t.type||"line";"cubic-horizontal"===t.type&&(i="cubic");var o=(null===(n=t.labelCfg)||void 0===n?void 0:n.style)||{},a=t.size||[(null===(r=t.style)||void 0===r?void 0:r.width)||8,1];e.edges.push({id:t.id||Object(p.uniqueId)(),type:i,size:a,style:th({lineWidth:Object(p.isArray)(a)?a[1]:1},t.style),order:t.order,label:t.label,itemType:"edge",labelCfg:{position:"right",style:th({fontFamily:"Arial"},o)}})}))),this.set("itemsData",e)},e.prototype.getContainer=function(){return this.get("container")},e.prototype.formatArray=function(t){var e=this.get(t);if(Object(p.isNumber)(e))this.set(t,[e,e,e,e]);else if(Object(p.isArray)(e))switch(e.length){case 0:this.set(t,[0,0,0,0]);break;case 1:this.set(t,[e[0],e[0],e[0],e[0]]);break;case 2:this.set(t,[e[0],e[1],e[0],e[1]]);break;case 3:this.set(t,[e[0],e[1],e[2],e[1]])}return this.get(t)},e.prototype.getShapeSize=function(t){var e,n,r;return t.size&&(Object(p.isArray)(t.size)?(e=t.size[0],n=t.size[1]||t.size[0],r=t.size[0]/2):Object(p.isNumber)(t.size)&&(e=t.size,n=t.size,r=t.size/2)),t.style&&(t.style.width&&(e=t.style.width),t.style.height&&(n=t.style.height),t.style.r&&(r=t.style.r)),r||(r=5),e||(e=r),n||(n=r),{width:e,height:n,r:r}},e.prototype.getStyle=function(t,e){return th(th({},"node"===t?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1}),e.style||{})},e.prototype.destroy=function(){var t=this.get("graph").get("container"),e=this.get("container");t.removeChild(e)},e}(iu)};Object(u.registerNode)("circle",{options:{size:u.BaseGlobal.defaultNode.size,style:{x:0,y:0,stroke:u.BaseGlobal.defaultNode.style.stroke,fill:u.BaseGlobal.defaultNode.style.fill,lineWidth:u.BaseGlobal.defaultNode.style.lineWidth},labelCfg:{style:{fill:u.BaseGlobal.nodeLabel.style.fill,fontSize:u.BaseGlobal.nodeLabel.style.fontSize,fontFamily:u.BaseGlobal.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:u.BaseGlobal.defaultNode.linkPoints.size,lineWidth:u.BaseGlobal.defaultNode.linkPoints.lineWidth,fill:u.BaseGlobal.defaultNode.linkPoints.fill,stroke:u.BaseGlobal.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:Object(s.__assign)({},u.BaseGlobal.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=Object(p.deepMix)({},r,t.icon),a=this.type+"-keyShape",u=e.addShape("circle",{attrs:i,className:a,name:a,draggable:!0});e.shapeMap[a]=u;var c=o.width,l=o.height,h=o.show,f=o.text;if(h){var d=this.type+"-icon";e.shapeMap[d]=f?e.addShape("text",{attrs:Object(s.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:d,name:d,draggable:!0}):e.addShape("image",{attrs:Object(s.__assign)({x:-c/2,y:-l/2},o),className:d,name:d,draggable:!0})}return this.drawLinkPoints(t,e),u},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints;if(n){var r=n||{},i=r.top,o=r.left,a=r.right,u=r.bottom,c=r.size,l=r.r,h=Object(s.__rest)(r,["top","left","right","bottom","size","r"]),f=this.getSize(t)[0]/2;if(o){var d="link-point-left";e.shapeMap[d]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:-f,y:0,r:c/2||l||5}),className:d,name:d,isAnchorPoint:!0})}if(a){var p="link-point-right";e.shapeMap[p]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:f,y:0,r:c/2||l||5}),className:p,name:p,isAnchorPoint:!0})}if(i){var g="link-point-top";e.shapeMap[g]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:0,y:-f,r:c/2||l||5}),className:g,name:g,isAnchorPoint:!0})}if(u){var v="link-point-bottom";e.shapeMap[v]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:0,y:f,r:c/2||l||5}),className:v,name:v,isAnchorPoint:!0})}}},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=Object(p.deepMix)({},e,n),i=this.getSize(t)[0]/2;return Object(s.__assign)({x:0,y:0,r:i},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getSize(t),o=Object(s.__assign)({},t.style);void 0===t.style.stroke&&t.color&&(o.stroke=t.color),void 0!==t.style.r||isNaN(i[0])||(o.r=i[0]/2),this.updateShape(t,e,o,!0,n),this.updateLinkPoints(t,r)}},"single-node"),Object(u.registerNode)("rect",{options:{size:[100,30],style:{radius:0,stroke:u.BaseGlobal.defaultNode.style.stroke,fill:u.BaseGlobal.defaultNode.style.fill,lineWidth:u.BaseGlobal.defaultNode.style.lineWidth},labelCfg:{style:{fill:u.BaseGlobal.nodeLabel.style.fill,fontSize:u.BaseGlobal.nodeLabel.style.fontSize,fontFamily:u.BaseGlobal.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:u.BaseGlobal.defaultNode.linkPoints.size,lineWidth:u.BaseGlobal.defaultNode.linkPoints.lineWidth,fill:u.BaseGlobal.defaultNode.linkPoints.fill,stroke:u.BaseGlobal.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:Object(s.__assign)({},u.BaseGlobal.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t),r=e.addShape("rect",{attrs:n,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0});return e.shapeMap[this.type+"-keyShape"]=r,this.drawLinkPoints(t,e),r},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,u=r.bottom,c=r.size,l=r.r,h=Object(s.__rest)(r,["top","left","right","bottom","size","r"]),f=this.getSize(t),d=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:-d/2,y:0,r:c/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:d/2,y:0,r:c/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:0,y:-p/2,r:c/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:0,y:p/2,r:c/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=Object(p.mix)({},e,n),i=this.getSize(t),o=r.width||i[0],a=r.height||i[1];return Object(s.__assign)({x:-o/2,y:-a/2,width:o,height:a},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getOptions({}).style,o=this.getSize(t),a=e.get("keyShape");t.size||(o[0]=a.attr("width")||i.width,o[1]=a.attr("height")||i.height);var s={stroke:t.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},u=Object(p.mix)({},i,a.attr(),s);u=Object(p.mix)(u,t.style),this.updateShape(t,e,u,!1,n),this.updateLinkPoints(t,r)}},"single-node"),Object(u.registerNode)("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:u.BaseGlobal.defaultNode.style.stroke,fill:u.BaseGlobal.defaultNode.style.fill,lineWidth:u.BaseGlobal.defaultNode.style.lineWidth},labelCfg:{style:{fill:u.BaseGlobal.nodeLabel.style.fill,fontSize:u.BaseGlobal.nodeLabel.style.fontSize,fontFamily:u.BaseGlobal.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:u.BaseGlobal.defaultNode.linkPoints.size,lineWidth:u.BaseGlobal.defaultNode.linkPoints.lineWidth,fill:u.BaseGlobal.defaultNode.linkPoints.fill,stroke:u.BaseGlobal.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:Object(s.__assign)({},u.BaseGlobal.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=e.addShape("ellipse",{attrs:i,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});e.shapeMap["ellipse-keyShape"]=o;var a=r.width,u=r.height,c=r.show,l=r.text;return c&&(e.shapeMap[this.type+"-icon"]=l?e.addShape("text",{attrs:Object(s.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}):e.addShape("image",{attrs:Object(s.__assign)({x:-a/2,y:-u/2},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,u=r.bottom,c=r.size,l=r.r,h=Object(s.__rest)(r,["top","left","right","bottom","size","r"]),f=this.getSize(t),d=f[0]/2,p=f[1]/2;o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:-d,y:0,r:c/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:d,y:0,r:c/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:0,y:-p,r:c/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:0,y:p,r:c/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=Object(p.mix)({},e,n),i=this.getSize(t),o=i[0]/2,a=i[1]/2;return Object(s.__assign)({x:0,y:0,rx:o,ry:a},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getOptions({}).style,o=this.getSize(t),a={stroke:t.color,rx:o[0]/2,ry:o[1]/2},s=e.get("keyShape"),u=Object(p.mix)({},i,s.attr(),a);u=Object(p.mix)(u,t.style),this.updateShape(t,e,u,!0,n),this.updateLinkPoints(t,r)}},"single-node"),Object(u.registerNode)("diamond",{options:{size:[80,80],style:{stroke:u.BaseGlobal.defaultNode.style.stroke,fill:u.BaseGlobal.defaultNode.style.fill,lineWidth:u.BaseGlobal.defaultNode.style.lineWidth},labelCfg:{style:{fill:u.BaseGlobal.nodeLabel.style.fill,fontSize:u.BaseGlobal.nodeLabel.style.fontSize,fontFamily:u.BaseGlobal.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:u.BaseGlobal.defaultNode.linkPoints.size,lineWidth:u.BaseGlobal.defaultNode.linkPoints.lineWidth,fill:u.BaseGlobal.defaultNode.linkPoints.fill,stroke:u.BaseGlobal.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:Object(s.__assign)({},u.BaseGlobal.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0});e.shapeMap[this.type+"-keyShape"]=o;var a=r.width,u=r.height,c=r.show,l=r.text;return c&&(e.shapeMap[this.type+"-icon"]=l?e.addShape("text",{attrs:Object(s.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}):e.addShape("image",{attrs:Object(s.__assign)({x:-a/2,y:-u/2},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,u=r.bottom,c=r.size,l=r.r,h=Object(s.__rest)(r,["top","left","right","bottom","size","r"]),f=this.getSize(t),d=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:-d/2,y:0,r:c/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:d/2,y:0,r:c/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:0,y:-p/2,r:c/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:0,y:p/2,r:c/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(t){var e=this.getSize(t),n=e[0],r=e[1];return[["M",0,-r/2],["L",n/2,0],["L",0,r/2],["L",-n/2,0],["Z"]]},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=Object(p.mix)({},e,n),i=this.getPath(t);return Object(s.__assign)({path:i},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=Object(p.mix)({},i,s.attr(),a);u=Object(p.mix)(u,t.style),this.updateShape(t,e,u,!0,n),this.updateLinkPoints(t,r)}},"single-node"),Object(u.registerNode)("triangle",{options:{size:40,direction:"up",style:{stroke:u.BaseGlobal.defaultNode.style.stroke,fill:u.BaseGlobal.defaultNode.style.fill,lineWidth:u.BaseGlobal.defaultNode.style.lineWidth},labelCfg:{style:{fill:u.BaseGlobal.nodeLabel.style.fill,fontSize:u.BaseGlobal.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:u.BaseGlobal.defaultNode.linkPoints.size,lineWidth:u.BaseGlobal.defaultNode.linkPoints.lineWidth,fill:u.BaseGlobal.defaultNode.linkPoints.fill,stroke:u.BaseGlobal.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:Object(s.__assign)({},u.BaseGlobal.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var n=this.mergeStyle||this.getOptions(t),r=n.icon,i=void 0===r?{}:r,o=n.direction,a=this.getShapeStyle(t),u=t.direction||o,c=e.addShape("path",{attrs:a,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0});e.shapeMap[this.type+"-keyShape"]=c;var l=i.width,h=i.height,f=i.show,d=i.offset,p=i.text;if(f)if(p)e.shapeMap[this.type+"-icon"]=e.addShape("text",{attrs:Object(s.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:this.type+"-icon",name:this.type+"-icon",draggable:!0});else{var g=-l/2,v=-h/2;"up"!==u&&"down"!==u||(v+=d),"left"!==u&&"right"!==u||(g+=d),e.shapeMap[this.type+"-icon"]=e.addShape("image",{attrs:Object(s.__assign)({x:g,y:v},i),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})}return this.drawLinkPoints(t,e),c},drawLinkPoints:function(t,e){var n=this.mergeStyle||this.getOptions(t),r=n.linkPoints,i=void 0===r?{}:r,o=n.direction,a=t.direction||o,u=i.top,c=i.left,l=i.right,h=i.bottom,f=i.size,d=i.r,p=Object(s.__rest)(i,["top","left","right","bottom","size","r"]),g=this.getSize(t)[0];if(c){var v=null,m=g*Math.sin(1/3*Math.PI),y=g*Math.sin(1/3*Math.PI);"up"===a?v=[-y,m]:"down"===a?v=[-y,-m]:"left"===a&&(v=[-y,y-m]),v&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},p),{x:v[0],y:v[1],r:f/2||d||5}),className:"link-point-left",name:"link-point-left"}))}if(l){var b=null;m=g*Math.sin(1/3*Math.PI),y=g*Math.sin(1/3*Math.PI);"up"===a?b=[y,m]:"down"===a?b=[y,-m]:"right"===a&&(b=[y,y-m]),b&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},p),{x:b[0],y:b[1],r:f/2||d||5}),className:"link-point-right",name:"link-point-right"}))}if(u){var x=null;m=g*Math.sin(1/3*Math.PI),y=g*Math.sin(1/3*Math.PI);"up"===a?x=[y-m,-m]:"left"===a?x=[y,-m]:"right"===a&&(x=[-y,-m]),x&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},p),{x:x[0],y:x[1],r:f/2||d||5}),className:"link-point-top",name:"link-point-top"}))}if(h){var w=null;m=g*Math.sin(1/3*Math.PI),y=g*Math.sin(1/3*Math.PI);"down"===a?w=[-y+m,m]:"left"===a?w=[y,m]:"right"===a&&(w=[-y,m]),w&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},p),{x:w[0],y:w[1],r:f/2||d||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(t){var e=(this.mergeStyle||this.getOptions(t)).direction,n=t.direction||e,r=this.getSize(t)[0],i=r*Math.sin(1/3*Math.PI),o=r*Math.sin(1/3*Math.PI),a=[["M",-o,i],["L",0,-i],["L",o,i],["Z"]];return"down"===n?a=[["M",-o,-i],["L",o,-i],["L",0,i],["Z"]]:"left"===n?a=[["M",-o,o-i],["L",o,-o],["L",o,o],["Z"]]:"right"===n&&(a=[["M",o,o-i],["L",-o,o],["L",-o,-o],["Z"]]),a},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=Object(p.mix)({},e,n),i=this.getPath(t);return Object(s.__assign)({path:i},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=Object(p.mix)({},i,s.attr(),a);u=Object(p.mix)(u,t.style),this.updateShape(t,e,u,!0,n),this.updateLinkPoints(t,r)},updateLinkPoints:function(t,e){var n=this.getOptions({}),r=n.linkPoints,i=n.direction,o=t.direction||i,a=e.shapeMap["link-point-left"]||e.find((function(t){return"link-point-left"===t.get("className")})),u=e.shapeMap["link-point-right"]||e.find((function(t){return"link-point-right"===t.get("className")})),c=e.shapeMap["link-point-top"]||e.find((function(t){return"link-point-top"===t.get("className")})),l=e.shapeMap["link-point-bottom"]||e.find((function(t){return"link-point-bottom"===t.get("className")})),h=r,f=a||u||c||l;f&&(h=f.attr());var d=Object(p.mix)({},h,t.linkPoints),g=d.fill,v=d.stroke,m=d.lineWidth,y=d.size/2;y||(y=d.r);var b=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},x=b.left,w=b.right,_=b.top,S=b.bottom,E=this.getSize(t)[0],M={r:y,fill:g,stroke:v,lineWidth:m},O=null,A=E*Math.sin(1/3*Math.PI),k=E*Math.sin(1/3*Math.PI);"up"===o?O=[-k,A]:"down"===o?O=[-k,-A]:"left"===o&&(O=[-k,k-A]),O&&(a?x||void 0===x?a.attr(Object(s.__assign)(Object(s.__assign)({},M),{x:O[0],y:O[1]})):(a.remove(),delete e.shapeMap["link-point-left"]):x&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},M),{x:O[0],y:O[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var C=null;"up"===o?C=[k,A]:"down"===o?C=[k,-A]:"right"===o&&(C=[k,k-A]),C&&(u?w||void 0===w?u.attr(Object(s.__assign)(Object(s.__assign)({},M),{x:C[0],y:C[1]})):(u.remove(),delete e.shapeMap["link-point-right"]):w&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},M),{x:C[0],y:C[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var I=null;"up"===o?I=[k-A,-A]:"left"===o?I=[k,-A]:"right"===o&&(I=[-k,-A]),I&&(c?_||void 0===_?c.attr(Object(s.__assign)(Object(s.__assign)({},M),{x:I[0],y:I[1]})):(c.remove(),delete e.shapeMap["link-point-top"]):_&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},M),{x:I[0],y:I[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var T=null;"down"===o?T=[-k+A,A]:"left"===o?T=[k,A]:"right"===o&&(T=[-k,A]),T&&(l?S||void 0===S?l.attr(Object(s.__assign)(Object(s.__assign)({},M),{x:T[0],y:T[1]})):(l.remove(),delete e.shapeMap["link-point-bottom"]):S&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},M),{x:T[0],y:T[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node"),Object(u.registerNode)("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:u.BaseGlobal.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:u.BaseGlobal.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:u.BaseGlobal.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).preRect,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=this.getSize(t),a=o[0],u=o[1],c=e.addShape("rect",{attrs:i,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0});e.shapeMap[this.type+"-keyShape"]=c;var l=r.show,h=Object(s.__rest)(r,["show"]);return l&&(e.shapeMap["pre-rect"]=e.addShape("rect",{attrs:Object(s.__assign)({x:-a/2,y:-u/2,height:u},h),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),c},drawLogoIcon:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).logoIcon,r=void 0===n?{}:n,i=this.getSize(t)[0];if(r.show){var o=r.width,a=r.height,u=r.x,c=r.y,l=r.offset,h=r.text,f=Object(s.__rest)(r,["width","height","x","y","offset","text"]);e.shapeMap["rect-logo-icon"]=h?e.addShape("text",{attrs:Object(s.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},f),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):e.addShape("image",{attrs:Object(s.__assign)(Object(s.__assign)({},f),{x:u||-i/2+o+l,y:c||-a/2,width:o,height:a}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).stateIcon,r=void 0===n?{}:n,i=this.getSize(t)[0];if(r.show){var o=r.width,a=r.height,u=r.x,c=r.y,l=r.offset,h=r.text,f=Object(s.__rest)(r,["width","height","x","y","offset","text"]);e.shapeMap["rect-state-icon"]=h?e.addShape("text",{attrs:Object(s.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},f),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):e.addShape("image",{attrs:Object(s.__assign)(Object(s.__assign)({},f),{x:u||i/2-o+l,y:c||-a/2,width:o,height:a}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,u=r.bottom,c=r.size,l=r.r,h=Object(s.__rest)(r,["top","left","right","bottom","size","r"]),f=this.getSize(t),d=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:-d/2,y:0,r:c/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:d/2,y:0,r:c/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:0,y:-p/2,r:c/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},h),{x:0,y:p/2,r:c/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(t,e){var n=this.getOptions(t),r=n.labelCfg,i=void 0===r?{}:r,o=n.logoIcon,a=void 0===o?{}:o,u=n.descriptionCfg,c=void 0===u?{}:u,l=this.getSize(t)[0],h=null,f=a.show,d=a.width,g=-l/2+i.offset;f&&(g=-l/2+d+i.offset);var v=i.style,m=c.style,y=c.paddingTop;return Object(p.isString)(t.description)?(h=e.addShape("text",{attrs:Object(s.__assign)(Object(s.__assign)({},v),{x:g,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0}),e.shapeMap["text-shape"]=h,e.shapeMap["rect-description"]=e.addShape("text",{attrs:Object(s.__assign)(Object(s.__assign)({},m),{x:g,y:17+(y||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0})):(h=e.addShape("text",{attrs:Object(s.__assign)(Object(s.__assign)({},v),{x:g,y:7,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0}),e.shapeMap["text-shape"]=h),h},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=Object(p.mix)({},e,n),i=this.getSize(t),o=r.width||i[0],a=r.height||i[1];return Object(s.__assign)({x:-o/2,y:-a/2,width:o,height:a},r)},update:function(t,e){var n=this.mergeStyle||this.getOptions(t),r=n.style,i=void 0===r?{}:r,o=n.labelCfg,a=void 0===o?{}:o,u=n.descriptionCfg,c=void 0===u?{}:u,l=this.getSize(t),h=l[0],f=l[1];e.get("keyShape").attr(Object(s.__assign)(Object(s.__assign)({},i),{x:-h/2,y:-f/2,width:h,height:f}));var d=e.getContainer(),g=d.shapeMap["rect-logo-icon"]||d.find((function(t){return"rect-logo-icon"===t.get("className")})),v=g?g.attr():{},m=Object(p.mix)({},v,t.logoIcon),y=m.width;void 0===y&&(y=this.options.logoIcon.width);var b=t.logoIcon?t.logoIcon.show:void 0,x=a.offset,w=-h/2+y+x;b||void 0===b||(w=-h/2+x);var _=d.shapeMap["node-label"]||d.find((function(t){return"node-label"===t.get("className")})),S=d.shapeMap["rect-description"]||d.find((function(t){return"rect-description"===t.get("className")}));if(t.label)if(_){var E=t.labelCfg?t.labelCfg.style:{},M=Object(p.mix)({},_.attr(),E);t.label&&(M.text=t.label),M.x=w,Object(p.isString)(t.description)&&(M.y=-5),S&&(S.resetMatrix(),S.attr({x:w})),_.resetMatrix(),_.attr(M)}else d.shapeMap["node-label"]=d.addShape("text",{attrs:Object(s.__assign)(Object(s.__assign)({},a.style),{x:w,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0});if(Object(p.isString)(t.description)){var O=c.paddingTop;if(S){E=t.descriptionCfg?t.descriptionCfg.style:{};var A=Object(p.mix)({},S.attr(),E);Object(p.isString)(t.description)&&(A.text=t.description),A.x=w,S.resetMatrix(),S.attr(Object(s.__assign)(Object(s.__assign)({},A),{y:17+(O||0)}))}else d.shapeMap["rect-description"]=d.addShape("text",{attrs:Object(s.__assign)(Object(s.__assign)({},c.style),{x:w,y:17+(O||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0})}var k=d.shapeMap["pre-rect"]||d.find((function(t){return"pre-rect"===t.get("className")}));if(k&&!k.destroyed){var C=Object(p.mix)({},k.attr(),t.preRect);k.attr(Object(s.__assign)(Object(s.__assign)({},C),{x:-h/2,y:-f/2,height:f}))}if(g&&!g.destroyed)if(b||void 0===b){var I=m.width,T=m.height,P=m.x,N=m.y,j=m.offset,D=Object(s.__rest)(m,["width","height","x","y","offset"]);g.attr(Object(s.__assign)(Object(s.__assign)({},D),{x:P||-h/2+I+j,y:N||-T/2,width:I,height:T}))}else g.remove(),delete d.shapeMap["pre-rect"];else b&&this.drawLogoIcon(t,d);var L=d.shapeMap["rect-state-icon"]||d.find((function(t){return"rect-state-icon"===t.get("className")})),R=L?L.attr():{},B=Object(p.mix)({},R,t.stateIcon);if(L){B.show||void 0===B.show||(L.remove(),delete d.shapeMap["rect-state-icon"]);var G=B.width,F=(T=B.height,P=B.x,N=B.y,B.offset),z=Object(s.__rest)(B,["width","height","x","y","offset"]);L.attr(Object(s.__assign)(Object(s.__assign)({},z),{x:P||h/2-G+F,y:N||-T/2,width:G,height:T}))}else B.show&&this.drawStateIcon(t,d);this.updateLinkPoints(t,d)}},"single-node"),Object(u.registerNode)("star",{options:{size:60,style:{stroke:u.BaseGlobal.defaultNode.style.stroke,fill:u.BaseGlobal.defaultNode.style.fill,lineWidth:u.BaseGlobal.defaultNode.style.lineWidth},labelCfg:{style:{fill:u.BaseGlobal.nodeLabel.style.fill,fontSize:u.BaseGlobal.nodeLabel.style.fontSize,fontFamily:u.BaseGlobal.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:u.BaseGlobal.defaultNode.linkPoints.size,lineWidth:u.BaseGlobal.defaultNode.linkPoints.lineWidth,fill:u.BaseGlobal.defaultNode.linkPoints.fill,stroke:u.BaseGlobal.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:Object(s.__assign)({},u.BaseGlobal.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0});e.shapeMap[this.type+"-keyShape"]=o;var a=r.width,u=r.height,c=r.show,l=r.text;return c&&(e.shapeMap[this.type+"-icon"]=l?e.addShape("text",{attrs:Object(s.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}):e.addShape("image",{attrs:Object(s.__assign)({x:-a/2,y:-u/2},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,u=r.leftBottom,c=r.rightBottom,l=r.size,h=r.r,f=Object(s.__rest)(r,["top","left","right","leftBottom","rightBottom","size","r"]),d=this.getSize(t)[0];if(a){var p=Math.cos(.1*Math.PI)*d,g=Math.sin(.1*Math.PI)*d;e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},f),{x:p,y:-g,r:l/2||h||5}),className:"link-point-right",name:"link-point-right"})}if(i){p=Math.cos(.5*Math.PI)*d,g=Math.sin(.5*Math.PI)*d;e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},f),{x:p,y:-g,r:l/2||h||5}),className:"link-point-top",name:"link-point-top"})}if(o){p=Math.cos(.9*Math.PI)*d,g=Math.sin(.9*Math.PI)*d;e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},f),{x:p,y:-g,r:l/2||h||5}),className:"link-point-left",name:"link-point-left"})}if(u){p=Math.cos(1.3*Math.PI)*d,g=Math.sin(1.3*Math.PI)*d;e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},f),{x:p,y:-g,r:l/2||h||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(c){p=Math.cos(1.7*Math.PI)*d,g=Math.sin(1.7*Math.PI)*d;e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},f),{x:p,y:-g,r:l/2||h||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(t){for(var e=this.getSize(t)[0],n=3*e/8,r=t.innerR||n,i=[],o=0;o<5;o++){var a=Math.cos((18+72*o)/180*Math.PI)*e,s=Math.sin((18+72*o)/180*Math.PI)*e,u=Math.cos((54+72*o)/180*Math.PI)*r,c=Math.sin((54+72*o)/180*Math.PI)*r;0===o?i.push(["M",a,-s]):i.push(["L",a,-s]),i.push(["L",u,-c])}return i.push(["Z"]),i},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=Object(p.mix)({},e,n),i=this.getPath(t);return Object(s.__assign)({path:i},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=Object(p.mix)({},i,s.attr(),a);u=Object(p.mix)(u,t.style),this.updateShape(t,e,u,!0,n),this.updateLinkPoints(t,r)},updateLinkPoints:function(t,e){var n=this.getOptions({}).linkPoints,r=e.shapeMap["link-point-left"]||e.find((function(t){return"link-point-left"===t.get("className")})),i=e.shapeMap["link-point-right"]||e.find((function(t){return"link-point-right"===t.get("className")})),o=e.shapeMap["link-point-top"]||e.find((function(t){return"link-point-top"===t.get("className")})),a=e.shapeMap["link-point-left-bottom"]||e.find((function(t){return"link-point-left-bottom"===t.get("className")})),u=e.shapeMap["link-point-left-bottom"]||e.find((function(t){return"link-point-right-bottom"===t.get("className")})),c=n,l=r||i||o||a||u;l&&(c=l.attr());var h=Object(p.mix)({},c,t.linkPoints),f=h.fill,d=h.stroke,g=h.lineWidth,v=h.size/2;v||(v=h.r);var m=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},y=m.left,b=m.right,x=m.top,w=m.leftBottom,_=m.rightBottom,S=this.getSize(t)[0],E={r:v,fill:f,stroke:d,lineWidth:g},M=Math.cos(.1*Math.PI)*S,O=Math.sin(.1*Math.PI)*S;i?b||void 0===b?i.attr(Object(s.__assign)(Object(s.__assign)({},E),{x:M,y:-O})):(i.remove(),delete e.shapeMap["link-point-right"]):b&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},E),{x:M,y:-O}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),M=Math.cos(.5*Math.PI)*S,O=Math.sin(.5*Math.PI)*S,o?x||void 0===x?o.attr(Object(s.__assign)(Object(s.__assign)({},E),{x:M,y:-O})):(o.remove(),delete e.shapeMap["link-point-top"]):x&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},E),{x:M,y:-O}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),M=Math.cos(.9*Math.PI)*S,O=Math.sin(.9*Math.PI)*S,r?y||void 0===y?r.attr(Object(s.__assign)(Object(s.__assign)({},E),{x:M,y:-O})):(r.remove(),delete e.shapeMap["link-point-left"]):y&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},E),{x:M,y:-O}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),M=Math.cos(1.3*Math.PI)*S,O=Math.sin(1.3*Math.PI)*S,a?w||void 0===w?a.attr(Object(s.__assign)(Object(s.__assign)({},E),{x:M,y:-O})):(a.remove(),delete e.shapeMap["link-point-left-bottom"]):w&&(e.shapeMap["link-point-left-bottom"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},E),{x:M,y:-O}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),M=Math.cos(1.7*Math.PI)*S,O=Math.sin(1.7*Math.PI)*S,u?_||void 0===_?u.attr(Object(s.__assign)(Object(s.__assign)({},E),{x:M,y:-O})):(a.remove(),delete e.shapeMap["link-point-right-bottom"]):_&&(e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:Object(s.__assign)(Object(s.__assign)({},E),{x:M,y:-O}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var rh=u.Util.defaultSubjectColors;Object(u.registerNode)("donut",{options:{size:u.BaseGlobal.defaultNode.size,style:{x:0,y:0,stroke:u.BaseGlobal.defaultNode.style.stroke,fill:u.BaseGlobal.defaultNode.style.fill,lineWidth:u.BaseGlobal.defaultNode.style.lineWidth},labelCfg:{style:{fill:u.BaseGlobal.nodeLabel.style.fill,fontSize:u.BaseGlobal.nodeLabel.style.fontSize,fontFamily:u.BaseGlobal.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:u.BaseGlobal.defaultNode.linkPoints.size,lineWidth:u.BaseGlobal.defaultNode.linkPoints.lineWidth,fill:u.BaseGlobal.defaultNode.linkPoints.fill,stroke:u.BaseGlobal.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:Object(s.__assign)({},u.BaseGlobal.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=Object(p.deepMix)({},r,t.icon),a=e.addShape("circle",{attrs:i,className:this.type+"-keyShape",draggable:!0,name:this.type+"-keyShape"});e.shapeMap[this.type+"-keyShape"]=a;var u=o.width,c=o.height,l=o.show,h=o.text;l&&(e.shapeMap[this.type+"-icon"]=h?e.addShape("text",{attrs:Object(s.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}):e.addShape("image",{attrs:Object(s.__assign)({x:-u/2,y:-c/2},o),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}));var f=a.attr("r"),d=.6*f,g=(f+d)/2,v=t,m=v.donutAttrs,y=void 0===m?{}:m,b=v.donutColorMap,x=void 0===b?{}:b,w=Object.keys(y).length;if(y&&w>1){var _=[],S=0;if(Object.keys(y).forEach((function(t){var e=y[t]||0;Object(p.isNumber)(e)&&(_.push({key:t,value:e,color:x[t]}),S+=e)})),S){var E=f-d;if(1===w)return void(e.shapeMap["fan-shape-0"]=e.addShape("circle",{attrs:{r:g,x:0,y:0,stroke:_[0].color||rh[0],lineWidth:E},name:"fan-shape-0"}));var M=[g,0],O=0;_.forEach((function(t,n){var r=t.value/S;if(!(r<.001))if(r>.999&&(r=1),1!==r){t.percent=r,t.angle=r*Math.PI*2,t.beginAgnle=O,O+=t.angle,t.endAngle=O,t.arcBegin=M,t.arcEnd=[g*Math.cos(t.endAngle),-g*Math.sin(t.endAngle)];var i=t.angle>Math.PI?1:0,o=[["M",t.arcBegin[0],t.arcBegin[1]],["A",g,g,0,i,0,t.arcEnd[0],t.arcEnd[1]],["L",t.arcEnd[0],t.arcEnd[1]]];e.shapeMap["fan-shape-"+n]=e.addShape("path",{attrs:{path:o,lineWidth:E,stroke:t.color||rh[n%rh.length]},name:"fan-shape-"+n}),M=t.arcEnd}else e.shapeMap["fan-shape-"+n]=e.addShape("circle",{attrs:{r:g,x:0,y:0,stroke:t.color||rh[n%rh.length],lineWidth:E},name:"fan-shape-"+n})}))}}return this.drawLinkPoints(t,e),a},update:void 0},"circle");var ih=function(t){var e=t.x,n=t.y;return{x:e,y:n,centerX:e,centerY:n,minX:e,minY:n,maxX:e,maxY:n,height:0,width:0}},oh=function(t){for(var e=[],n={},r=t.length-1;r>=0;r--){var i=t[r];i.id=i.x+"|||"+i.y,n[i.id]=i,e.push(i)}return e},ah=function(t){return oh(t)},sh=function(t,e){return t.width||t.height?{centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}:t},uh=function(t,e,n){var r=function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return 0===n&&0===r?0:n/e.width>r/e.height}(e,t);if(0===r){var i=t.centerX,o=t.centerY;return n.y<e.y?o=t.minY:n.x>e.x?i=t.maxX:n.x<e.x?i=t.minX:n.x===e.x&&(o=t.maxY),{x:i,y:o}}return r?{x:e.x>t.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},ch=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(n+i)/2,centerY:(r+o)/2,minX:n,minY:r,maxX:i,maxY:o,height:o-r,width:i-n}},lh=function(t){return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},hh=function(t,e){var n=t.x,r=t.y;return n<e.minX||n>e.maxX||r<e.minY||r>e.maxY},fh=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},dh=function(t,e,n,r,i){return fh(t,e)+fh(t,n)+function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n}(t,[e,n,r,i])},ph=function t(e,n,r,i,o){void 0===o&&(o=0),e.unshift(n[i]),r[i]&&r[i]!==i&&o<=100&&t(e,n,r,r[i],o+1)},gh=function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=r.x-t.x,s=r.y-t.y,u=n.x-e.x,c=n.y-e.y,l=r.x-e.x,h=r.y-e.y;return(i*s-o*a)*(u*h-c*l)<=0&&(i*c-o*u)*(a*h-s*l)<=0},vh=function(t,e,n){if(n.width||n.height){var r=lh(n),i=r[0],o=r[1],a=r[2],s=r[3];return gh(t,e,i,o)||gh(t,e,i,s)||gh(t,e,o,a)||gh(t,e,a,s)}return!1},mh=function(t,e,n,r){var i=[];return t.forEach((function(t){if(t!==e&&(t.x===e.x||t.y===e.y)){if(vh(t,e,n)||vh(t,e,r))return;i.push(t)}})),oh(i)},yh=function(t,e){var n=[],r=t[0];return n.push("M"+r.x+" "+r.y),t.forEach((function(r,i){var o=t[i+1],a=t[i+2];if(o&&a)if(function(t,e,n){return!(t.x===e.x&&e.x===n.x||t.y===e.y&&e.y===n.y)}(r,o,a)){var s=function(t,e,n,r){var i=fh(t,e),o=fh(n,e);return i<r&&(r=i),o<r&&(r=o),[{x:e.x-r/i*(e.x-t.x),y:e.y-r/i*(e.y-t.y)},{x:e.x-r/o*(e.x-n.x),y:e.y-r/o*(e.y-n.y)}]}(r,o,a,e),u=s[0],c=s[1];n.push("L"+u.x+" "+u.y),n.push("Q"+o.x+" "+o.y+" "+c.x+" "+c.y),n.push("L"+c.x+" "+c.y)}else n.push("L"+o.x+" "+o.y);else o&&n.push("L"+o.x+" "+o.y)})),n.join("")},bh=function(t,e,n,r,i){var o,a;if(n&&n.getType())if("combo"===n.getType()){(o=n.getKeyShape().getCanvasBBox()||ih(t)).centerX=(o.minX+o.maxX)/2,o.centerY=(o.minY+o.maxY)/2}else o=n.getBBox();else o=ih(t);if(r&&r.getType())if("combo"===r.getType()){var s=r.getKeyShape().getBBox();if(s){var u=r.getModel(),c=u.x,l=u.y;(a={x:c,y:l,width:s.width,height:s.height,minX:s.minX+c,maxX:s.maxX+c,minY:s.minY+l,maxY:s.maxY+l}).centerX=(a.minX+a.maxX)/2,a.centerY=(a.minY+a.maxY)/2}else a=ih(e)}else a=r&&r.getBBox();else a=ih(e);var h=sh(o,i),f=sh(a,i),d=uh(h,t,e),p=uh(f,e,t),g=function(t){void 0===t&&(t=[]);var e=[],n=[];t.forEach((function(t){e.push(t.x),n.push(t.y)}));var r=Math.min.apply(Math,e),i=Math.max.apply(Math,e),o=Math.min.apply(Math,n),a=Math.max.apply(Math,n);return{centerX:(r+i)/2,centerY:(o+a)/2,maxX:i,maxY:a,minX:r,minY:o,height:a-o,width:i-r}}([d,p]),v=ch(h,g),m=ch(f,g),y=[];y=y.concat(lh(v)).concat(lh(m));var b={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[g,v,m].forEach((function(t){y=y.concat(function(t,e){return function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x).concat(function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y))}(t,b).filter((function(t){return hh(t,h)&&hh(t,f)})))})),[{x:d.x,y:p.y},{x:p.x,y:d.y}].forEach((function(t){hh(t,h)&&hh(t,f)&&y.push(t)})),y.unshift(d),y.push(p);var x=function(t,e,n,r,i,o,a){var s=[],u=[e],c={},l={},h={};l[e.id]=0,h[e.id]=dh(e,n,e);var f,d,p,g,v,m={};for(t.forEach((function(t){m[t.id]=t}));u.length;){if(f=void 0,d=1/0,u.forEach((function(t){h[t.id]<=d&&(d=h[t.id],f=t)})),f===n){var y=[];return ph(y,m,c,n.id),y}g=f,v=void 0,(v=(p=u).indexOf(g))>-1&&p.splice(v,1),s.push(f),mh(t,f,r,i).forEach((function(t){if(-1===s.indexOf(t)){-1===u.indexOf(t)&&u.push(t);var r=h[f.id]+fh(f,t);l[t.id]&&r>=l[t.id]||(c[t.id]=f.id,l[t.id]=r,h[t.id]=l[t.id]+dh(t,n,e,o,a))}}))}return[e,n]}(y=oh(y),d,p,o,a,t,e);return x.unshift(t),x.push(e),ah(x)},xh={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},fallbackRoute:function(t,e,n,r,i){return ah(bh(t,e,n,r,i.offset))}},wh=(Math.PI,function(t,e){var n=Math.round(Math.abs(t/e));return n<0?0:(t<0?-1:1)*n}),_h=function(t,e){var n=e.x-t.x,r=e.y-t.y;return n||r?Math.atan2(r,n):0},Sh=function(t,e){var n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n},Eh=function(t,e,n){for(var r=1/0,i=0,o=e.length;i<o;i++){var a=n(t,e[i]);a<r&&(r=a)}return r},Mh=function(t,e,n,r,i){var o=[];if(!n)return[t];var a=i.directions,s=i.offset,c=n.getBBox(),l=e.x>c.minX&&e.x<c.maxX&&e.y>c.minY&&e.y<c.maxY,h=sh(c,s);for(var f in h)h[f]=wh(h[f],i.gridSize);if(l){for(var d=0,p=a;d<p.length;d++){var g=p[d],v=[[{x:h.minX,y:h.minY},{x:h.maxX,y:h.minY}],[{x:h.minX,y:h.minY},{x:h.minX,y:h.maxY}],[{x:h.maxX,y:h.minY},{x:h.maxX,y:h.maxY}],[{x:h.minX,y:h.maxY},{x:h.maxX,y:h.maxY}]];for(f=0;f<4;f++){var m=v[f],y=u.Util.getLineIntersect(t,{x:t.x+g.stepX*h.width,y:t.y+g.stepY*h.height},m[0],m[1]);y&&!vh(t,y,c)&&(y.id=y.x+"|||"+y.y,o.push(y))}}return o}var b=uh(h,t,r);return b.id=b.x+"|||"+b.y,[b]},Oh=function(t,e,n,r){var i=_h(t,e);if(!n[t.id]){var o=_h(r,t);return Sh(o,i)}var a=_h({x:n[t.id].x,y:n[t.id].y},t);return Sh(a,i)},Ah=function(t,e,n,r,i,o,a){var s=[r],u=t.id,c=t.x,l=t.y,h={x:c,y:l,id:u};for(Oh(h,o,e,n)&&s.unshift({x:o.x===r.x?r.x:h.x*a,y:o.y===r.y?r.y:h.y*a});e[u]&&e[u].id!==u;){var f={x:c,y:l,id:u},d=e[u].id,p=e[u].x,g=e[u].y,v={x:p,y:g,id:d};Oh(v,f,e,n)&&s.unshift({x:v.x===f.x?s[0].x:v.x*a,y:v.y===f.y?s[0].y:v.y*a}),u=d,c=p,l=g}var m=c,y=l;return s[0].x=m===n.x?i.x:s[0].x,s[0].y=y===n.y?i.y:s[0].y,s.unshift(i),s},kh=function(t,e,n,r,i){if(isNaN(t.x)||isNaN(e.x))return[];var o=Object(p.deepMix)(xh,i);o.obstacles=o.obstacles||[];var a=o.gridSize,s=function(t,e,n){var r={};return t.forEach((function(t){if(t)for(var i=sh(t.getBBox(),n),o=wh(i.minX,e);o<=wh(i.maxX,e);o+=1)for(var a=wh(i.minY,e);a<=wh(i.maxY,e);a+=1)r[o+"|||"+a]=!0})),r}(o.obstacles.concat([n,r]),a,o.offset),u={x:wh(t.x,a),y:wh(t.y,a)},c={x:wh(e.x,a),y:wh(e.y,a)};t.id=u.x+"|||"+u.y,e.id=c.x+"|||"+c.y;var l=Mh(u,t,n,c,o),h=Mh(c,e,r,u,o);l.forEach((function(t){delete s[t.id]})),h.forEach((function(t){delete s[t.id]}));for(var f={},d={},g={},v={},m={},y=0;y<l.length;y++){var b=l[y];f[b.id]=b,v[b.id]=0,m[b.id]=Eh(b,h,o.distFunc)}for(var x,w,_,S,E,M,O,A=o.maximumLoops,k=o.penalties;Object.keys(f).length>0&&A>0&&(x=void 0,w=1/0,Object.keys(f).forEach((function(t){var e=f[t].id;m[e]<=w&&(w=m[e],x=f[e])})),x);){if(h.findIndex((function(t){return t.x===x.x&&t.y===x.y}))>-1)return Ah(x,g,u,e,t,c,a);delete f[x.id],d[x.id]=!0;for(y=0;y<o.directions.length;y++)_=o.directions[y],d[(S={x:x.x+_.stepX,y:x.y+_.stepY,id:Math.round(x.x)+_.stepX+"|||"+(Math.round(x.y)+_.stepY)}).id]||(O=Oh(x,S,g,u))>o.maxAllowedDirectionChange||s[S.id]||(f[S.id]||(f[S.id]=S),E=o.distFunc(x,S)+(isNaN(k[O])?a:k[O]),M=v[x.id]+E,v[S.id]&&M>=v[S.id]||(g[S.id]=x,v[S.id]=M,m[S.id]=M+Eh(S,h,o.distFunc)));A-=1}return o.fallbackRoute(t,e,n,r,o)};Object(u.registerEdge)("polyline",{options:{color:u.BaseGlobal.defaultEdge.color,size:u.BaseGlobal.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:u.BaseGlobal.defaultEdge.style.stroke,lineAppendWidth:u.BaseGlobal.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:u.BaseGlobal.edgeLabel.style.fill,fontSize:u.BaseGlobal.edgeLabel.style.fontSize,fontFamily:u.BaseGlobal.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:Object(s.__assign)({},u.BaseGlobal.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);0===n.radius&&delete n.radius;var r=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n});return e.shapeMap["edge-shape"]=r,r},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},r=Object(p.mix)({},e,n,t.style);t=this.getPathPoints(t),this.radius=r.radius,this.offset=r.offset;var i=t.startPoint,o=t.endPoint,a=this.getControlPoints(t),s=[i];a&&(s=s.concat(a)),s.push(o);var c=t.sourceNode,l=t.targetNode,h=r.radius,f=this.options.routeCfg,d=Object(p.mix)({},f,t.routeCfg);d.offset=r.offset;var g=this.getPath(s,c,l,h,d);return(Object(p.isArray)(g)&&g.length<=1||Object(p.isString)(g)&&-1===g.indexOf("L"))&&(g="M0 0, L0 0"),(isNaN(i.x)||isNaN(i.y)||isNaN(o.x)||isNaN(o.y))&&(g="M0 0, L0 0"),Object(p.mix)({},u.BaseGlobal.defaultEdge.style,r,{lineWidth:t.size,path:g})},updateShapeStyle:function(t,e){var n=e.getContainer();if(e.isVisible()){var r={stroke:t.color},i=n.shapeMap["edge-shape"]||n.find((function(t){return"edge-shape"===t.get("className")}))||e.getKeyShape(),o=t.size,a=(t=this.getPathPoints(t)).startPoint,s=t.endPoint,u=this.getControlPoints(t),c=[a];u&&(c=c.concat(u)),c.push(s);var l=i.attr(),h=Object(p.mix)({},r,l,t.style),f=t.sourceNode,d=t.targetNode,g=h.radius,v=this.options.routeCfg,m=Object(p.mix)({},v,t.routeCfg);m.offset=h.offset;var y=this.getPath(c,f,d,g,m);(Object(p.isArray)(y)&&y.length<=1||Object(p.isString)(y)&&-1===y.indexOf("L"))&&(y="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(s.x)||isNaN(s.y))&&(y="M0 0, L0 0"),l.endArrow&&!1===h.endArrow&&(t.style.endArrow={path:""}),l.startArrow&&!1===h.startArrow&&(t.style.startArrow={path:""});var b=Object(p.mix)(r,i.attr(),{lineWidth:o,path:y},t.style);i&&i.attr(b)}},getPath:function(t,e,n,r,i){var o=i.offset,a=i.simple;if(!o||t.length>2){if(r)return yh(t,r);var s=[];return Object(p.each)(t,(function(t,e){0===e?s.push(["M",t.x,t.y]):s.push(["L",t.x,t.y])})),s}var c=a?bh(t[t.length-1],t[0],n,e,o):kh(t[0],t[t.length-1],e,n,i);return c&&c.length?r?yh(c,r):u.Util.pointsToPolygon(c):"M0 0, L0 0"}},"single-edge");var Ch=Ts.cloneEvent,Ih=Ts.isNaN,Th=Math.abs,Ph=["shift","ctrl","alt","control"],Nh={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(t){var e=this.origin,n=+t.clientX,r=+t.clientY;if(!Ih(n)&&!Ih(r)){var i=n-e.x,o=r-e.y;"x"===this.get("direction")?o=0:"y"===this.get("direction")&&(i=0),this.origin={x:n,y:r};var a=this.graph.get("width"),s=this.graph.get("height"),u=this.graph.get("canvas").getCanvasBBox(),c=this.scalableRange,l=this.scalableRange;c<1&&c>-1&&(c*=a,l*=s),(u.minX<=a+c&&u.minX+i>a+c||u.maxX+c>=0&&u.maxX+c+i<0)&&(i=0),(u.minY<=s+l&&u.minY+o>s+l||u.maxY+l>=0&&u.maxY+l+o<0)&&(o=0),this.graph.translate(i,o)}},onTouchStart:function(t){var e=t.originalEvent.touches,n=e[0],r=e[1];n&&r||(t.preventDefault(),this.onMouseDown(t))},onMouseDown:function(t){var e=t.originalEvent;if((!e||t.name===u.G6Event.TOUCHSTART||0===e.button)&&(t.name===u.G6Event.TOUCHSTART||"undefined"==typeof window||!window.event||window.event.buttons||window.event.button)&&this.shouldBegin.call(this,t)&&!this.keydown){var n=t.target,r=n&&n.isCanvas&&n.isCanvas();if((this.allowDragOnItem||r)&&(this.origin={x:t.clientX,y:t.clientY},this.dragging=!1,this.enableOptimize)){for(var i=this.graph,o=i.getEdges(),a=0,s=o.length;a<s;a++){var c=o[a].get("group").get("children");c&&c.forEach((function(t){t.set("ori-visibility",t.get("ori-visibility")||t.get("visible")),t.hide()}))}for(var l=i.getNodes(),h=0,f=l.length;h<f;h++)for(var d=0,p=l[h].getContainer().get("children");d<p.length;d++){var g=p[d];g.get("isKeyShape")||(g.set("ori-visibility",g.get("ori-visibility")||g.get("visible")),g.hide())}}}},onTouchMove:function(t){var e=t.originalEvent.touches,n=e[0],r=e[1];n&&r?this.onMouseUp(t):(t.preventDefault(),this.onMouseMove(t))},onMouseMove:function(t){var e=this.graph;if(!this.keydown){var n=t.target,r=n&&n.isCanvas&&n.isCanvas();if((this.allowDragOnItem||r)&&(t=Ch(t),this.origin)){if(this.dragging)t.type="drag",e.emit("canvas:drag",t);else{if(Th(this.origin.x-t.clientX)+Th(this.origin.y-t.clientY)<10)return;this.shouldBegin.call(this,t)&&(t.type="dragstart",e.emit("canvas:dragstart",t),this.originPosition={x:t.clientX,y:t.clientY},this.dragging=!0)}this.shouldUpdate.call(this,t)&&this.updateViewport(t)}}},onMouseUp:function(t){var e,n,r=this.graph;if(!this.keydown){var i=r.getZoom(),o=r.get("modeController"),a=null===(n=null===(e=null==o?void 0:o.modes[o.mode])||void 0===e?void 0:e.filter((function(t){return"zoom-canvas"===t.type})))||void 0===n?void 0:n[0],s=a?a.optimizeZoom||.1:0;if(this.enableOptimize){for(var u=r.getEdges(),c=0,l=u.length;c<l;c++){var h=u[c].get("group").get("children");h&&h.forEach((function(t){t.get("ori-visibility")&&t.show()}))}if(i>s)for(var f=r.getNodes(),d=0,p=f.length;d<p;d++)for(var g=0,v=f[d].getContainer().get("children");g<v.length;g++){var m=v[g];if(!m.get("isKeyShape"))m.get("ori-visibility")&&m.show()}}this.dragging?(t=Ch(t),this.shouldEnd.call(this,t)&&this.updateViewport(t),t.type="dragend",t.dx=t.clientX-this.originPosition.x,t.dy=t.clientY-this.originPosition.y,r.emit("canvas:dragend",t),this.endDrag()):this.origin=null}},endDrag:function(){this.origin=null,this.dragging=!1,this.dragbegin=!1},onKeyDown:function(t){var e=t.key;e&&(Ph.indexOf(e.toLowerCase())>-1?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1}},jh={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:dragstart":"onDragStart","node:drag":"onDrag","node:dragend":"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd"}},validationCombo:function(t){return!(!this.origin||!t||t.destroyed)&&"combo"===t.getType()},onTouchStart:function(t){if(t.item){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.onDragStart(t)}},onTouchMove:function(t){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return void this.onDragEnd(t);t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.onDrag(t)},onDragStart:function(t){var e=this;if(this.currentShouldEnd=!0,this.shouldBegin.call(this,t)){var n=t.item;if(n&&!n.destroyed&&!n.hasLocked()){n.getContainer().set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(n);var r=t.target;if(r)if(r.get("isAnchorPoint"))return;var i=this.graph;this.targets=[],this.targetCombo=null;var o=i.findAllByState("node",this.selectedState),a=n.get("id");0===o.filter((function(t){var e=t.get("id");return a===e})).length?this.targets.push(n):o.length>1?o.forEach((function(t){t.hasLocked()||e.targets.push(t)})):this.targets.push(n);var s=[];this.targets.forEach((function(t){s.push(Object(p.clone)(t.getModel()))})),this.set("beforeDragNodes",s),this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach((function(t){t.getEdges().forEach((function(t){t.isVisible()&&(e.hidenEdge[t.getID()]=!0,t.hide())}))})),this.origin={x:t.x,y:t.y},this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;this.origin&&this.shouldUpdate.call(this,t)&&(this.get("enableDelegate")?this.updateDelegate(t):this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge")}):this.targets.map((function(n){e.update(n,t)})))},onDragEnd:function(t){var e,n=this;if(this.origin){null===(e=this.cachedCaptureItems)||void 0===e||e.forEach((function(t){t.getContainer().set("capture",!0)})),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach((function(t){t.getEdges().forEach((function(t){n.hidenEdge[t.getID()]&&t.show(),t.refresh()}))})),this.hidenEdge={};var r=this.graph;if(r.get("enabledStack")&&this.enableStack){var i={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach((function(t){i.before.nodes.push({id:t.id,x:t.x,y:t.y})})),this.targets.forEach((function(t){var e=t.getModel();i.after.nodes.push({id:e.id,x:e.x,y:e.y})})),r.pushStack("update",Object(p.clone)(i))}r.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(t){var e=t.item;if(this.currentShouldEnd=this.shouldEnd.call(this,t,e),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&this.validationCombo(e)){var n=this.graph;if(this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)n.updateCombos();else{var r=e.getModel();this.targets.map((function(t){t.getModel().comboId!==r.id&&n.updateComboTree(t,r.id)})),n.updateCombo(e)}n.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.currentShouldEnd=this.shouldEnd.call(this,t,void 0),this.updatePositions(t,!this.currentShouldEnd),this.targets&&0!==this.targets.length&&this.currentShouldEnd&&(this.onlyChangeComboSize?e.updateCombos():this.targets.map((function(t){t.getModel().comboId&&e.updateComboTree(t)})))},onDropNode:function(t){if(this.targets&&0!==this.targets.length){var e=t.item,n=this.graph,r=e.getModel().comboId,i=r?n.findById(r):void 0;if(this.currentShouldEnd=this.shouldEnd.call(this,t,i),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){if(this.onlyChangeComboSize)n.updateCombos();else if(r){var o=n.findById(r);this.comboActiveState&&n.setItemState(o,this.comboActiveState,!1),this.targets.map((function(t){var e=t.getModel();r!==e.comboId&&n.updateComboTree(t,r)})),n.updateCombo(o)}else this.targets.map((function(t){t.getModel().comboId&&n.updateComboTree(t)}));n.emit("dragnodeend",{items:this.targets,targetItem:e})}}},onDragEnter:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t,e){var n=this;this.targets&&0!==this.targets.length&&(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),updateFunc:this.update}):e||this.targets.map((function(e){return n.update(e,t)})):this.targets.map((function(r){return n.update(r,t,e)})))},update:function(t,e,n){var r=this.origin,i=t.get("model"),o=t.get("id");this.point[o]||(this.point[o]={x:i.x||0,y:i.y||0});var a=e.x-r.x+this.point[o].x,s=e.y-r.y+this.point[o].y;n&&(a+=r.x-e.x,s+=r.y-e.y);var u={x:a,y:s};this.get("updateEdge")?this.graph.updateItem(t,u,!1):t.updatePosition(u)},debounceUpdate:Object(p.debounce)((function(t){var e=t.targets,n=t.graph,r=t.point,i=t.origin,o=t.evt,a=t.updateEdge;t.updateFunc;e.map((function(t){var e=t.get("model"),s=t.get("id");r[s]||(r[s]={x:e.x||0,y:e.y||0});var u={x:o.x-i.x+r[s].x,y:o.y-i.y+r[s].y};a?n.updateItem(t,u,!1):t.updatePosition(u)}))}),50,!0),updateDelegate:function(t){var e=this.graph;if(this.delegateRect){var n=t.x-this.origin.x+this.originPoint.minX,r=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:n,y:r})}else{var i=e.get("group"),o=Object(p.deepMix)({},D.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(t),u=a.x,c=a.y,l=a.width,h=a.height,f=a.minX,d=a.minY;this.originPoint={x:u,y:c,width:l,height:h,minX:f,minY:d},this.delegateRect=i.addShape("rect",{attrs:Object(s.__assign)({width:l,height:h,x:u,y:c},o),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(t){var e=this.targets;0===e.length&&e.push(t.item);for(var n=1/0,r=-1/0,i=1/0,o=-1/0,a=0;a<e.length;a++){var s=e[a].getBBox(),u=s.minX,c=s.minY,l=s.maxX,h=s.maxY;u<n&&(n=u),c<i&&(i=c),l>r&&(r=l),h>o&&(o=h)}return{x:Math.floor(n),y:Math.floor(i),width:Math.ceil(r)-Math.floor(n),height:Math.ceil(o)-Math.floor(i),minX:n,minY:i}}},Dh={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return"mouseenter"===this.get("trigger")?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(t){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.setAllItemStates(t)},clearOnTouchStart:function(t){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.clearActiveState(t)},setAllItemStates:function(t){var e=t.item,n=this.graph;if(this.item=e,this.shouldUpdate(t.item,{event:t,action:"activate"})){for(var r=this.activeState,i=this.inactiveState,o=n.getNodes(),a=n.getCombos(),s=n.getEdges(),u=n.get("vedges"),c=o.length,l=a.length,h=s.length,f=u.length,d=0;d<c;d++){var p=o[d],g=p.hasState("selected");this.resetSelected&&g&&n.setItemState(p,"selected",!1),n.setItemState(p,r,!1),i&&n.setItemState(p,i,!0)}for(d=0;d<l;d++){var v=a[d];g=v.hasState("selected");this.resetSelected&&g&&n.setItemState(v,"selected",!1),n.setItemState(v,r,!1),i&&n.setItemState(v,i,!0)}for(d=0;d<h;d++){var m=s[d];n.setItemState(m,r,!1),i&&n.setItemState(m,i,!0)}for(d=0;d<f;d++){var y=u[d];n.setItemState(y,r,!1),i&&n.setItemState(y,i,!0)}i&&n.setItemState(e,i,!1),n.setItemState(e,r,!0);var b=e.getEdges(),x=b.length;for(d=0;d<x;d++){var w=void 0;w=(m=b[d]).getSource()===e?m.getTarget():m.getSource(),i&&n.setItemState(w,i,!1),n.setItemState(w,r,!0),n.setItemState(m,i,!1),n.setItemState(m,r,!0),m.toFront()}n.emit("afteractivaterelations",{item:t.item,action:"activate"})}},clearActiveState:function(t){var e=this.get("graph");if(this.shouldUpdate(t.item,{event:t,action:"deactivate"})){var n=this.activeState,r=this.inactiveState,i=e.get("autoPaint");e.setAutoPaint(!1);for(var o=e.getNodes()||[],a=e.getCombos()||[],s=e.getEdges()||[],u=e.get("vedges")||[],c=o.length,l=a.length,h=s.length,f=u.length,d=0;d<c;d++){var p=o[d];e.clearItemStates(p,[n,r])}for(d=0;d<l;d++){var g=a[d];e.clearItemStates(g,[n,r])}for(d=0;d<h;d++){var v=s[d];e.clearItemStates(v,[n,r,"deactivate"])}for(d=0;d<f;d++){var m=u[d];e.clearItemStates(m,[n,r,"deactivate"])}e.paint(),e.setAutoPaint(i),e.emit("afteractivaterelations",{item:t.item||this.get("item"),action:"deactivate"})}}},Lh=Math.min,Rh=Math.max,Bh=Math.abs,Gh=["drag","shift","ctrl","alt","control"],Fh={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:"shift",includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return Gh.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(t){var e=t.item,n=this.brush;e||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates(),n||(n=this.createBrush()),this.originPoint={x:t.canvasX,y:t.canvasY},n.attr({width:0,height:0}),n.show(),this.dragging=!0)},onMouseMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&this.updateBrush(t)},onMouseUp:function(t){this.graph;(this.brush||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(t),this.dragging=!1)},clearStates:function(){var t=this.graph,e=this.selectedState,n=t.findAllByState("node",e),r=t.findAllByState("edge",e);n.forEach((function(n){return t.setItemState(n,e,!1)})),r.forEach((function(n){return t.setItemState(n,e,!1)})),this.selectedNodes=[],this.selectedEdges=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedNodes:function(t){var e=this,n=this.graph,r=this.originPoint,i=this.shouldUpdate,o=this.selectedState,a={x:t.x,y:t.y},s=n.getPointByCanvas(r.x,r.y),u=Lh(a.x,s.x),c=Rh(a.x,s.x),l=Lh(a.y,s.y),h=Rh(a.y,s.y),f=[],d=[];n.getNodes().forEach((function(t){if(t.isVisible()){var e=t.getBBox();if(e.centerX>=u&&e.centerX<=c&&e.centerY>=l&&e.centerY<=h&&i(t,"select")){f.push(t);var r=t.getModel();d.push(r.id),n.setItemState(t,o,!0)}}}));var p=[];this.includeEdges&&f.forEach((function(t){t.getOutEdges().forEach((function(t){if(t.isVisible()){var r=t.getModel(),o=r.source,a=r.target;d.includes(o)&&d.includes(a)&&i(t,"select")&&(p.push(t),n.setItemState(t,e.selectedState,!0))}}))})),this.selectedEdges=p,this.selectedNodes=f,this.onSelect&&this.onSelect(f,p),n.emit("nodeselectchange",{selectedItems:{nodes:f,edges:p},select:!0})},createBrush:function(){var t=this.graph.get("canvas").addShape("rect",{attrs:this.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(t){var e=this.originPoint;this.brush.attr({width:Bh(t.canvasX-e.x),height:Bh(t.canvasY-e.y),x:Lh(t.canvasX,e.x),y:Lh(t.canvasY,e.y)})},onKeyDown:function(t){var e=t.key;if(e){var n=this.trigger.toLowerCase(),r=e.toLowerCase();this.keydown=r===n||"control"===r&&"ctrl"===n||"ctrl"===r&&"control"===n}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}},zh=["shift","ctrl","alt","control"],Uh={getDefaultCfg:function(){return{multiple:!0,trigger:"shift",selectedState:"selected"}},getEvents:function(){return zh.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.multiple?{"node:click":"onClick","combo:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(t){var e=this,n=t.item;if(n&&!n.destroyed){n.getType();var r=e.graph,i=e.keydown,o=e.multiple,a=e.shouldUpdate;if(e.shouldBegin.call(e,t)){if(!i||!o){var s=r.findAllByState("node",e.selectedState).concat(r.findAllByState("combo",e.selectedState));Object(p.each)(s,(function(t){t!==n&&r.setItemState(t,e.selectedState,!1)}))}if(n.hasState(e.selectedState)){a.call(e,t)&&r.setItemState(n,e.selectedState,!1);var u=r.findAllByState("node",e.selectedState),c=r.findAllByState("combo",e.selectedState);r.emit("nodeselectchange",{target:n,selectedItems:{nodes:u,combos:c},select:!1})}else{a.call(e,t)&&r.setItemState(n,e.selectedState,!0);u=r.findAllByState("node",e.selectedState),c=r.findAllByState("combo",e.selectedState);r.emit("nodeselectchange",{target:n,selectedItems:{nodes:u,combos:c},select:!0})}}}},onCanvasClick:function(){var t=this,e=this.graph,n=e.findAllByState("node",this.selectedState);Object(p.each)(n,(function(n){e.setItemState(n,t.selectedState,!1)}));var r=e.findAllByState("combo",this.selectedState);Object(p.each)(r,(function(n){e.setItemState(n,t.selectedState,!1)})),e.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()||"control"===e.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1}},Vh=d.ext.transform,Wh={getDefaultCfg:function(){return{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(t){var e=t.originalEvent.touches,n=e[0],r=e[1];t.preventDefault(),r&&(this.shouldBegin&&!this.shouldBegin.call(this,t)||(this.startPoint={pageX:n.pageX,pageY:n.pageY},this.moveable=!0,r&&(this.endPoint={pageX:r.pageX,pageY:r.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(t){if(this.moveable){t.preventDefault();var e=t.originalEvent.touches,n=e[0],r=e[1];if(r){this.endPoint||(this.endPoint={pageX:r.pageX,pageY:r.pageY});var i=function(t,e){return Math.hypot(e.x-t.x,e.y-t.y)},o=i({x:n.pageX,y:n.pageY},{x:r.pageX,y:r.pageY})/i({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),a=this.originScale*o;this.currentScale=a;var s=this.get("minZoom")||this.graph.get("minZoom");if(!(a>(this.get("maxZoom")||this.graph.get("maxZoom"))||a<s)){var u=this.graph.get("canvas").getPointByClient(t.clientX,t.clientY);this.graph.zoomTo(a,{x:u.x,y:u.y}),this.graph.emit("wheelzoom",t)}}}},onTouchEnd:function(){this.moveable=!1,this.endPoint=null},onWheel:function(t){var e=this,n=this.graph,r=this.fixSelectedItems;if((!this.shouldBegin||this.shouldBegin.call(this,t))&&this.shouldUpdate.call(this,t)){t.preventDefault();var i,o=n.get("canvas").getPointByClient(t.clientX,t.clientY),a=this.get("sensitivity"),s=n.getZoom();i=s*(t.wheelDelta<0?1-.05*a:1/(1-.05*a));var u=this.get("minZoom")||n.get("minZoom");if(!(i>(this.get("maxZoom")||n.get("maxZoom"))||i<u)){if(this.get("enableOptimize")){var c=this.get("optimizeZoom"),l=this.get("optimized"),h=n.getNodes(),f=n.getEdges(),d=h.length,g=f.length;if(!l){for(var v=0;v<d;v++){if(!(O=h[v]).destroyed)for(var m=(q=O.get("group").get("children")).length,y=0;y<m;y++){(L=q[y]).destoryed||L.get("isKeyShape")||(L.set("ori-visibility",L.get("ori-visibility")||L.get("visible")),L.hide())}}for(var b=0;b<g;b++)for(m=(q=(H=f[b]).get("group").get("children")).length,y=0;y<m;y++){(L=q[y]).set("ori-visibility",L.get("ori-visibility")||L.get("visible")),L.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var x=setTimeout((function(){var t=n.getZoom();if(e.get("optimized")){e.set("optimized",!1);for(var r=0;r<d;r++){var i=h[r],o=(l=i.get("group").get("children")).length;if(t<c)(s=(p=i.getKeyShape()).get("ori-visibility"))&&p.show();else for(var a=0;a<o;a++){var s=(m=l[a]).get("ori-visibility");!m.get("visible")&&s&&s&&m.show()}}for(var u=0;u<g;u++){var l,p,v=f[u];o=(l=v.get("group").get("children")).length;if(t<c)(s=(p=v.getKeyShape()).get("ori-visibility"))&&p.show();else for(a=0;a<o;a++){var m;if(!(m=l[a]).get("visible"))(s=m.get("ori-visibility"))&&m.show()}}}}),100);this.set("timeout",x)}if(s<=1){var w=void 0,_=void 0;if(r.fixAll||r.fixLineWidth||r.fixLabel){w=n.findAllByState("node",r.fixState),_=n.findAllByState("edge",r.fixState);for(var S=s/i,E=w.length,M=0;M<E;M++){var O,A=(O=w[M]).getContainer(),k=O.getModel(),C=O.getOriginStyle(),I=O.getStateStyle(r.fixState),T=O.get("shapeFactory").getShape(k.type).getStateStyle(r.fixState,O)[r.fixState];if(r.fixAll){if(i<=1){var P=Object(p.clone)(A.getMatrix());P||(P=[1,0,0,0,1,0,0,0,1]);var N=O.getModel(),j=N.x,D=N.y;P=Vh(P,[["t",-j,-D],["s",S,S],["t",j,D]]),A.setMatrix(P)}}else for(m=(q=A.get("children")).length,y=0;y<m;y++){var L=q[y],R=void 0,B=void 0;if(r.fixLabel)if("text"===L.get("type")){R=L.attr("fontSize")||12;var G=I[L.get("name")],F=T[L.get("name")],z=G?G.fontSize:12,U=F?F.fontSize:12,V=z||U||12;if(i<=1&&L.attr("fontSize",V/i),B)break}if(r.fixLineWidth&&L.get("isKeyShape")){B=L.attr("lineWidth")||0;var W=I.lineWidth||T.lineWidth||C.lineWidth||0;if(i<=1&&L.attr("lineWidth",W/i),R)break}}}for(var Y=_.length,X=0;X<Y;X++){var H,q=(A=(H=_[X]).getContainer()).get("children");for(k=H.getModel(),I=H.getStateStyle(r.fixState),T=H.get("shapeFactory").getShape(k.type).getStateStyle(r.fixState,H)[r.fixState],m=q.length,y=0;y<m;y++){L=q[y],R=void 0,B=void 0;if(r.fixLabel||r.fixAll)if("text"===L.get("type")){R=L.attr("fontSize")||12;G=I[L.get("name")],F=T[L.get("name")],z=G?G.fontSize:12,U=F?F.fontSize:12,V=z||U||12;if(i<=1&&L.attr("fontSize",V/i),B)break}if((r.fixLineWidth||r.fixAll)&&L.get("isKeyShape")){B=L.attr("lineWidth")||0;W=I.lineWidth||T.lineWidth||1;if(i<=1&&L.attr("lineWidth",W/i),R)break}}}}}n.zoomTo(i,{x:o.x,y:o.y}),n.emit("wheelzoom",t)}}}},Yh={onMouseEnter:function(t){var e=t.item;this.currentTarget=e,this.showTooltip(t),this.graph.emit("tooltipchange",{item:t.item,action:"show"})},onMouseMove:function(t){this.shouldUpdate(t)?this.currentTarget&&t.item===this.currentTarget&&this.updatePosition(t):this.hideTooltip()},onMouseLeave:function(t){this.shouldEnd(t)&&(this.hideTooltip(),this.graph.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null)},showTooltip:function(t){var e=this.container;if(t.item&&!t.item.destroyed){e||(e=this.createTooltip(this.graph.get("canvas")),this.container=e);var n=this.formatText(t.item.get("model"),t);e.innerHTML=n,B(this.container,{visibility:"visible"}),this.updatePosition(t)}},hideTooltip:function(){B(this.container,{visibility:"hidden"})},updatePosition:function(t){var e=this.get("shouldBegin"),n=this.width,r=this.height,i=this.container,o=this.graph;if(e(t)){var a=o.getPointByClient(t.clientX,t.clientY),s=o.getCanvasByPoint(a.x,a.y),u=s.x,c=s.y,l=i.getBoundingClientRect();u>n/2?u-=l.width:u+=this.offset,c>r/2?c-=l.height:c+=this.offset;var h=u+"px",f=c+"px";B(this.container,{left:h,top:f,visibility:"visible"})}else B(i,{visibility:"hidden"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var n=R('<div class="g6-tooltip g6-'+this.item+'-tooltip"></div>');return e.parentNode.appendChild(n),B(n,{position:"absolute",visibility:"visible"}),this.width=t.get("width"),this.height=t.get("height"),this.container=n,this.graph.get("tooltips").push(n),n}},Xh=Object(s.__assign)({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(t){return t.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Yh),Hh=Object(s.__assign)({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: "+t.source+" target: "+t.target}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Yh),qh=["click","dblclick"],Kh={getDefaultCfg:function(){return{trigger:"click",onChange:function(){}}},getEvents:function(){var t,e;return qh.includes(this.trigger)?e=this.trigger:(e="click",console.warn("Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["node:"+e]="onNodeClick",t.touchstart="onNodeClick",t},onNodeClick:function(t){var e=t.item;if(e){var n=this.graph.findDataById(e.get("id"));if(n){var r=n.children;if(r&&0!==r.length){var i=!n.collapsed;this.shouldBegin(t,i)&&(n.collapsed=i,e.getModel().collapsed=i,this.graph.emit("itemcollapsed",{item:t.item,collapsed:i}),this.shouldUpdate(t,i)&&(this.onChange(e,i),this.graph.layout()))}}}}},Zh=Ts.calculationItemsBBox,$h={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected"}},getEvents:function(){return{"combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(t){var e=t.item;return!(!e||e.destroyed)&&(!!this.shouldUpdate.call(this,t)&&"combo"===e.getType())},onDragStart:function(t){var e=this,n=this.graph,r=t.item;if(this.currentShouldEnd=!0,this.validationCombo(t)){this.targets=[];var i=n.findAllByState("combo",this.selectedState),o=r.get("id");0===i.filter((function(t){var e=t.get("id");return o===e})).length?this.targets.push(r):this.targets=i,this.activeState&&this.targets.map((function(t){var r=t.getModel();if(r.parentId){var i=n.findById(r.parentId);i&&n.setItemState(i,e.activeState,!0)}})),this.point={},this.originPoint={},this.origin={x:t.x,y:t.y},this.currentItemChildCombos=[],function t(e,n){if(!1!==n(e)&&e){var r=e.get("combos");if(0===r.length)return!1;Object(p.each)(r,(function(e){t(e,n)}))}}(r,(function(t){if(t.destroyed)return!1;var n=t.getModel();return e.currentItemChildCombos.push(n.id),!0}))}},onDrag:function(t){var e=this;if(this.origin&&this.validationCombo(t))if(this.enableDelegate)this.updateDelegate(t);else{if(this.activeState){var n=this.graph,r=t.item,i=r.getModel(),o=n.getCombos(),a=r.getBBox(),s=a.centerX,u=a.centerY,c=a.width;o.filter((function(t){var n=t.getModel();return i.parentId,n.id!==i.id&&!e.currentItemChildCombos.includes(n.id)})).map((function(t){var r=t.getBBox(),i=r.centerX,o=r.centerY,a=r.width,l=s-i,h=u-o,f=2*Math.sqrt(l*l+h*h);c+a-f>.8*c?n.setItemState(t,e.activeState,!0):n.setItemState(t,e.activeState,!1)}))}Object(p.each)(this.targets,(function(n){e.updateCombo(n,t)}))}},updatePositions:function(t,e){var n=this;(this.enableDelegate||e)&&Object(p.each)(this.targets,(function(r){n.updateCombo(r,t,e)}))},onDrop:function(t){var e=this,n=t.item;if(this.currentShouldEnd=this.shouldEnd.call(this,t,n),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&n&&this.targets&&!n.destroyed){var r=this.graph,i=n.getModel();this.targets.map((function(t){t.getModel().parentId!==i.id?(e.activeState&&r.setItemState(n,e.activeState,!1),e.onlyChangeComboSize?r.updateCombo(t):r.updateComboTree(t,i.id)):r.updateCombo(n)})),this.end(n,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(this.targets&&0!==this.targets.length){var n=this.graph,r=t.item.getModel().comboId,i=r?n.findById(r):void 0;if(this.currentShouldEnd=this.shouldEnd.call(this,t,i),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){var o;if(r){if(this.activeState){var a=n.findById(r);n.setItemState(a,this.activeState,!1)}this.targets.map((function(t){e.onlyChangeComboSize?n.updateCombo(t):r!==t.getID()&&(o=n.findById(r),r!==t.getModel().parentId&&n.updateComboTree(t,r))}))}else this.targets.map((function(t){e.onlyChangeComboSize?n.updateCombo(t):t.getModel().comboId&&n.updateComboTree(t)}));this.endComparison=!0,this.end(o,t)}}},onDragEnter:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.currentShouldEnd&&this.updatePositions(t);var n=this.getParentCombo(e.getModel().parentId),r=this.graph;n&&this.activeState&&r.setItemState(n,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var n=this;if(this.origin){var r=this.graph;if(this.delegateShape)r.get("delegateGroup").clear(),this.delegateShape=null;t&&this.activeState&&r.setItemState(t,this.activeState,!1),t||this.targets.map((function(t){n.onlyChangeComboSize?r.updateCombo(t):r.updateComboTree(t)})),this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e){var n=this;if(!1!==e(t)&&t){var r=t.get("combos");Object(p.each)(r,(function(t){n.traverse(t,e)}));var i=t.get("nodes");Object(p.each)(i,(function(t){n.traverse(t,e)}))}},updateCombo:function(t,e,n){var r=this;this.traverse(t,(function(t){return!t.destroyed&&(r.updateSignleItem(t,e,n),!0)}))},updateSignleItem:function(t,e,n){var r=this.origin,i=this.graph,o=t.getModel(),a=t.get("id");this.point[a]||(this.point[a]={x:o.x,y:o.y});var s=e.x-r.x+this.point[a].x,u=e.y-r.y+this.point[a].y;n&&(s+=r.x-e.x,u+=r.y-e.y),i.updateItem(t,{x:s,y:u})},getParentCombo:function(t){var e=this.graph;if(t){var n=e.findById(t);if(n)return n}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var n=t.x-this.origin.x+this.originPoint.minX,r=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:n,y:r})}else{var i=e.get("delegateGroup"),o=null,a=(o=this.targets.length>1?Zh(this.targets):this.targets[0].getBBox()).x,u=o.y,c=o.width,l=o.height,h=o.minX,f=o.minY;this.originPoint={x:a,y:u,width:c,height:l,minX:h,minY:f};var d=Object(s.__assign)(Object(s.__assign)({},D.delegateStyle),this.delegateStyle);this.delegateShape=i.addShape("rect",{attrs:Object(s.__assign)({width:o.width,height:o.height,x:o.x,y:o.y},d),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}}},Qh=["click","dblclick"],Jh={getDefaultCfg:function(){return{trigger:"dblclick",relayout:!0}},getEvents:function(){var t,e;return Qh.includes(this.trigger)?e=this.trigger:(e="dblclick",console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["combo:"+e]="onComboClick",t},onComboClick:function(t){var e=t.item,n=this.graph,r=this.relayout;if(e&&!e.destroyed&&"combo"===e.getType()){var i=e.getModel().id;i&&(n.collapseExpandCombo(i),r&&n.get("layout")?n.layout():n.refreshPositions())}}},tf=Ts.isPolygonsIntersect,ef=Ts.pathToPoints,nf=["drag","shift","ctrl","alt","control"],rf=["click","drag"],of=["shift","ctrl","control","alt","meta",void 0],af=["shift","ctrl","alt","control"],sf=["shift","ctrl","alt","control"],uf={"drag-canvas":Nh,"zoom-canvas":Wh,"drag-node":jh,"activate-relations":Dh,"brush-select":Fh,"click-select":Uh,"lasso-select":{getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:"shift",includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return nf.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(t){var e=this.lasso;t.item||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates(),e||(e=this.createLasso()),this.dragging=!0,this.originPoint={x:t.x,y:t.y},this.points.push(this.originPoint),e.show())},onDragMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&(this.points.push({x:t.x,y:t.y}),this.updateLasso(t))},onDragEnd:function(t){(this.lasso||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var t=this.points,e=[];return t.length&&(t.forEach((function(t,n){0===n?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])})),e.push(["L",t[0].x,t[0].y])),e},clearStates:function(){var t=this.graph,e=this.selectedState,n=t.findAllByState("node",e),r=t.findAllByState("edge",e);n.forEach((function(n){return t.setItemState(n,e,!1)})),r.forEach((function(n){return t.setItemState(n,e,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var t=this,e=this.graph,n=this.shouldUpdate,r=this.points.map((function(t){return[e.getCanvasByPoint(t.x,t.y).x,e.getCanvasByPoint(t.x,t.y).y]})),i=this.selectedState,o=[],a=[];e.getNodes().forEach((function(t){if(t.isVisible()&&function(t,e){var n,r=t.getKeyShape();if("path"===t.get("type"))n=ef(r.attr("path"));else{var i=r.getCanvasBBox();n=[[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]}return tf(e,n)}(t,r)&&n(t,"select")){o.push(t);var s=t.getModel();a.push(s.id),e.setItemState(t,i,!0)}}));var s=[];this.includeEdges&&o.forEach((function(r){r.getOutEdges().forEach((function(r){if(r.isVisible()){var i=r.getModel(),o=i.source,u=i.target;a.includes(o)&&a.includes(u)&&n(r,"select")&&(s.push(r),e.setItemState(r,t.selectedState,!0))}}))})),this.selectedEdges=s,this.selectedNodes=o,this.onSelect&&this.onSelect(o,s),e.emit("nodeselectchange",{selectedItems:{nodes:o,edges:s},select:!0})},createLasso:function(){var t=this.graph.get("delegateGroup").addShape("path",{attrs:Object(s.__assign)({path:[]},this.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(t){this.lasso.attr({path:this.getLassoPath()})},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}},tooltip:Xh,"edge-tooltip":Hh,"collapse-expand":Kh,"drag-combo":$h,"collapse-expand-combo":Jh,"create-edge":{getDefaultCfg:function(){return{trigger:"click",key:void 0,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t;return rf.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="click",console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),this.key&&-1===of.indexOf(this.key.toLowerCase())&&(this.trigger=void 0,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined")),"drag"===this.trigger?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:"click"===this.trigger&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),this.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(t){if(!this.key||this.keydown){var e=t.item;e&&e.getID()!==this.source&&"node"===e.getType()||this.cancelCreating({item:this.edge,x:t.x,y:t.y})}},onClick:function(t){if(!this.key||this.keydown){var e=t.item,n=this.graph,r=e.getModel(),i=this.getEdgeConfig;if(this.addingEdge&&this.edge){if(!this.shouldEnd.call(this,t))return;var o=void 0;o=i&&Object(p.isFunction)(i)?i({source:this.source,target:r.id}):this.edgeConfig;var a=Object(s.__assign)({target:r.id},o);if(this.source===r.id&&(a.type="loop"),n.emit("beforecreateedge",{}),n.updateItem(this.edge,a,!1),n.get("enabledStack")){var u=Object(s.__assign)(Object(s.__assign)({},this.edge.getModel()),{itemType:"edge"}),c={};c.edges=[u],n.pushStack("add",{before:{},after:c})}n.emit("aftercreateedge",{edge:this.edge}),this.edge.getKeyShape().set("capture",!0),this.edge=null,this.addingEdge=!1}else{if(!this.shouldBegin.call(this,t))return;o=void 0;o=i&&Object(p.isFunction)(i)?i({source:r.id,target:r.id}):this.edgeConfig,this.edge=n.addItem("edge",Object(s.__assign)({source:r.id,target:r.id},o),!1),this.source=r.id,this.addingEdge=!0,this.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){if(!this.key||this.keydown){var e={x:t.x,y:t.y};this.graph.findById(this.source)?this.addingEdge&&this.edge&&this.graph.updateItem(this.edge,{target:e},!1):this.addingEdge=!1}},cancelCreating:function(t){if(!this.key||this.keydown){var e=this.graph,n=t.item;if(this.addingEdge&&t.target&&t.target.isCanvas&&t.target.isCanvas())return e.removeItem(this.edge,!1),this.edge=null,void(this.addingEdge=!1);this.addingEdge&&this.edge===n&&(e.removeItem(this.edge,!1),this.edge=null,this.addingEdge=!1)}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.key.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.addingEdge&&this.edge&&(this.graph.removeItem(this.edge,!1),this.addingEdge=!1,this.edge=null),this.keydown=!1}},"shortcuts-call":{getDefaultCfg:function(){return{trigger:"ctrl",combinedKey:"1",functionName:"fitView",functionParams:[]}},getEvents:function(){return af.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="ctrl",console.warn("Behavior shortcuts-fit-view 的 trigger 参数 '"+this.trigger+"' 不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(t){var e=t.key;if(e){var n=this.trigger.toLowerCase(),r=e.toLowerCase();this.triggerKeydown||(this.triggerKeydown=r===n||"control"===r&&"ctrl"===n||"ctrl"===r&&"control"===n);var i=this.graph;if(!i[this.functionName])return console.warn("Behavior shortcuts-fit-view 的 functionName 参数 '"+this.functionName+"' 不合法,它不是 Graph 的一个函数名"),{};if(!this.triggerKeydown||this.combinedKey){var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(r===o||"control"===r&&"ctrl"===o||"ctrl"===r&&"control"===o)&&(this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]())}else this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]()}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}},"scroll-canvas":{getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0}},getEvents:function(){return this.zoomKey&&-1!==sf.indexOf(this.zoomKey)||(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(t){var e=this,n=this.graph,r=t[this.zoomKey+"Key"];if("control"===this.zoomKey&&(r=t.ctrlKey),r){var i=n.get("canvas").getPointByClient(t.clientX,t.clientY),o=n.getZoom();t.wheelDelta>0?o+=.05*o:o-=.05*o,n.zoomTo(o,{x:i.x,y:i.y})}else{var a=t.deltaX||t.movementX,s=t.deltaY||t.movementY;!s&&navigator.userAgent.indexOf("Firefox")>-1&&(s=125*-t.wheelDelta/3);var u=this.graph.get("width"),c=this.graph.get("height"),l=this.graph.get("canvas").getCanvasBBox(),h=this.scalableRange,f=this.scalableRange;h<1&&h>-1&&(h*=u,f*=c);var d=l.minX,p=l.maxX,g=l.minY,v=l.maxY;a>0?p<-h?a=0:p-a<-h&&(a=p+h):a<0&&(d>u+h?a=0:d-a>u+h&&(a=d-(u+h))),s>0?v<-f?s=0:v-s<-f&&(s=v+f):s<0&&(g>c+f?s=0:g-s>c+f&&(s=g-(c+f))),"x"===this.get("direction")?s=0:"y"===this.get("direction")&&(a=0),n.translate(-a,-s)}if(t.preventDefault(),this.get("enableOptimize")){var m=this.get("optimizeZoom"),y=this.get("optimized"),b=n.getNodes(),x=n.getEdges(),w=b.length,_=x.length;if(!y){for(var S=0;S<w;S++){var E=b[S];if(!E.destroyed)for(var M=(k=E.get("group").get("children")).length,O=0;O<M;O++){(C=k[O]).destoryed||C.get("isKeyShape")||(C.set("ori-visibility",C.get("ori-visibility")||C.get("visible")),C.hide())}}for(var A=0;A<_;A++){var k;for(M=(k=x[A].get("group").get("children")).length,O=0;O<M;O++){var C;(C=k[O]).set("ori-visibility",C.get("ori-visibility")||C.get("visible")),C.hide()}}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var I=setTimeout((function(){var t=n.getZoom();if(e.get("optimized")){e.set("optimized",!1);for(var r=0;r<w;r++){var i=b[r],o=(c=i.get("group").get("children")).length;if(t<m)(s=(l=i.getKeyShape()).get("ori-visibility"))&&l.show();else for(var a=0;a<o;a++){var s=(f=c[a]).get("ori-visibility");!f.get("visible")&&s&&s&&f.show()}}for(var u=0;u<_;u++){var c,l,h=x[u];o=(c=h.get("group").get("children")).length;if(t<m)(s=(l=h.getKeyShape()).get("ori-visibility"))&&l.show();else for(a=0;a<o;a++){var f;if(!(f=c[a]).get("visible"))(s=f.get("ori-visibility"))&&f.show()}}}}),100);this.set("timeout",I)}}}};Object(p.each)(uf,(function(t,e){Object(u.registerBehavior)(e,t)}));var cf=Object(s.__assign)(Object(s.__assign)({},c),l),lf=nh.Grid,hf=nh.Minimap,ff=nh.Bundling,df=nh.Menu,pf=nh.Fisheye,gf=nh.ToolBar,vf=nh.Tooltip,mf=nh.TimeBar,yf=nh.ImageMinimap,bf=nh.EdgeFilterLens,xf=nh.SnapLine,wf=nh.Legend,_f={version:D.version,Graph:tu,TreeGraph:ru,Util:Ts,Layout:bs,TreeLayout:Ns,registerLayout:js,Global:D,registerBehavior:u.registerBehavior,registerCombo:u.registerCombo,registerEdge:u.registerEdge,registerNode:u.registerNode,Minimap:nh.Minimap,Grid:nh.Grid,Bundling:nh.Bundling,Menu:nh.Menu,ToolBar:nh.ToolBar,Tooltip:nh.Tooltip,Legend:nh.Legend,TimeBar:mf,SnapLine:xf,Fisheye:pf,ImageMinimap:yf,EdgeFilterLens:bf,Algorithm:cf,Arrow:u.Arrow,Marker:u.Marker,Shape:u.Shape};_f.version="4.5.0";e.default=_f;var Sf="4.5.0"},function(t,e,n){"use strict";var r=n(1),i=n(22),o=n(57),a=n(31),s=n(0),u=n(17),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.onCanvasChange=function(t){Object(a.h)(this,t)},e.prototype.getShapeBase=function(){return o},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,e){e&&(t.save(),Object(a.a)(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],n=[];Object(s.each)(t,(function(t){var r=t.cfg.cacheCanvasBBox;r&&t.cfg.isInView&&(e.push(r.minX,r.maxX),n.push(r.minY,r.maxY))}));var r=null;if(e.length){var i=Object(s.min)(e),o=Object(s.max)(e),a=Object(s.min)(n),c=Object(s.max)(n);r={minX:i,minY:a,x:i,y:a,maxX:o,maxY:c,width:o-i,height:c-a};var l=this.cfg.canvas;if(l){var h=l.getViewRange();this.set("isInView",Object(u.f)(r,h))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",r)},e.prototype.draw=function(t,e){var n=this.cfg.children,r=!e||this.cfg.refresh;n.length&&r&&(t.save(),Object(a.a)(t,this),this._applyClip(t,this.getClip()),Object(a.d)(t,n,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(i.AbstractGroup);e.a=c},function(t,e,n){"use strict";var r=n(1),i=n(22),o=n(0),a=n(82),s=n(72),u=n(36),c=n(18),l=n(27),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.isEntityGroup=function(){return!0},e.prototype.createDom=function(){var t=Object(l.b)("g");this.set("el",t);var e=this.getParent();if(e){var n=e.get("el");n||(n=e.createDom(),e.set("el",n)),n.appendChild(t)}return t},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e);var n=this.get("canvas");if(n&&n.get("autoDraw")){var r=n.get("context");this.createPath(r,e)}},e.prototype.onCanvasChange=function(t){Object(s.b)(this,t)},e.prototype.getShapeBase=function(){return a},e.prototype.getGroupBase=function(){return e},e.prototype.draw=function(t){var e=this.getChildren(),n=this.get("el");this.get("destroyed")?n&&n.parentNode.removeChild(n):(n||this.createDom(),Object(u.a)(this,t),this.createPath(t),e.length&&Object(s.a)(t,e))},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(o.each)(e||n,(function(t,e){c.b[e]&&r.setAttribute(c.b[e],t)})),Object(u.c)(this)},e}(i.AbstractGroup);e.a=h},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(7),i=n.n(r),o=n(8),a=n.n(o),s=n(2),u=function(){function t(e,n){i()(this,t),this.center=void 0,this.halfExtents=void 0,this.min=s.e.create(),this.max=s.e.create(),this.update(e,n)}return a()(t,[{key:"update",value:function(t,e){this.center=t||s.e.create(),this.halfExtents=e||s.e.fromValues(.5,.5,.5),this.min=s.e.sub(this.min,this.center,this.halfExtents),this.max=s.e.add(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){s.e.add(this.center,e,t),s.e.scale(this.center,this.center,.5),s.e.sub(this.halfExtents,e,t),s.e.scale(this.halfExtents,this.halfExtents,.5),s.e.copy(this.min,t),s.e.copy(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){var e=this.center,n=e[0],r=e[1],i=e[2],o=this.halfExtents,a=o[0],s=o[1],u=o[2],c=n-a,l=n+a,h=r-s,f=r+s,d=i-u,p=i+u,g=t.center,v=g[0],m=g[1],y=g[2],b=t.halfExtents,x=b[0],w=b[1],_=b[2],S=v-x,E=v+x,M=m-w,O=m+w,A=y-_,k=y+_;S<c&&(c=S),E>l&&(l=E),M<h&&(h=M),O>f&&(f=O),A<d&&(d=A),k>p&&(p=k),e[0]=.5*(c+l),e[1]=.5*(h+f),e[2]=.5*(d+p),o[0]=.5*(l-c),o[1]=.5*(f-h),o[2]=.5*(p-d),this.min[0]=c,this.min[1]=h,this.min[2]=d,this.max[0]=l,this.max[1]=f,this.max[2]=p}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"containsPoint",value:function(t){var e=this.getMin(),n=this.getMax();return!(t[0]<e[0]||t[0]>n[0]||t[1]<e[1]||t[1]>n[1]||t[2]<e[2]||t[2]>n[2])}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?s.e.copy(s.e.create(),this.min):272===t.pnVertexFlag?s.e.fromValues(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?s.e.fromValues(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?s.e.fromValues(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?s.e.fromValues(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?s.e.fromValues(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?s.e.fromValues(this.max[0],this.max[1],this.min[2]):s.e.fromValues(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?s.e.copy(s.e.create(),this.max):272===t.pnVertexFlag?s.e.fromValues(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?s.e.fromValues(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?s.e.fromValues(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?s.e.fromValues(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?s.e.fromValues(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?s.e.fromValues(this.min[0],this.min[1],this.max[2]):s.e.fromValues(this.min[0],this.min[1],this.min[2])}}]),t}()},function(t,e,n){"use strict";n.r(e),n.d(e,"Base",(function(){return h})),n.d(e,"Circle",(function(){return d})),n.d(e,"Dom",(function(){return p})),n.d(e,"Ellipse",(function(){return g})),n.d(e,"Image",(function(){return v})),n.d(e,"Line",(function(){return y})),n.d(e,"Marker",(function(){return w})),n.d(e,"Path",(function(){return _})),n.d(e,"Polygon",(function(){return S})),n.d(e,"Polyline",(function(){return E})),n.d(e,"Rect",(function(){return M})),n.d(e,"Text",(function(){return I}));var r={};n.r(r),n.d(r,"Base",(function(){return h})),n.d(r,"Circle",(function(){return d})),n.d(r,"Dom",(function(){return p})),n.d(r,"Ellipse",(function(){return g})),n.d(r,"Image",(function(){return v})),n.d(r,"Line",(function(){return y})),n.d(r,"Marker",(function(){return w})),n.d(r,"Path",(function(){return _})),n.d(r,"Polygon",(function(){return S})),n.d(r,"Polyline",(function(){return E})),n.d(r,"Rect",(function(){return M})),n.d(r,"Text",(function(){return I}));var i=n(1),o=n(22),a=n(36),s=n(27),u=n(72),c=n(18),l=n(80),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="svg",e.canFill=!1,e.canStroke=!1,e}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e);var n=this.get("canvas");if(n&&n.get("autoDraw")){var r=n.get("context");this.draw(r,e)}},e.prototype.getShapeBase=function(){return r},e.prototype.getGroupBase=function(){return l.a},e.prototype.onCanvasChange=function(t){Object(u.b)(this,t)},e.prototype.calculateBBox=function(){var t=this.get("el"),e=null;if(t)e=t.getBBox();else{var n=Object(o.getBBoxMethod)(this.get("type"));n&&(e=n(this))}if(e){var r=e.x,i=e.y,a=e.width,s=e.height,u=this.getHitLineWidth(),c=u/2,l=r-c,h=i-c;return{x:l,y:h,minX:l,minY:h,maxX:r+a+c,maxY:i+s+c,width:a+u,height:s+u}}return{x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0}},e.prototype.isFill=function(){var t=this.attr(),e=t.fill,n=t.fillStyle;return(e||n||this.isClipShape())&&this.canFill},e.prototype.isStroke=function(){var t=this.attr(),e=t.stroke,n=t.strokeStyle;return(e||n)&&this.canStroke},e.prototype.draw=function(t,e){var n=this.get("el");this.get("destroyed")?n&&n.parentNode.removeChild(n):(n||Object(s.a)(this),Object(a.a)(this,t),this.createPath(t,e),this.shadow(t,e),this.strokeAndFill(t,e),this.transform(e))},e.prototype.createPath=function(t,e){},e.prototype.strokeAndFill=function(t,e){var n=e||this.attr(),r=n.fill,i=n.fillStyle,o=n.stroke,a=n.strokeStyle,s=n.fillOpacity,u=n.strokeOpacity,l=n.lineWidth,h=this.get("el");this.canFill&&(e?"fill"in n?this._setColor(t,"fill",r):"fillStyle"in n&&this._setColor(t,"fill",i):this._setColor(t,"fill",r||i),s&&h.setAttribute(c.b.fillOpacity,s)),this.canStroke&&l>0&&(e?"stroke"in n?this._setColor(t,"stroke",o):"strokeStyle"in n&&this._setColor(t,"stroke",a):this._setColor(t,"stroke",o||a),u&&h.setAttribute(c.b.strokeOpacity,u),l&&h.setAttribute(c.b.lineWidth,l))},e.prototype._setColor=function(t,e,n){var r=this.get("el");if(n)if(n=n.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(n))(i=t.find("gradient",n))||(i=t.addGradient(n)),r.setAttribute(c.b[e],"url(#"+i+")");else if(/^[p,P]{1}[\s]*\(/.test(n)){var i;(i=t.find("pattern",n))||(i=t.addPattern(n)),r.setAttribute(c.b[e],"url(#"+i+")")}else r.setAttribute(c.b[e],n);else r.setAttribute(c.b[e],"none")},e.prototype.shadow=function(t,e){var n=this.attr(),r=e||n,i=r.shadowOffsetX,o=r.shadowOffsetY,s=r.shadowBlur,u=r.shadowColor;(i||o||s||u)&&Object(a.b)(this,t)},e.prototype.transform=function(t){var e=this.attr();(t||e).matrix&&Object(a.c)(this)},e.prototype.isInShape=function(t,e){return this.isPointInPath(t,e)},e.prototype.isPointInPath=function(t,e){var n=this.get("el"),r=this.get("canvas").get("el").getBoundingClientRect(),i=t+r.left,o=e+r.top,a=document.elementFromPoint(i,o);return!(!a||!a.isEqualNode(n))},e.prototype.getHitLineWidth=function(){var t=this.attrs,e=t.lineWidth,n=t.lineAppendWidth;return this.isStroke()?e+n:0},e}(o.AbstractShape),f=n(0),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="circle",e.canFill=!0,e.canStroke=!0,e}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x:0,y:0,r:0})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(f.each)(e||n,(function(t,e){"x"===e||"y"===e?r.setAttribute("c"+e,t):c.b[e]&&r.setAttribute(c.b[e],t)}))},e}(h),p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dom",e.canFill=!1,e.canStroke=!1,e}return Object(i.__extends)(e,t),e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");if(Object(f.each)(e||n,(function(t,e){c.b[e]&&r.setAttribute(c.b[e],t)})),"function"==typeof n.html){var i=n.html.call(this,n);if(i instanceof Element||i instanceof HTMLDocument){for(var o=r.childNodes,a=o.length-1;a>=0;a--)r.removeChild(o[a]);r.appendChild(i)}else r.innerHTML=i}else r.innerHTML=n.html},e}(h),g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ellipse",e.canFill=!0,e.canStroke=!0,e}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(f.each)(e||n,(function(t,e){"x"===e||"y"===e?r.setAttribute("c"+e,t):c.b[e]&&r.setAttribute(c.b[e],t)}))},e}(h),v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="image",e.canFill=!1,e.canStroke=!1,e}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");Object(f.each)(e||r,(function(t,e){"img"===e?n._setImage(r.img):c.b[e]&&i.setAttribute(c.b[e],t)}))},e.prototype.setAttr=function(t,e){this.attrs[t]=e,"img"===t&&this._setImage(e)},e.prototype._setImage=function(t){var e=this.attr(),n=this.get("el");if(Object(f.isString)(t))n.setAttribute("href",t);else if(t instanceof window.Image)e.width||(n.setAttribute("width",t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",t.height),this.attr("height",t.height)),n.setAttribute("href",t.src);else if(t instanceof HTMLElement&&Object(f.isString)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase())n.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var r=document.createElement("canvas");r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.getContext("2d").putImageData(t,0,0),e.width||(n.setAttribute("width",""+t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",""+t.height),this.attr("height",t.height)),n.setAttribute("href",r.toDataURL())}},e}(h),m=n(21),y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="line",e.canFill=!1,e.canStroke=!0,e}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(f.each)(e||n,(function(e,i){if("startArrow"===i||"endArrow"===i)if(e){var o=Object(f.isObject)(e)?t.addArrow(n,c.b[i]):t.getDefaultArrow(n,c.b[i]);r.setAttribute(c.b[i],"url(#"+o+")")}else r.removeAttribute(c.b[i]);else c.b[i]&&r.setAttribute(c.b[i],e)}))},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2;return m.c.length(e,n,r,i)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2;return m.c.pointAt(n,r,i,o,t)},e}(h),b={circle:function(t,e,n){return[["M",t,e],["m",-n,0],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["z"]]},triangleDown:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},x={get:function(t){return b[t]},register:function(t,e){b[t]=e},remove:function(t){delete b[t]},getAll:function(){return b}},w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="marker",e.canFill=!0,e.canStroke=!0,e}return Object(i.__extends)(e,t),e.prototype.createPath=function(t){this.get("el").setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return Object(f.isArray)(t)?t.map((function(t){return t.join(" ")})).join(""):t},e.prototype._getPath=function(){var t,e=this.attr(),n=e.x,r=e.y,i=e.r||e.radius,o=e.symbol||"circle";return(t=Object(f.isFunction)(o)?o:x.get(o))?t(n,r,i):(console.warn(t+" symbol is not exist."),null)},e.symbolsFactory=x,e}(h),_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="path",e.canFill=!0,e.canStroke=!0,e}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");Object(f.each)(e||r,(function(e,o){if("path"===o&&Object(f.isArray)(e))i.setAttribute("d",n._formatPath(e));else if("startArrow"===o||"endArrow"===o)if(e){var a=Object(f.isObject)(e)?t.addArrow(r,c.b[o]):t.getDefaultArrow(r,c.b[o]);i.setAttribute(c.b[o],"url(#"+a+")")}else i.removeAttribute(c.b[o]);else c.b[o]&&i.setAttribute(c.b[o],e)}))},e.prototype._formatPath=function(t){var e=t.map((function(t){return t.join(" ")})).join("");return~e.indexOf("NaN")?"":e},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var e=this.get("el"),n=this.getTotalLength();if(0===n)return null;var r=e?e.getPointAtLength(t*n):null;return r?{x:r.x,y:r.y}:null},e}(h),S=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polygon",e.canFill=!0,e.canStroke=!0,e}return Object(i.__extends)(e,t),e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(f.each)(e||n,(function(t,e){"points"===e&&Object(f.isArray)(t)&&t.length>=2?r.setAttribute("points",t.map((function(t){return t[0]+","+t[1]})).join(" ")):c.b[e]&&r.setAttribute(c.b[e],t)}))},e}(h),E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polyline",e.canFill=!0,e.canStroke=!0,e}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(f.each)(e||n,(function(t,e){"points"===e&&Object(f.isArray)(t)&&t.length>=2?r.setAttribute("points",t.map((function(t){return t[0]+","+t[1]})).join(" ")):c.b[e]&&r.setAttribute(c.b[e],t)}))},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return Object(f.isNil)(e)?(this.set("totalLength",m.d.length(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,n,r=this.attr().points,i=this.get("tCache");return i||(this._setTcache(),i=this.get("tCache")),Object(f.each)(i,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),m.c.pointAt(r[n][0],r[n][1],r[n+1][0],r[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,r,i=0,o=[];Object(f.each)(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=m.c.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=r,n[1]=i/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(h);var M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="rect",e.canFill=!0,e.canStroke=!0,e}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el"),o=!1,a=["x","y","width","height","radius"];Object(f.each)(e||r,(function(t,e){-1===a.indexOf(e)||o?-1===a.indexOf(e)&&c.b[e]&&i.setAttribute(c.b[e],t):(i.setAttribute("d",n._assembleRect(r)),o=!0)}))},e.prototype._assembleRect=function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.radius;if(!o)return"M "+e+","+n+" l "+r+",0 l 0,"+i+" l"+-r+" 0 z";var a=function(t){var e=0,n=0,r=0,i=0;return Object(f.isArray)(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,{r1:e,r2:n,r3:r,r4:i}}(o);return Object(f.isArray)(o)?1===o.length?a.r1=a.r2=a.r3=a.r4=o[0]:2===o.length?(a.r1=a.r3=o[0],a.r2=a.r4=o[1]):3===o.length?(a.r1=o[0],a.r2=a.r4=o[1],a.r3=o[2]):(a.r1=o[0],a.r2=o[1],a.r3=o[2],a.r4=o[3]):a.r1=a.r2=a.r3=a.r4=o,[["M "+(e+a.r1)+","+n],["l "+(r-a.r1-a.r2)+",0"],["a "+a.r2+","+a.r2+",0,0,1,"+a.r2+","+a.r2],["l 0,"+(i-a.r2-a.r3)],["a "+a.r3+","+a.r3+",0,0,1,"+-a.r3+","+a.r3],["l "+(a.r3+a.r4-r)+",0"],["a "+a.r4+","+a.r4+",0,0,1,"+-a.r4+","+-a.r4],["l 0,"+(a.r4+a.r1-i)],["a "+a.r1+","+a.r1+",0,0,1,"+a.r1+","+-a.r1],["z"]].join(" ")},e}(h),O=n(143),A={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},k={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},C={left:"left",start:"left",center:"middle",right:"end",end:"end"},I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="text",e.canFill=!0,e.canStroke=!0,e}return Object(i.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");this._setFont(),Object(f.each)(e||r,(function(t,e){"text"===e?n._setText(""+t):"matrix"===e&&t?Object(a.c)(n):c.b[e]&&i.setAttribute(c.b[e],t)})),i.setAttribute("paint-order","stroke"),i.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),e=this.attr(),n=e.textBaseline,r=e.textAlign,i=Object(O.a)();i&&"firefox"===i.name?t.setAttribute("dominant-baseline",k[n]||"alphabetic"):t.setAttribute("alignment-baseline",A[n]||"baseline"),t.setAttribute("text-anchor",C[r]||"left")},e.prototype._setText=function(t){var e=this.get("el"),n=this.attr(),r=n.x,i=n.textBaseline,o=void 0===i?"bottom":i;if(t)if(~t.indexOf("\n")){var a=t.split("\n"),s=a.length-1,u="";Object(f.each)(a,(function(t,e){0===e?"alphabetic"===o?u+='<tspan x="'+r+'" dy="'+-s+'em">'+t+"</tspan>":"top"===o?u+='<tspan x="'+r+'" dy="0.9em">'+t+"</tspan>":"middle"===o?u+='<tspan x="'+r+'" dy="'+-(s-1)/2+'em">'+t+"</tspan>":"bottom"===o?u+='<tspan x="'+r+'" dy="-'+(s+.3)+'em">'+t+"</tspan>":"hanging"===o&&(u+='<tspan x="'+r+'" dy="'+(-(s-1)-.3)+'em">'+t+"</tspan>"):u+='<tspan x="'+r+'" dy="1em">'+t+"</tspan>"})),e.innerHTML=u}else e.innerHTML=t;else e.innerHTML=""},e}(h)},function(t,e,n){"use strict";n.r(e),n.d(e,"create",(function(){return i})),n.d(e,"clone",(function(){return o})),n.d(e,"fromValues",(function(){return a})),n.d(e,"copy",(function(){return s})),n.d(e,"set",(function(){return u})),n.d(e,"add",(function(){return c})),n.d(e,"subtract",(function(){return l})),n.d(e,"multiply",(function(){return h})),n.d(e,"divide",(function(){return f})),n.d(e,"ceil",(function(){return d})),n.d(e,"floor",(function(){return p})),n.d(e,"min",(function(){return g})),n.d(e,"max",(function(){return v})),n.d(e,"round",(function(){return m})),n.d(e,"scale",(function(){return y})),n.d(e,"scaleAndAdd",(function(){return b})),n.d(e,"distance",(function(){return x})),n.d(e,"squaredDistance",(function(){return w})),n.d(e,"length",(function(){return _})),n.d(e,"squaredLength",(function(){return S})),n.d(e,"negate",(function(){return E})),n.d(e,"inverse",(function(){return M})),n.d(e,"normalize",(function(){return O})),n.d(e,"dot",(function(){return A})),n.d(e,"cross",(function(){return k})),n.d(e,"lerp",(function(){return C})),n.d(e,"random",(function(){return I})),n.d(e,"transformMat2",(function(){return T})),n.d(e,"transformMat2d",(function(){return P})),n.d(e,"transformMat3",(function(){return N})),n.d(e,"transformMat4",(function(){return j})),n.d(e,"rotate",(function(){return D})),n.d(e,"angle",(function(){return L})),n.d(e,"zero",(function(){return R})),n.d(e,"str",(function(){return B})),n.d(e,"exactEquals",(function(){return G})),n.d(e,"equals",(function(){return F})),n.d(e,"len",(function(){return U})),n.d(e,"sub",(function(){return V})),n.d(e,"mul",(function(){return W})),n.d(e,"div",(function(){return Y})),n.d(e,"dist",(function(){return X})),n.d(e,"sqrDist",(function(){return H})),n.d(e,"sqrLen",(function(){return q})),n.d(e,"forEach",(function(){return K}));var r=n(13);function i(){var t=new r.a(2);return r.a!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t){var e=new r.a(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var n=new r.a(2);return n[0]=t,n[1]=e,n}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,n){return t[0]=e,t[1]=n,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function l(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function h(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function f(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function g(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function v(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function m(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function y(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function b(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function x(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function _(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function S(t){var e=t[0],n=t[1];return e*e+n*n}function E(t,e){return t[0]=-e[0],t[1]=-e[1],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function O(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]}function k(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function C(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function I(t,e){e=e||1;var n=2*r.c()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function T(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function P(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function N(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function j(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function D(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function L(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function R(t){return t[0]=0,t[1]=0,t}function B(t){return"vec2("+t[0]+", "+t[1]+")"}function G(t,e){return t[0]===e[0]&&t[1]===e[1]}function F(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r.b*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r.b*Math.max(1,Math.abs(i),Math.abs(a))}var z,U=_,V=l,W=h,Y=f,X=x,H=w,q=S,K=(z=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)z[0]=t[a],z[1]=t[a+1],i(z,z,o),t[a]=z[0],t[a+1]=z[1];return t})},function(t,e){var n=[],r=[];function i(t,e){if(e=e||{},void 0===t)throw new Error("insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).");var i,o=!0===e.prepend?"prepend":"append",a=void 0!==e.container?e.container:document.querySelector("head"),s=n.indexOf(a);return-1===s&&(s=n.push(a)-1,r[s]={}),void 0!==r[s]&&void 0!==r[s][o]?i=r[s][o]:(i=r[s][o]=function(){var t=document.createElement("style");return t.setAttribute("type","text/css"),t}(),"prepend"===o?a.insertBefore(i,a.childNodes[0]):a.appendChild(i)),65279===t.charCodeAt(0)&&(t=t.substr(1,t.length)),i.styleSheet?i.styleSheet.cssText+=t:i.textContent+=t,i}t.exports=i,t.exports.insertCss=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r,i,o,a,s,u,c,l,h,f=n(10),d=n.n(f),p=n(16),g=n.n(p),v=n(11),m=n.n(v),y=n(7),b=n.n(y),x=n(12),w=n.n(x),_=(n(30),n(6)),S=n(14),E=n(37),M=n(52),O=(r=Object(_.injectable)(),i=Object(_.inject)(S.a.RenderEngine),o=Object(_.inject)(S.a.ResourcePool),r((h=l=function t(){var e=this;b()(this,t),m()(this,"engine",u,this),m()(this,"resourcePool",c,this),this.model=void 0,this.setup=function(t,e,n){var r=t.getPass(M.a.IDENTIFIER);if(r){var i=t.createRenderTarget(e,"render to screen",{width:1,height:1});n.data={input:e.read(r.data.output),output:e.write(t,i)}}},this.execute=function(){var t=g()(d.a.mark((function t(n,r){var i,o,a,s,u,c,l;return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.engine,o=i.createModel,a=i.createAttribute,s=i.createBuffer,e.model){t.next=6;break}return t.next=4,o({vs:e.engine.supportWebGPU?"layout(location = 0) in vec2 a_Position;\nlayout(location = 0) out vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}":"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:e.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform sampler u_TextureSampler;\nlayout(set = 0, binding = 1) uniform texture2D u_Texture;\n\nlayout(location = 0) in vec2 v_UV;\nlayout(location = 0) out vec4 outColor;\n\nvoid main() {\n outColor = texture(sampler2D(u_Texture, u_TextureSampler), v_UV);\n}":"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n}",attributes:{a_Position:a({buffer:s({data:[-4,-4,4,-4,0,4],type:E.a.FLOAT}),size:2,arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})},uniforms:{u_Texture:null},depth:{enable:!1},count:3,blend:{enable:!0}});case 4:u=t.sent,e.model=u;case 6:c=n.getResourceNode(r.data.input),l=e.resourcePool.getOrCreateResource(c.resource),e.engine.useFramebuffer(null,(function(){e.engine.clear({framebuffer:null,color:[0,0,0,0],depth:1,stencil:0}),e.model.draw({uniforms:{u_Texture:l}})}));case 9:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),this.tearDown=function(){e.model=void 0}},l.IDENTIFIER="Copy Pass",s=h,u=w()(s.prototype,"engine",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c=w()(s.prototype,"resourcePool",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),a=s))||a)},function(t,e,n){var r;"undefined"!=typeof self&&self,r=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=31)}([function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Array.isArray?Array.isArray(t):Object(r.a)(t,"Array")}},function(t,e,n){"use strict";e.a=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}},function(t,e,n){"use strict";var r=n(0),i=n(13);e.a=function(t,e){if(t)if(Object(r.a)(t))for(var n=0,o=t.length;n<o&&!1!==e(t[n],n);n++);else if(Object(i.a)(t))for(var a in t)if(t.hasOwnProperty(a)&&!1===e(t[a],a))break}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Function")}},function(t,e,n){"use strict";var r={}.toString;e.a=function(t,e){return r.call(t)==="[object "+e+"]"}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Number")}},function(t,e,n){"use strict";e.a=function(t){return null==t}},function(t,e,n){var r=n(33).mix;t.exports={assign:r}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"String")}},function(t,e,n){"use strict";var r=n(15),i=n(4);e.a=function(t){if(!Object(r.a)(t)||!Object(i.a)(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}},function(t,e,n){"use strict";var r=n(6);e.a=function(t){return Object(r.a)(t)?"":t.toString()}},function(t,e,n){var r=n(18),i=function(){function t(t,e){void 0===e&&(e={}),this.options=e,this.rootNode=r(t,e)}return t.prototype.execute=function(){throw new Error("please override this method")},t}();t.exports=i},function(t,e,n){"use strict";var r=n(1);e.a=function(t,e){return!!Object(r.a)(t)&&t.indexOf(e)>-1}},function(t,e,n){"use strict";e.a=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}},function(t,e,n){"use strict";var r=n(2),i=n(1);e.a=function(t,e){if(!Object(i.a)(t))return t;var n=[];return Object(r.a)(t,(function(t,r){e(t,r)&&n.push(t)})),n}},function(t,e,n){"use strict";e.a=function(t){return"object"==typeof t&&null!==t}},function(t,e,n){"use strict";function r(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}e.a=function(t,e,n,i){return e&&r(t,e),n&&r(t,n),i&&r(t,i),t}},function(t,e,n){var r=n(30),i=["LR","RL","TB","BT","H","V"],o=["LR","RL","H"],a=i[0];t.exports=function(t,e,n){var s=e.direction||a;if(e.isHorizontal=function(t){return o.indexOf(t)>-1}(s),s&&-1===i.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===i[0])n(t,e);else if(s===i[1])n(t,e),t.right2left();else if(s===i[2])n(t,e);else if(s===i[3])n(t,e),t.bottom2top();else if(s===i[4]||s===i[5]){var u=r(t,e),c=u.left,l=u.right;n(c,e),n(l,e),e.isHorizontal?c.right2left():c.bottom2top(),l.translate(c.x-l.x,c.y-l.y),t.x=c.x,t.y=l.y;var h=t.getBoundingBox();e.isHorizontal?h.top<0&&t.translate(0,-h.top):h.left<0&&t.translate(-h.left,0)}var f=e.fixedRoot;return void 0===f&&(f=!0),f&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),t}},function(t,e,n){var r=n(7),i={getId:function(t){return t.id||t.name},getPreH:function(t){return t.preH||0},getPreV:function(t){return t.preV||0},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function o(t,e){var n=this;if(n.vgap=n.hgap=0,t instanceof o)return t;n.data=t;var r=e.getHGap(t),i=e.getVGap(t);return n.preH=e.getPreH(t),n.preV=e.getPreV(t),n.width=e.getWidth(t),n.height=e.getHeight(t),n.width+=n.preH,n.height+=n.preV,n.id=e.getId(t),n.x=n.y=0,n.depth=0,n.children||(n.children=[]),n.addGap(r,i),n}r.assign(o.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){this.hgap+=t,this.vgap+=e,this.width+=2*t,this.height+=2*e},eachNode:function(t){for(var e,n=[this];e=n.shift();)t(e),n=e.children.concat(n)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,n=[this];e=n.shift();)t(e),n=n.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)})),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode((function(n){n.x+=t,n.y+=e,n.x+=n.preH,n.y+=n.preV}))},right2left:function(){var t=this.getBoundingBox();this.eachNode((function(e){e.x=e.x-2*(e.x-t.left)-e.width})),this.translate(t.width,0)},bottom2top:function(){var t=this.getBoundingBox();this.eachNode((function(e){e.y=e.y-2*(e.y-t.top)-e.height})),this.translate(0,t.height)}}),t.exports=function(t,e,n){void 0===e&&(e={});var a,s=new o(t,e=r.assign({},i,e)),u=[s];if(!n&&!t.collapsed)for(;a=u.shift();)if(!a.data.collapsed){var c=e.getChildren(a.data),l=c?c.length:0;if(a.children=new Array(l),c&&l)for(var h=0;h<l;h++){var f=new o(c[h],e);a.children[h]=f,u.push(f),f.parent=a,f.depth=a.depth+1}}return s}},function(t,e,n){"use strict";var r=n(6),i=n(20);e.a=function(t,e){var n=Object(i.a)(e),o=n.length;if(Object(r.a)(t))return!o;for(var a=0;a<o;a+=1){var s=n[a];if(e[s]!==t[s]||!(s in t))return!1}return!0}},function(t,e,n){"use strict";var r=n(2),i=n(3),o=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return Object(r.a)(t,(function(n,r){Object(i.a)(t)&&"prototype"===r||e.push(r)})),e};e.a=o},function(t,e,n){"use strict";var r=n(1),i=Array.prototype.splice;e.a=function(t,e){if(!Object(r.a)(t))return[];for(var n=t?e.length:0,o=n-1;n--;){var a=void 0,s=e[n];n!==o&&s===a||(a=s,i.call(t,s,1))}return t}},function(t,e,n){"use strict";var r=n(12),i=n(2);e.a=function(t){var e=[];return Object(i.a)(t,(function(t){Object(r.a)(e,t)||e.push(t)})),e}},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(24);e.a=function(t,e){if(!e)return{0:t};if(!Object(i.a)(e)){var n=Object(r.a)(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,i=n.length;r<i;r++)e+=t[n[r]]&&t[n[r]].toString();return e}}return Object(o.a)(t,e)}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(3),a=Object.prototype.hasOwnProperty;e.a=function(t,e){if(!e||!Object(i.a)(t))return{};var n,s={},u=Object(o.a)(e)?e:function(t){return t[e]};return Object(r.a)(t,(function(t){n=u(t),a.call(s,n)?s[n].push(t):s[n]=[t]})),s}},function(t,e,n){"use strict";e.a=function(t,e){return t.hasOwnProperty(e)}},function(t,e,n){"use strict";var r=n(2),i=n(3),o=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return Object(r.a)(t,(function(n,r){Object(i.a)(t)&&"prototype"===r||e.push(n)})),e};e.a=o},function(t,e,n){"use strict";var r={}.toString;e.a=function(t){return r.call(t).replace(/^\[object /,"").replace(/]$/,"")}},function(t,e,n){"use strict";var r=Object.prototype;e.a=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}},function(t,e,n){"use strict";var r=n(15),i=n(1),o=n(8),a=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Object(o.a)(t)||Object(o.a)(e))return!1;if(Object(i.a)(t)||Object(i.a)(e)){if(t.length!==e.length)return!1;for(var n=!0,s=0;s<t.length&&(n=a(t[s],e[s]));s++);return n}if(Object(r.a)(t)||Object(r.a)(e)){var u=Object.keys(t),c=Object.keys(e);if(u.length!==c.length)return!1;for(n=!0,s=0;s<u.length&&(n=a(t[u[s]],e[u[s]]));s++);return n}return!1};e.a=a},function(t,e,n){var r=n(18);t.exports=function(t,e){for(var n=r(t.data,e,!0),i=r(t.data,e,!0),o=t.children.length,a=Math.round(o/2),s=e.getSide||function(t,e){return e<a?"right":"left"},u=0;u<o;u++){var c=t.children[u];"right"===s(c,u)?i.children.push(c):n.children.push(c)}return n.eachNode((function(t){t.isRoot()||(t.side="left")})),i.eachNode((function(t){t.isRoot()||(t.side="right")})),{left:n,right:i}}},function(t,e,n){var r={compactBox:n(32),dendrogram:n(114),indented:n(116),mindmap:n(118)};t.exports=r},function(t,e,n){var r=n(11),i=n(113),o=n(17),a=n(7),s=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.execute=function(){return o(this.rootNode,this.options,i)},r}(r),u={};t.exports=function(t,e){return e=a.assign({},u,e),new s(t,e).execute()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12);n.d(e,"contains",(function(){return r.a})),n.d(e,"includes",(function(){return r.a}));var i=n(34);n.d(e,"difference",(function(){return i.a}));var o=n(35);n.d(e,"find",(function(){return o.a}));var a=n(36);n.d(e,"findIndex",(function(){return a.a}));var s=n(37);n.d(e,"firstValue",(function(){return s.a}));var u=n(38);n.d(e,"flatten",(function(){return u.a}));var c=n(39);n.d(e,"flattenDeep",(function(){return c.a}));var l=n(40);n.d(e,"getRange",(function(){return l.a}));var h=n(41);n.d(e,"pull",(function(){return h.a}));var f=n(21);n.d(e,"pullAt",(function(){return f.a}));var d=n(42);n.d(e,"reduce",(function(){return d.a}));var p=n(43);n.d(e,"remove",(function(){return p.a}));var g=n(44);n.d(e,"sortBy",(function(){return g.a}));var v=n(45);n.d(e,"union",(function(){return v.a}));var m=n(22);n.d(e,"uniq",(function(){return m.a}));var y=n(46);n.d(e,"valuesOfKey",(function(){return y.a}));var b=n(47);n.d(e,"head",(function(){return b.a}));var x=n(48);n.d(e,"last",(function(){return x.a}));var w=n(49);n.d(e,"startsWith",(function(){return w.a}));var _=n(50);n.d(e,"endsWith",(function(){return _.a}));var S=n(14);n.d(e,"filter",(function(){return S.a}));var E=n(51);n.d(e,"every",(function(){return E.a}));var M=n(52);n.d(e,"some",(function(){return M.a}));var O=n(53);n.d(e,"group",(function(){return O.a}));var A=n(24);n.d(e,"groupBy",(function(){return A.a}));var k=n(23);n.d(e,"groupToMap",(function(){return k.a}));var C=n(54);n.d(e,"getWrapBehavior",(function(){return C.a}));var I=n(55);n.d(e,"wrapBehavior",(function(){return I.a}));var T=n(56);n.d(e,"number2color",(function(){return T.a}));var P=n(57);n.d(e,"parseRadius",(function(){return P.a}));var N=n(58);n.d(e,"clamp",(function(){return N.a}));var j=n(59);n.d(e,"fixedBase",(function(){return j.a}));var D=n(60);n.d(e,"isDecimal",(function(){return D.a}));var L=n(61);n.d(e,"isEven",(function(){return L.a}));var R=n(62);n.d(e,"isInteger",(function(){return R.a}));var B=n(63);n.d(e,"isNegative",(function(){return B.a}));var G=n(64);n.d(e,"isNumberEqual",(function(){return G.a}));var F=n(65);n.d(e,"isOdd",(function(){return F.a}));var z=n(66);n.d(e,"isPositive",(function(){return z.a}));var U=n(67);n.d(e,"maxBy",(function(){return U.a}));var V=n(68);n.d(e,"minBy",(function(){return V.a}));var W=n(69);n.d(e,"mod",(function(){return W.a}));var Y=n(70);n.d(e,"toDegree",(function(){return Y.a}));var X=n(71);n.d(e,"toInteger",(function(){return X.a}));var H=n(72);n.d(e,"toRadian",(function(){return H.a}));var q=n(73);n.d(e,"forIn",(function(){return q.a}));var K=n(25);n.d(e,"has",(function(){return K.a}));var Z=n(74);n.d(e,"hasKey",(function(){return Z.a}));var $=n(75);n.d(e,"hasValue",(function(){return $.a}));var Q=n(20);n.d(e,"keys",(function(){return Q.a}));var J=n(19);n.d(e,"isMatch",(function(){return J.a}));var tt=n(26);n.d(e,"values",(function(){return tt.a}));var et=n(76);n.d(e,"lowerCase",(function(){return et.a}));var nt=n(77);n.d(e,"lowerFirst",(function(){return nt.a}));var rt=n(78);n.d(e,"substitute",(function(){return rt.a}));var it=n(79);n.d(e,"upperCase",(function(){return it.a}));var ot=n(80);n.d(e,"upperFirst",(function(){return ot.a}));var at=n(27);n.d(e,"getType",(function(){return at.a}));var st=n(81);n.d(e,"isArguments",(function(){return st.a}));var ut=n(0);n.d(e,"isArray",(function(){return ut.a}));var ct=n(1);n.d(e,"isArrayLike",(function(){return ct.a}));var lt=n(82);n.d(e,"isBoolean",(function(){return lt.a}));var ht=n(83);n.d(e,"isDate",(function(){return ht.a}));var ft=n(84);n.d(e,"isError",(function(){return ft.a}));var dt=n(3);n.d(e,"isFunction",(function(){return dt.a}));var pt=n(85);n.d(e,"isFinite",(function(){return pt.a}));var gt=n(6);n.d(e,"isNil",(function(){return gt.a}));var vt=n(86);n.d(e,"isNull",(function(){return vt.a}));var mt=n(5);n.d(e,"isNumber",(function(){return mt.a}));var yt=n(13);n.d(e,"isObject",(function(){return yt.a}));var bt=n(15);n.d(e,"isObjectLike",(function(){return bt.a}));var xt=n(9);n.d(e,"isPlainObject",(function(){return xt.a}));var wt=n(28);n.d(e,"isPrototype",(function(){return wt.a}));var _t=n(87);n.d(e,"isRegExp",(function(){return _t.a}));var St=n(8);n.d(e,"isString",(function(){return St.a}));var Et=n(4);n.d(e,"isType",(function(){return Et.a}));var Mt=n(88);n.d(e,"isUndefined",(function(){return Mt.a}));var Ot=n(89);n.d(e,"isElement",(function(){return Ot.a}));var At=n(90);n.d(e,"requestAnimationFrame",(function(){return At.a}));var kt=n(91);n.d(e,"clearAnimationFrame",(function(){return kt.a}));var Ct=n(92);n.d(e,"augment",(function(){return Ct.a}));var It=n(93);n.d(e,"clone",(function(){return It.a}));var Tt=n(94);n.d(e,"debounce",(function(){return Tt.a}));var Pt=n(95);n.d(e,"memoize",(function(){return Pt.a}));var Nt=n(96);n.d(e,"deepMix",(function(){return Nt.a}));var jt=n(2);n.d(e,"each",(function(){return jt.a}));var Dt=n(97);n.d(e,"extend",(function(){return Dt.a}));var Lt=n(98);n.d(e,"indexOf",(function(){return Lt.a}));var Rt=n(99);n.d(e,"isEmpty",(function(){return Rt.a}));var Bt=n(29);n.d(e,"isEqual",(function(){return Bt.a}));var Gt=n(100);n.d(e,"isEqualWith",(function(){return Gt.a}));var Ft=n(101);n.d(e,"map",(function(){return Ft.a}));var zt=n(102);n.d(e,"mapValues",(function(){return zt.a}));var Ut=n(16);n.d(e,"mix",(function(){return Ut.a})),n.d(e,"assign",(function(){return Ut.a}));var Vt=n(103);n.d(e,"get",(function(){return Vt.a}));var Wt=n(104);n.d(e,"set",(function(){return Wt.a}));var Yt=n(105);n.d(e,"pick",(function(){return Yt.a}));var Xt=n(106);n.d(e,"throttle",(function(){return Xt.a}));var Ht=n(107);n.d(e,"toArray",(function(){return Ht.a}));var qt=n(10);n.d(e,"toString",(function(){return qt.a}));var Kt=n(108);n.d(e,"uniqueId",(function(){return Kt.a}));var Zt=n(109);n.d(e,"noop",(function(){return Zt.a}));var $t=n(110);n.d(e,"identity",(function(){return $t.a}));var Qt=n(111);n.d(e,"size",(function(){return Qt.a}));var Jt=n(112);n.d(e,"Cache",(function(){return Jt.a}))},function(t,e,n){"use strict";var r=n(14),i=n(12);e.a=function(t,e){return void 0===e&&(e=[]),Object(r.a)(t,(function(t){return!Object(i.a)(e,t)}))}},function(t,e,n){"use strict";var r=n(3),i=n(19),o=n(0),a=n(9);e.a=function(t,e){if(!Object(o.a)(t))return null;var n;if(Object(r.a)(e)&&(n=e),Object(a.a)(e)&&(n=function(t){return Object(i.a)(t,e)}),n)for(var s=0;s<t.length;s+=1)if(n(t[s]))return t[s];return null}},function(t,e,n){"use strict";e.a=function(t,e,n){void 0===n&&(n=0);for(var r=n;r<t.length;r++)if(e(t[r],r))return r;return-1}},function(t,e,n){"use strict";var r=n(6),i=n(0);e.a=function(t,e){for(var n=null,o=0;o<t.length;o++){var a=t[o][e];if(!Object(r.a)(a)){n=Object(i.a)(a)?a[0]:a;break}}return n}},function(t,e,n){"use strict";var r=n(0);e.a=function(t){if(!Object(r.a)(t))return[];for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e}},function(t,e,n){"use strict";var r=n(0),i=function(t,e){if(void 0===e&&(e=[]),Object(r.a)(t))for(var n=0;n<t.length;n+=1)i(t[n],e);else e.push(t);return e};e.a=i},function(t,e,n){"use strict";var r=n(0),i=n(14);e.a=function(t){if(!(t=Object(i.a)(t,(function(t){return!isNaN(t)}))).length)return{min:0,max:0};if(Object(r.a)(t[0])){for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);t=e}var o=Math.max.apply(null,t);return{min:Math.min.apply(null,t),max:o}}},function(t,e,n){"use strict";var r=Array.prototype,i=r.splice,o=r.indexOf;e.a=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)for(var a=e[r],s=-1;(s=o.call(t,a))>-1;)i.call(t,s,1);return t}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(9);e.a=function(t,e,n){if(!Object(i.a)(t)&&!Object(o.a)(t))return t;var a=n;return Object(r.a)(t,(function(t,n){a=e(a,t,n)})),a}},function(t,e,n){"use strict";var r=n(1),i=n(21);e.a=function(t,e){var n=[];if(!Object(r.a)(t))return n;for(var o=-1,a=[],s=t.length;++o<s;){var u=t[o];e(u,o,t)&&(n.push(u),a.push(o))}return Object(i.a)(t,a),n}},function(t,e,n){"use strict";var r=n(0),i=n(8),o=n(3);e.a=function(t,e){var n;if(Object(o.a)(e))n=function(t,n){return e(t)-e(n)};else{var a=[];Object(i.a)(e)?a.push(e):Object(r.a)(e)&&(a=e),n=function(t,e){for(var n=0;n<a.length;n+=1){var r=a[n];if(t[r]>e[r])return 1;if(t[r]<e[r])return-1}return 0}}return t.sort(n),t}},function(t,e,n){"use strict";var r=n(22);e.a=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object(r.a)([].concat.apply([],t))}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(6);e.a=function(t,e){var n=[],a={};return t.forEach((function(t){var s=t[e];Object(o.a)(s)||(Object(i.a)(s)||(s=[s]),Object(r.a)(s,(function(t){a[t]||(n.push(t),a[t]=!0)})))})),n}},function(t,e,n){"use strict";e.a=function(t){if(Object(r.a)(t))return t[0]};var r=n(1)},function(t,e,n){"use strict";e.a=function(t){if(Object(r.a)(t))return t[t.length-1]};var r=n(1)},function(t,e,n){"use strict";var r=n(0),i=n(8);e.a=function(t,e){return!(!Object(r.a)(t)&&!Object(i.a)(t))&&t[0]===e}},function(t,e,n){"use strict";var r=n(0),i=n(8);e.a=function(t,e){return!(!Object(r.a)(t)&&!Object(i.a)(t))&&t[t.length-1]===e}},function(t,e,n){"use strict";e.a=function(t,e){for(var n=0;n<t.length;n++)if(!e(t[n],n))return!1;return!0}},function(t,e,n){"use strict";e.a=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n],n))return!0;return!1}},function(t,e,n){"use strict";var r=n(23);e.a=function(t,e){if(!e)return[t];var n=Object(r.a)(t,e),i=[];for(var o in n)i.push(n[o]);return i}},function(t,e,n){"use strict";e.a=function(t,e){return t["_wrap_"+e]}},function(t,e,n){"use strict";e.a=function(t,e){if(t["_wrap_"+e])return t["_wrap_"+e];var n=function(n){t[e](n)};return t["_wrap_"+e]=n,n}},function(t,e,n){"use strict";var r={};e.a=function(t){var e=r[t];if(!e){for(var n=t.toString(16),i=n.length;i<6;i++)n="0"+n;e="#"+n,r[t]=e}return e}},function(t,e,n){"use strict";var r=n(0);e.a=function(t){var e=0,n=0,i=0,o=0;return Object(r.a)(t)?1===t.length?e=n=i=o=t[0]:2===t.length?(e=i=t[0],n=o=t[1]):3===t.length?(e=t[0],n=o=t[1],i=t[2]):(e=t[0],n=t[1],i=t[2],o=t[3]):e=n=i=o=t,{r1:e,r2:n,r3:i,r4:o}}},function(t,e,n){"use strict";e.a=function(t,e,n){return t<e?e:t>n?n:t}},function(t,e,n){"use strict";e.a=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%1!=0}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%2==0}},function(t,e,n){"use strict";var r=n(5),i=Number.isInteger?Number.isInteger:function(t){return Object(r.a)(t)&&t%1==0};e.a=i},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t<0}},function(t,e,n){"use strict";e.a=function(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%2!=0}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t>0}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(3);e.a=function(t,e){if(Object(i.a)(t)){var n,a,s=t[0];return n=Object(o.a)(e)?e(t[0]):t[0][e],Object(r.a)(t,(function(t){(a=Object(o.a)(e)?e(t):t[e])>n&&(s=t,n=a)})),s}}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(3);e.a=function(t,e){if(Object(i.a)(t)){var n,a,s=t[0];return n=Object(o.a)(e)?e(t[0]):t[0][e],Object(r.a)(t,(function(t){(a=Object(o.a)(e)?e(t):t[e])<n&&(s=t,n=a)})),s}}},function(t,e,n){"use strict";e.a=function(t,e){return(t%e+e)%e}},function(t,e,n){"use strict";var r=180/Math.PI;e.a=function(t){return r*t}},function(t,e,n){"use strict";e.a=parseInt},function(t,e,n){"use strict";var r=Math.PI/180;e.a=function(t){return r*t}},function(t,e,n){"use strict";var r=n(2);e.a=r.a},function(t,e,n){"use strict";var r=n(25);e.a=r.a},function(t,e,n){"use strict";var r=n(12),i=n(26);e.a=function(t,e){return Object(r.a)(Object(i.a)(t),e)}},function(t,e,n){"use strict";var r=n(10);e.a=function(t){return Object(r.a)(t).toLowerCase()}},function(t,e,n){"use strict";var r=n(10);e.a=function(t){var e=Object(r.a)(t);return e.charAt(0).toLowerCase()+e.substring(1)}},function(t,e,n){"use strict";e.a=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t}},function(t,e,n){"use strict";var r=n(10);e.a=function(t){return Object(r.a)(t).toUpperCase()}},function(t,e,n){"use strict";var r=n(10);e.a=function(t){var e=Object(r.a)(t);return e.charAt(0).toUpperCase()+e.substring(1)}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Arguments")}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Boolean")}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Date")}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Error")}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&isFinite(t)}},function(t,e,n){"use strict";e.a=function(t){return null===t}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"RegExp")}},function(t,e,n){"use strict";e.a=function(t){return void 0===t}},function(t,e,n){"use strict";e.a=function(t){return t instanceof Element||t instanceof HTMLDocument}},function(t,e,n){"use strict";e.a=function(t){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)})(t)}},function(t,e,n){"use strict";e.a=function(t){(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout)(t)}},function(t,e,n){"use strict";var r=n(16),i=n(3);e.a=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=t[0],o=1;o<t.length;o++){var a=t[o];Object(i.a)(a)&&(a=a.prototype),Object(r.a)(n.prototype,a)}}},function(t,e,n){"use strict";var r=n(0),i=function(t){if("object"!=typeof t||null===t)return t;var e;if(Object(r.a)(t)){e=[];for(var n=0,o=t.length;n<o;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=i(t[n]):e[n]=t[n]}else for(var a in e={},t)"object"==typeof t[a]&&null!=t[a]?e[a]=i(t[a]):e[a]=t[a];return e};e.a=i},function(t,e,n){"use strict";e.a=function(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}}},function(t,e,n){"use strict";var r=n(3);e.a=function(t,e){if(!Object(r.a)(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n}},function(t,e,n){"use strict";var r=n(0),i=n(9);function o(t,e,n,a){for(var s in n=n||0,a=a||5,e)if(e.hasOwnProperty(s)){var u=e[s];null!==u&&Object(i.a)(u)?(Object(i.a)(t[s])||(t[s]={}),n<a?o(t[s],u,n+1,a):t[s]=e[s]):Object(r.a)(u)?(t[s]=[],t[s]=t[s].concat(u)):void 0!==u&&(t[s]=u)}}e.a=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)o(t,e[r]);return t}},function(t,e,n){"use strict";var r=n(16),i=n(3);e.a=function(t,e,n,o){Object(i.a)(e)||(n=e,e=t,t=function(){});var a=Object.create?function(t,e){return Object.create(t,{constructor:{value:e}})}:function(t,e){function n(){}n.prototype=t;var r=new n;return r.constructor=e,r},s=a(e.prototype,t);return t.prototype=Object(r.a)(s,t.prototype),t.superclass=a(e.prototype,e),Object(r.a)(s,n),Object(r.a)(t,o),t}},function(t,e,n){"use strict";var r=n(1);e.a=function(t,e){if(!Object(r.a)(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var i=-1,o=0;o<t.length;o++)if(t[o]===e){i=o;break}return i}},function(t,e,n){"use strict";var r=n(6),i=n(1),o=n(27),a=n(28),s=Object.prototype.hasOwnProperty;e.a=function(t){if(Object(r.a)(t))return!0;if(Object(i.a)(t))return!t.length;var e=Object(o.a)(t);if("Map"===e||"Set"===e)return!t.size;if(Object(a.a)(t))return!Object.keys(t).length;for(var n in t)if(s.call(t,n))return!1;return!0}},function(t,e,n){"use strict";var r=n(3),i=n(29);e.a=function(t,e,n){return Object(r.a)(n)?!!n(t,e):Object(i.a)(t,e)}},function(t,e,n){"use strict";var r=n(2),i=n(1);e.a=function(t,e){if(!Object(i.a)(t))return t;var n=[];return Object(r.a)(t,(function(t,r){n.push(e(t,r))})),n}},function(t,e,n){"use strict";var r=n(6),i=n(13),o=function(t){return t};e.a=function(t,e){void 0===e&&(e=o);var n={};return Object(i.a)(t)&&!Object(r.a)(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n}},function(t,e,n){"use strict";var r=n(8);e.a=function(t,e,n){for(var i=0,o=Object(r.a)(e)?e.split("."):e;t&&i<o.length;)t=t[o[i++]];return void 0===t||i<o.length?n:t}},function(t,e,n){"use strict";var r=n(13),i=n(8),o=n(5);e.a=function(t,e,n){var a=t,s=Object(i.a)(e)?e.split("."):e;return s.forEach((function(t,e){e<s.length-1?(Object(r.a)(a[t])||(a[t]=Object(o.a)(s[e+1])?[]:{}),a=a[t]):a[t]=n})),t}},function(t,e,n){"use strict";var r=n(2),i=n(9),o=Object.prototype.hasOwnProperty;e.a=function(t,e){if(null===t||!Object(i.a)(t))return{};var n={};return Object(r.a)(e,(function(e){o.call(t,e)&&(n[e]=t[e])})),n}},function(t,e,n){"use strict";e.a=function(t,e,n){var r,i,o,a,s=0;n||(n={});var u=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var c=Date.now();s||!1!==n.leading||(s=c);var l=e-(c-s);return i=this,o=arguments,l<=0||l>e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,l)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c}},function(t,e,n){"use strict";var r=n(1);e.a=function(t){return Object(r.a)(t)?Array.prototype.slice.call(t):[]}},function(t,e,n){"use strict";var r={};e.a=function(t){return r[t=t||"g"]?r[t]+=1:r[t]=1,t+r[t]}},function(t,e,n){"use strict";e.a=function(){}},function(t,e,n){"use strict";e.a=function(t){return t}},function(t,e,n){"use strict";e.a=function(t){return Object(r.a)(t)?0:Object(i.a)(t)?t.length:Object.keys(t).length};var r=n(6),i=n(1)},function(t,e,n){"use strict";var r=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}();e.a=r},function(t,e){function n(t,e,n,r){void 0===r&&(r=[]);var i=this;i.w=t||0,i.h=e||0,i.y=n||0,i.x=0,i.c=r||[],i.cs=r.length,i.prelim=0,i.mod=0,i.shift=0,i.change=0,i.tl=null,i.tr=null,i.el=null,i.er=null,i.msel=0,i.mser=0}function r(t,e){var n=function t(e,n){var r=n?e.y:e.x;return e.children.forEach((function(e){r=Math.min(t(e,n),r)})),r}(t,e);!function t(e,n,r){r?e.y+=n:e.x+=n,e.children.forEach((function(e){t(e,n,r)}))}(t,-n,e)}n.fromNode=function(t,e){if(!t)return null;var r=[];return t.children.forEach((function(t){r.push(n.fromNode(t,e))})),e?new n(t.height,t.width,t.x,r):new n(t.width,t.height,t.y,r)},t.exports=function(t,e){void 0===e&&(e={});var i=e.isHorizontal;function o(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function a(t,e,n){for(var r=t.c[e-1],i=r.mod,o=t.c[e],a=o.mod;null!==r&&null!==o;){l(r)>n.low&&(n=n.nxt);var h=i+r.prelim+r.w-(a+o.prelim);h>0&&(a+=h,s(t,e,n.index,h));var f=l(r),d=l(o);f<=d&&null!==(r=c(r))&&(i+=r.mod),f>=d&&null!==(o=u(o))&&(a+=o.mod)}!r&&o?function(t,e,n,r){var i=t.c[0].el;i.tl=n;var o=r-n.mod-t.c[0].msel;i.mod+=o,i.prelim-=o,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,o,a):r&&!o&&function(t,e,n,r){var i=t.c[e].er;i.tr=n;var o=r-n.mod-t.c[e].mser;i.mod+=o,i.prelim-=o,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,r,i)}function s(t,e,n,r){t.c[e].mod+=r,t.c[e].msel+=r,t.c[e].mser+=r,function(t,e,n,r){if(n!==e-1){var i=e-n;t.c[n+1].shift+=r/i,t.c[e].shift-=r/i,t.c[e].change-=r-r/i}}(t,e,n,r)}function u(t){return 0===t.cs?t.tl:t.c[0]}function c(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function l(t){return t.y+t.h}function h(t,e,n){for(;null!==n&&t>=n.low;)n=n.nxt;return{low:t,index:e,nxt:n}}!function t(e,n,r){void 0===r&&(r=0),n?(e.x=r,r+=e.width):(e.y=r,r+=e.height),e.children.forEach((function(e){t(e,n,r)}))}(t,i);var f=n.fromNode(t,i);return function t(e){if(0!==e.cs){t(e.c[0]);for(var n=h(l(e.c[0].el),0,null),r=1;r<e.cs;++r){t(e.c[r]);var i=l(e.c[r].er);a(e,r,n),n=h(i,r,n)}!function(t){t.prelim=(t.c[0].prelim+t.c[0].mod+t.c[t.cs-1].mod+t.c[t.cs-1].prelim+t.c[t.cs-1].w)/2-t.w/2}(e),o(e)}else o(e)}(f),function t(e,n){n+=e.mod,e.x=e.prelim+n,function(t){for(var e=0,n=0,r=0;r<t.cs;r++)e+=t.c[r].shift,n+=e+t.c[r].change,t.c[r].mod+=n}(e);for(var r=0;r<e.cs;r++)t(e.c[r],n)}(f,0),function t(e,n,r){r?n.y=e.x:n.x=e.x,e.c.forEach((function(e,i){t(e,n.children[i],r)}))}(f,t,i),r(t,i),t}},function(t,e,n){var r=n(11),i=n(115),o=n(17),a=n(7),s=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.execute=function(){return this.rootNode.width=0,o(this.rootNode,this.options,i)},r}(r),u={};t.exports=function(t,e){return e=a.assign({},u,e),new s(t,e).execute()}},function(t,e,n){var r=n(7);function i(t,e){void 0===t&&(t=0),void 0===e&&(e=[]);var n=this;n.x=n.y=0,n.leftChild=n.rightChild=null,n.height=0,n.children=e}var o={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};t.exports=function(t,e){void 0===e&&(e={}),e=r.assign({},o,e);var n,a=0,s=function t(e){if(!e)return null;e.width=0,e.depth&&e.depth>a&&(a=e.depth);var n=e.children,r=n.length,o=new i(e.height,[]);return n.forEach((function(e,n){var i=t(e);o.children.push(i),0===n&&(o.leftChild=i),n===r-1&&(o.rightChild=i)})),o.originNode=e,o.isLeaf=e.isLeaf(),o}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=a;else{var n=e.children.map((function(e){return t(e)})),r=Math.min.apply(null,n);e.drawingDepth=r-1}return e.drawingDepth}(s),function t(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,n&&(r.y=n.y+n.height+e.nodeSep,r.originNode.parent!==n.originNode.parent&&(r.y+=e.subTreeSep)),n=r):(r.children.forEach((function(e){t(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(s),function t(e,n,r){r?(n.x=e.x,n.y=e.y):(n.x=e.y,n.y=e.x),e.children.forEach((function(e,i){t(e,n.children[i],r)}))}(s,t,e.isHorizontal),t}},function(t,e,n){var r=n(11),i=n(117),o=n(30),a=n(7),s=["LR","RL","H"],u=s[0],c=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.execute=function(){var t=this.options,e=this.rootNode;t.isHorizontal=!0;var n=t.indent,r=void 0===n?20:n,a=t.dropCap,c=void 0===a||a,l=t.direction||u;if(l&&-1===s.indexOf(l))throw new TypeError("Invalid direction: "+l);if(l===s[0])i(e,r,c);else if(l===s[1])i(e,r,c),e.right2left();else if(l===s[2]){var h=o(e,t),f=h.left,d=h.right;i(f,r,c),f.right2left(),i(d,r,c);var p=f.getBoundingBox();d.translate(p.width,0),e.x=d.x-e.width/2}return e},r}(r),l={};t.exports=function(t,e){return e=a.assign({},l,e),new c(t,e).execute()}},function(t,e){t.exports=function(t,e,n){var r=null;t.eachNode((function(t){!function(t,e,n,r){var i="function"==typeof n?n(t):n*t.depth;if(!r)try{if(t.id===t.parent.children[0].id)return t.x+=i,void(t.y=e?e.y:0)}catch(t){}t.x+=i,t.y=e?e.y+e.height:0}(t,r,e,n),r=t}))}},function(t,e,n){var r=n(11),i=n(119),o=n(17),a=n(7),s=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.execute=function(){return o(this.rootNode,this.options,i)},r}(r),u={};t.exports=function(t,e){return e=a.assign({},u,e),new s(t,e).execute()}},function(t,e,n){var r=n(7),i={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=r.assign({},i,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse((function(t){t.x=t.parent.x+t.parent.width})),t.parent=null,function t(e,n){var r=0;return e.children.length?e.children.forEach((function(e){r+=t(e,n)})):r=e.height,e._subTreeSep=n.getSubTreeSep(e.data),e.totalHeight=Math.max(e.height,r)+2*e._subTreeSep,e.totalHeight}(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode((function(t){var e=t.children,n=e.length;if(n){var r=e[0];if(r.startY=t.startY+t._subTreeSep,1===n)r.y=t.y+t.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var i=1;i<n;i++){var o=e[i];o.startY=e[i-1].startY+e[i-1].totalHeight,o.y=o.startY+o.totalHeight/2-o.height/2}}}})),function t(e){var n=e.children,r=n.length;if(r){n.forEach((function(e){t(e)}));var i=n[0],o=n[r-1],a=o.y-i.y+o.height,s=0;if(n.forEach((function(t){s+=t.totalHeight})),a>e.height)e.y=i.y+a/2-e.height/2;else if(1!==n.length||e.height>s){var u=e.y+(e.height-a)/2-i.y;n.forEach((function(t){t.translate(0,u)}))}else e.y=(i.y+i.height/2+o.y+o.height/2)/2-e.height/2}}(t)}}])},t.exports=r()},function(t,e,n){"use strict";var r=n(317),i=n(321),o=[].slice,a=["keyword","gray","hex"],s={};Object.keys(i).forEach((function(t){s[o.call(i[t].labels).sort().join("")]=t}));var u={};function c(t,e){if(!(this instanceof c))return new c(t,e);if(e&&e in a&&(e=null),e&&!(e in i))throw new Error("Unknown model: "+e);var n,l;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof c)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var h=r.get(t);if(null===h)throw new Error("Unable to parse color from string: "+t);this.model=h.model,l=i[this.model].channels,this.color=h.value.slice(0,l),this.valpha="number"==typeof h.value[l]?h.value[l]:1}else if(t.length){this.model=e||"rgb",l=i[this.model].channels;var f=o.call(t,0,l);this.color=d(f,l),this.valpha="number"==typeof t[l]?t[l]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var p=Object.keys(t);"alpha"in t&&(p.splice(p.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var g=p.sort().join("");if(!(g in s))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=s[g];var v=i[this.model].labels,m=[];for(n=0;n<v.length;n++)m.push(t[v[n]]);this.color=d(m)}if(u[this.model])for(l=i[this.model].channels,n=0;n<l;n++){var y=u[this.model][n];y&&(this.color[n]=y(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function l(t,e,n){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(u[t]||(u[t]=[]))[e]=n})),t=t[0],function(r){var i;return arguments.length?(n&&(r=n(r)),(i=this[t]()).color[e]=r,i):(i=this[t]().color[e],n&&(i=n(i)),i)}}function h(t){return function(e){return Math.max(0,Math.min(t,e))}}function f(t){return Array.isArray(t)?t:[t]}function d(t,e){for(var n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}c.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in r.to?this:this.rgb(),n=1===(e=e.round("number"==typeof t?t:1)).valpha?e.color:e.color.concat(this.valpha);return r.to[e.model](n)},percentString:function(t){var e=this.rgb().round("number"==typeof t?t:1),n=1===e.valpha?e.color:e.color.concat(this.valpha);return r.to.rgb.percent(n)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=i[this.model].channels,n=i[this.model].labels,r=0;r<e;r++)t[n[r]]=this.color[r];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new c(this.color.map(function(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new c(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:l("rgb",0,h(255)),green:l("rgb",1,h(255)),blue:l("rgb",2,h(255)),hue:l(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:l("hsl",1,h(100)),lightness:l("hsl",2,h(100)),saturationv:l("hsv",1,h(100)),value:l("hsv",2,h(100)),chroma:l("hcg",1,h(100)),gray:l("hcg",2,h(100)),white:l("hwb",1,h(100)),wblack:l("hwb",2,h(100)),cyan:l("cmyk",0,h(100)),magenta:l("cmyk",1,h(100)),yellow:l("cmyk",2,h(100)),black:l("cmyk",3,h(100)),x:l("xyz",0,h(100)),y:l("xyz",1,h(100)),z:l("xyz",2,h(100)),l:l("lab",0,h(100)),a:l("lab",1),b:l("lab",2),keyword:function(t){return arguments.length?new c(t):i[this.model].keyword(this.color)},hex:function(t){return arguments.length?new c(t):r.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){for(var t=this.rgb().color,e=[],n=0;n<t.length;n++){var r=t[n]/255;e[n]=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return c.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),n=e.color[0];return n=(n=(n+t)%360)<0?360+n:n,e.color[0]=n,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);var n=t.rgb(),r=this.rgb(),i=void 0===e?.5:e,o=2*i-1,a=n.alpha()-r.alpha(),s=((o*a==-1?o:(o+a)/(1+o*a))+1)/2,u=1-s;return c.rgb(s*n.red()+u*r.red(),s*n.green()+u*r.green(),s*n.blue()+u*r.blue(),n.alpha()*i+r.alpha()*(1-i))}},Object.keys(i).forEach((function(t){if(-1===a.indexOf(t)){var e=i[t].channels;c.prototype[t]=function(){if(this.model===t)return new c(this);if(arguments.length)return new c(arguments,t);var n="number"==typeof arguments[e]?e:this.valpha;return new c(f(i[this.model][t].raw(this.color)).concat(n),t)},c[t]=function(n){return"number"==typeof n&&(n=d(o.call(arguments),e)),new c(n,t)}}})),t.exports=c},function(t,e,n){var r=n(66),i=n(45);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){var r=n(104),i=n(105);t.exports=function(t,e,n,o){var a=!n;n||(n={});for(var s=-1,u=e.length;++s<u;){var c=e[s],l=o?o(n[c],t[c],c,n,t):void 0;void 0===l&&(l=t[c]),a?i(n,c,l):r(n,c,l)}return n}},function(t,e,n){var r=n(357),i=n(51),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},function(t,e,n){var r=n(359),i=n(107),o=n(157),a=o&&o.isTypedArray,s=a?i(a):r;t.exports=s},function(t,e,n){var r=n(77);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0;var r=n(42);function i(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function o(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}e.getServiceIdentifierAsString=i,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var r="",i=n(t,e);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach((function(t){var e="Object";null!==t.implementationType&&(e=o(t.implementationType)),r=r+"\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(function t(e,n){return null!==e.parentRequest&&(e.parentRequest.serviceIdentifier===n||t(e.parentRequest,n))}(e,e.serviceIdentifier)){var n=function(t){return function t(e,n){void 0===n&&(n=[]);var r=i(e.serviceIdentifier);return n.push(r),null!==e.parentRequest?t(e.parentRequest,n):n}(t).reverse().join(" --\x3e ")}(e);throw new Error(r.CIRCULAR_DEPENDENCY+" "+n)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return Z}));n(240);var r,i,o,a,s,u=n(6),c=n(285),l=n.n(c),h=n(26),f=n(11),d=n.n(f),p=n(7),g=n.n(p),v=n(8),m=n.n(v),y=n(12),b=n.n(y),x=(n(30),n(14)),w=n(37),_=(r=Object(u.injectable)(),i=Object(u.inject)(x.a.RenderEngine),r((a=function(){function t(){g()(this,t),d()(this,"engine",s,this),this.resourcePool={}}return m()(t,[{key:"getOrCreateResource",value:function(t){if(!this.resourcePool[t.name]){var e=t.descriptor,n=e.width,r=e.height,i=e.usage;this.resourcePool[t.name]=this.engine.createFramebuffer({color:this.engine.createTexture2D({width:n,height:r,wrapS:w.a.CLAMP_TO_EDGE,wrapT:w.a.CLAMP_TO_EDGE,usage:i})})}return this.resourcePool[t.name]}},{key:"clean",value:function(){this.resourcePool={}}}]),t}(),s=b()(a.prototype,"engine",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),o=a))||o),S=n(137),E=n(139),M=n(124),O=n(125),A=n(126),k=n(127),C=n(128),I=n(129),T=n(85),P=n(71),N=n(52),j=n(131),D=n(132),L=n(24),R=n.n(L),B=n(25),G=n.n(B),F=n(19),z=n.n(F);function U(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=z()(t);if(e){var i=z()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return G()(this,n)}}var V=function(t){R()(n,t);var e=U(n);function n(t){var r;return g()(this,n),(r=e.call(this,t)).name=void 0,r.name=t.name||"",r}return n}(h.a),W=n(133),Y=n(134),X=n(135),H=n(136),q=n(138),K=new u.Container;l()(K,!1);function Z(){var t=new u.Container;return t.parent=K,t.bind(x.a.Systems).to(W.a).inSingletonScope().whenTargetNamed(x.a.SceneGraphSystem),t.bind(x.a.Systems).to(S.a).inSingletonScope().whenTargetNamed(x.a.FrameGraphSystem),t.bind(x.a.Systems).to(I.a).inSingletonScope().whenTargetNamed(x.a.MeshSystem),t.bind(x.a.Systems).to(M.a).inSingletonScope().whenTargetNamed(x.a.GeometrySystem),t.bind(x.a.Systems).to(A.a).inSingletonScope().whenTargetNamed(x.a.MaterialSystem),t.bind(x.a.Systems).to(j.a).inSingletonScope().whenTargetNamed(x.a.RendererSystem),t.bind(x.a.ResourcePool).to(_).inSingletonScope(),t.bind(x.a.ConfigService).to(X.a).inSingletonScope(),t.bind(x.a.InteractorService).to(H.a).inSingletonScope(),t.bind(x.a.RenderPass).to(N.a).inSingletonScope().whenTargetNamed(N.a.IDENTIFIER),t.bind(x.a.RenderPass).to(T.a).inSingletonScope().whenTargetNamed(T.a.IDENTIFIER),t.bind(x.a.RenderPass).to(P.a).inSingletonScope().whenTargetNamed(P.a.IDENTIFIER),t.bind(x.a.RenderPassFactory).toFactory((function(t){return function(e){return t.container.getNamed(x.a.RenderPass,e)}})),t}K.bind(x.a.ShaderModuleService).to(q.a).inSingletonScope(),K.bind(x.a.NameComponentManager).toConstantValue(new h.b(V)),K.bind(x.a.HierarchyComponentManager).toConstantValue(new h.b(D.a)),K.bind(x.a.TransformComponentManager).toConstantValue(new h.b(Y.a)),K.bind(x.a.MeshComponentManager).toConstantValue(new h.b(C.a)),K.bind(x.a.CullableComponentManager).toConstantValue(new h.b(k.a)),K.bind(x.a.GeometryComponentManager).toConstantValue(new h.b(E.a)),K.bind(x.a.MaterialComponentManager).toConstantValue(new h.b(O.a))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(17);function i(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function o(t,e){return i(t)*i(e)?(t[0]*e[0]+t[1]*e[1])/(i(t)*i(e)):1}function a(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(o(t,e))}function s(t,e){var n=e[1],i=e[2],s=Object(r.m)(Object(r.o)(e[3]),2*Math.PI),u=e[4],c=e[5],l=t[0],h=t[1],f=e[6],d=e[7],p=Math.cos(s)*(l-f)/2+Math.sin(s)*(h-d)/2,g=-1*Math.sin(s)*(l-f)/2+Math.cos(s)*(h-d)/2,v=p*p/(n*n)+g*g/(i*i);v>1&&(n*=Math.sqrt(v),i*=Math.sqrt(v));var m=n*n*(g*g)+i*i*(p*p),y=m?Math.sqrt((n*n*(i*i)-m)/m):1;u===c&&(y*=-1),isNaN(y)&&(y=0);var b=i?y*n*g/i:0,x=n?y*-i*p/n:0,w=(l+f)/2+Math.cos(s)*b-Math.sin(s)*x,_=(h+d)/2+Math.sin(s)*b+Math.cos(s)*x,S=[(p-b)/n,(g-x)/i],E=[(-1*p-b)/n,(-1*g-x)/i],M=a([1,0],S),O=a(S,E);return o(S,E)<=-1&&(O=Math.PI),o(S,E)>=1&&(O=0),0===c&&O>0&&(O-=2*Math.PI),1===c&&O<0&&(O+=2*Math.PI),{cx:w,cy:_,rx:Object(r.j)(t,[f,d])?0:n,ry:Object(r.j)(t,[f,d])?0:i,startAngle:M,endAngle:M+O,xRotation:s,arcFlag:u,sweepFlag:c}}},function(t,e,n){var r;!function(i){var o=/^\s+/,a=/\s+$/,s=0,u=i.round,c=i.min,l=i.max,h=i.random;function f(t,e){if(e=e||{},(t=t||"")instanceof f)return t;if(!(this instanceof f))return new f(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,s=null,u=null,h=!1,f=!1;"string"==typeof t&&(t=function(t){t=t.replace(o,"").replace(a,"").toLowerCase();var e,n=!1;if(I[t])t=I[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=V.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=V.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=V.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=V.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=V.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=V.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=V.hex8.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),a:G(e[4]),format:n?"name":"hex8"};if(e=V.hex6.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),format:n?"name":"hex"};if(e=V.hex4.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),a:G(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=V.hex3.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==typeof t&&(W(t.r)&&W(t.g)&&W(t.b)?(d=t.r,p=t.g,g=t.b,e={r:255*N(d,255),g:255*N(p,255),b:255*N(g,255)},h=!0,f="%"===String(t.r).substr(-1)?"prgb":"rgb"):W(t.h)&&W(t.s)&&W(t.v)?(r=R(t.s),s=R(t.v),e=function(t,e,n){t=6*N(t,360),e=N(e,100),n=N(n,100);var r=i.floor(t),o=t-r,a=n*(1-e),s=n*(1-o*e),u=n*(1-(1-o)*e),c=r%6;return{r:255*[n,s,a,a,u,n][c],g:255*[u,n,n,s,a,a][c],b:255*[a,a,u,n,n,s][c]}}(t.h,r,s),h=!0,f="hsv"):W(t.h)&&W(t.s)&&W(t.l)&&(r=R(t.s),u=R(t.l),e=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=N(t,360),e=N(e,100),n=N(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,u=2*n-s;r=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,r,u),h=!0,f="hsl"),t.hasOwnProperty("a")&&(n=t.a));var d,p,g;return n=P(n),{ok:h,format:t.format||f,r:c(255,l(e.r,0)),g:c(255,l(e.g,0)),b:c(255,l(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=u(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=u(this._r)),this._g<1&&(this._g=u(this._g)),this._b<1&&(this._b=u(this._b)),this._ok=n.ok,this._tc_id=s++}function d(t,e,n){t=N(t,255),e=N(e,255),n=N(n,255);var r,i,o=l(t,e,n),a=c(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,l:s}}function p(t,e,n){t=N(t,255),e=N(e,255),n=N(n,255);var r,i,o=l(t,e,n),a=c(t,e,n),s=o,u=o-a;if(i=0===o?0:u/o,o==a)r=0;else{switch(o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,v:s}}function g(t,e,n,r){var i=[L(u(t).toString(16)),L(u(e).toString(16)),L(u(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function v(t,e,n,r){return[L(B(r)),L(u(t).toString(16)),L(u(e).toString(16)),L(u(n).toString(16))].join("")}function m(t,e){e=0===e?0:e||10;var n=f(t).toHsl();return n.s-=e/100,n.s=j(n.s),f(n)}function y(t,e){e=0===e?0:e||10;var n=f(t).toHsl();return n.s+=e/100,n.s=j(n.s),f(n)}function b(t){return f(t).desaturate(100)}function x(t,e){e=0===e?0:e||10;var n=f(t).toHsl();return n.l+=e/100,n.l=j(n.l),f(n)}function w(t,e){e=0===e?0:e||10;var n=f(t).toRgb();return n.r=l(0,c(255,n.r-u(-e/100*255))),n.g=l(0,c(255,n.g-u(-e/100*255))),n.b=l(0,c(255,n.b-u(-e/100*255))),f(n)}function _(t,e){e=0===e?0:e||10;var n=f(t).toHsl();return n.l-=e/100,n.l=j(n.l),f(n)}function S(t,e){var n=f(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,f(n)}function E(t){var e=f(t).toHsl();return e.h=(e.h+180)%360,f(e)}function M(t){var e=f(t).toHsl(),n=e.h;return[f(t),f({h:(n+120)%360,s:e.s,l:e.l}),f({h:(n+240)%360,s:e.s,l:e.l})]}function O(t){var e=f(t).toHsl(),n=e.h;return[f(t),f({h:(n+90)%360,s:e.s,l:e.l}),f({h:(n+180)%360,s:e.s,l:e.l}),f({h:(n+270)%360,s:e.s,l:e.l})]}function A(t){var e=f(t).toHsl(),n=e.h;return[f(t),f({h:(n+72)%360,s:e.s,l:e.l}),f({h:(n+216)%360,s:e.s,l:e.l})]}function k(t,e,n){e=e||6,n=n||30;var r=f(t).toHsl(),i=360/n,o=[f(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(f(r));return o}function C(t,e){e=e||6;for(var n=f(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(f({h:r,s:i,v:o})),o=(o+s)%1;return a}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:i.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=P(t),this._roundA=u(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=u(360*t.h),n=u(100*t.s),r=u(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=d(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=d(this._r,this._g,this._b),e=u(360*t.h),n=u(100*t.s),r=u(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return g(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[L(u(t).toString(16)),L(u(e).toString(16)),L(u(n).toString(16)),L(B(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:u(this._r),g:u(this._g),b:u(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+u(this._r)+", "+u(this._g)+", "+u(this._b)+")":"rgba("+u(this._r)+", "+u(this._g)+", "+u(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:u(100*N(this._r,255))+"%",g:u(100*N(this._g,255))+"%",b:u(100*N(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+u(100*N(this._r,255))+"%, "+u(100*N(this._g,255))+"%, "+u(100*N(this._b,255))+"%)":"rgba("+u(100*N(this._r,255))+"%, "+u(100*N(this._g,255))+"%, "+u(100*N(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(T[g(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+v(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=f(t);n="#"+v(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(x,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(m,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(S,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(C,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(M,arguments)},tetrad:function(){return this._applyCombination(O,arguments)}},f.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:R(t[r]));t=n}return f(t,e)},f.equals=function(t,e){return!(!t||!e)&&f(t).toRgbString()==f(e).toRgbString()},f.random=function(){return f.fromRatio({r:h(),g:h(),b:h()})},f.mix=function(t,e,n){n=0===n?0:n||50;var r=f(t).toRgb(),i=f(e).toRgb(),o=n/100;return f({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},f.readability=function(t,e){var n=f(t),r=f(e);return(i.max(n.getLuminance(),r.getLuminance())+.05)/(i.min(n.getLuminance(),r.getLuminance())+.05)},f.isReadable=function(t,e,n){var r,i,o=f.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},f.mostReadable=function(t,e,n){var r,i,o,a,s=null,u=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var c=0;c<e.length;c++)(r=f.readability(t,e[c]))>u&&(u=r,s=f(e[c]));return f.isReadable(t,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,f.mostReadable(t,["#fff","#000"],n))};var I=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},T=f.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(I);function P(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function N(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=c(e,l(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),i.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function j(t){return c(1,l(0,t))}function D(t){return parseInt(t,16)}function L(t){return 1==t.length?"0"+t:""+t}function R(t){return t<=1&&(t=100*t+"%"),t}function B(t){return i.round(255*parseFloat(t)).toString(16)}function G(t){return D(t)/255}var F,z,U,V=(z="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",U="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+z),rgba:new RegExp("rgba"+U),hsl:new RegExp("hsl"+z),hsla:new RegExp("hsla"+U),hsv:new RegExp("hsv"+z),hsva:new RegExp("hsva"+U),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function W(t){return!!V.CSS_UNIT.exec(t)}t.exports?t.exports=f:void 0===(r=function(){return f}.call(e,n,e,t))||(t.exports=r)}(Math)},function(t,e,n){t.exports={EPSILON:n(264),create:n(265),clone:n(536),fromValues:n(537),copy:n(538),set:n(266),equals:n(539),exactEquals:n(540),add:n(267),subtract:n(171),sub:n(541),multiply:n(268),mul:n(542),divide:n(269),div:n(543),inverse:n(544),min:n(545),max:n(546),rotate:n(547),floor:n(548),ceil:n(549),round:n(550),scale:n(551),scaleAndAdd:n(552),distance:n(270),dist:n(553),squaredDistance:n(271),sqrDist:n(554),length:n(272),len:n(555),squaredLength:n(273),sqrLen:n(556),negate:n(557),normalize:n(274),dot:n(275),cross:n(558),lerp:n(559),random:n(560),transformMat2:n(561),transformMat2d:n(562),transformMat3:n(563),transformMat4:n(564),forEach:n(565),limit:n(566)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];!a&&0!==a||!s&&0!==s||(i[a][s]=1,e||(i[s][a]=1))})),i};e.default=r},function(t,e,n){var r=n(100),i=n(332),o=n(333),a=n(334),s=n(335),u=n(336);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,t.exports=c},function(t,e,n){var r=n(327),i=n(328),o=n(329),a=n(330),s=n(331);function u(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])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e,n){var r=n(73);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(65)(Object,"create");t.exports=r},function(t,e,n){var r=n(351);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(105),i=n(73),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];o.call(t,e)&&i(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(190);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(192)(Object.getPrototypeOf,Object);t.exports=r},function(t,e,n){var r=n(163),i=n(380)(r);t.exports=i},function(t,e,n){var r=n(112),i=n(92);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},function(t,e,n){var r=n(32),i=n(166),o=n(394),a=n(215);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(a(t))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},function(t,e,n){var r=n(68),i=n(224),o=n(225);t.exports=function(t,e){return o(i(t,e,r),t+"")}},function(t,e,n){var r=n(73),i=n(54),o=n(106),a=n(45);t.exports=function(t,e,n){if(!a(n))return!1;var s=typeof e;return!!("number"==s?i(n)&&o(e,n.length):"string"==s&&e in n)&&r(n[e],t)}},function(t,e,n){"use strict";var r=n(29);t.exports={longestPath:function(t){var e={};r.forEach(t.sources(),(function n(i){var o=t.node(i);if(r.has(e,i))return o.rank;e[i]=!0;var a=r.min(r.map(t.outEdges(i),(function(e){return n(e.w)-t.edge(e).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},longestPathWithLayer:function(t){var e={},n=0;r.forEach(t.sources(),(function i(o){var a=t.node(o);if(r.has(e,o))return a.rank;e[o]=!0;var s=r.min(r.map(t.outEdges(o),(function(e){return i(e.w)-t.edge(e).minlen})));return s!==Number.POSITIVE_INFINITY&&null!=s||(s=0),a.rank=s,n=Math.min(a.rank,n),a.rank})),n+=1,t.nodes().forEach((function(e){var i=t.node(e);isNaN(i.layer)?i.rank-=n:function e(n,i){var o=t.node(n),a=isNaN(o.layer)?i:o.layer;(void 0===o.rank||o.rank<a)&&(o.rank=a),r.map(t.outEdges(n),(function(n){e(n.w,a+t.edge(n).minlen)}))}(e,i.layer)}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}}},function(t,e,n){"use strict";var r=n(37);n.d(e,"gl",(function(){return r.a}));n(251),n(252),n(253),n(254),n(255),n(256),n(257),n(258),n(259),n(260),n(261)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVNode=void 0;const r=n(33),i=n(148);class o extends i.SVModel{constructor(t,e,n,r,i,o,a){super(t,e,n,r,"node"),this.group=n,this.layout=r,Object.keys(i).map(t=>{"id"!==t&&(this[t]=i[t])}),this.sourceNode=i,this.sourceId=i.id.toString(),this.links={inDegree:[],outDegree:[]},this.appendages=[],this.sourceNode=i,this.label=o,this.G6ModelProps=this.generateG6ModelProps(a)}generateG6ModelProps(t){const e=r.Util.objectClone(t.style);return Object.assign(Object.assign({},this.sourceNode),{id:this.id,x:0,y:0,rotation:t.rotation||0,type:t.type,size:t.size||[60,30],anchorPoints:t.anchorPoints,label:this.label,style:Object.assign(Object.assign({},e),{fill:this.disable?"#ccc":e.fill}),labelCfg:r.Util.objectClone(t.labelOptions)})}isNode(){return!0}setSelectedState(t){null!==this.G6Item&&(this.G6Item.setState("selected",t),this.appendages.forEach(e=>{e.setSelectedState(t)}))}getSourceId(){return this.sourceId}isSameGroup(t){return this.modelConstructor.isSameGroup(this,t)}}e.SVNode=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EventBus=void 0,e.EventBus={events:{},on(t,n){void 0===e.EventBus.events[t]&&(e.EventBus.events[t]=[]),e.EventBus.events[t].push(n)},emit(t,n){void 0!==e.EventBus.events[t]&&e.EventBus.events[t].map(t=>t(n))}}},function(t,e,n){"use strict";var r=function(){function t(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return t.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.toString=function(){return"[Event (type="+this.type+")]"},t.prototype.save=function(){},t.prototype.restore=function(){},t}();e.a=r},function(t,e,n){"use strict";var r=n(1),i=n(140),o=n(20),a=function(t){function e(e){var n=t.call(this)||this;n.destroyed=!1;var r=n.getDefaultCfg();return n.cfg=Object(o.i)(r,e),n}return Object(r.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,e){this.cfg[t]=e},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(i.a);e.a=a},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=null;function i(){if(!r){var t=document.createElement("canvas");t.width=1,t.height=1,r=t.getContext("2d")}return r}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return o}));var r=-1,i=1;function o(){return i++}},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r,i,o,a,s,u,c,l=n(10),h=n.n(l),f=n(16),d=n.n(f),p=n(11),g=n.n(p),v=n(7),m=n.n(v),y=n(8),b=n.n(y),x=n(12),w=n.n(x),_=(n(30),n(6)),S=n(3),E=n(14),M=n(37),O=(r=Object(_.injectable)(),i=Object(_.inject)(E.a.GeometryComponentManager),o=Object(_.inject)(E.a.RenderEngine),r((s=function(){function t(){m()(this,t),g()(this,"geometry",u,this),g()(this,"engine",c,this)}var e;return b()(t,[{key:"execute",value:(e=d()(h.a.mark((function t(){var e=this;return h.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.geometry.forEach((function(t,n){n.dirty&&(n.attributes.forEach((function(t){var n;t.dirty&&t.data&&(t.buffer?null===(n=t.buffer)||void 0===n||n.subData({data:t.data,offset:0}):t.buffer=e.engine.createBuffer({data:t.data,type:M.a.FLOAT}),t.dirty=!1)})),n.indices&&(n.indicesBuffer?n.indicesBuffer.subData({data:n.indices,offset:0}):n.indicesBuffer=e.engine.createElements({data:n.indices,count:n.indices.length,type:M.a.UNSIGNED_INT,usage:M.a.STATIC_DRAW})),n.dirty=!1)}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.geometry.forEach((function(t,e){e.indicesBuffer&&e.indicesBuffer.destroy(),e.attributes.forEach((function(t){t.buffer&&t.buffer.destroy()}))})),this.geometry.clear()}},{key:"createBufferGeometry",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{vertexCount:3},e=t.vertexCount,n=Object(S.createEntity)();return this.geometry.create(n,{vertexCount:e})}},{key:"createInstancedBufferGeometry",value:function(t){var e=t.maxInstancedCount,n=t.vertexCount,r=Object(S.createEntity)();return this.geometry.create(r,{maxInstancedCount:e,vertexCount:n})}}]),t}(),u=w()(s.prototype,"geometry",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c=w()(s.prototype,"engine",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),a=s))||a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var r=n(4),i=n.n(r),o=n(7),a=n.n(o),s=n(8),u=n.n(s),c=n(23),l=n.n(c),h=n(24),f=n.n(h),d=n(25),p=n.n(d),g=n(19),v=n.n(g),m=n(3);function y(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 b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=v()(t);if(e){var i=v()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p()(this,n)}}var w=function(t){f()(n,t);var e=x(n);function n(t){var r;return a()(this,n),(r=e.call(this,t)).vertexShaderGLSL=void 0,r.fragmentShaderGLSL=void 0,r.defines={},r.dirty=!0,r.uniforms=[],r.cull={enable:!0,face:m.gl.BACK},r.depth={enable:!0},r.blend=void 0,r.entity=void 0,r.type=void 0,Object.assign(l()(r),t),r}return u()(n,[{key:"setDefines",value:function(t){return this.defines=b(b({},this.defines),t),this}},{key:"setCull",value:function(t){return this.cull=t,this}},{key:"setDepth",value:function(t){return this.depth=t,this}},{key:"setBlend",value:function(t){return this.blend=t,this}},{key:"setUniform",value:function(t,e){var n=this;if("string"!=typeof t)return Object.keys(t).forEach((function(e){return n.setUniform(e,t[e])})),this;var r=this.uniforms.find((function(e){return e.name===t}));return r?(r.dirty=!0,r.data=e):this.uniforms.push({name:t,dirty:!0,data:e}),this.dirty=!0,this}}]),n}(n(26).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return T}));var r,i,o,a,s,u,c,l,h,f=n(4),d=n.n(f),p=n(10),g=n.n(p),v=n(16),m=n.n(v),y=n(11),b=n.n(y),x=n(7),w=n.n(x),_=n(8),S=n.n(_),E=n(12),M=n.n(E),O=(n(30),n(6)),A=n(3),k=n(14);function C(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 I(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?C(Object(n),!0).forEach((function(e){d()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var T=(r=Object(O.injectable)(),i=Object(O.inject)(k.a.MaterialComponentManager),o=Object(O.inject)(k.a.RenderEngine),a=Object(O.inject)(k.a.ShaderModuleService),r((u=function(){function t(){w()(this,t),b()(this,"material",c,this),b()(this,"engine",l,this),b()(this,"shaderModule",h,this)}var e;return S()(t,[{key:"execute",value:(e=m()(g.a.mark((function t(){return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.material.clear()}},{key:"createShaderMaterial",value:function(t){var e=Object(A.createEntity)(),n=t.vertexShader,r=t.fragmentShader,i=[];if(!this.engine.supportWebGPU){var o="material-".concat(e);this.shaderModule.registerModule(o,{vs:t.vertexShader,fs:t.fragmentShader});var a=this.shaderModule.getModule(o);n=a.vs,r=a.fs,a.uniforms&&(i=Object.keys(a.uniforms).map((function(t){return{dirty:!0,name:t,data:a.uniforms[t]}})))}return this.material.create(e,I(I({vertexShaderGLSL:n,fragmentShaderGLSL:r},t),{},{uniforms:i}))}}]),t}(),c=M()(u.prototype,"material",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),l=M()(u.prototype,"engine",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),h=M()(u.prototype,"shaderModule",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),s=u))||s)},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r,i=n(7),o=n.n(i),a=n(23),s=n.n(a),u=n(24),c=n.n(u),l=n(25),h=n.n(l),f=n(19),d=n.n(f),p=n(26);function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h()(this,n)}}!function(t){t[t.Standard=0]="Standard"}(r||(r={}));var v=function(t){c()(n,t);var e=g(n);function n(t){var i;return o()(this,n),(i=e.call(this,t)).strategy=r.Standard,i.visibilityPlaneMask=0,i.visible=!1,Object.assign(s()(i),t),i}return n}(p.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(7),i=n.n(r),o=n(23),a=n.n(o),s=n(24),u=n.n(s),c=n(25),l=n.n(c),h=n(19),f=n.n(h),d=n(26),p=n(81);function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=f()(t);if(e){var i=f()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}var v=function(t){u()(n,t);var e=g(n);function n(t){var r;return i()(this,n),(r=e.call(this,t)).material=void 0,r.geometry=void 0,r.aabb=new p.a,r.aabbDirty=!0,r.model=void 0,r.visible=!0,r.children=[],Object.assign(a()(r),t),r}return n}(d.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return D}));var r,i,o,a,s,u,c,l,h,f,d,p,g,v=n(10),m=n.n(v),y=n(16),b=n.n(y),x=n(11),w=n.n(x),_=n(7),S=n.n(_),E=n(8),M=n.n(E),O=n(12),A=n.n(O),k=(n(30),n(2)),C=n(6),I=n(14),T=n(58),P=n(145);function N(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return j(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function j(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}var D=(r=Object(C.injectable)(),i=Object(C.inject)(I.a.MeshComponentManager),o=Object(C.inject)(I.a.CullableComponentManager),a=Object(C.inject)(I.a.GeometryComponentManager),s=Object(C.inject)(I.a.HierarchyComponentManager),u=Object(C.inject)(I.a.TransformComponentManager),r((l=function(){function t(){S()(this,t),w()(this,"mesh",h,this),w()(this,"cullable",f,this),w()(this,"geometry",d,this),w()(this,"hierarchy",p,this),w()(this,"transform",g,this),this.planes=void 0}var e;return M()(t,[{key:"setFrustumPlanes",value:function(t){this.planes=t}},{key:"execute",value:(e=b()(m.a.mark((function t(e){var n,r,i,o,a,s,u,c,l,h,f,d,p,g,v,y,b,x,w,_,S;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=N(e);try{for(n.s();!(r=n.n()).done;){i=r.value,o=i.getScene(),a=i.getCamera(),s=N(o.getEntities());try{for(s.s();!(u=s.n()).done;)c=u.value,(l=this.mesh.getComponentByEntity(c))&&(h=this.hierarchy.getComponentByEntity(c),f=this.cullable.getComponentByEntity(c),d=l.geometry,p=this.transform.getComponentByEntity(c),d&&d.aabb&&p&&l.aabbDirty&&(g=p.worldTransform,v=d.aabb,y=v.center,b=v.halfExtents,x=k.e.transformMat4(k.e.create(),y,g),w=Object(P.b)(g,k.a.create()),_=k.e.transformMat3(k.e.create(),b,w),l.aabb.update(x,_),l.aabbDirty=!1),f&&d&&(S=this.cullable.getComponentByEntity((null==h?void 0:h.parentID)||-1),f.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(l.aabb,(null==S?void 0:S.visibilityPlaneMask)||T.b.INDETERMINATE,this.planes||a.getFrustum().planes),f.visible=f.visibilityPlaneMask!==T.b.OUTSIDE))}catch(t){s.e(t)}finally{s.f()}}}catch(t){n.e(t)}finally{n.f()}case 2:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.cullable.clear(),this.mesh.clear()}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n){if(e===T.b.OUTSIDE||e===T.b.INSIDE)return e;for(var r=T.b.INSIDE,i=0,o=n.length;i<o;++i){var a=i<31?1<<i:0;if(!(i<31&&0==(e&a))){var s=n[i],u=s.normal,c=s.distance;if(k.e.dot(u,t.getNegativeFarPoint(n[i]))+c>0)return T.b.OUTSIDE;k.e.dot(u,t.getPositiveFarPoint(n[i]))+c>0&&(r|=a)}}return r}}]),t}(),h=A()(l.prototype,"mesh",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),f=A()(l.prototype,"cullable",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),d=A()(l.prototype,"geometry",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),p=A()(l.prototype,"hierarchy",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g=A()(l.prototype,"transform",[u],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c=l))||c)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(7),i=n.n(r),o=n(8),a=n.n(o),s=n(2),u=function(){function t(e,n){i()(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||s.e.fromValues(0,1,0),this.updatePNVertexFlag()}return a()(t,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return s.e.dot(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/s.e.len(this.normal);s.e.scale(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&s.e.lerp(n,t,e,i),o}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return P}));var r,i,o,a,s,u,c,l,h,f,d,p,g=n(10),v=n.n(g),m=n(16),y=n.n(m),b=n(11),x=n.n(b),w=n(7),_=n.n(w),S=n(8),E=n.n(S),M=n(12),O=n.n(M),A=(n(30),n(6)),k=n(14),C=n(85),I=n(71),T=n(52),P=(r=Object(A.injectable)(),i=Object(A.inject)(k.a.Systems),o=Object(A.named)(k.a.FrameGraphSystem),a=Object(A.inject)(k.a.RenderPassFactory),s=Object(A.inject)(k.a.ConfigService),u=Object(A.inject)(k.a.ResourcePool),r((l=function(){function t(){_()(this,t),x()(this,"frameGraphSystem",h,this),x()(this,"renderPassFactory",f,this),x()(this,"configService",d,this),x()(this,"resourcePool",p,this)}var e;return E()(t,[{key:"execute",value:(e=y()(v.a.mark((function t(e){var n,r,i,o,a,s,u,c;return v.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.renderPassFactory(T.a.IDENTIFIER),r=n.setup,i=n.execute,this.frameGraphSystem.addPass(T.a.IDENTIFIER,r,i),o=this.renderPassFactory(C.a.IDENTIFIER),a=o.setup,s=o.execute,u=o.tearDown,c=this.frameGraphSystem.addPass(C.a.IDENTIFIER,a,s,u),this.frameGraphSystem.present(c.data.output);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.resourcePool.clean()}},{key:"pick",value:function(t,e){return this.renderPassFactory(I.a.IDENTIFIER).pick(t,e)}}]),t}(),h=O()(l.prototype,"frameGraphSystem",[i,o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),f=O()(l.prototype,"renderPassFactory",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),d=O()(l.prototype,"configService",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),p=O()(l.prototype,"resourcePool",[u],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c=l))||c)},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r=n(7),i=n.n(r),o=n(23),a=n.n(o),s=n(24),u=n.n(s),c=n(25),l=n.n(c),h=n(19),f=n.n(h);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=f()(t);if(e){var i=f()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}var p=function(t){u()(n,t);var e=d(n);function n(t){var r;return i()(this,n),(r=e.call(this,t)).parentID=void 0,Object.assign(a()(r),t),r}return n}(n(26).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return A}));var r,i,o,a,s,u,c,l,h,f=n(10),d=n.n(f),p=n(16),g=n.n(p),v=n(11),m=n.n(v),y=n(7),b=n.n(y),x=n(8),w=n.n(x),_=n(12),S=n.n(_),E=(n(30),n(2)),M=n(6),O=n(14),A=(r=Object(M.injectable)(),i=Object(M.inject)(O.a.HierarchyComponentManager),o=Object(M.inject)(O.a.TransformComponentManager),a=Object(M.inject)(O.a.MeshComponentManager),r((u=function(){function t(){b()(this,t),m()(this,"hierarchy",c,this),m()(this,"transform",l,this),m()(this,"mesh",h,this)}var e;return w()(t,[{key:"execute",value:(e=g()(d.a.mark((function t(){return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.runTransformUpdateSystem(),this.runHierarchyUpdateSystem();case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.hierarchy.clear(),this.transform.clear()}},{key:"getHierarchyComponentManager",value:function(){return this.hierarchy}},{key:"getTransformComponentManager",value:function(){return this.transform}},{key:"runTransformUpdateSystem",value:function(){var t=this;this.transform.forEach((function(e,n){(n.isDirty()||n.isLocalDirty())&&(t.setMeshAABBDirty(t.mesh.getComponentByEntity(e)),n.updateTransform())}))}},{key:"runHierarchyUpdateSystem",value:function(){var t=this;this.hierarchy.forEach((function(e,n){var r=t.transform.getComponentByEntity(e),i=t.transform.getComponentByEntity(n.parentID);null!==r&&null!==i&&r.updateTransformWithParent(i)}))}},{key:"attach",value:function(t,e,n){this.hierarchy.contains(t)&&this.detach(t),this.hierarchy.create(t,{parentID:e});var r=this.mesh.getComponentByEntity(e);if(this.setMeshAABBDirty(r),r&&-1===r.children.indexOf(t)&&r.children.push(t),this.hierarchy.getCount()>1)for(var i=this.hierarchy.getCount()-1;i>0;--i)for(var o=this.hierarchy.getEntity(i),a=0;a<i;++a){if(this.hierarchy.getComponent(a).parentID===o){this.hierarchy.moveItem(i,a),++i;break}}this.hierarchy.getComponentByEntity(t);var s=this.transform.getComponentByEntity(e);null===s&&(s=this.transform.create(e));var u=this.transform.getComponentByEntity(t);null===u&&(u=this.transform.create(t),s=this.transform.getComponentByEntity(e)),u.parent=s,!n&&s&&(u.matrixTransform(E.b.invert(E.b.create(),s.worldTransform)),u.updateTransform()),s&&u.updateTransformWithParent(s)}},{key:"detach",value:function(t){var e=this.hierarchy.getComponentByEntity(t);if(null!==e){var n=this.transform.getComponentByEntity(t);null!==n&&(n.parent=null,n.applyTransform()),this.hierarchy.removeKeepSorted(t);var r=this.mesh.getComponentByEntity(e.parentID);if(r){var i=r.children.indexOf(t);r.children.splice(i,1)}this.setMeshAABBDirty(r)}}},{key:"detachChildren",value:function(t){var e=this.mesh.getComponentByEntity(t);e&&(e.children=[]);for(var n=0;n<this.hierarchy.getCount();){var r;if((null===(r=this.hierarchy.getComponent(n))||void 0===r?void 0:r.parentID)===t){var i=this.hierarchy.getEntity(n);this.detach(i)}else++n}}},{key:"setMeshAABBDirty",value:function(t){t&&(t.aabbDirty=!0)}}]),t}(),c=S()(u.prototype,"hierarchy",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),l=S()(u.prototype,"transform",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),h=S()(u.prototype,"mesh",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),s=u))||s)},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var r=n(7),i=n.n(r),o=n(8),a=n.n(o),s=n(23),u=n.n(s),c=n(24),l=n.n(c),h=n(25),f=n.n(h),d=n(19),p=n.n(d),g=n(2);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=p()(t);if(e){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var m=function(t){l()(n,t);var e=v(n);function n(t){var r,o,a,s,c,l,h,f,d,p,v,m,y,b,x;return i()(this,n),(r=e.call(this,t)).dirtyFlag=void 0,r.localDirtyFlag=void 0,r.parent=null,r.localPosition=g.e.fromValues(0,0,0),r.localRotation=g.c.fromValues(0,0,0,1),r.localScale=g.e.fromValues(1,1,1),r.localTransform=g.b.create(),r.position=g.e.fromValues(0,0,0),r.rotation=g.c.fromValues(0,0,0,1),r.scaling=g.e.fromValues(1,1,1),r.worldTransform=g.b.create(),r.matrixTransform=(o=g.b.create(),function(t){g.b.multiply(o,r.getLocalTransform(),t),g.b.getScaling(r.localScale,o),g.b.getTranslation(r.localPosition,o),g.b.getRotation(r.localRotation,o)}),r.rotateRollPitchYaw=(a=g.c.create(),s=g.c.create(),c=g.c.create(),function(t,e,n){r.setDirty(),g.c.fromEuler(a,t,0,0),g.c.fromEuler(s,0,e,0),g.c.fromEuler(c,0,0,n),g.c.multiply(r.localRotation,a,r.localRotation),g.c.multiply(r.localRotation,r.localRotation,s),g.c.multiply(r.localRotation,c,r.localRotation),g.c.normalize(r.localRotation,r.localRotation)}),r.lerp=(l=g.e.create(),h=g.c.create(),f=g.e.create(),d=g.e.create(),p=g.c.create(),v=g.e.create(),function(t,e,n){r.setDirty(),g.b.getScaling(l,t.worldTransform),g.b.getTranslation(f,t.worldTransform),g.b.getRotation(h,t.worldTransform),g.b.getScaling(d,e.worldTransform),g.b.getTranslation(v,e.worldTransform),g.b.getRotation(p,e.worldTransform),g.e.lerp(r.localScale,l,d,n),g.c.slerp(r.localRotation,h,p,n),g.e.lerp(r.localPosition,f,v,n)}),r.translate=(m=g.e.create(),function(t){return g.e.add(m,r.getPosition(),t),r.setPosition(m),r.setDirty(!0),u()(r)}),r.translateLocal=function(t){return g.e.transformQuat(t,t,r.localRotation),g.e.add(r.localPosition,r.localPosition,t),r.setLocalDirty(!0),u()(r)},r.setPosition=(y=g.b.create(),function(t){return r.position=t,r.setLocalDirty(!0),null===r.parent?g.e.copy(r.localPosition,t):(g.b.copy(y,r.parent.worldTransform),g.b.invert(y,y),g.e.transformMat4(r.localPosition,t,y)),u()(r)}),r.rotate=(b=g.c.create(),function(t){if(null===r.parent)g.c.multiply(r.localRotation,r.localRotation,t),g.c.normalize(r.localRotation,r.localRotation);else{var e=r.getRotation(),n=r.parent.getRotation();g.c.copy(b,n),g.c.invert(b,b),g.c.multiply(b,b,t),g.c.multiply(r.localRotation,t,e),g.c.normalize(r.localRotation,r.localRotation)}return r.setLocalDirty(),u()(r)}),r.rotateLocal=function(t){return g.c.multiply(r.localRotation,r.localRotation,t),g.c.normalize(r.localRotation,r.localRotation),r.setLocalDirty(!0),u()(r)},r.setRotation=(x=g.c.create(),function(t){return null===r.parent?g.c.copy(r.localRotation,t):(g.c.copy(x,r.parent.getRotation()),g.c.invert(x,x),g.c.copy(r.localRotation,x),g.c.mul(r.localRotation,r.localRotation,t)),r.setLocalDirty(!0),u()(r)}),r}return a()(n,[{key:"setLocalPosition",value:function(t){g.e.copy(this.localPosition,t),this.setLocalDirty(!0)}},{key:"setLocalScale",value:function(t){g.e.copy(this.localScale,t),this.setLocalDirty(!0)}},{key:"setLocalRotation",value:function(t){return g.c.copy(this.localRotation,t),this.setLocalDirty(!0),this}},{key:"isDirty",value:function(){return this.dirtyFlag}},{key:"setDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.dirtyFlag|=n.DIRTY:this.dirtyFlag&=~n.DIRTY}},{key:"isLocalDirty",value:function(){return this.localDirtyFlag}},{key:"setLocalDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?(this.localDirtyFlag|=n.DIRTY,this.setDirty(!0)):this.localDirtyFlag&=~n.DIRTY}},{key:"updateTransform",value:function(){this.isLocalDirty()&&this.getLocalTransform(),this.isDirty()&&null===this.parent&&(g.b.copy(this.worldTransform,this.getLocalTransform()),this.setDirty(!1))}},{key:"updateTransformWithParent",value:function(t){g.b.multiply(this.worldTransform,t.worldTransform,this.getLocalTransform())}},{key:"applyTransform",value:function(){this.setDirty(),g.b.getScaling(this.localScale,this.worldTransform),g.b.getTranslation(this.localPosition,this.worldTransform),g.b.getRotation(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localPosition=g.e.fromValues(0,0,0),this.localRotation=g.c.fromValues(0,0,0,1),this.localScale=g.e.fromValues(1,1,1)}},{key:"scaleLocal",value:function(t){return this.setLocalDirty(),g.e.multiply(this.localScale,this.localScale,t),this}},{key:"getLocalPosition",value:function(){return this.localPosition}},{key:"getLocalRotation",value:function(){return this.localRotation}},{key:"getLocalScale",value:function(){return this.localScale}},{key:"getLocalTransform",value:function(){return this.localDirtyFlag&&(g.b.fromRotationTranslationScale(this.localTransform,this.localRotation,this.localPosition,this.localScale),this.setLocalDirty(!1)),this.localTransform}},{key:"getWorldTransform",value:function(){return this.isLocalDirty()||this.isDirty()?(this.parent&&this.parent.getWorldTransform(),this.updateTransform(),this.worldTransform):this.worldTransform}},{key:"getPosition",value:function(){return g.b.getTranslation(this.position,this.worldTransform),this.position}},{key:"getRotation",value:function(){return g.b.getRotation(this.rotation,this.worldTransform),this.rotation}},{key:"getScale",value:function(){return g.b.getScaling(this.scaling,this.worldTransform),this.scaling}}]),n}(n(26).a);m.DIRTY=1},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r,i=n(7),o=n.n(i),a=n(8),s=n.n(a),u=n(6),c=Object(u.injectable)()(r=function(){function t(){o()(this,t),this.config=void 0}return s()(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}())||r},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i,o=n(7),a=n.n(o),s=n(8),u=n.n(s),c=n(6);!function(t){t.PANSTART="PANSTART",t.PANEND="PANEND",t.PANMOVE="PANMOVE",t.PINCH="PINCH",t.KEYDOWN="KEYDOWN",t.KEYUP="KEYUP",t.HOVER="HOVER"}(i||(i={}));var l=Object(c.injectable)()(r=function(){function t(){a()(this,t)}return u()(t,[{key:"listen",value:function(t){}},{key:"on",value:function(t,e){}},{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"destroy",value:function(){}}]),t}())||r},function(t,e,n){"use strict";n.d(e,"a",(function(){return B}));var r=n(62),i=n.n(r),o=n(10),a=n.n(o),s=n(16),u=n.n(s),c=n(11),l=n.n(c),h=n(7),f=n.n(h),d=n(8),p=n.n(d),g=n(12),v=n.n(g),m=(n(30),n(6)),y=n(14),b=function t(){f()(this,t),this.index=void 0},x=function t(){f()(this,t),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0},w=function(){function t(){f()(this,t),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return p()(t,[{key:"read",value:function(t){return this.reads.find((function(e){return e.index===t.index}))||this.reads.push(t),t}},{key:"sample",value:function(t){return this.read(t),t}},{key:"write",value:function(t,e){if(this.writes.find((function(t){return t.index===e.index})))return e;var n=t.getResourceNode(e);n.resource.version++,n.resource.imported&&(this.hasSideEffect=!0);var r=t.createResourceNode(n.resource);return t.getResourceNode(r).writer=this,this.writes.push(r),r}}]),t}(),_=n(24),S=n.n(_),E=n(25),M=n.n(E),O=n(19),A=n.n(O);function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=A()(t);if(e){var i=A()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var C,I,T,P,N,j=function(t){S()(n,t);var e=k(n);function n(){var t;f()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))).version=0,t.refs=0,t.name=void 0,t.imported=void 0,t.priority=void 0,t.discardStart=!0,t.discardEnd=!1,t.descriptor=void 0,t.resource=void 0,t}return p()(n,[{key:"preExecuteDestroy",value:function(){this.discardEnd=!0}},{key:"postExecuteDestroy",value:function(){this.imported}},{key:"postExecuteDevirtualize",value:function(){this.discardStart=!1}},{key:"preExecuteDevirtualize",value:function(){this.imported}}]),n}((function t(){f()(this,t),this.first=void 0,this.last=void 0})),D=function t(){f()(this,t),this.resource=void 0,this.writer=void 0,this.readerCount=0,this.version=void 0};function L(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return R(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function R(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}var B=(C=Object(m.injectable)(),I=Object(m.inject)(y.a.RenderEngine),C((P=function(){function t(){f()(this,t),this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[],l()(this,"engine",N,this)}var e,n;return p()(t,[{key:"execute",value:(n=u()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.compile(),t.next=3,this.executePassNodes(e);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"tearDown",value:function(){this.frameGraphPasses.forEach((function(t){t.tearDown&&t.tearDown()})),this.reset()}},{key:"addPass",value:function(t,e,n,r){var i=new x;i.execute=n,r&&(i.tearDown=r),i.name=t;var o=new w;return o.name=t,this.passNodes.push(o),this.frameGraphPasses.push(i),e(this,o,i),i}},{key:"getPass",value:function(t){return this.frameGraphPasses.find((function(e){return e.name===t}))}},{key:"compile",value:function(){var t,e=this,n=L(this.passNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.refCount=r.writes.length+(r.hasSideEffect?1:0),r.reads.forEach((function(t){e.resourceNodes[t.index].readerCount++}))}}catch(t){n.e(t)}finally{n.f()}var i,o=[],a=L(this.resourceNodes);try{for(a.s();!(i=a.n()).done;){var s=i.value;0===s.readerCount&&o.push(s)}}catch(t){a.e(t)}finally{a.f()}for(;o.length;){var u=o.pop(),c=u&&u.writer;if(c&&0==--c.refCount){var l,h=L(c.reads);try{for(h.s();!(l=h.n()).done;){var f=l.value,d=this.resourceNodes[f.index];0==--d.readerCount&&o.push(d)}}catch(t){h.e(t)}finally{h.f()}}}this.resourceNodes.forEach((function(t){t.resource.refs+=t.readerCount}));var p,g=L(this.passNodes);try{for(g.s();!(p=g.n()).done;){var v=p.value;if(v.refCount){var m,y=L(v.reads);try{for(y.s();!(m=y.n()).done;){var b=m.value,x=this.resourceNodes[b.index].resource;x.first=x.first?x.first:v,x.last=v}}catch(t){y.e(t)}finally{y.f()}var w,_=L(v.writes);try{for(_.s();!(w=_.n()).done;){var S=w.value,E=this.resourceNodes[S.index].resource;E.first=E.first?E.first:v,E.last=v}}catch(t){_.e(t)}finally{_.f()}}}}catch(t){g.e(t)}finally{g.f()}for(var M=0;M<2;M++){var O,A=L(this.resourceNodes);try{for(A.s();!(O=A.n()).done;){var k=O.value.resource;if(k.priority===M&&k.refs){var C=k.first,I=k.last;C&&I&&(C.devirtualize.push(k),I.destroy.push(k))}}}catch(t){A.e(t)}finally{A.f()}}}},{key:"executePassNodes",value:(e=u()(a.a.mark((function t(e){var n,r,o,s,u,c,l,h,f,d,p,g,v;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=L(this.passNodes.entries()),t.prev=1,n.s();case 3:if((r=n.n()).done){t.next=18;break}if(o=i()(r.value,2),s=o[0],!(u=o[1]).refCount){t.next=16;break}c=L(u.devirtualize);try{for(c.s();!(l=c.n()).done;)l.value.preExecuteDevirtualize(this.engine)}catch(t){c.e(t)}finally{c.f()}h=L(u.destroy);try{for(h.s();!(f=h.n()).done;)f.value.preExecuteDestroy(this.engine)}catch(t){h.e(t)}finally{h.f()}return t.next=12,this.frameGraphPasses[s].execute(this,this.frameGraphPasses[s],e);case 12:d=L(u.devirtualize);try{for(d.s();!(p=d.n()).done;)p.value.postExecuteDevirtualize(this.engine)}catch(t){d.e(t)}finally{d.f()}g=L(u.destroy);try{for(g.s();!(v=g.n()).done;)v.value.postExecuteDestroy(this.engine)}catch(t){g.e(t)}finally{g.f()}case 16:t.next=3;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(1),n.e(t.t0);case 23:return t.prev=23,n.f(),t.finish(23);case 26:this.reset();case 27:case"end":return t.stop()}}),t,this,[[1,20,23,26]])}))),function(t){return e.apply(this,arguments)})},{key:"reset",value:function(){this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[]}},{key:"getResourceNode",value:function(t){return this.resourceNodes[t.index]}},{key:"createResourceNode",value:function(t){var e=new D;e.resource=t,e.version=t.version,this.resourceNodes.push(e);var n=new b;return n.index=this.resourceNodes.length-1,n}},{key:"createTexture",value:function(t,e,n){var r=new j;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"createRenderTarget",value:function(t,e,n){var r=new j;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"present",value:function(t){this.addPass("Present",(function(e,n){n.read(t),n.hasSideEffect=!0}),u()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))))}}]),t}(),N=v()(P.prototype,"engine",[I],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),T=P))||T)},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var r=n(4),i=n.n(r),o=n(7),a=n.n(o),s=n(8),u=n.n(s),c=n(6);var l,h=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function f(t){var e={};return{content:t=t.replace(h,(function(t,n,r){var i=r.split(":"),o=i[0].trim(),a="";switch(i.length>1&&(a=i[1].trim()),n){case"bool":a="true"===a;break;case"float":case"int":a=Number(a);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":a=a?a.replace("[","").replace("]","").split(",").reduce((function(t,e){return t.push(Number(e.trim())),t}),[]):new Array(function(t){var e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16}return e}(n)).fill(0)}return e[o]=a,"uniform ".concat(n," ").concat(o,";\n")})),uniforms:e}}function d(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 p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var g=/precision\s+(high|low|medium)p\s+float/,v=/#pragma include (["^+"]?["\ "[a-zA-Z_0-9](.*)"]*?)/g,m=Object(c.injectable)()(l=function(){function t(){a()(this,t),this.moduleCache={},this.rawContentCache={}}return u()(t,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("picking",{vs:"attribute vec3 a_PickingColor;\nvarying vec4 v_PickingResult;\n\nuniform vec3 u_PickingColor : [0, 0, 0];\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\nuniform float u_PickingThreshold : 1.0;\nuniform float u_PickingBuffer: 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n abs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&\n abs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&\n abs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;\n}\n\nvoid setPickingColor(vec3 pickingColor) {\n // compares only in highlight stage\n v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));\n\n // Stores the picking color so that the fragment shader can render it during picking\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nfloat setPickingSize(float x) {\n return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\n}",fs:"varying vec4 v_PickingResult;\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 filterHighlightColor(vec4 color) {\n bool selected = bool(v_PickingResult.a);\n\n if (selected) {\n vec4 highLightColor = u_HighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\n\n vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(resultRGB, color.a);\n } else {\n return color;\n }\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 filterPickingColor(vec4 color) {\n vec3 pickingColor = v_PickingResult.rgb;\n if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\n discard;\n }\n return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 filterColor(vec4 color) {\n return filterPickingColor(filterHighlightColor(color));\n}\n"}),this.registerModule("sdf2d",{vs:"",fs:"/**\n * 2D signed distance field functions\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\n */\n\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\n\nfloat sdCircle(vec2 p, float r) {\n return length(p) - r;\n}\n\nfloat sdEquilateralTriangle(vec2 p) {\n float k = sqrt(3.0);\n p.x = abs(p.x) - 1.0;\n p.y = p.y + 1.0/k;\n if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\n p.x -= clamp( p.x, -2.0, 0.0 );\n return -length(p)*sign(p.y);\n}\n\nfloat sdBox(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\n}\n\nfloat sdPentagon(vec2 p, float r) {\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\n p.x = abs(p.x);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagon(vec2 p, float r) {\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdOctogon(vec2 p, float r) {\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\n p = abs(p);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagram(vec2 p, float r) {\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdRhombus(vec2 p, vec2 b) {\n vec2 q = abs(p);\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\n}\n\nfloat sdVesica(vec2 p, float r, float d) {\n p = abs(p);\n float b = sqrt(r*r-d*d); // can delay this sqrt\n return ((p.y-b)*d>p.x*b)\n ? length(p-vec2(0.0,b))\n : length(p-vec2(-d,0.0))-r;\n}"})}},{key:"registerModule",value:function(t,e){if(!this.rawContentCache[t]){var n=e.vs,r=void 0===n?"":n,i=e.fs,o=void 0===i?"":i,a=e.uniforms,s=f(r),u=s.content,c=s.uniforms,l=f(o),h=l.content,d=l.uniforms;this.rawContentCache[t]={fs:h,uniforms:p(p(p({},c),d),a),vs:u}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var e=this;if(this.moduleCache[t])return this.moduleCache[t];var n,r=this.rawContentCache[t].vs||"",i=this.rawContentCache[t].fs||"",o=this.processModule(r,[],"vs"),a=o.content,s=o.includeList,u=this.processModule(i,[],"fs"),c=u.content,l=u.includeList,h=c,f=(n=s.concat(l).concat(t),n.filter((function(t,e,n){return n.indexOf(t)===e}))).reduce((function(t,n){return p(p({},t),e.rawContentCache[n].uniforms)}),{});return g.test(c)||(h="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n#endif\n"+c),this.moduleCache[t]={fs:h.trim(),uniforms:f,vs:a.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,e,n){var r=this;return{content:t.replace(v,(function(t,i){var o=i.split(" ")[0].replace(/"/g,"");if(e.indexOf(o)>-1)return"";var a=r.rawContentCache[o][n];return e.push(o),r.processModule(a||"",e,n).content})),includeList:e}}}]),t}())||l},function(t,e,n){"use strict";n.d(e,"a",(function(){return A}));var r=n(4),i=n.n(r),o=n(7),a=n.n(o),s=n(8),u=n.n(s),c=n(23),l=n.n(c),h=n(24),f=n.n(h),d=n(25),p=n.n(d),g=n(19),v=n.n(g),m=n(2),y=n(26),b=n(43),x=n.n(b),w={};w["[object Float32Array]"]=w["[object Float64Array]"]=w["[object Int8Array]"]=w["[object Int16Array]"]=w["[object Int32Array]"]=w["[object Uint8Array]"]=w["[object Uint8ClampedArray]"]=w["[object Uint16Array]"]=w["[object Uint32Array]"]=!0,w["[object Arguments]"]=w["[object Array]"]=w["[object ArrayBuffer]"]=w["[object Boolean]"]=w["[object DataView]"]=w["[object Date]"]=w["[object Error]"]=w["[object Function]"]=w["[object Map]"]=w["[object Number]"]=w["[object Object]"]=w["[object RegExp]"]=w["[object Set]"]=w["[object String]"]=w["[object WeakMap]"]=!1;var _=Object.prototype.toString;var S=function(t){return function(t){return!!t&&"object"===x()(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!w[_.call(t)]};function E(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 M(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?E(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=v()(t);if(e){var i=v()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p()(this,n)}}var A=function(t){f()(n,t);var e=O(n);function n(t){var r;return a()(this,n),(r=e.call(this,t)).dirty=!0,r.attributes=[],r.indices=void 0,r.indicesBuffer=void 0,r.vertexCount=0,r.maxInstancedCount=void 0,r.aabb=void 0,r.entity=void 0,Object.assign(l()(r),t),r}return u()(n,[{key:"setAttribute",value:function(t,e,n,r){var i=this.attributes.find((function(e){return e.name===t}));return i?(i.data=e,i.dirty=!0):this.attributes.push(M(M({dirty:!0,name:t,data:e},n),{},{bufferGetter:r})),this.dirty=!0,this}},{key:"setIndex",value:function(t){return this.indices=new Uint32Array(t.buffer?t.buffer:t),this.dirty=!0,this}},{key:"applyMatrix",value:function(t){var e=this.attributes.find((function(t){return"position"===t.name})),n=this.attributes.find((function(t){return"normal"===t.name}));if(e&&(e.dirty=!0,e.data&&e.data.length))for(var r=0;r<e.data.length;r+=3){var i=m.f.fromValues(e.data[r],e.data[r+1],e.data[r+2],1);m.f.transformMat4(i,i,t),S(e.data)?e.data.set([i[0],i[1],i[2]],r):(e.data[r]=i[0],e.data[r+1]=i[1],e.data[r+2]=i[2])}if(n){var o=m.a.normalFromMat4(m.a.create(),t);if(n.data&&n.data.length)for(var a=0;a<n.data.length;a+=3){var s=m.e.fromValues(n.data[a],n.data[a+1],n.data[a+2]);m.e.transformMat3(s,s,o),m.e.normalize(s,s),S(n.data)?n.data.set([s[0],s[1],s[2]],a):(n.data[a]=s[0],n.data[a+1]=s[1],n.data[a+2]=s[2])}}}}]),n}(y.a)},function(t,e,n){"use strict";var r=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0),this},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}();e.a=r},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(142),a=n(20),s={};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,o=[],s=[],u=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return u.length>0?(Object(a.a)(u,(function(t){var e=t.getBBox();o.push(e.minX,e.maxX),s.push(e.minY,e.maxY)})),t=Object(i.min)(o),e=Object(i.max)(o),n=Object(i.min)(s),r=Object(i.max)(s)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,o=[],s=[],u=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return u.length>0?(Object(a.a)(u,(function(t){var e=t.getCanvasBBox();o.push(e.minX,e.maxX),s.push(e.minY,e.maxY)})),t=Object(i.min)(o),e=Object(i.max)(o),n=Object(i.min)(s),r=Object(i.max)(s)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,n,r){if(t.prototype.onAttrChange.call(this,e,n,r),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var r=this.getTotalMatrix();r!==n&&this._applyChildrenMarix(r)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();Object(a.a)(e,(function(e){e.applyMatrix(t)}))},e.prototype.addShape=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],r=t[1];Object(a.f)(n)?r=n:r.type=n;var i=s[r.type];i||(i=Object(a.k)(r.type),s[r.type]=i);var o=this.getShapeBase(),u=new o[i](r);return this.add(u),u},e.prototype.addGroup=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=t[0],i=t[1];if(Object(a.d)(r))n=new r(i||{parent:this});else{var o=r||{},s=this.getGroupBase();n=new s(o)}return this.add(n),n},e.prototype.getCanvas=function(){return this.isCanvas()?this:this.get("canvas")},e.prototype.getShape=function(t,e,n){if(!Object(a.b)(this))return null;var r,i=this.getChildren();if(this.isCanvas())r=this._findShape(i,t,e,n);else{var o=[t,e,1];o=this.invertFromMatrix(o),this.isClipped(o[0],o[1])||(r=this._findShape(i,o[0],o[1],n))}return r},e.prototype._findShape=function(t,e,n,r){for(var i=null,o=t.length-1;o>=0;o--){var s=t[o];if(Object(a.b)(s)&&(s.isGroup()?i=s.getShape(e,n,r):s.isHit(e,n)&&(i=s)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),r=this.get("timeline"),i=t.getParent();i&&function(t,e,n){void 0===n&&(n=!0),n?e.destroy():(e.set("parent",null),e.set("canvas",null)),Object(a.j)(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,n){if(e.set("canvas",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,e),r&&function t(e,n){if(e.set("timeline",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,r),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t,e=this.getChildren();Object(a.a)(e,(function(t,e){return t._INDEX=e,t})),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,n){var r=t(e,n);return 0===r?e._INDEX-n._INDEX:r})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],n=this.getChildren();return Object(a.a)(n,(function(n){t(n)&&e.push(n),n.isGroup()&&(e=e.concat(n.findAll(t)))})),e},e.prototype.find=function(t){var e=null,n=this.getChildren();return Object(a.a)(n,(function(n){if(t(n)?e=n:n.isGroup()&&(e=n.find(t)),e)return!1})),e},e.prototype.findById=function(t){return this.find((function(e){return e.get("id")===t}))},e.prototype.findByClassName=function(t){return this.find((function(e){return e.get("className")===t}))},e.prototype.findAllByName=function(t){return this.findAll((function(e){return e.get("name")===t}))},e}(o.a);e.a=u},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(15),a=n(20),s=n(40),u=n(121),c=o.ext.transform,l=["zIndex","capture","visible","type"],h=["repeat"];function f(t,e){var n={},r=e.attrs;for(var i in t)n[i]=r[i];return n}function d(t,e){var n={},r=e.attr();return Object(i.each)(t,(function(t,e){-1!==h.indexOf(e)||Object(i.isEqual)(r[e],t)||(n[e]=t)})),n}function p(t,e){if(e.onFrame)return t;var n=e.startTime,r=e.delay,o=e.duration,a=Object.prototype.hasOwnProperty;return Object(i.each)(t,(function(t){n+r<t.startTime+t.delay+t.duration&&o>t.delay&&Object(i.each)(e.toAttrs,(function(e,n){a.call(t.toAttrs,n)&&(delete t.toAttrs[n],delete t.fromAttrs[n])}))})),t}var g=function(t){function e(e){var n=t.call(this,e)||this;n.attrs={};var r=n.getDefaultAttrs();return Object(i.mix)(r,e.attrs),n.attrs=r,n.initAttrs(r),n.initAnimate(),n}return Object(r.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],o=e[1];if(!r)return this.attrs;if(Object(i.isObject)(r)){for(var a in r)this.setAttr(a,r[a]);return this.afterAttrsChange(r),this}return 2===e.length?(this.setAttr(r,o),this.afterAttrsChange(((t={})[r]=o,t)),this):this.attrs[r]},e.prototype.isClipped=function(t,e){var n=this.getClip();return n&&!n.isHit(t,e)},e.prototype.setAttr=function(t,e){var n=this.attrs[t];n!==e&&(this.attrs[t]=e,this.onAttrChange(t,e,n))},e.prototype.onAttrChange=function(t,e,n){"matrix"===t&&this.set("totalMatrix",null)},e.prototype.afterAttrsChange=function(t){if(this.cfg.isClipShape){var e=this.cfg.applyTo;e&&e.onCanvasChange("clip")}else this.onCanvasChange("attr")},e.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},e.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},e.prototype.setZIndex=function(t){this.set("zIndex",t);var e=this.getParent();return e&&e.sort(),this},e.prototype.toFront=function(){var t=this.getParent();if(t){var e=t.getChildren(),n=(this.get("el"),e.indexOf(this));e.splice(n,1),e.push(this),this.onCanvasChange("zIndex")}},e.prototype.toBack=function(){var t=this.getParent();if(t){var e=t.getChildren(),n=(this.get("el"),e.indexOf(this));e.splice(n,1),e.unshift(this),this.onCanvasChange("zIndex")}},e.prototype.remove=function(t){void 0===t&&(t=!0);var e=this.getParent();e?(Object(a.j)(e.getChildren(),this),e.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},e.prototype.resetMatrix=function(){this.attr("matrix",this.getDefaultMatrix()),this.onCanvasChange("matrix")},e.prototype.getMatrix=function(){return this.attr("matrix")},e.prototype.setMatrix=function(t){this.attr("matrix",t),this.onCanvasChange("matrix")},e.prototype.getTotalMatrix=function(){var t=this.cfg.totalMatrix;if(!t){var e=this.attr("matrix"),n=this.cfg.parentMatrix;t=n&&e?Object(s.b)(n,e):e||n,this.set("totalMatrix",t)}return t},e.prototype.applyMatrix=function(t){var e=this.attr("matrix"),n=null;n=t&&e?Object(s.b)(t,e):e||t,this.set("totalMatrix",n),this.set("parentMatrix",t)},e.prototype.getDefaultMatrix=function(){return null},e.prototype.applyToMatrix=function(t){var e=this.attr("matrix");return e?Object(s.c)(e,t):t},e.prototype.invertFromMatrix=function(t){var e=this.attr("matrix");if(e){var n=Object(s.a)(e);if(n)return Object(s.c)(n,t)}return t},e.prototype.setClip=function(t){var e=this.getCanvas(),n=null;if(t){var r=this.getShapeBase()[Object(i.upperFirst)(t.type)];r&&(n=new r({type:t.type,isClipShape:!0,applyTo:this,attrs:t.attrs,canvas:e}))}return this.set("clipShape",n),this.onCanvasChange("clip"),n},e.prototype.getClip=function(){var t=this.cfg.clipShape;return t||null},e.prototype.clone=function(){var t=this,e=this.attrs,n={};Object(i.each)(e,(function(t,r){Object(i.isArray)(e[r])?n[r]=function(t){for(var e=[],n=0;n<t.length;n++)Object(i.isArray)(t[n])?e.push([].concat(t[n])):e.push(t[n]);return e}(e[r]):n[r]=e[r]}));var r=new(0,this.constructor)({attrs:n});return Object(i.each)(l,(function(e){r.set(e,t.get(e))})),r},e.prototype.destroy=function(){this.destroyed||(this.attrs={},t.prototype.destroy.call(this))},e.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},e.prototype.animate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(this.get("timeline")||this.get("canvas")){this.set("animating",!0);var n=this.get("timeline");n||(n=this.get("canvas").get("timeline"),this.set("timeline",n));var r=this.get("animations")||[];n.timer||n.initTimer();var o,a,s,u,c,l=t[0],h=t[1],g=t[2],v=void 0===g?"easeLinear":g,m=t[3],y=void 0===m?i.noop:m,b=t[4],x=void 0===b?0:b;Object(i.isFunction)(l)?(o=l,l={}):Object(i.isObject)(l)&&l.onFrame&&(o=l.onFrame,a=l.repeat),Object(i.isObject)(h)?(h=(c=h).duration,v=c.easing||"easeLinear",x=c.delay||0,a=c.repeat||a||!1,y=c.callback||i.noop,s=c.pauseCallback||i.noop,u=c.resumeCallback||i.noop):(Object(i.isNumber)(y)&&(x=y,y=null),Object(i.isFunction)(v)?(y=v,v="easeLinear"):v=v||"easeLinear");var w=d(l,this),_={fromAttrs:f(w,this),toAttrs:w,duration:h,easing:v,repeat:a,callback:y,pauseCallback:s,resumeCallback:u,delay:x,startTime:n.getTime(),id:Object(i.uniqueId)(),onFrame:o,pathFormatted:!1};r.length>0?r=p(r,_):n.addAnimator(this),r.push(_),this.set("animations",r),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var n=this.get("animations");Object(i.each)(n,(function(n){t&&(n.onFrame?e.attr(n.onFrame(1)):e.attr(n.toAttrs)),n.callback&&n.callback()})),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return Object(i.each)(e,(function(t){t._paused=!0,t._pauseTime=n,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),n=this.get("_pause").pauseTime;return Object(i.each)(e,(function(e){e.startTime=e.startTime+(t-n),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var n,r=this,o=e.propagationPath;this.getEvents();"mouseenter"===t?n=e.fromShape:"mouseleave"===t&&(n=e.toShape);for(var s=function(t){var s=o[t],c=s.get("name");if(c){if((s.isGroup()||s.isCanvas&&s.isCanvas())&&n&&Object(a.g)(s,n))return"break";Object(i.isArray)(c)?Object(i.each)(c,(function(t){r.emitDelegateEvent(s,t,e)})):u.emitDelegateEvent(s,c,e)}},u=this,c=0;c<o.length;c++){if("break"===s(c))break}},e.prototype.emitDelegateEvent=function(t,e,n){var r=this.getEvents(),i=e+":"+n.type;(r[i]||r["*"])&&(n.name=i,n.currentTarget=t,n.delegateTarget=this,n.delegateObject=t.get("delegateObject"),this.emit(i,n))},e.prototype.translate=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var n=this.getMatrix(),r=c(n,[["t",t,e]]);return this.setMatrix(r),this},e.prototype.move=function(t,e){var n=this.attr("x")||0,r=this.attr("y")||0;return this.translate(t-n,e-r),this},e.prototype.moveTo=function(t,e){return this.move(t,e)},e.prototype.scale=function(t,e){var n=this.getMatrix(),r=c(n,[["s",t,e||t]]);return this.setMatrix(r),this},e.prototype.rotate=function(t){var e=this.getMatrix(),n=c(e,[["r",t]]);return this.setMatrix(n),this},e.prototype.rotateAtStart=function(t){var e=this.attr(),n=e.x,r=e.y,i=this.getMatrix(),o=c(i,[["t",-n,-r],["r",t],["t",n,r]]);return this.setMatrix(o),this},e.prototype.rotateAtPoint=function(t,e,n){var r=this.getMatrix(),i=c(r,[["t",-t,-e],["r",n],["t",t,e]]);return this.setMatrix(i),this},e}(u.a);e.a=g},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return f}));var r=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},i=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},o=function(e){this.version=e,this.type="node",this.name="node",this.os=t.platform},a=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},s=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},u=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},c=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,l=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],h=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function f(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new u:"undefined"!=typeof navigator?p(navigator.userAgent):void 0!==t&&t.version?new o(t.version.slice(1)):null}function d(t){return""!==t&&l.reduce((function(e,n){var r=n[0],i=n[1];if(e)return e;var o=i.exec(t);return!!o&&[r,o]}),!1)}function p(t){var e=d(t);if(!e)return null;var n=e[0],o=e[1];if("searchbot"===n)return new s;var u=o[1]&&o[1].split(".").join("_").split("_").slice(0,3);u?u.length<3&&(u=r(r([],u,!0),function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-u.length),!0)):u=[];var l=u.join("."),f=function(t){for(var e=0,n=h.length;e<n;e++){var r=h[e],i=r[0];if(r[1].exec(t))return i}return null}(t),p=c.exec(t);return p&&p[1]?new a(n,l,f,p[1]):new i(n,l,f)}}).call(this,n(178))},function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return l}));var r=n(17),i=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,o=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,a=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,s=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function u(t,e){var n=t.match(s);Object(r.c)(n,(function(t){var n=t.split(":");e.addColorStop(n[0],n[1])}))}function c(t,e,n){var c=e.getBBox();if(isNaN(c.x)||isNaN(c.y)||isNaN(c.width)||isNaN(c.height))return n;if(Object(r.k)(n)){if("("===n[1]||"("===n[2]){if("l"===n[0])return function(t,e,n){var r,o,a=i.exec(n),s=parseFloat(a[1])%360*(Math.PI/180),c=a[2],l=e.getBBox();s>=0&&s<.5*Math.PI?(r={x:l.minX,y:l.minY},o={x:l.maxX,y:l.maxY}):.5*Math.PI<=s&&s<Math.PI?(r={x:l.maxX,y:l.minY},o={x:l.minX,y:l.maxY}):Math.PI<=s&&s<1.5*Math.PI?(r={x:l.maxX,y:l.maxY},o={x:l.minX,y:l.minY}):(r={x:l.minX,y:l.maxY},o={x:l.maxX,y:l.minY});var h=Math.tan(s),f=h*h,d=(o.x-r.x+h*(o.y-r.y))/(f+1)+r.x,p=h*(o.x-r.x+h*(o.y-r.y))/(f+1)+r.y,g=t.createLinearGradient(r.x,r.y,d,p);return u(c,g),g}(t,e,n);if("r"===n[0])return function(t,e,n){var r=o.exec(n),i=parseFloat(r[1]),a=parseFloat(r[2]),c=parseFloat(r[3]),l=r[4];if(0===c){var h=l.match(s);return h[h.length-1].split(":")[1]}var f=e.getBBox(),d=f.maxX-f.minX,p=f.maxY-f.minY,g=Math.sqrt(d*d+p*p)/2,v=t.createRadialGradient(f.minX+d*i,f.minY+p*a,0,f.minX+d/2,f.minY+p/2,c*g);return u(l,v),v}(t,e,n);if("p"===n[0])return function(t,e,n){if(e.get("patternSource")&&e.get("patternSource")===n)return e.get("pattern");var r,i,o=a.exec(n),s=o[1],u=o[2];function c(){r=t.createPattern(i,s),e.set("pattern",r),e.set("patternSource",n)}switch(s){case"a":s="repeat";break;case"x":s="repeat-x";break;case"y":s="repeat-y";break;case"n":s="no-repeat";break;default:s="no-repeat"}return i=new Image,u.match(/^data:/i)||(i.crossOrigin="Anonymous"),i.src=u,i.complete?c():(i.onload=c,i.src=i.src),r}(t,e,n)}return n}return n instanceof CanvasPattern?n:void 0}function l(t){var e=0,n=0,i=0,o=0;return Object(r.g)(t)?1===t.length?e=n=i=o=t[0]:2===t.length?(e=i=t[0],n=o=t[1]):3===t.length?(e=t[0],n=o=t[1],i=t[2]):(e=t[0],n=t[1],i=t[2],o=t[3]):e=n=i=o=t,[e,n,i,o]}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(62),i=n.n(r);n(2);function o(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function a(t){var e=i()(t,3);return e[0]+256*e[1]+65536*e[2]-1}},function(t,e,n){t.exports={graphlib:n(48),layout:n(437),debug:n(499),util:{time:n(38).time,notime:n(38).notime},version:n(500)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVLink=void 0;const r=n(33),i=n(148);class o extends i.SVModel{constructor(t,e,n,r,i,o,a,s){super(t,e,n,r,"link"),this.node=i,this.target=o,this.linkIndex=a,i.links.outDegree.push(this),o.links.inDegree.push(this),this.G6ModelProps=this.generateG6ModelProps(s)}generateG6ModelProps(t){let e=t.sourceAnchor,n=t.targetAnchor;return t.sourceAnchor&&"function"==typeof t.sourceAnchor&&null!==this.linkIndex&&(e=t.sourceAnchor(this.linkIndex)),t.targetAnchor&&"function"==typeof t.targetAnchor&&null!==this.linkIndex&&(n=t.targetAnchor(this.linkIndex)),{id:this.id,type:t.type,source:this.node.id,target:this.target.id,sourceAnchor:e,targetAnchor:n,label:t.label,style:r.Util.objectClone(t.style),labelCfg:r.Util.objectClone(t.labelOptions),curveOffset:t.curveOffset}}}e.SVLink=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVModel=void 0;const r=n(33),i=n(296);e.SVModel=class{constructor(t,e,n,r,i){this.id=t,this.sourceType=e,this.group=n,this.layout=r,this.shadowG6Item=null,this.G6Item=null,this.preLayout=!1,this.discarded=!1,this.freed=!1,this.leaked=!1,this.transformMatrix=[1,0,0,0,1,0,0,0,1],this.modelType=i}generateG6ModelProps(t){return null}get(t){return this.G6ModelProps[t]}set(t,e){if(!this.discarded)if("object"!=typeof t){if(this.G6ModelProps[t]!==e){if(this.G6ModelProps[t]="style"===t||"labelCfg"===t?i.default(this.G6ModelProps[t]||{},e):e,"rotation"===t){const t=r.Util.calcRotateMatrix(this.getMatrix(),e);this.setMatrix(t)}if(this.G6Item)if(this.preLayout){this.G6Item.getModel()[t]=e}else this.g6Instance.updateItem(this.G6Item,this.G6ModelProps);this.shadowG6Item&&this.shadowG6Instance.updateItem(this.shadowG6Item,this.G6ModelProps)}}else Object.keys(t).map(e=>{this.set(e,t[e])})}updateG6ModelStyle(t){const e={style:Object.assign({},t.style),labelCfg:Object.assign({},t.labelCfg)};this.G6ModelProps=i.default.recursive(this.G6ModelProps,e),this.G6Item&&this.g6Instance.updateItem(this.G6Item,this.G6ModelProps),this.shadowG6Item&&this.shadowG6Instance.updateItem(this.shadowG6Item,this.G6ModelProps)}getBound(){return this.shadowG6Item.getBBox()}getMatrix(){return[...this.transformMatrix]}setMatrix(t){this.transformMatrix=t,this.set("style",{matrix:t})}setSelectedState(t){null!==this.G6Item&&this.G6Item.setState("selected",t)}getG6ModelProps(){return r.Util.objectClone(this.G6ModelProps)}getModelType(){return this.modelType}isNode(){return!1}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MESSAGE=e.ALGORITHM=void 0;e.ALGORITHM={pageRank:"pageRank",breadthFirstSearch:"breadthFirstSearch",connectedComponent:"connectedComponent",depthFirstSearch:"depthFirstSearch",detectCycle:"detectCycle",detectDirectedCycle:"detectDirectedCycle",detectAllCycles:"detectAllCycles",detectAllDirectedCycle:"detectAllDirectedCycle",detectAllUndirectedCycle:"detectAllUndirectedCycle",dijkstra:"dijkstra",findAllPath:"findAllPath",findShortestPath:"findShortestPath",floydWarshall:"floydWarshall",getAdjMatrix:"getAdjMatrix",getDegree:"getDegree",getInDegree:"getInDegree",getNeighbors:"getNeighbors",getOutDegree:"getOutDegree",labelPropagation:"labelPropagation",louvain:"louvain",GADDI:"GADDI",minimumSpanningTree:"minimumSpanningTree",SUCCESS:"SUCCESS",FAILURE:"FAILURE"};e.MESSAGE={SUCCESS:"SUCCESS",FAILURE:"FAILURE"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(1),i=n(0),o=n(47),a=function(t,e,n,r){var i=t.nodes,a=void 0===i?[]:i,u=t.edges,c=void 0===u?[]:u,l=[],h={},f={},d={};a.forEach((function(t,n){var r=t.id;l.push(r),f[r]=1/0,r===e&&(f[r]=0)}));for(var p=a.length,g=function(t){var e=function(t,e,n){for(var r,i=1/0,o=0;o<e.length;o++){var a=e[o].id;!n[a]&&t[a]<=i&&(i=t[a],r=e[o])}return r}(f,a,h),i=e.id;if(h[i]=!0,f[i]===1/0)return"continue";(n?(0,o.getOutEdgesNodeId)(i,c):(0,o.getEdgesByNodeId)(i,c)).forEach((function(t){var n=t.target,o=t.source,a=n===i?o:n,s=r&&t[r]?t[r]:1;f[a]>f[e.id]+s?(f[a]=f[e.id]+s,d[a]=[e.id]):f[a]===f[e.id]+s&&d[a].push(e.id)}))},v=0;v<p;v++)g();d[e]=[e];var m={};for(var y in f)f[y]!==1/0&&s(e,y,d,m);var b={};for(var y in m)b[y]=m[y][0];return{length:f,path:b,allPath:m}};function s(t,e,n,o){if(t===e)return[t];if(o[e])return o[e];for(var a=[],u=0,c=n[e];u<c.length;u++){var l=s(t,c[u],n,o);if(!l)return;for(var h=0,f=l;h<f.length;h++){var d=f[h];(0,i.isArray)(d)?a.push((0,r.__spreadArray)((0,r.__spreadArray)([],d,!0),[e],!1)):a.push([d,e])}}return o[e]=a,o[e]}e.default=a},function(t,e,n){"use strict";var r=n(44);t.exports=i;function i(t){this._isDirected=!r.has(t,"directed")||t.directed,this._isMultigraph=!!r.has(t,"multigraph")&&t.multigraph,this._isCompound=!!r.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function o(t,e){t[e]?t[e]++:t[e]=1}function a(t,e){--t[e]||delete t[e]}function s(t,e,n,i){var o=""+e,a=""+n;if(!t&&o>a){var s=o;o=a,a=s}return o+""+a+""+(r.isUndefined(i)?"\0":i)}function u(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function c(t,e){return s(t,e.v,e.w,e.name)}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(t){return this._label=t,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultNodeLabelFn=t,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return r.keys(this._nodes)},i.prototype.sources=function(){var t=this;return r.filter(this.nodes(),(function(e){return r.isEmpty(t._in[e])}))},i.prototype.sinks=function(){var t=this;return r.filter(this.nodes(),(function(e){return r.isEmpty(t._out[e])}))},i.prototype.setNodes=function(t,e){var n=arguments,i=this;return r.each(t,(function(t){n.length>1?i.setNode(t,e):i.setNode(t)})),this},i.prototype.setNode=function(t,e){return r.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)},i.prototype.node=function(t){return this._nodes[t]},i.prototype.hasNode=function(t){return r.has(this._nodes,t)},i.prototype.removeNode=function(t){var e=this;if(r.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],r.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),r.each(r.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],r.each(r.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},i.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(e))e="\0";else{for(var n=e+="";!r.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},i.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},i.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},i.prototype.children=function(t){if(r.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return r.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},i.prototype.predecessors=function(t){var e=this._preds[t];if(e)return r.keys(e)},i.prototype.successors=function(t){var e=this._sucs[t];if(e)return r.keys(e)},i.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return r.union(e,this.successors(t))},i.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},i.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;r.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),r.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var i={};return this._isCompound&&r.each(e.nodes(),(function(t){e.setParent(t,function t(r){var o=n.parent(r);return void 0===o||e.hasNode(o)?(i[r]=o,o):o in i?i[o]:t(o)}(t))})),e},i.prototype.setDefaultEdgeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultEdgeLabelFn=t,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return r.values(this._edgeObjs)},i.prototype.setPath=function(t,e){var n=this,i=arguments;return r.reduce(t,(function(t,r){return i.length>1?n.setEdge(t,r,e):n.setEdge(t,r),r})),this},i.prototype.setEdge=function(){var t,e,n,i,a=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,n=c.name,2===arguments.length&&(i=arguments[1],a=!0)):(t=c,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),t=""+t,e=""+e,r.isUndefined(n)||(n=""+n);var l=s(this._isDirected,t,e,n);if(r.has(this._edgeLabels,l))return a&&(this._edgeLabels[l]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=a?i:this._defaultEdgeLabelFn(t,e,n);var h=u(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,o(this._preds[e],t),o(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},i.prototype.edge=function(t,e,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return this._edgeLabels[r]},i.prototype.hasEdge=function(t,e,n){var i=1===arguments.length?c(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return r.has(this._edgeLabels,i)},i.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):s(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],a(this._preds[e],t),a(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},i.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.v===e})):i}},i.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.w===e})):i}},i.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},function(t,e,n){var r=n(65)(n(49),"Map");t.exports=r},function(t,e,n){var r=n(343),i=n(350),o=n(352),a=n(353),s=n(354);function u(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])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){(function(t){var r=n(187),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&r.process,s=function(){try{var t=o&&o.require&&o.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}).call(this,n(155)(t))},function(t,e,n){var r=n(108),i=n(360),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e,n){var r=n(195),i=n(196),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=s},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},function(t,e,n){var r=n(201);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e,n){var r=n(164),i=n(60);t.exports=function(t,e){return t&&r(t,e,i)}},function(t,e,n){var r=n(379)();t.exports=r},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},function(t,e,n){var r=n(32),i=n(77),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||(a.test(t)||!o.test(t)||null!=e&&t in Object(e))}},function(t,e,n){var r=n(160),i=n(413);t.exports=function t(e,n,o,a,s){var u=-1,c=e.length;for(o||(o=i),s||(s=[]);++u<c;){var l=e[u];n>0&&o(l)?n>1?t(l,n-1,o,a,s):r(s,l):a||(s[s.length]=l)}return s}},function(t,e,n){var r=n(77);t.exports=function(t,e,n){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=e(a);if(null!=s&&(void 0===u?s==s&&!r(s):n(s,u)))var u=s,c=a}return c}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var r=n(170),i=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new r.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=n(169),i=n(248),o=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=i.namedConstraint(t),new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=i.taggedConstraint(t)(e),new r.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return i.typeConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return i.namedConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return i.taggedConstraint(t)(e)(n.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=o},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Bound=void 0;const r=n(173);e.Bound={fromPoints(t){let e=-1/0,n=1/0,r=-1/0,i=1/0;return t.map(t=>{t[0]>e&&(e=t[0]),t[0]<n&&(n=t[0]),t[1]>r&&(r=t[1]),t[1]<i&&(i=t[1])}),{x:n,y:i,width:e-n,height:r-i}},toPoints:t=>[[t.x,t.y],[t.x+t.width,t.y],[t.x+t.width,t.y+t.height],[t.x,t.y+t.height]],union:(...t)=>t.length>1?t.reduce((t,e)=>{let n=t.x<e.x?t.x:e.x,r=t.x+t.width<e.x+e.width?e.x+e.width:t.x+t.width,i=t.y<e.y?t.y:e.y;return{x:n,y:i,width:r-n,height:(t.y+t.height<e.y+e.height?e.y+e.height:t.y+t.height)-i}}):t[0],intersect(t,e){let n,r,i,o,a,s;return t.x<e.x+e.width&&t.x+t.width>e.x&&(n=t.x<e.x?e.x:t.x,i=t.x+t.width,a=i-n),t.y<e.y+e.height&&t.y+t.height>e.y&&(r=t.y<e.y?e.y:t.y,o=t.y+t.height<e.y+e.height?t.y+t.height:e.y+e.height,s=o-r),a&&s?{x:n,y:r,width:a,height:s}:null},translate(t,e,n){t.x+=e,t.y+=n},rotation(t,n){let i=t.x+t.width/2,o=t.y+t.height/2;return e.Bound.fromPoints(e.Bound.toPoints(t).map(t=>r.Vector.rotation(n,t,[i,o])))},isOverlap(t,e){let n=t.x+t.width,r=t.y+t.height,i=e.x+e.width,o=e.y+e.height;return t.x<i&&e.x<n&&t.y<o&&e.y<r}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Vector=void 0,e.Vector={add:(t,e)=>[t[0]+e[0],t[1]+e[1]],subtract:(t,e)=>[t[0]-e[0],t[1]-e[1]],dot:(t,e)=>t[0]*e[0]+t[1]*e[1],scale:(t,e)=>[t[0]*e,t[1]*e],length:t=>Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)),rotation(t,e,n=[0,0]){if(0===t)return e;t=-t;let r=Math.cos(t),i=Math.sin(t),o=[e[0]-n[0],e[1]-n[1]],a=[0,0];return a[0]=n[0]+(o[0]*r-o[1]*i),a[1]=n[1]+(o[0]*i+o[1]*r),a},tangent:t=>[-t[1],t[0]],normalize(t){let n=e.Vector.length(t);return 0===n?[0,0]:1===n?t:[t[0]/n,t[1]/n]},location:(t,n,r)=>e.Vector.add(t,e.Vector.scale(e.Vector.normalize(n),r)),negative:t=>e.Vector.scale(t,-1)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const r=n(33),i=n(172),o=n(15);class a{constructor(...t){this.models=[],this.id=r.Util.generateId(),t&&this.add(...t)}add(...t){t.map(t=>{this.models.push(t)})}remove(t){r.Util.removeFromList(this.models,e=>e.id===t.id)}getBound(){return this.models.length?i.Bound.union(...this.models.map(t=>t.getBound())):{x:0,y:0,width:0,height:0}}getPaddingBound(t=0){const e=this.getBound();return e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t,e}getModels(){return this.models}translate(t,e){this.models.map(n=>{n instanceof a?n.translate(t,e):(n.set("x",n.get("x")+t),n.set("y",n.get("y")+e))})}scale(t,e){this.models.map(n=>{if(n instanceof a)n.scale(t,e);else{const r=o.ext.transform(n.getMatrix(),[["t",-t[0],-t[1]],["s",e,e],["t",t[0],t[1]]]);n.setMatrix(r)}})}clear(){this.models.length=0}}e.Group=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SV=void 0;const r=n(294),i=n(172),o=n(174),a=n(78),s=n(573),u=n(574),c=n(575),l=n(576),h=n(577),f=n(578),d=n(579),p=n(580),g=n(173),v=n(33);e.SV=function(t,e={}){return new r.Engine(t,e)},e.SV.Group=o.Group,e.SV.Bound=i.Bound,e.SV.Vector=g.Vector,e.SV.Mat3=a.default.Util.mat3,e.SV.G6=a.default,e.SV.registeredLayout={},e.SV.registeredShape=[s.default,u.default,c.default,h.default,f.default,p.default,d.default,l.default],e.SV.registerShape=v.Util.registerShape,e.SV.registerLayout=function(t,n){"function"!=typeof n.sourcesPreprocess&&(n.sourcesPreprocess=function(t){return t}),"function"!=typeof n.defineLeakRule&&(n.defineLeakRule=function(t){return t}),"function"==typeof n.defineOptions&&"function"==typeof n.layout&&(e.SV.registeredLayout[t]=n)}},function(t,e){},function(t,e){},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!l){var t=s(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||l||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(1),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=this.getChildren(),r=0;r<n.length;r++){var i=n[r];e.add(i.clone())}return e},e}(n(141).a);e.a=i},function(t,e,n){"use strict";var r=n(1),i=n(142),o=n(40),a=function(t){function e(e){return t.call(this,e)||this}return Object(r.__extends)(e,t),e.prototype._isInBBox=function(t,e){var n=this.getBBox();return n.minX<=t&&n.maxX>=t&&n.minY<=e&&n.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,r=t.minY,i=t.maxX,a=t.maxY;if(e){var s=Object(o.c)(e,[t.minX,t.minY]),u=Object(o.c)(e,[t.maxX,t.minY]),c=Object(o.c)(e,[t.minX,t.maxY]),l=Object(o.c)(e,[t.maxX,t.maxY]);n=Math.min(s[0],u[0],c[0],l[0]),i=Math.max(s[0],u[0],c[0],l[0]),r=Math.min(s[1],u[1],c[1],l[1]),a=Math.max(s[1],u[1],c[1],l[1])}var h=this.attrs;if(h.shadowColor){var f=h.shadowBlur,d=void 0===f?0:f,p=h.shadowOffsetX,g=void 0===p?0:p,v=h.shadowOffsetY,m=void 0===v?0:v,y=n-d+g,b=i+d+g,x=r-d+m,w=a+d+m;n=Math.min(n,y),i=Math.max(i,b),r=Math.min(r,x),a=Math.max(a,w)}return{x:n,y:r,minX:n,minY:r,maxX:i,maxY:a,width:i-n,height:a-r}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),r=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(n&&n.isHit(o,a))return!0;if(r&&r.isHit(o,a))return!0}return!1},e}(i.a);e.a=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return e?o(t):i(t)},e.detectStrongConnectComponents=e.detectConnectedComponents=void 0;var r=n(47),i=function(t){for(var e=t.nodes,n=void 0===e?[]:e,i=t.edges,o=void 0===i?[]:i,a=[],s={},u=[],c=function t(e){u.push(e),s[e.id]=!0;for(var i=(0,r.getNeighbors)(e.id,o),a=function(e){var r=i[e];if(!s[r]){var o=n.filter((function(t){return t.id===r}));o.length>0&&t(o[0])}},c=0;c<i.length;++c)a(c)},l=0;l<n.length;l++){var h=n[l];if(!s[h.id]){c(h);for(var f=[];u.length>0;)f.push(u.pop());a.push(f)}}return a};e.detectConnectedComponents=i;var o=function(t){for(var e=t.nodes,n=void 0===e?[]:e,i=t.edges,o=void 0===i?[]:i,a=[],s={},u={},c={},l=[],h=0,f=function t(e){u[e.id]=h,c[e.id]=h,h+=1,a.push(e),s[e.id]=!0;for(var i=(0,r.getNeighbors)(e.id,o,"target").filter((function(t){return n.map((function(t){return t.id})).indexOf(t)>-1})),f=function(r){var o=i[r];if(u[o]||0===u[o])s[o]&&(c[e.id]=Math.min(c[e.id],u[o]));else{var a=n.filter((function(t){return t.id===o}));a.length>0&&t(a[0]),c[e.id]=Math.min(c[e.id],c[o])}},d=0;d<i.length;d++)f(d);if(c[e.id]===u[e.id]){for(var p=[];a.length>0;){var g=a.pop();if(s[g.id]=!1,p.push(g),g===e)break}p.length>0&&l.push(p)}},d=0,p=n;d<p.length;d++){var g=p[d];u[g.id]||0===u[g.id]||f(g)}return l};e.detectStrongConnectComponents=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getOutDegree=e.getInDegree=e.default=void 0;var r=function(t){var e={},n=t.nodes,r=void 0===n?[]:n,i=t.edges,o=void 0===i?[]:i;return r.forEach((function(t){e[t.id]={degree:0,inDegree:0,outDegree:0}})),o.forEach((function(t){e[t.source].degree++,e[t.source].outDegree++,e[t.target].degree++,e[t.target].inDegree++})),e},i=r;e.default=i;e.getInDegree=function(t,e){return r(t)[e]?r(t)[e].inDegree:0};e.getOutDegree=function(t,e){return r(t)[e]?r(t)[e].outDegree:0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){!function t(e,n,i,o){o.enter({current:n,previous:i});var a=e.edges,s=void 0===a?[]:a;(0,r.getNeighbors)(n,s,"target").forEach((function(r){o.allowTraversal({previous:i,current:n,next:r})&&t(e,r,n,o)})),o.leave({current:n,previous:i})}(t,e,"",function(t){void 0===t&&(t={});var e=t,n=function(){},r=(i={},function(t){var e=t.next;return!i[e]&&(i[e]=!0,!0)});var i;return e.allowTraversal=t.allowTraversal||r,e.enter=t.enter||n,e.leave=t.leave||n,e}(n))};var r=n(47)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(98))&&r.__esModule?r:{default:r};var o=function(t,e){for(var n=(0,i.default)(t,e),r=[],o=n.length,a=0;a<o;a+=1){r[a]=[];for(var s=0;s<o;s+=1)a===s?r[a][s]=0:0!==n[a][s]&&n[a][s]?r[a][s]=n[a][s]:r[a][s]=1/0}for(var u=0;u<o;u+=1)for(a=0;a<o;a+=1)for(s=0;s<o;s+=1)r[a][s]>r[a][u]+r[u][s]&&(r[a][s]=r[a][u]+r[u][s]);return r};e.default=o},function(t,e,n){var r=n(322),i={};for(var o in r)r.hasOwnProperty(o)&&(i[r[o]]=o);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var u=a[s].channels,c=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:u}),Object.defineProperty(a[s],"labels",{value:c})}a.rgb.hsl=function(t){var e,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),u=s-a;return s===a?e=0:r===s?e=(i-o)/u:i===s?e=2+(o-r)/u:o===s&&(e=4+(r-i)/u),(e=Math.min(60*e,360))<0&&(e+=360),n=(a+s)/2,[e,100*(s===a?0:n<=.5?u/(s+a):u/(2-s-a)),100*n]},a.rgb.hsv=function(t){var e,n,r,i,o,a=t[0]/255,s=t[1]/255,u=t[2]/255,c=Math.max(a,s,u),l=c-Math.min(a,s,u),h=function(t){return(c-t)/6/l+.5};return 0===l?i=o=0:(o=l/c,e=h(a),n=h(s),r=h(u),a===c?i=r-n:s===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},a.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,r))),100*(r=1-1/255*Math.max(e,Math.max(n,r)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-r,1-i)))/(1-e)||0),100*((1-r-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=i[t];if(e)return e;var n,o,a,s=1/0;for(var u in r)if(r.hasOwnProperty(u)){var c=r[u],l=(o=t,a=c,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));l<s&&(s=l,n=u)}return n},a.keyword.rgb=function(t){return r[t]},a.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*e+.7152*n+.0722*r),100*(.0193*e+.1192*n+.9505*r)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],r=e[1],i=e[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(t){var e,n,r,i,o,a=t[0]/360,s=t[1]/100,u=t[2]/100;if(0===s)return[o=255*u,o,o];e=2*u-(n=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0&&r++,r>1&&r--,o=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,i[c]=255*o;return i},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[e,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*r*(1-n),s=255*r*(1-n*o),u=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,u,a];case 1:return[s,r,a];case 2:return[a,r,u];case 3:return[a,s,r];case 4:return[u,a,r];case 5:return[r,a,s]}},a.hsv.hsl=function(t){var e,n,r,i=t[0],o=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return r=(2-o)*a,n=o*s,[i,100*(n=(n/=(e=(2-o)*s)<=1?e:2-e)||0),100*(r/=2)]},a.hwb.rgb=function(t){var e,n,r,i,o,a,s,u=t[0]/360,c=t[1]/100,l=t[2]/100,h=c+l;switch(h>1&&(c/=h,l/=h),r=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(r=1-r),i=c+r*((n=1-l)-c),e){default:case 6:case 0:o=n,a=i,s=c;break;case 1:o=i,a=n,s=c;break;case 2:o=c,a=n,s=i;break;case 3:o=c,a=i,s=n;break;case 4:o=i,a=c,s=n;break;case 5:o=n,a=c,s=i}return[255*o,255*a,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},a.xyz.rgb=function(t){var e,n,r,i=t[0]/100,o=t[1]/100,a=t[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2];return n/=100,r/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(t){var e,n,r,i=t[0];e=t[1]/500+(n=(i+16)/116),r=n-t[2]/200;var o=Math.pow(n,3),a=Math.pow(e,3),s=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[e*=95.047,n*=100,r*=108.883]},a.lab.lch=function(t){var e,n=t[0],r=t[1],i=t[2];return(e=360*Math.atan2(i,r)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(r*r+i*i),e]},a.lch.lab=function(t){var e,n=t[0],r=t[1];return e=t[2]/360*2*Math.PI,[n,r*Math.cos(e),r*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),s=o-a;return e=s<=0?0:o===n?(r-i)/s%6:o===r?2+(i-n)/s:4+(n-r)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?a/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return(r=n<.5?2*e*n:2*e*(1-n))<1&&(i=(n-.5*r)/(1-r)),[t[0],100*r,100*i]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];var i,o=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-n)*r,[255*(n*o[0]+i),255*(n*o[1]+i),255*(n*o[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,r=n-e,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},function(t,e,n){var r=n(99),i=n(154),o=n(104),a=n(355),s=n(361),u=n(193),c=n(194),l=n(364),h=n(365),f=n(198),d=n(366),p=n(76),g=n(370),v=n(371),m=n(203),y=n(32),b=n(75),x=n(375),w=n(45),_=n(377),S=n(60),E=n(67),M={};M["[object Arguments]"]=M["[object Array]"]=M["[object ArrayBuffer]"]=M["[object DataView]"]=M["[object Boolean]"]=M["[object Date]"]=M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Map]"]=M["[object Number]"]=M["[object Object]"]=M["[object RegExp]"]=M["[object Set]"]=M["[object String]"]=M["[object Symbol]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M["[object Error]"]=M["[object Function]"]=M["[object WeakMap]"]=!1,t.exports=function t(e,n,O,A,k,C){var I,T=1&n,P=2&n,N=4&n;if(O&&(I=k?O(e,A,k,C):O(e)),void 0!==I)return I;if(!w(e))return e;var j=y(e);if(j){if(I=g(e),!T)return c(e,I)}else{var D=p(e),L="[object Function]"==D||"[object GeneratorFunction]"==D;if(b(e))return u(e,T);if("[object Object]"==D||"[object Arguments]"==D||L&&!k){if(I=P||L?{}:m(e),!T)return P?h(e,s(I,e)):l(e,a(I,e))}else{if(!M[D])return k?e:{};I=v(e,D,T)}}C||(C=new r);var R=C.get(e);if(R)return R;C.set(e,I),_(e)?e.forEach((function(r){I.add(t(r,n,O,r,e,C))})):x(e)&&e.forEach((function(r,i){I.set(i,t(r,n,O,i,e,C))}));var B=j?void 0:(N?P?d:f:P?E:S)(e);return i(B||e,(function(r,i){B&&(r=e[i=r]),o(I,i,t(r,n,O,i,e,C))})),I}},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(188))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(65),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e,n){var r=n(356),i=n(90),o=n(32),a=n(75),s=n(106),u=n(91),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),l=!n&&i(t),h=!n&&!l&&a(t),f=!n&&!l&&!h&&u(t),d=n||l||h||f,p=d?r(t.length,String):[],g=p.length;for(var v in t)!e&&!c.call(t,v)||d&&("length"==v||h&&("offset"==v||"parent"==v)||f&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,g))||p.push(v);return p}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){(function(t){var r=n(49),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=s?s(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(155)(t))},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(160),i=n(109),o=n(159),a=n(196),s=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,o(t)),t=i(t);return e}:a;t.exports=s},function(t,e,n){var r=n(199),i=n(159),o=n(60);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(160),i=n(32);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},function(t,e,n){var r=n(65)(n(49),"Set");t.exports=r},function(t,e,n){var r=n(49).Uint8Array;t.exports=r},function(t,e,n){var r=n(161);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(204),i=n(109),o=n(108);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:r(i(t))}},function(t,e,n){var r=n(45),i=Object.create,o=function(){function t(){}return function(e){if(!r(e))return{};if(i)return i(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=o},function(t,e,n){t.exports=n(206)},function(t,e,n){var r=n(154),i=n(110),o=n(207),a=n(32);t.exports=function(t,e){return(a(t)?r:i)(t,o(e))}},function(t,e,n){var r=n(68);t.exports=function(t){return"function"==typeof t?t:r}},function(t,e,n){var r=n(195),i=n(381),o=n(55),a=n(32);t.exports=function(t,e){return(a(t)?r:i)(t,o(e,3))}},function(t,e,n){var r=n(384),i=n(51);t.exports=function t(e,n,o,a,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,a,t,s))}},function(t,e,n){var r=n(211),i=n(387),o=n(212);t.exports=function(t,e,n,a,s,u){var c=1&n,l=t.length,h=e.length;if(l!=h&&!(c&&h>l))return!1;var f=u.get(t),d=u.get(e);if(f&&d)return f==e&&d==t;var p=-1,g=!0,v=2&n?new r:void 0;for(u.set(t,e),u.set(e,t);++p<l;){var m=t[p],y=e[p];if(a)var b=c?a(y,m,p,e,t,u):a(m,y,p,t,e,u);if(void 0!==b){if(b)continue;g=!1;break}if(v){if(!i(e,(function(t,e){if(!o(v,e)&&(m===t||s(m,t,n,a,u)))return v.push(e)}))){g=!1;break}}else if(m!==y&&!s(m,y,n,a,u)){g=!1;break}}return u.delete(t),u.delete(e),g}},function(t,e,n){var r=n(153),i=n(385),o=n(386);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,t.exports=a},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(45);t.exports=function(t){return t==t&&!r(t)}},function(t,e){t.exports=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}},function(t,e,n){var r=n(397);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(398),i=n(217);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e,n){var r=n(112),i=n(90),o=n(32),a=n(106),s=n(156),u=n(92);t.exports=function(t,e,n){for(var c=-1,l=(e=r(e,t)).length,h=!1;++c<l;){var f=u(e[c]);if(!(h=null!=t&&n(t,f)))break;t=t[f]}return h||++c!=l?h:!!(l=null==t?0:t.length)&&s(l)&&a(f,l)&&(o(t)||i(t))}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(401),i=n(217);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e){t.exports=function(t){return void 0===t}},function(t,e,n){var r=n(113),i=n(55),o=n(222),a=n(32);t.exports=function(t,e){return(a(t)?r:o)(t,i(e,3))}},function(t,e,n){var r=n(110),i=n(54);t.exports=function(t,e){var n=-1,o=i(t)?Array(t.length):[];return r(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}},function(t,e,n){var r=n(403),i=n(110),o=n(55),a=n(404),s=n(32);t.exports=function(t,e,n){var u=s(t)?r:a,c=arguments.length<3;return u(t,o(e,4),n,c,i)}},function(t,e,n){var r=n(414),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=i(o.length-e,0),u=Array(s);++a<s;)u[a]=o[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=o[a];return c[e]=n(u),r(t,this,c)}}},function(t,e,n){var r=n(415),i=n(416)(r);t.exports=i},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},function(t,e,n){var r=n(54),i=n(51);t.exports=function(t){return i(t)&&r(t)}},function(t,e,n){var r=n(425),i=n(60);t.exports=function(t){return null==t?[]:r(t,i(t))}},function(t,e,n){var r=n(44),i=n(230);t.exports=function(t,e,n,r){return function(t,e,n,r){var o,a,s={},u=new i,c=function(t){var e=t.v!==o?t.v:t.w,r=s[e],i=n(t),c=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+i);c<r.distance&&(r.distance=c,r.predecessor=o,u.decrease(e,c))};t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;s[t]={distance:n},u.add(t,n)}));for(;u.size()>0&&(o=u.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return s}(t,String(e),n||o,r||function(e){return t.outEdges(e)})};var o=r.constant(1)},function(t,e,n){var r=n(44);function i(){this._arr=[],this._keyIndices={}}t.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},i.prototype.has=function(t){return r.has(this._keyIndices,t)},i.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,o=i.length;return n[t]=o,i.push({key:t,priority:e}),this._decrease(o),!0}return!1},i.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},i.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)},i.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))},i.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},i.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,i=n[t],o=n[e];n[t]=o,n[e]=i,r[o.key]=t,r[i.key]=e}},function(t,e,n){var r=n(44);t.exports=function(t){var e=0,n=[],i={},o=[];return t.nodes().forEach((function(a){r.has(i,a)||function a(s){var u=i[s]={onStack:!0,lowlink:e,index:e++};if(n.push(s),t.successors(s).forEach((function(t){r.has(i,t)?i[t].onStack&&(u.lowlink=Math.min(u.lowlink,i[t].index)):(a(t),u.lowlink=Math.min(u.lowlink,i[t].lowlink))})),u.lowlink===u.index){var c,l=[];do{c=n.pop(),i[c].onStack=!1,l.push(c)}while(s!==c);o.push(l)}}(a)})),o}},function(t,e,n){var r=n(44);function i(t){var e={},n={},i=[];if(r.each(t.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(e,s)||(n[s]=!0,e[s]=!0,r.each(t.predecessors(s),a),delete n[s],i.push(s))})),r.size(e)!==t.nodeCount())throw new o;return i}function o(){}t.exports=i,i.CycleException=o,o.prototype=new Error},function(t,e,n){var r=n(44);t.exports=function(t,e,n){r.isArray(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],a={};return r.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);!function t(e,n,i,o,a,s){r.has(o,n)||(o[n]=!0,i||s.push(n),r.each(a(n),(function(n){t(e,n,i,o,a,s)})),i&&s.push(n))}(t,e,"post"===n,a,i,o)})),o}},function(t,e,n){var r=n(444);t.exports=function(t){return t?(t=r(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(167);t.exports=function(t){return(null==t?0:t.length)?r(t,1):[]}},function(t,e,n){var r=n(105),i=n(73);t.exports=function(t,e,n){(void 0!==n&&!i(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e){t.exports=function(t,e){return t<e}},function(t,e,n){"use strict";var r=n(29),i=n(48).Graph,o=n(116).slack;function a(t,e){return r.forEach(t.nodes(),(function n(i){r.forEach(e.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;t.hasNode(s)||o(e,r)||(t.setNode(s,{}),t.setEdge(i,s,{}),n(s))}))})),t.nodeCount()}function s(t,e){return r.forEach(t.nodes(),(function n(i){r.forEach(e.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;t.hasNode(s)||void 0===e.node(s).layer&&o(e,r)||(t.setNode(s,{}),t.setEdge(i,s,{}),n(s))}))})),t.nodeCount()}function u(t,e){return r.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return o(e,n)}))}function c(t,e,n){r.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}t.exports={feasibleTree:function(t){var e,n,r=new i({directed:!1}),s=t.nodes()[0],l=t.nodeCount();r.setNode(s,{});for(;a(r,t)<l;)e=u(r,t),n=r.hasNode(e.v)?o(t,e):-o(t,e),c(r,t,n);return r},feasibleTreeWithLayer:function(t){var e,n,r=new i({directed:!1}),a=t.nodes()[0],l=t.nodeCount();r.setNode(a,{});for(;s(r,t)<l;)e=u(r,t),n=r.hasNode(e.v)?o(t,e):-o(t,e),c(r,t,n);return r}}},function(t,e,n){(function(t,e){
|
||
/*! *****************************************************************************
|
||
Copyright (C) Microsoft. All rights reserved.
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||
this file except in compliance with the License. You may obtain a copy of the
|
||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||
|
||
See the Apache Version 2.0 License for specific language governing permissions
|
||
and limitations under the License.
|
||
***************************************************************************** */
|
||
var n;!function(n){!function(r){var i="object"==typeof e?e:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),o=a(n);function a(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===i.Reflect?i.Reflect=n:o=a(i.Reflect,o),function(e){var n=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,i=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",a="function"==typeof Object.create,s={__proto__:[]}instanceof Array,u=!a&&!s,c={create:a?function(){return N(Object.create(null))}:s?function(){return N({__proto__:null})}:function(){return N({})},has:u?function(t,e){return n.call(t,e)}:function(t,e){return e in t},get:u?function(t,e){return n.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),h="object"==typeof t&&t.env&&"true"===t.env.REFLECT_METADATA_USE_MAP_POLYFILL,f=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[o]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,i)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[o]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function i(t,e){return e}function a(t,e){return[t,e]}}():Map,d=h||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new f}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[o]=function(){return this.keys()},t}():Set,p=new(h||"function"!=typeof WeakMap?function(){var t=c.create(),e=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&c.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?c.get(e,this._key):void 0},t.prototype.set=function(t,e){return i(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=i(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var e;do{e="@@WeakMap@@"+a()}while(c.has(t,e));return t[e]=!0,e}function i(t,r){if(!n.call(t,e)){if(!r)return;Object.defineProperty(t,e,{value:c.create()})}return t[e]}function o(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function a(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):o(new Uint8Array(t),t):o(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;r<16;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}():WeakMap);function g(t,e,n){var r=p.get(t);if(w(r)){if(!n)return;r=new f,p.set(t,r)}var i=r.get(e);if(w(i)){if(!n)return;i=new f,r.set(e,i)}return i}function v(t,e,n){var r=g(e,n,!1);return!w(r)&&!!r.has(t)}function m(t,e,n){var r=g(e,n,!1);if(!w(r))return r.get(t)}function y(t,e,n,r){g(n,r,!0).set(t,e)}function b(t,e){var n=[],r=g(t,e,!1);if(w(r))return n;for(var i=function(t){var e=C(t,o);if(!A(e))throw new TypeError;var n=e.call(t);if(!S(n))throw new TypeError;return n}(r.keys()),a=0;;){var s=I(i);if(!s)return n.length=a,n;var u=s.value;try{n[a]=u}catch(t){try{T(i)}finally{throw t}}a++}}function x(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function w(t){return void 0===t}function _(t){return null===t}function S(t){return"object"==typeof t?null!==t:"function"==typeof t}function E(t,e){switch(x(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",r=C(t,i);if(void 0!==r){var o=r.call(t,n);if(S(o))throw new TypeError;return o}return function(t,e){if("string"===e){var n=t.toString;if(A(n))if(!S(i=n.call(t)))return i;if(A(r=t.valueOf))if(!S(i=r.call(t)))return i}else{var r;if(A(r=t.valueOf))if(!S(i=r.call(t)))return i;var i,o=t.toString;if(A(o))if(!S(i=o.call(t)))return i}throw new TypeError}(t,"default"===n?"number":n)}function M(t){var e=E(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function O(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function A(t){return"function"==typeof t}function k(t){return"function"==typeof t}function C(t,e){var n=t[e];if(null!=n){if(!A(n))throw new TypeError;return n}}function I(t){var e=t.next();return!e.done&&e}function T(t){var e=t.return;e&&e.call(t)}function P(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===l)return e;if(e!==l)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function N(t){return t.__=void 0,delete t.__,t}e("decorate",(function(t,e,n,r){if(w(n)){if(!O(t))throw new TypeError;if(!k(e))throw new TypeError;return function(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!w(r)&&!_(r)){if(!k(r))throw new TypeError;e=r}}return e}(t,e)}if(!O(t))throw new TypeError;if(!S(e))throw new TypeError;if(!S(r)&&!w(r)&&!_(r))throw new TypeError;return _(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!w(o)&&!_(o)){if(!S(o))throw new TypeError;r=o}}return r}(t,e,n=M(n),r)})),e("metadata",(function(t,e){return function(n,r){if(!S(n))throw new TypeError;if(!w(r)&&!function(t){switch(x(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;y(t,e,n,r)}})),e("defineMetadata",(function(t,e,n,r){if(!S(n))throw new TypeError;return w(r)||(r=M(r)),y(t,e,n,r)})),e("hasMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),function t(e,n,r){if(v(e,n,r))return!0;var i=P(n);return!_(i)&&t(e,i,r)}(t,e,n)})),e("hasOwnMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),v(t,e,n)})),e("getMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),function t(e,n,r){if(v(e,n,r))return m(e,n,r);var i=P(n);return _(i)?void 0:t(e,i,r)}(t,e,n)})),e("getOwnMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),m(t,e,n)})),e("getMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return w(e)||(e=M(e)),function t(e,n){var r=b(e,n),i=P(e);if(null===i)return r;var o=t(i,n);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new d,s=[],u=0,c=r;u<c.length;u++){var l=c[u];a.has(l)||(a.add(l),s.push(l))}for(var h=0,f=o;h<f.length;h++){l=f[h];a.has(l)||(a.add(l),s.push(l))}return s}(t,e)})),e("getOwnMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return w(e)||(e=M(e)),b(t,e)})),e("deleteMetadata",(function(t,e,n){if(!S(e))throw new TypeError;w(n)||(n=M(n));var r=g(e,n,!1);if(w(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=p.get(e);return i.delete(n),i.size>0||p.delete(e),!0}))}(o)}()}(n||(n={}))}).call(this,n(178),n(188))},function(t,e,n){var r=n(242);t.exports=function(t,e){if(t){if("string"==typeof t)return r(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)?r(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(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},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var r=n(34),i=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(r.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(r.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(r.TAGGED_PROP,t)||[]},t}();e.MetadataReader=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0;var r=n(42);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var r=n(42),i=n(34),o=n(50),a=n(61),s=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=s,e.inject=function(t){return function(e,n,s){if(void 0===t)throw new Error(r.UNDEFINED_INJECT_ANNOTATION(e.name));var u=new o.Metadata(i.INJECT_TAG,t);"number"==typeof s?a.tagParameter(e,n,s,u):a.tagProperty(e,n,u)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var r=n(34),i=n(69),o=n(50),a=n(512),s=function(){function t(t,e,n,s){this.id=i.id(),this.type=t,this.serviceIdentifier=n,this.name=new a.QueryableString(e||""),this.metadata=new Array;var u=null;"string"==typeof s?u=new o.Metadata(r.NAMED_TAG,s):s instanceof o.Metadata&&(u=s),null!==u&&this.metadata.push(u)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(r.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(r.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(r.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(r.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===r.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(r.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;r<i.length;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=n(169),i=n(170),o=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new r.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var r=n(34),i=n(50),o=function(t,e){var n=t.parentRequest;return null!==n&&(!!e(n)||o(n,e))};e.traverseAncerstors=o;var a=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new i.Metadata(t,e),n}};e.taggedConstraint=a;var s=a(r.NAMED_TAG);e.namedConstraint=s;e.typeConstraint=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var r=e.bindings[0].implementationType;return t===r}return!1}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(2),i=n(81);function o(t){for(var e=new i.a,n=r.e.fromValues(t[0],t[1],t[2]),o=r.e.fromValues(t[0],t[1],t[2]),a=3;a<t.length;){var s=t[a++],u=t[a++],c=t[a++];s<n[0]&&(n[0]=s),u<n[1]&&(n[1]=u),c<n[2]&&(n[2]=c),s>o[0]&&(o[0]=s),u>o[1]&&(o[1]=u),c>o[2]&&(o[2]=c)}return e.setMinMax(n,o),e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r="undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent)},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){"use strict";var r;!function(t){t.Normal="normal",t.PostProcessing="post-processing"}(r||(r={}))},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){t.exports=1e-6},function(t,e){t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},function(t,e){t.exports=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i);return t}},function(t,e){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVMarker=e.SVIndexLabel=e.SVAddressLabel=e.SVFreedLabel=e.SVNodeAppendage=void 0;const r=n(33),i=n(148);class o extends i.SVModel{constructor(t,e,n,r,i,o){super(t,e,n,r,i),this.target=o,this.target.appendages.push(this)}}e.SVNodeAppendage=o;e.SVFreedLabel=class extends o{constructor(t,e,n,r,i){super(t,e,n,r,"freedLabel",i),this.target.freedLabel=this,this.G6ModelProps=this.generateG6ModelProps()}generateG6ModelProps(){return{id:this.id,x:0,y:0,type:"rect",label:"已释放",labelCfg:{style:{fill:"#b83b5e",opacity:.6}},size:[0,0],style:{opacity:0,stroke:null,fill:"transparent"}}}};e.SVAddressLabel=class extends o{constructor(t,e,n,r,i,o){super(t,e,n,r,"addressLabel",i),this.sourceId=i.sourceId,this.target.addressLabel=this,this.G6ModelProps=this.generateG6ModelProps(o)}generateG6ModelProps(t){return{id:this.id,x:0,y:0,type:"rect",label:this.sourceId,labelCfg:{style:Object.assign({fill:"#666",fontSize:16},t.style)},size:[0,0],style:{stroke:null,fill:"transparent"}}}};e.SVIndexLabel=class extends o{constructor(t,e,n,r,i,o,a){super(t,e,n,r,"indexLabel",o),this.target.indexLabel=this,this.value=i,this.G6ModelProps=this.generateG6ModelProps(a)}generateG6ModelProps(t){return{id:this.id,x:0,y:0,type:"rect",label:this.value,labelCfg:{style:Object.assign({fill:"#bbb",textAlign:"center",textBaseline:"middle",fontSize:14,fontStyle:"italic"},t.style)},size:[0,0],style:{stroke:null,fill:"transparent"}}}};e.SVMarker=class extends o{constructor(t,e,n,r,i,o,a){super(t,e,n,r,"marker",o),this.label=i,this.target.marker=this,this.G6ModelProps=this.generateG6ModelProps(a)}generateG6ModelProps(t){this.anchor=t.anchor;const e="pointer"===t.type?[8,30]:[12,12];return{id:this.id,x:0,y:0,rotation:0,type:t.type||"marker",size:t.size||e,anchorPoints:null,label:"string"==typeof this.label?this.label:this.label.join(", "),style:r.Util.objectClone(t.style),labelCfg:r.Util.objectClone(t.labelOptions)}}getLabelSizeRadius(){const{width:t,height:e}=this.shadowG6Item.getContainer().getChildren()[2].getBBox();return Math.max(t,e)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SolveZoomCanvasWithLeak=e.SolveDragCanvasWithLeak=e.SolveBrushSelectDrag=e.SolveNodeAppendagesDrag=e.DetermineNodeDrag=void 0;const r=n(119),i=n(118);e.DetermineNodeDrag=function(t,e,n){var r;const i=t.get(e.group),o=null===(r=i.options.behavior)||void 0===r?void 0:r.dragNode;if(function(t,e){const n=t.sourceType;return Array.isArray(e)?e.includes(n):void 0===e||!0===e}(e,o))return!0;const a=e.sourceType,s=e.getModelType(),u=i[s].filter(t=>t.sourceType===a),c=n.filter(t=>t.group===e.group&&t.getModelType()===s&&t.sourceType===a);return u.length===c.length},e.SolveNodeAppendagesDrag=function(t){const e=t.getG6Instance();e.on("node:dragstart",e=>{let n=e.item.SVModel;if(n instanceof i.SVNode==!1)return;void 0===t.brushSelectedModels.find(t=>t.id===n.id)&&(t.brushSelectedModels.forEach(t=>{t.setSelectedState(!1),t instanceof i.SVNode&&t.appendages.forEach(t=>t.setSelectedState(!1))}),t.brushSelectedModels.length=0)}),e.on("node:dragend",e=>{let n=e.item.SVModel;if(n instanceof i.SVNode==!1)return;void 0===t.brushSelectedModels.find(t=>t.id===n.id)&&(n.setSelectedState(!1),n.set({x:n.G6Item.getModel().x,y:n.G6Item.getModel().y}),n.appendages.forEach(t=>{t.setSelectedState(!1),t.set({x:t.G6Item.getModel().x,y:t.G6Item.getModel().y})})),t.brushSelectedModels.forEach(t=>{t.set({x:t.G6Item.getModel().x,y:t.G6Item.getModel().y}),t instanceof i.SVNode&&t.appendages.forEach(t=>{t.set({x:t.G6Item.getModel().x,y:t.G6Item.getModel().y})})})})},e.SolveBrushSelectDrag=function(t){t.getG6Instance().on("nodeselectchange",n=>{const r=n.selectedItems,i=[];n.target||(t.brushSelectedModels.length=0,r.nodes.forEach(t=>{i.push(t.SVModel)}),r.nodes.forEach(n=>{const r=n.SVModel;e.DetermineNodeDrag(t.getLayoutGroupTable(),r,i)?t.brushSelectedModels.push(r):r.setSelectedState(!1)}))})},e.SolveDragCanvasWithLeak=function(t){let e=t.getG6Instance(),n=0;e.on("viewportchange",e=>{if("translate"!==e.action)return!1;let i=e.matrix[7],o=i-n;n=i,t.leakAreaY=t.leakAreaY+o,t.hasLeak&&r.EventBus.emit("onLeakAreaUpdate",{leakAreaY:t.leakAreaY,hasLeak:t.hasLeak})})},e.SolveZoomCanvasWithLeak=function(t){}},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"easeLinear",(function(){return O})),n.d(r,"easeQuad",(function(){return C})),n.d(r,"easeQuadIn",(function(){return A})),n.d(r,"easeQuadOut",(function(){return k})),n.d(r,"easeQuadInOut",(function(){return C})),n.d(r,"easeCubic",(function(){return P})),n.d(r,"easeCubicIn",(function(){return I})),n.d(r,"easeCubicOut",(function(){return T})),n.d(r,"easeCubicInOut",(function(){return P})),n.d(r,"easePoly",(function(){return D})),n.d(r,"easePolyIn",(function(){return N})),n.d(r,"easePolyOut",(function(){return j})),n.d(r,"easePolyInOut",(function(){return D})),n.d(r,"easeSin",(function(){return F})),n.d(r,"easeSinIn",(function(){return B})),n.d(r,"easeSinOut",(function(){return G})),n.d(r,"easeSinInOut",(function(){return F})),n.d(r,"easeExp",(function(){return W})),n.d(r,"easeExpIn",(function(){return U})),n.d(r,"easeExpOut",(function(){return V})),n.d(r,"easeExpInOut",(function(){return W})),n.d(r,"easeCircle",(function(){return H})),n.d(r,"easeCircleIn",(function(){return Y})),n.d(r,"easeCircleOut",(function(){return X})),n.d(r,"easeCircleInOut",(function(){return H})),n.d(r,"easeBounce",(function(){return Z})),n.d(r,"easeBounceIn",(function(){return K})),n.d(r,"easeBounceOut",(function(){return Z})),n.d(r,"easeBounceInOut",(function(){return $})),n.d(r,"easeBack",(function(){return tt})),n.d(r,"easeBackIn",(function(){return Q})),n.d(r,"easeBackOut",(function(){return J})),n.d(r,"easeBackInOut",(function(){return tt})),n.d(r,"easeElastic",(function(){return rt})),n.d(r,"easeElasticIn",(function(){return nt})),n.d(r,"easeElasticOut",(function(){return rt})),n.d(r,"easeElasticInOut",(function(){return it}));var i,o,a=n(1),s=n(143),u=n(141),c=n(20),l=n(0),h=0,f=0,d=0,p=0,g=0,v=0,m="object"==typeof performance&&performance.now?performance:Date,y="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function b(){return g||(y(x),g=m.now()+v)}function x(){g=0}function w(){this._call=this._time=this._next=null}function _(t,e,n){var r=new w;return r.restart(t,e,n),r}function S(){g=(p=m.now())+v,h=f=0;try{!function(){b(),++h;for(var t,e=i;e;)(t=g-e._time)>=0&&e._call.call(null,t),e=e._next;--h}()}finally{h=0,function(){var t,e,n=i,r=1/0;for(;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:i=e);o=t,M(r)}(),g=0}}function E(){var t=m.now(),e=t-p;e>1e3&&(v-=e,p=t)}function M(t){h||(f&&(f=clearTimeout(f)),t-g>24?(t<1/0&&(f=setTimeout(S,t-m.now()-v)),d&&(d=clearInterval(d))):(d||(p=m.now(),d=setInterval(E,1e3)),h=1,y(S)))}function O(t){return+t}function A(t){return t*t}function k(t){return t*(2-t)}function C(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function I(t){return t*t*t}function T(t){return--t*t*t+1}function P(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}w.prototype=_.prototype={constructor:w,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?b():+n)+(null==e?0:+e),this._next||o===this||(o?o._next=this:i=this,o=this),this._call=t,this._time=n,M()},stop:function(){this._call&&(this._call=null,this._time=1/0,M())}};var N=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),j=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),D=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),L=Math.PI,R=L/2;function B(t){return 1==+t?1:1-Math.cos(t*R)}function G(t){return Math.sin(t*R)}function F(t){return(1-Math.cos(L*t))/2}function z(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function U(t){return z(1-+t)}function V(t){return 1-z(t)}function W(t){return((t*=2)<=1?z(1-t):2-z(t-1))/2}function Y(t){return 1-Math.sqrt(1-t*t)}function X(t){return Math.sqrt(1- --t*t)}function H(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var q=7.5625;function K(t){return 1-Z(1-t)}function Z(t){return(t=+t)<4/11?q*t*t:t<8/11?q*(t-=6/11)*t+3/4:t<10/11?q*(t-=9/11)*t+15/16:q*(t-=21/22)*t+63/64}function $(t){return((t*=2)<=1?1-Z(1-t):Z(t-1)+1)/2}var Q=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(1.70158),J=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(1.70158),tt=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),et=2*Math.PI,nt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=et);function i(t){return e*z(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*et)},i.period=function(n){return t(e,n)},i}(1,.3),rt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=et);function i(t){return 1-e*z(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*et)},i.period=function(n){return t(e,n)},i}(1,.3),it=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=et);function i(t){return((t=2*t-1)<0?e*z(-t)*Math.sin((r-t)/n):2-e*z(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*et)},i.period=function(n){return t(e,n)},i}(1,.3),ot=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function at(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function st(){}var ut="\\s*([+-]?\\d+)\\s*",ct="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",lt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ht=/^#([0-9a-f]{3,8})$/,ft=new RegExp("^rgb\\("+[ut,ut,ut]+"\\)$"),dt=new RegExp("^rgb\\("+[lt,lt,lt]+"\\)$"),pt=new RegExp("^rgba\\("+[ut,ut,ut,ct]+"\\)$"),gt=new RegExp("^rgba\\("+[lt,lt,lt,ct]+"\\)$"),vt=new RegExp("^hsl\\("+[ct,lt,lt]+"\\)$"),mt=new RegExp("^hsla\\("+[ct,lt,lt,ct]+"\\)$"),yt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function bt(){return this.rgb().formatHex()}function xt(){return this.rgb().formatRgb()}function wt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ht.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?_t(e):3===n?new Ot(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?St(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?St(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ft.exec(t))?new Ot(e[1],e[2],e[3],1):(e=dt.exec(t))?new Ot(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=pt.exec(t))?St(e[1],e[2],e[3],e[4]):(e=gt.exec(t))?St(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=vt.exec(t))?It(e[1],e[2]/100,e[3]/100,1):(e=mt.exec(t))?It(e[1],e[2]/100,e[3]/100,e[4]):yt.hasOwnProperty(t)?_t(yt[t]):"transparent"===t?new Ot(NaN,NaN,NaN,0):null}function _t(t){return new Ot(t>>16&255,t>>8&255,255&t,1)}function St(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ot(t,e,n,r)}function Et(t){return t instanceof st||(t=wt(t)),t?new Ot((t=t.rgb()).r,t.g,t.b,t.opacity):new Ot}function Mt(t,e,n,r){return 1===arguments.length?Et(t):new Ot(t,e,n,null==r?1:r)}function Ot(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function At(){return"#"+Ct(this.r)+Ct(this.g)+Ct(this.b)}function kt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ct(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function It(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Pt(t,e,n,r)}function Tt(t){if(t instanceof Pt)return new Pt(t.h,t.s,t.l,t.opacity);if(t instanceof st||(t=wt(t)),!t)return new Pt;if(t instanceof Pt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Pt(a,s,u,t.opacity)}function Pt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Nt(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function jt(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}ot(st,wt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:bt,formatHex:bt,formatHsl:function(){return Tt(this).formatHsl()},formatRgb:xt,toString:xt}),ot(Ot,Mt,at(st,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:At,formatHex:At,formatRgb:kt,toString:kt})),ot(Pt,(function(t,e,n,r){return 1===arguments.length?Tt(t):new Pt(t,e,n,null==r?1:r)}),at(st,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Pt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Pt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ot(Nt(t>=240?t-240:t+120,i,r),Nt(t,i,r),Nt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Dt=function(t){return function(){return t}};function Lt(t,e){return function(n){return t+n*e}}function Rt(t){return 1==(t=+t)?Bt:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Dt(isNaN(e)?n:e)}}function Bt(t,e){var n=e-t;return n?Lt(t,n):Dt(isNaN(t)?e:t)}var Gt=function t(e){var n=Rt(e);function r(t,e){var r=n((t=Mt(t)).r,(e=Mt(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Bt(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Ft(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=Mt(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}Ft((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return jt((n-r/e)*e,a,i,o,s)}})),Ft((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return jt((n-r/e)*e,i,o,a,s)}}));var zt=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}};function Ut(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Vt(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Zt(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}var Wt=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},Yt=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},Xt=function(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=Zt(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},Ht=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qt=new RegExp(Ht.source,"g");var Kt=function(t,e){var n,r,i,o=Ht.lastIndex=qt.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=Ht.exec(t))&&(r=qt.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Yt(n,r)})),o=qt.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})},Zt=function(t,e){var n,r=typeof e;return null==e||"boolean"===r?Dt(e):("number"===r?Yt:"string"===r?(n=wt(e))?(e=n,Gt):Kt:e instanceof wt?Gt:e instanceof Date?Wt:Ut(e)?zt:Array.isArray(e)?Vt:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Xt:Yt)(t,e)},$t=n(53),Qt=[1,0,0,0,1,0,0,0,1];function Jt(t,e,n){var i,o=e.startTime;if(n<o+e.delay||e._paused)return!1;var a=e.duration,s=e.easing;if(n=n-o-e.delay,e.repeat)i=n%a/a,i=r[s](i);else{if(!((i=n/a)<1))return e.onFrame?t.attr(e.onFrame(1)):t.attr(e.toAttrs),!0;i=r[s](i)}if(e.onFrame){var u=e.onFrame(i);t.attr(u)}else!function(t,e,n){var r={},i=e.fromAttrs,o=e.toAttrs;if(!t.destroyed){var a,s,u,c;for(var h in o)if(!Object(l.isEqual)(i[h],o[h]))if("path"===h){var f=o[h],d=i[h];f.length>d.length?(f=$t.parsePathString(o[h]),d=$t.parsePathString(i[h]),d=$t.fillPathByDiff(d,f),d=$t.formatPath(d,f),e.fromAttrs.path=d,e.toAttrs.path=f):e.pathFormatted||(f=$t.parsePathString(o[h]),d=$t.parsePathString(i[h]),d=$t.formatPath(d,f),e.fromAttrs.path=d,e.toAttrs.path=f,e.pathFormatted=!0),r[h]=[];for(var p=0;p<f.length;p++){for(var g=f[p],v=d[p],m=[],y=0;y<g.length;y++)Object(l.isNumber)(g[y])&&v&&Object(l.isNumber)(v[y])?(a=Zt(v[y],g[y]),m.push(a(n))):m.push(g[y]);r[h].push(m)}}else if("matrix"===h){var b=(u=i[h]||Qt,(Ut(c=o[h]||Qt)?zt:Vt)(u,c))(n);r[h]=b}else["fill","stroke","fillStyle","strokeStyle"].includes(h)&&(s=o[h],/^[r,R,L,l]{1}[\s]*\(/.test(s))?r[h]=o[h]:Object(l.isFunction)(o[h])||(a=Zt(i[h],o[h]),r[h]=a(n));t.attr(r)}}(t,e,i);return!1}var te=function(){function t(t){this.animators=[],this.current=0,this.timer=null,this.canvas=t}return t.prototype.initTimer=function(){var t,e,n,r=this;this.timer=_((function(i){if(r.current=i,r.animators.length>0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],Jt(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ee=n(120),ne=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function re(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function ie(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&Object(c.g)(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var oe=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");Object(c.a)(ne,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");Object(c.a)(ne,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new ee.a(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=r.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,l=a.clientY-t.clientY;u>120||c*c+l*l>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,re(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||ie(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{re(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),ae=Object(s.a)(),se=ae&&"firefox"===ae.name,ue=function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return Object(a.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");Object(c.h)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new oe({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new te(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");c.c&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");c.c&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(se&&!Object(c.e)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(c.e)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(u.a);e.a=ue},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=new Map;function i(t,e){r.set(t,e)}function o(t){return r.get(t)}var a=function(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}},s=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.r;return{x:n-i,y:r-i,width:2*i,height:2*i}},u=n(21);function c(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}function l(t,e){var n=t.get("startArrowShape"),r=t.get("endArrowShape");return n&&(e=c(e,n.getCanvasBBox())),r&&(e=c(e,r.getCanvasBBox())),e}var h=n(70),f=n(39),d=n(0);function p(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),u=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!u||0===Math.sin(u)||Object(d.isNumberEqual)(u,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(u/2-c)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(l-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}i("rect",a),i("image",a),i("circle",s),i("marker",s),i("polyline",(function(t){for(var e=t.attr().points,n=[],r=[],i=0;i<e.length;i++){var o=e[i];n.push(o[0]),r.push(o[1])}var a=u.f.getBBoxByArray(n,r),s=a.x,c=a.y,h={minX:s,minY:c,maxX:s+a.width,maxY:c+a.height};return{x:(h=l(t,h)).minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}})),i("polygon",(function(t){for(var e=t.attr().points,n=[],r=[],i=0;i<e.length;i++){var o=e[i];n.push(o[0]),r.push(o[1])}return u.f.getBBoxByArray(n,r)})),i("text",(function(t){var e=t.attr(),n=e.x,r=e.y,i=e.text,o=e.fontSize,a=e.lineHeight,s=e.font;s||(s=Object(h.a)(e));var u,c=Object(h.c)(i,s);if(c){var l=e.textAlign,f=e.textBaseline,d=Object(h.b)(i,o,a),p={x:n,y:r-d};l&&("end"===l||"right"===l?p.x-=c:"center"===l&&(p.x-=c/2)),f&&("top"===f?p.y+=d:"middle"===f&&(p.y+=d/2)),u={x:p.x,y:p.y,width:c,height:d}}else u={x:n,y:r,width:0,height:0};return u})),i("path",(function(t){var e=t.attr(),n=e.path,r=e.stroke?e.lineWidth:0,i=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=(y=t[o]).currentPoint,s=y.params,c=y.prePoint,l=void 0;switch(y.command){case"Q":l=u.e.box(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=u.b.box(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var h=y.arcParams;l=u.a.box(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(a[0]),r.push(a[1])}l&&(y.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===y.command||"M"===y.command)&&y.prePoint&&y.nextPoint&&i.push(y)}n=n.filter((function(t){return!Number.isNaN(t)})),r=r.filter((function(t){return!Number.isNaN(t)}));var f=Object(d.min)(n),g=Object(d.min)(r),v=Object(d.max)(n),m=Object(d.max)(r);if(0===i.length)return{x:f,y:g,width:v-f,height:m-g};for(o=0;o<i.length;o++){var y;(a=(y=i[o]).currentPoint)[0]===f?f-=p(y,e).xExtra:a[0]===v&&(v+=p(y,e).xExtra),a[1]===g?g-=p(y,e).yExtra:a[1]===m&&(m+=p(y,e).yExtra)}return{x:f,y:g,width:v-f,height:m-g}}(t.get("segments")||Object(f.d)(n),r),o=i.x,a=i.y,s={minX:o,minY:a,maxX:o+i.width,maxY:a+i.height};return{x:(s=l(t,s)).minX,y:s.minY,width:s.maxX-s.minX,height:s.maxY-s.minY}})),i("line",(function(t){var e=t.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2,a={minX:Math.min(n,i),maxX:Math.max(n,i),minY:Math.min(r,o),maxY:Math.max(r,o)};return{x:(a=l(t,a)).minX,y:a.minY,width:a.maxX-a.minX,height:a.maxY-a.minY}})),i("ellipse",(function(t){var e=t.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;return{x:n-i,y:r-o,width:2*i,height:2*o}}))},function(t,e,n){"use strict";var r=n(1),i=n(22),o=n(18),a=n(72),s=n(36),u=n(27),c=n(82),l=n(80),h=n(0),f=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,d=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,p=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function g(t){var e=t.match(p);if(!e)return"";var n="";return e.sort((function(t,e){return t=t.split(":"),e=e.split(":"),Number(t[0])-Number(e[0])})),Object(h.each)(e,(function(t){t=t.split(":"),n+='<stop offset="'+t[0]+'" stop-color="'+t[1]+'"></stop>'})),n}var v=function(){function t(t){this.cfg={};var e=null,n=Object(h.uniqueId)("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var n,r,i=f.exec(t),o=Object(h.mod)(Object(h.toRadian)(parseFloat(i[1])),2*Math.PI),a=i[2];o>=0&&o<.5*Math.PI?(n={x:0,y:0},r={x:1,y:1}):.5*Math.PI<=o&&o<Math.PI?(n={x:1,y:0},r={x:0,y:1}):Math.PI<=o&&o<1.5*Math.PI?(n={x:1,y:1},r={x:0,y:0}):(n={x:0,y:1},r={x:1,y:0});var s=Math.tan(o),u=s*s,c=(r.x-n.x+s*(r.y-n.y))/(u+1)+n.x,l=s*(r.x-n.x+s*(r.y-n.y))/(u+1)+n.y;e.setAttribute("x1",n.x),e.setAttribute("y1",n.y),e.setAttribute("x2",c),e.setAttribute("y2",l),e.innerHTML=g(a)}(t,e=Object(u.b)("linearGradient")):function(t,e){var n=d.exec(t),r=parseFloat(n[1]),i=parseFloat(n[2]),o=parseFloat(n[3]),a=n[4];e.setAttribute("cx",r),e.setAttribute("cy",i),e.setAttribute("r",o),e.innerHTML=g(a)}(t,e=Object(u.b)("radialGradient")),e.setAttribute("id",n),this.el=e,this.id=n,this.cfg=t,this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),m={shadowColor:"color",shadowOpacity:"opacity",shadowBlur:"blur",shadowOffsetX:"dx",shadowOffsetY:"dy"},y={x:"-40%",y:"-40%",width:"200%",height:"200%"},b=function(){function t(t){this.type="filter",this.cfg={},this.type="filter";var e=Object(u.b)("filter");return Object(h.each)(y,(function(t,n){e.setAttribute(n,t)})),this.el=e,this.id=Object(h.uniqueId)("filter_"),this.el.id=this.id,this.cfg=t,this._parseShadow(t,e),this}return t.prototype.match=function(t,e){if(this.type!==t)return!1;var n=!0,r=this.cfg;return Object(h.each)(Object.keys(r),(function(t){if(r[t]!==e[t])return n=!1,!1})),n},t.prototype.update=function(t,e){var n=this.cfg;return n[m[t]]=e,this._parseShadow(n,this.el),this},t.prototype._parseShadow=function(t,e){var n='<feDropShadow\n dx="'+(t.dx||0)+'"\n dy="'+(t.dy||0)+'"\n stdDeviation="'+(t.blur?t.blur/10:0)+'"\n flood-color="'+(t.color?t.color:"#000")+'"\n flood-opacity="'+(t.opacity?t.opacity:1)+'"\n />';e.innerHTML=n},t}(),x=function(){function t(t,e){this.cfg={};var n=Object(u.b)("marker"),r=Object(h.uniqueId)("marker_");n.setAttribute("id",r);var i=Object(u.b)("path");i.setAttribute("stroke",t.stroke||"none"),i.setAttribute("fill",t.fill||"none"),n.appendChild(i),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=i,this.id=r;var o=t["marker-start"===e?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",!0===o?this._setDefaultPath(e,i):(this.cfg=o,this._setMarker(t.lineWidth,i)),this}return t.prototype.match=function(){return!1},t.prototype._setDefaultPath=function(t,e){var n=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),n.setAttribute("refX",""+10*Math.cos(Math.PI/6)),n.setAttribute("refY","5")},t.prototype._setMarker=function(t,e){var n=this.el,r=this.cfg.path,i=this.cfg.d;Object(h.isArray)(r)&&(r=r.map((function(t){return t.join(" ")})).join("")),e.setAttribute("d",r),n.appendChild(e),i&&n.setAttribute("refX",""+i/t)},t.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}(),w=function(){function t(t){this.type="clip",this.cfg={};var e=Object(u.b)("clipPath");this.el=e,this.id=Object(h.uniqueId)("clip_"),e.id=this.id;var n=t.cfg.el;return e.appendChild(n),this.cfg=t,this}return t.prototype.match=function(){return!1},t.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}(),_=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,S=function(){function t(t){this.cfg={};var e=Object(u.b)("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var n=Object(u.b)("image");e.appendChild(n);var r=Object(h.uniqueId)("pattern_");e.id=r,this.el=e,this.id=r,this.cfg=t;var i=_.exec(t)[2];n.setAttribute("href",i);var o=new Image;function a(){e.setAttribute("width",""+o.width),e.setAttribute("height",""+o.height)}return i.match(/^data:/i)||(o.crossOrigin="Anonymous"),o.src=i,o.complete?a():(o.onload=a,o.src=o.src),this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),E=function(){function t(t){var e=Object(u.b)("defs"),n=Object(h.uniqueId)("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return t.prototype.find=function(t,e){for(var n=this.children,r=null,i=0;i<n.length;i++)if(n[i].match(t,e)){r=n[i].id;break}return r},t.prototype.findById=function(t){for(var e=this.children,n=null,r=0;r<e.length;r++)if(e[r].id===t){n=e[r];break}return n},t.prototype.add=function(t){this.children.push(t),t.canvas=this.canvas,t.parent=this},t.prototype.getDefaultArrow=function(t,e){var n=t.stroke||t.strokeStyle;if(this.defaultArrow[n])return this.defaultArrow[n].id;var r=new x(t,e);return this.defaultArrow[n]=r,this.el.appendChild(r.el),this.add(r),r.id},t.prototype.addGradient=function(t){var e=new v(t);return this.el.appendChild(e.el),this.add(e),e.id},t.prototype.addArrow=function(t,e){var n=new x(t,e);return this.el.appendChild(n.el),this.add(n),n.id},t.prototype.addShadow=function(t){var e=new b(t);return this.el.appendChild(e.el),this.add(e),e.id},t.prototype.addPattern=function(t){var e=new S(t);return this.el.appendChild(e.el),this.add(e),e.id},t.prototype.addClip=function(t){var e=new w(t);return this.el.appendChild(e.el),this.add(e),e.id},t}(),M=function(t){function e(e){return t.call(this,Object(r.__assign)(Object(r.__assign)({},e),{autoDraw:!0,renderer:"svg"}))||this}return Object(r.__extends)(e,t),e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return l.a},e.prototype.getShape=function(t,e,n){var r=n.target||n.srcElement;if(!o.a[r.tagName]){for(var i=r.parentNode;i&&!o.a[i.tagName];)i=i.parentNode;r=i}return this.find((function(t){return t.get("el")===r}))},e.prototype.createDom=function(){var t=Object(u.b)("svg"),e=new E(t);return t.setAttribute("width",""+this.get("width")),t.setAttribute("height",""+this.get("height")),this.set("context",e),t},e.prototype.onCanvasChange=function(t){var e=this.get("context"),n=this.get("el");if("sort"===t){var r=this.get("children");r&&r.length&&Object(u.d)(this,(function(t,e){return r.indexOf(t)-r.indexOf(e)?1:0}))}else if("clear"===t){if(n){n.innerHTML="";var i=e.el;i.innerHTML="",n.appendChild(i)}}else"matrix"===t?Object(s.c)(this):"clip"===t?Object(s.a)(this,e):"changeSize"===t&&(n.setAttribute("width",""+this.get("width")),n.setAttribute("height",""+this.get("height")))},e.prototype.draw=function(){var t=this.get("context"),e=this.getChildren();Object(s.a)(this,t),e.length&&Object(a.a)(t,e)},e}(i.AbstractCanvas);e.a=M},function(t,e,n){"use strict";n(135),n(136),n(138)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r.a})),n.d(e,"b",(function(){return o.a}));var r=n(81),i=(n(7),n(8),n(2)),o=(i.e.create(),n(58));n(130),i.e.create(),i.e.create(),i.e.create(),i.e.create(),i.e.create()},function(t,e,n){"use strict";var r=n(1),i=n(22);function o(t,e,n){var r=t.getTotalMatrix();if(r){var o=function(t,e){if(e){var n=Object(i.invert)(e);return Object(i.multiplyVec2)(n,t)}return t}([e,n,1],r);return[o[0],o[1]]}return[e,n]}function a(t,e,n){if(t.isCanvas&&t.isCanvas())return!0;if(!Object(i.isAllowCapture)(t)||!1===t.cfg.isInView)return!1;if(t.cfg.clipShape){var r=o(t,e,n),a=r[0],s=r[1];if(t.isClipped(a,s))return!1}var u=t.cfg.cacheCanvasBBox||t.getCanvasBBox();return e>=u.minX&&e<=u.maxX&&n>=u.minY&&n<=u.maxY}var s=n(57),u=n(79),c=n(17),l=n(31),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e},e.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return s},e.prototype.getGroupBase=function(){return u.a},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||Object(c.d)();return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,n){t.prototype.setDOMSize.call(this,e,n);var r=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*n,o>1&&r.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var e=this.get("context"),n=this.get("el");e.clearRect(0,0,n.width,n.height)},e.prototype.getShape=function(e,n){return this.get("quickHit")?function t(e,n,r){if(!a(e,n,r))return null;for(var i=null,s=e.getChildren(),u=s.length-1;u>=0;u--){var c=s[u];if(c.isGroup())i=t(c,n,r);else if(a(c,n,r)){var l=c,h=o(c,n,r),f=h[0],d=h[1];l.isInShape(f,d)&&(i=c)}if(i)break}return i}(this,e,n):t.prototype.getShape.call(this,e,n,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),n=this.getViewRange();e.length&&e[0]===this?t=n:(t=Object(l.f)(e))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=Object(l.g)(t,n)));return t},e.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(Object(c.a)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),n=this.getChildren();t.clearRect(0,0,e.width,e.height),Object(l.a)(t,this),Object(l.d)(t,n),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),r=this._getRefreshRegion();r?(t.clearRect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.save(),t.beginPath(),t.rect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.clip(),Object(l.a)(t,this),Object(l.b)(this,n,r),Object(l.d)(t,n,r),t.restore()):e.length&&Object(l.c)(e),Object(c.c)(e,(function(t){t.get("hasChanged")&&t.set("hasChanged",!1)})),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,e=this.get("drawFrame");e||(e=Object(c.n)((function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)})),this.set("drawFrame",e))},e.prototype.skipDraw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},e}(i.AbstractCanvas);e.a=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"GADDIAsync",{enumerable:!0,get:function(){return r.GADDIAsync}}),Object.defineProperty(e,"connectedComponentAsync",{enumerable:!0,get:function(){return r.connectedComponentAsync}}),e.default=void 0,Object.defineProperty(e,"detectAllCyclesAsync",{enumerable:!0,get:function(){return r.detectAllCyclesAsync}}),Object.defineProperty(e,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return r.detectAllDirectedCycleAsync}}),Object.defineProperty(e,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return r.detectAllUndirectedCycleAsync}}),Object.defineProperty(e,"detectCycleAsync",{enumerable:!0,get:function(){return r.detectCycleAsync}}),e.detectDirectedCycleAsync=void 0,Object.defineProperty(e,"dijkstraAsync",{enumerable:!0,get:function(){return r.dijkstraAsync}}),Object.defineProperty(e,"findAllPathAsync",{enumerable:!0,get:function(){return r.findAllPathAsync}}),Object.defineProperty(e,"findShortestPathAsync",{enumerable:!0,get:function(){return r.findShortestPathAsync}}),Object.defineProperty(e,"floydWarshallAsync",{enumerable:!0,get:function(){return r.floydWarshallAsync}}),Object.defineProperty(e,"getAdjMatrixAsync",{enumerable:!0,get:function(){return r.getAdjMatrixAsync}}),Object.defineProperty(e,"getDegreeAsync",{enumerable:!0,get:function(){return r.getDegreeAsync}}),Object.defineProperty(e,"getInDegreeAsync",{enumerable:!0,get:function(){return r.getInDegreeAsync}}),Object.defineProperty(e,"getNeighborsAsync",{enumerable:!0,get:function(){return r.getNeighborsAsync}}),Object.defineProperty(e,"getOutDegreeAsync",{enumerable:!0,get:function(){return r.getOutDegreeAsync}}),Object.defineProperty(e,"labelPropagationAsync",{enumerable:!0,get:function(){return r.labelPropagationAsync}}),Object.defineProperty(e,"louvainAsync",{enumerable:!0,get:function(){return r.louvainAsync}}),Object.defineProperty(e,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return r.minimumSpanningTreeAsync}}),Object.defineProperty(e,"pageRankAsync",{enumerable:!0,get:function(){return r.pageRankAsync}});var r=n(297),i=r.detectCycleAsync;e.detectDirectedCycleAsync=i;var o={getAdjMatrixAsync:r.getAdjMatrixAsync,connectedComponentAsync:r.connectedComponentAsync,getDegreeAsync:r.getDegreeAsync,getInDegreeAsync:r.getInDegreeAsync,getOutDegreeAsync:r.getOutDegreeAsync,detectCycleAsync:r.detectCycleAsync,detectDirectedCycleAsync:i,detectAllCyclesAsync:r.detectAllCyclesAsync,detectAllDirectedCycleAsync:r.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:r.detectAllUndirectedCycleAsync,dijkstraAsync:r.dijkstraAsync,findAllPathAsync:r.findAllPathAsync,findShortestPathAsync:r.findShortestPathAsync,floydWarshallAsync:r.floydWarshallAsync,labelPropagationAsync:r.labelPropagationAsync,louvainAsync:r.louvainAsync,minimumSpanningTreeAsync:r.minimumSpanningTreeAsync,pageRankAsync:r.pageRankAsync,getNeighborsAsync:r.getNeighborsAsync,GADDIAsync:r.GADDIAsync};e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(532);e.default=function(t,e){return void 0===e&&(e=!0),{lazyInject:r.makePropertyInjectDecorator(t,e),lazyInjectNamed:r.makePropertyInjectNamedDecorator(t,e),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(t,e),lazyMultiInject:r.makePropertyMultiInjectDecorator(t,e)}}},function(t,e,n){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};function n(t){var e=new Error("(regl) "+t);throw console.error(e),e}function r(t,e){t||n(e)}function i(t){return t?": "+t:""}function o(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 a(t,e,r){e.indexOf(t)<0&&n("invalid value"+i(r)+". must be one of: "+e)}var s=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function u(t,e){for(t+="";t.length<e;)t=" "+t;return t}function c(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function l(t,e){this.number=t,this.line=e,this.errors=[]}function h(t,e,n){this.file=t,this.line=e,this.message=n}function f(){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 d(){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 p(t,e){var n,r=t.split("\n"),i=1,o=0,a={unknown:new c,0:new c};a.unknown.name=a[0].name=e||f(),a.unknown.lines.push(new l(0,""));for(var s=0;s<r.length;++s){var u=r[s],h=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(u);if(h)switch(h[1]){case"line":var d=/(\d+)(\s+\d+)?/.exec(h[2]);d&&(i=0|d[1],d[2]&&((o=0|d[2])in a||(a[o]=new c)));break;case"define":var p=/SHADER_NAME(_B64)?\s+(.*)$/.exec(h[2]);p&&(a[o].name=p[1]?(n=p[2],"undefined"!=typeof atob?atob(n):"base64:"+n):p[2])}a[o].lines.push(new l(i++,u))}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=f()}function v(t,e){var r=d();n(t+" in command "+(e||f())+("unknown"===r?"":" called from "+r))}function m(t,e,n,r){o(t,e)||v("invalid parameter type"+i(n)+". expected "+e+", got "+typeof t,r||f())}var y={};function b(t,e){return 32820===t||32819===t||33635===t?2:34042===t?4:y[t]*e}function x(t){return!(t&t-1||!t)}y[5120]=y[5121]=1,y[5122]=y[5123]=y[36193]=y[33635]=y[32819]=y[32820]=2,y[5124]=y[5125]=y[5126]=y[34042]=4;var w=e(r,{optional:function(t){t()},raise:n,commandRaise:v,command:function(t,e,n){t||v(e,n||f())},parameter:function(t,e,r){t in e||n("unknown parameter ("+t+")"+i(r)+". possible values: "+Object.keys(e).join())},commandParameter:function(t,e,n,r){t in e||v("unknown parameter ("+t+")"+i(n)+". possible values: "+Object.keys(e).join(),r||f())},constructor:function(t){Object.keys(t).forEach((function(t){s.indexOf(t)<0&&n('invalid regl constructor argument "'+t+'". must be one of '+s)}))},type:function(t,e,r){o(t,e)||n("invalid parameter type"+i(r)+". expected "+e+", got "+typeof t)},commandType:m,isTypedArray:function(e,r){t(e)||n("invalid parameter type"+i(r)+". must be a typed array")},nni:function(t,e){t>=0&&(0|t)===t||n("invalid parameter type, ("+t+")"+i(e)+". must be a nonnegative integer")},oneOf:a,shaderError:function(t,e,n,i,o){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var a=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";m(n,"string",s+" shader source must be a string",o);var c=p(n,o),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 h(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new h("unknown",0,t))}})),e}(a);!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)}))}(c,l),Object.keys(c).forEach((function(t){var e=c[t];if(e.hasErrors){var n=[""],r=[""];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(u(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(n){var r=n.message,o=/^\s*'(.*)'\s*:\s*(.*)$/.exec(r);if(o){var a=o[1];switch(r=o[2],a){case"assign":a="="}e=Math.max(t.line.indexOf(a,e),0)}else e=0;i(u("| ",6)),i(u("^^^",e+3)+"\n","font-weight:bold"),i(u("| ",6)),i(r+"\n","font-weight:bold")})),i(u("| ",6)+"\n")}else i(u(t.number,4)+"| "),i(t.line+"\n","color:red")})),"undefined"==typeof document||window.chrome?console.log(n.join("")):(r[0]=n.join("%c"),console.log.apply(console,r))}function i(t,e){n.push(t),r.push(e||"")}})),r.raise("Error compiling "+s+" shader, "+c[0].name)}},linkError:function(t,e,n,i,o){if(!t.getProgramParameter(e,t.LINK_STATUS)){var a=t.getProgramInfoLog(e),s=p(n,o),u='Error linking program with vertex shader, "'+p(i,o)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+u+"\n%c"+a,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(u+"\n"+a),r.raise(u)}},callSite:d,saveCommandRef:g,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}g(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var s=t._attributeSet={};o(s,n.static),o(s,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?a(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):a(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:f,texture2D:function(t,e,n){var i,o=e.width,a=e.height,s=e.channels;r(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),33071===t.wrapS&&33071===t.wrapT||r(x(o)&&x(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&r(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(r(x(o)&&x(a),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var u=e.images;for(i=0;i<16;++i)if(u[i]){var c=o>>i,l=a>>i;r(e.mipmask&1<<i,"missing mipmap data");var h=u[i];if(r(h.width===c&&h.height===l,"invalid shape for mip images"),r(h.format===e.format&&h.internalformat===e.internalformat&&h.type===e.type,"incompatible type for mip image"),h.compressed);else if(h.data){var f=Math.ceil(b(h.type,s)*c/h.unpackAlignment)*h.unpackAlignment;r(h.data.byteLength===f*l,"invalid data for image, buffer size is inconsistent with image format")}else h.element||h.copy}else t.genMipmaps||r(0==(e.mipmask&1<<i),"extra mipmap data");e.compressed&&r(!t.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(t,e,n,i){var o=t.width,a=t.height,s=t.channels;r(o>0&&o<=i.maxTextureSize&&a>0&&a<=i.maxTextureSize,"invalid texture shape"),r(o===a,"cube map must be square"),r(33071===e.wrapS&&33071===e.wrapT,"wrap mode not supported by cube map");for(var u=0;u<n.length;++u){var c=n[u];r(c.width===o&&c.height===a,"inconsistent cube map face shape"),e.genMipmaps&&(r(!c.compressed,"can not generate mipmap for compressed textures"),r(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var l=c.images,h=0;h<16;++h){var f=l[h];if(f){var d=o>>h,p=a>>h;r(c.mipmask&1<<h,"missing mipmap data"),r(f.width===d&&f.height===p,"invalid shape for mip images"),r(f.format===t.format&&f.internalformat===t.internalformat&&f.type===t.type,"incompatible type for mip image"),f.compressed||(f.data?r(f.data.byteLength===d*p*Math.max(b(f.type,s),f.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):f.element||f.copy)}}}}}),_=0;function S(t,e){this.id=_++,this.type=t,this.data=e}function E(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function M(t){return"["+function t(e){if(0===e.length)return[];var n=e.charAt(0),r=e.charAt(e.length-1);if(e.length>1&&n===r&&('"'===n||"'"===n))return['"'+E(e.substr(1,e.length-2))+'"'];var i=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(i)return t(e.substr(0,i.index)).concat(t(i[1])).concat(t(e.substr(i.index+i[0].length)));var o=e.split(".");if(1===o.length)return['"'+E(e)+'"'];for(var a=[],s=0;s<o.length;++s)a=a.concat(t(o[s]));return a}(t).join("][")+"]"}var O={DynamicVariable:S,define:function(t,e){return new S(t,M(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof S},unbox:function t(e,n){return"function"==typeof e?new S(0,e):"number"==typeof e||"boolean"==typeof e?new S(5,e):Array.isArray(e)?new S(6,e.map((e,r)=>t(e,n+"["+r+"]"))):e instanceof S?e:void w(!1,"invalid option type in uniform "+n)},accessor:M},A={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},k="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function C(t){return"string"==typeof t?t.split():(w(Array.isArray(t),"invalid extension array"),t)}function I(t){return"string"==typeof t?(w("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function T(t){var n,r,i,o,a,s=t||{},u={},c=[],l=[],h="undefined"==typeof window?1:window.devicePixelRatio,f=!1,d=function(t){t&&w.raise(t)},p=function(){};if("string"==typeof s?(w("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(s),w(n,"invalid query string for element")):"object"==typeof s?"string"==typeof(a=s).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=s:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(s)?i=(o=s).canvas:(w.constructor(s),"gl"in s?o=s.gl:"canvas"in s?i=I(s.canvas):"container"in s&&(r=I(s.container)),"attributes"in s&&(u=s.attributes,w.type(u,"object","invalid context attributes")),"extensions"in s&&(c=C(s.extensions)),"optionalExtensions"in s&&(l=C(s.optionalExtensions)),"onDone"in s&&(w.type(s.onDone,"function","invalid or missing onDone callback"),d=s.onDone),"profile"in s&&(f=!!s.profile),"pixelRatio"in s&&(h=+s.pixelRatio,w(h>0,"invalid pixel ratio"))):w.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){w("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var g=function(t,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,e(o.style,{width:n+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(r||document.body,0,h);if(!g)return null;i=g.canvas,p=g.onDestroy}void 0===u.premultipliedAlpha&&(u.premultipliedAlpha=!0),o=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")}(i,u)}return o?{gl:o,canvas:i,container:r,extensions:c,optionalExtensions:l,pixelRatio:h,profile:f,onDone:d,onDestroy:p}:(p(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function P(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}function N(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 j(){var t=P(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[N(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[N(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var D=j();function L(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))}D.zero=j();var R=function(t){return Object.keys(t).map((function(e){return t[e]}))},B={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 i=1;if(e.length)for(var o=0;o<e.length;++o)i*=e[o];else i=0;var a=r||D.allocType(n,i);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 i=0,o=0;o<e;++o)for(var a=t[o],s=0;s<n;++s)r[i++]=a[s]}(t,e[0],e[1],a);break;case 3:G(t,e[0],e[1],e[2],a,0);break;default:!function t(e,n,r,i,o){for(var a=1,s=r+1;s<n.length;++s)a*=n[s];var u=n[r];if(n.length-r==4){var c=n[r+1],l=n[r+2],h=n[r+3];for(s=0;s<u;++s)G(e[s],c,l,h,i,o),o+=a}else for(s=0;s<u;++s)t(e[s],n,r+1,i,o),o+=a}(t,e,0,a,0)}return a}};function G(t,e,n,r,i,o){for(var a=o,s=0;s<e;++s)for(var u=t[s],c=0;c<n;++c)for(var l=u[c],h=0;h<r;++h)i[a++]=l[h]}var F={"[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},z={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},U={dynamic:35048,stream:35040,static:35044},V=B.flatten,W=B.shape,Y=[];function X(t){return 0|F[Object.prototype.toString.call(t)]}function H(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function q(t,e,n,r,i,o,a){for(var s=0,u=0;u<n;++u)for(var c=0;c<r;++c)t[s++]=e[i*u+o*c+a]}Y[5120]=1,Y[5122]=2,Y[5124]=4,Y[5121]=1,Y[5123]=2,Y[5125]=4,Y[5126]=4;var K={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Z=new Float32Array(1),$=new Uint32Array(Z.buffer);function Q(t){for(var e=D.allocType(5123,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{Z[0]=t[n];var r=$[0],i=r>>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var s=-14-o;e[n]=i+(a+1024>>s)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function J(e){return Array.isArray(e)||t(e)}var tt=function(t){return!(t&t-1||!t)},et=[9984,9986,9985,9987],nt=[0,6409,6410,6407,6408],rt={};function it(t){return"[object "+t+"]"}rt[6409]=rt[6406]=rt[6402]=1,rt[34041]=rt[6410]=2,rt[6407]=rt[35904]=3,rt[6408]=rt[35906]=4;var ot=it("HTMLCanvasElement"),at=it("OffscreenCanvas"),st=it("CanvasRenderingContext2D"),ut=it("ImageBitmap"),ct=it("HTMLImageElement"),lt=it("HTMLVideoElement"),ht=Object.keys(F).concat([ot,at,st,ut,ct,lt]),ft=[];ft[5121]=1,ft[5126]=4,ft[36193]=2,ft[5123]=2,ft[5125]=4;var dt=[];function pt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function gt(t){return!!Array.isArray(t)&&!(0===t.length||!J(t[0]))}function vt(t){return Object.prototype.toString.call(t)}function mt(t){return vt(t)===ot}function yt(t){return vt(t)===at}function bt(t){if(!t)return!1;var e=vt(t);return ht.indexOf(e)>=0||pt(t)||gt(t)||L(t)}function xt(t){return 0|F[Object.prototype.toString.call(t)]}function wt(t,e){return D.allocType(36193===t.type?5126:t.type,e)}function _t(t,e){36193===t.type?(t.data=Q(e),D.freeType(e)):t.data=e}function St(t,e,n,r,i,o){var a;if(a=void 0!==dt[t]?dt[t]:rt[t]*ft[e],o&&(a*=6),i){for(var s=0,u=n;u>=1;)s+=a*u*u,u/=2;return s}return a*n*r}function Et(n,r,i,o,a,s,u){var c={"don't care":4352,"dont care":4352,nice:4354,fast:4353},l={repeat:10497,clamp:33071,mirror:33648},h={nearest:9728,linear:9729},f=e({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},h),d={none:0,browser:37444},p={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},g={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},v={};r.ext_srgb&&(g.srgb=35904,g.srgba=35906),r.oes_texture_float&&(p.float32=p.float=5126),r.oes_texture_half_float&&(p.float16=p["half float"]=36193),r.webgl_depth_texture&&(e(g,{depth:6402,"depth stencil":34041}),e(p,{uint16:5123,uint32:5125,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(v,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&e(v,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(v,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(v["rgb etc1"]=36196);var m=Array.prototype.slice.call(n.getParameter(34467));Object.keys(v).forEach((function(t){var e=v[t];m.indexOf(e)>=0&&(g[t]=e)}));var y=Object.keys(g);i.textureFormats=y;var b=[];Object.keys(g).forEach((function(t){var e=g[t];b[e]=t}));var x=[];Object.keys(p).forEach((function(t){var e=p[t];x[e]=t}));var _=[];Object.keys(h).forEach((function(t){_[h[t]]=t}));var S=[];Object.keys(f).forEach((function(t){var e=f[t];S[e]=t}));var E=[];Object.keys(l).forEach((function(t){E[l[t]]=t}));var M=y.reduce((function(t,e){var n=g[e];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n||r.ext_srgb&&(35904===n||35906===n)?t[n]=n:32855===n||e.indexOf("rgba")>=0?t[n]=6408:t[n]=6407,t}),{});function O(){this.internalformat=6408,this.format=6408,this.type=5121,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function A(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 k(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(w.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(w.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(w.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(w.parameter(e.colorSpace,d,"invalid colorSpace"),t.colorSpace=d[e.colorSpace]),"type"in e){var n=e.type;w(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),w(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."),w(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."),w.parameter(n,p,"invalid texture type"),t.type=p[n]}var o=t.width,a=t.height,s=t.channels,u=!1;"shape"in e?(w(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],a=e.shape[1],3===e.shape.length&&(s=e.shape[2],w(s>0&&s<=4,"invalid number of channels"),u=!0),w(o>=0&&o<=i.maxTextureSize,"invalid width"),w(a>=0&&a<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=a=e.radius,w(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,w(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,w(a>=0&&a<=i.maxTextureSize,"invalid height")),"channels"in e&&(s=e.channels,w(s>0&&s<=4,"invalid number of channels"),u=!0)),t.width=0|o,t.height=0|a,t.channels=0|s;var c=!1;if("format"in e){var l=e.format;w(r.webgl_depth_texture||!("depth"===l||"depth stencil"===l),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),w.parameter(l,g,"invalid texture format");var h=t.internalformat=g[l];t.format=M[h],l in p&&("type"in e||(t.type=p[l])),l in v&&(t.compressed=!0),c=!0}!u&&c?t.channels=rt[t.format]:u&&!c?t.channels!==nt[t.format]&&(t.format=t.internalformat=nt[t.channels]):c&&u&&w(t.channels===rt[t.format],"number of channels inconsistent with specified format")}}function C(t){n.pixelStorei(37440,t.flipY),n.pixelStorei(37441,t.premultiplyAlpha),n.pixelStorei(37443,t.colorSpace),n.pixelStorei(3317,t.unpackAlignment)}function I(){O.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function T(e,n){var r=null;if(bt(n)?r=n:n&&(w.type(n,"object","invalid pixel data type"),k(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),bt(n.data)&&(r=n.data)),w(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){w(!r,"can not specify copy and data field for the same texture");var o=a.viewportWidth,s=a.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||s-e.yOffset,e.needsCopy=!0,w(e.xOffset>=0&&e.xOffset<o&&e.yOffset>=0&&e.yOffset<s&&e.width>0&&e.width<=o&&e.height>0&&e.height<=s,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||5121!==e.type||(e.type=xt(r));else if(pt(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case 5121:case 5123:case 5125:case 5126:var r=D.allocType(t.type,n);r.set(e),t.data=r;break;case 36193:t.data=Q(e);break;default:w.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(L(r)){var u=r.data;Array.isArray(u)||5121!==e.type||(e.type=xt(u));var c,l,h,f,d,p,g=r.shape,v=r.stride;3===g.length?(h=g[2],p=v[2]):(w(2===g.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,p=1),c=g[0],l=g[1],f=v[0],d=v[1],e.alignment=1,e.width=c,e.height=l,e.channels=h,e.format=e.internalformat=nt[h],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,s=t.height,u=t.channels,c=wt(t,a*s*u),l=0,h=0;h<s;++h)for(var f=0;f<a;++f)for(var d=0;d<u;++d)c[l++]=e[n*f+r*h+i*d+o];_t(t,c)}(e,u,f,d,p,r.offset)}else if(mt(r)||yt(r)||vt(r)===st)mt(r)||yt(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 vt(t)===ut}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(t){return vt(t)===ct}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(t){return vt(t)===lt}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(gt(r)){var m=e.width||r[0].length,y=e.height||r.length,b=e.channels;b=J(r[0][0])?b||r[0][0].length:b||1;for(var x=B.shape(r),_=1,S=0;S<x.length;++S)_*=x[S];var E=wt(e,_);B.flatten(r,x,"",E),_t(e,E),e.alignment=1,e.width=m,e.height=y,e.channels=b,e.format=e.internalformat=nt[b],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;5126===e.type?w(i.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):36193===e.type&&w(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function P(t,e,r){var i=t.element,a=t.data,s=t.internalformat,u=t.format,c=t.type,l=t.width,h=t.height;C(t),i?n.texImage2D(e,r,u,u,c,i):t.compressed?n.compressedTexImage2D(e,r,s,l,h,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,u,t.xOffset,t.yOffset,l,h,0)):n.texImage2D(e,r,u,l,h,0,u,c,a||null)}function N(t,e,r,i,a){var s=t.element,u=t.data,c=t.internalformat,l=t.format,h=t.type,f=t.width,d=t.height;C(t),s?n.texSubImage2D(e,a,r,i,l,h,s):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,f,d,u):t.needsCopy?(o(),n.copyTexSubImage2D(e,a,r,i,t.xOffset,t.yOffset,f,d)):n.texSubImage2D(e,a,r,i,f,d,l,h,u)}var j=[];function G(){return j.pop()||new I}function F(t){t.needsFree&&D.freeType(t.data),I.call(t),j.push(t)}function z(){O.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function U(t,e,n){var r=t.images[0]=G();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function V(t,e){var n=null;if(bt(e))A(n=t.images[0]=G(),t),T(n,e),t.mipmask=1;else if(k(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i<r.length;++i)A(n=t.images[i]=G(),t),n.width>>=i,n.height>>=i,T(n,r[i]),t.mipmask|=1<<i;else A(n=t.images[0]=G(),t),T(n,e),t.mipmask=1;A(t,t.images[0]),!t.compressed||33776!==t.internalformat&&33777!==t.internalformat&&33778!==t.internalformat&&33779!==t.internalformat||w(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 W(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;P(n[r],e,r)}}var Y=[];function X(){var t=Y.pop()||new z;O.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function H(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&F(e[n]),e[n]=null;Y.push(t)}function q(){this.minFilter=9728,this.magFilter=9728,this.wrapS=33071,this.wrapT=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function K(t,e){if("min"in e){var n=e.min;w.parameter(n,f),t.minFilter=f[n],et.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;w.parameter(r,h),t.magFilter=h[r]}var o=t.wrapS,a=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(w.parameter(s,l),o=a=l[s]):Array.isArray(s)&&(w.parameter(s[0],l),w.parameter(s[1],l),o=l[s[0]],a=l[s[1]])}else{if("wrapS"in e){var u=e.wrapS;w.parameter(u,l),o=l[u]}if("wrapT"in e){var d=e.wrapT;w.parameter(d,l),a=l[d]}}if(t.wrapS=o,t.wrapT=a,"anisotropic"in e){var p=e.anisotropic;w("number"==typeof p&&p>=1&&p<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var g=!1;switch(typeof e.mipmap){case"string":w.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,g=!0;break;case"boolean":g=t.genMipmaps=e.mipmap;break;case"object":w(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,g=!0;break;default:w.raise("invalid mipmap type")}g&&!("min"in e)&&(t.minFilter=9984)}}function Z(t,e){n.texParameteri(e,10241,t.minFilter),n.texParameteri(e,10240,t.magFilter),n.texParameteri(e,10242,t.wrapS),n.texParameteri(e,10243,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,34046,t.anisotropic),t.genMipmaps&&(n.hint(33170,t.mipmapHint),n.generateMipmap(e))}var $=0,it={},ot=i.maxTextureUnits,at=Array(ot).map((function(){return null}));function ht(t){O.call(this),this.mipmask=0,this.internalformat=6408,this.id=$++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new q,u.profile&&(this.stats={size:0})}function ft(t){n.activeTexture(33984),n.bindTexture(t.target,t.texture)}function dt(){var t=at[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(3553,null)}function Et(t){var e=t.texture;w(e,"must not double destroy texture");var r=t.unit,i=t.target;r>=0&&(n.activeTexture(33984+r),n.bindTexture(i,null),at[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete it[t.id],s.textureCount--}return e(ht.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(t<0){for(var e=0;e<ot;++e){var r=at[e];if(r){if(r.bindCount>0)continue;r.unit=-1}at[e]=this,t=e;break}t>=ot&&w.raise("insufficient number of texture units"),u.profile&&s.maxTextureUnits<t+1&&(s.maxTextureUnits=t+1),this.unit=t,n.activeTexture(33984+t),n.bindTexture(this.target,this.texture)}return t},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Et(this)}}),u.profile&&(s.getTotalTextureSize=function(){var t=0;return Object.keys(it).forEach((function(e){t+=it[e].stats.size})),t}),{create2D:function(t,e){var r=new ht(3553);function o(t,e){var n=r.texInfo;q.call(n);var a=X();return"number"==typeof t?U(a,0|t,"number"==typeof e?0|e:0|t):t?(w.type(t,"object","invalid arguments to regl.texture"),K(n,t),V(a,t)):U(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,A(r,a),w.texture2D(n,a,i),r.internalformat=a.internalformat,o.width=a.width,o.height=a.height,ft(r),W(a,3553),Z(n,3553),dt(),H(a),u.profile&&(r.stats.size=St(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),o.format=b[r.internalformat],o.type=x[r.type],o.mag=_[n.magFilter],o.min=S[n.minFilter],o.wrapS=E[n.wrapS],o.wrapT=E[n.wrapT],o}return it[r.id]=r,s.textureCount++,o(t,e),o.subimage=function(t,e,n,i){w(!!t,"must specify image data");var a=0|e,s=0|n,u=0|i,c=G();return A(c,r),c.width=0,c.height=0,T(c,t),c.width=c.width||(r.width>>u)-a,c.height=c.height||(r.height>>u)-s,w(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),w(a>=0&&s>=0&&a+c.width<=r.width&&s+c.height<=r.height,"texture.subimage write out of bounds"),w(r.mipmask&1<<u,"missing mipmap data"),w(c.data||c.element||c.needsCopy,"missing image data"),ft(r),N(c,3553,a,s,u),dt(),F(c),o},o.resize=function(t,e){var i=0|t,a=0|e||i;if(i===r.width&&a===r.height)return o;o.width=r.width=i,o.height=r.height=a,ft(r);for(var s=0;r.mipmask>>s;++s){var c=i>>s,l=a>>s;if(!c||!l)break;n.texImage2D(3553,s,r.format,c,l,0,r.format,r.type,null)}return dt(),u.profile&&(r.stats.size=St(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,u.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(t,e,r,o,a,c){var l=new ht(34067);it[l.id]=l,s.cubeCount++;var h=new Array(6);function f(t,e,n,r,o,a){var s,c=l.texInfo;for(q.call(c),s=0;s<6;++s)h[s]=X();if("number"!=typeof t&&t)if("object"==typeof t)if(e)V(h[0],t),V(h[1],e),V(h[2],n),V(h[3],r),V(h[4],o),V(h[5],a);else if(K(c,t),k(l,t),"faces"in t){var d=t.faces;for(w(Array.isArray(d)&&6===d.length,"cube faces must be a length 6 array"),s=0;s<6;++s)w("object"==typeof d[s]&&!!d[s],"invalid input for cube map face"),A(h[s],l),V(h[s],d[s])}else for(s=0;s<6;++s)V(h[s],t);else w.raise("invalid arguments to cube map");else{var p=0|t||1;for(s=0;s<6;++s)U(h[s],p,p)}for(A(l,h[0]),i.npotTextureCube||w(tt(l.width)&&tt(l.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?l.mipmask=(h[0].width<<1)-1:l.mipmask=h[0].mipmask,w.textureCube(l,c,h,i),l.internalformat=h[0].internalformat,f.width=h[0].width,f.height=h[0].height,ft(l),s=0;s<6;++s)W(h[s],34069+s);for(Z(c,34067),dt(),u.profile&&(l.stats.size=St(l.internalformat,l.type,f.width,f.height,c.genMipmaps,!0)),f.format=b[l.internalformat],f.type=x[l.type],f.mag=_[c.magFilter],f.min=S[c.minFilter],f.wrapS=E[c.wrapS],f.wrapT=E[c.wrapT],s=0;s<6;++s)H(h[s]);return f}return f(t,e,r,o,a,c),f.subimage=function(t,e,n,r,i){w(!!e,"must specify image data"),w("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,s=0|i,u=G();return A(u,l),u.width=0,u.height=0,T(u,e),u.width=u.width||(l.width>>s)-o,u.height=u.height||(l.height>>s)-a,w(l.type===u.type&&l.format===u.format&&l.internalformat===u.internalformat,"incompatible format for texture.subimage"),w(o>=0&&a>=0&&o+u.width<=l.width&&a+u.height<=l.height,"texture.subimage write out of bounds"),w(l.mipmask&1<<s,"missing mipmap data"),w(u.data||u.element||u.needsCopy,"missing image data"),ft(l),N(u,34069+t,o,a,s),dt(),F(u),f},f.resize=function(t){var e=0|t;if(e!==l.width){f.width=l.width=e,f.height=l.height=e,ft(l);for(var r=0;r<6;++r)for(var i=0;l.mipmask>>i;++i)n.texImage2D(34069+r,i,l.format,e>>i,e>>i,0,l.format,l.type,null);return dt(),u.profile&&(l.stats.size=St(l.internalformat,l.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=l,u.profile&&(f.stats=l.stats),f.destroy=function(){l.decRef()},f},clear:function(){for(var t=0;t<ot;++t)n.activeTexture(33984+t),n.bindTexture(3553,null),at[t]=null;R(it).forEach(Et),s.cubeCount=0,s.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<ot;++t){var e=at[t];e&&(e.bindCount=0,e.unit=-1,at[t]=null)}R(it).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(3553===t.target)n.texImage2D(3553,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(34069+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);Z(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<ot;++t){var e=at[t];e&&(e.bindCount=0,e.unit=-1,at[t]=null),n.activeTexture(33984+t),n.bindTexture(3553,null),n.bindTexture(34067,null)}}}}dt[32854]=2,dt[32855]=2,dt[36194]=2,dt[34041]=4,dt[33776]=.5,dt[33777]=.5,dt[33778]=1,dt[33779]=1,dt[35986]=.5,dt[35987]=1,dt[34798]=1,dt[35840]=.5,dt[35841]=.25,dt[35842]=.5,dt[35843]=.25,dt[36196]=.5;var Mt=[];function Ot(t,e,n){return Mt[t]*e*n}Mt[32854]=2,Mt[32855]=2,Mt[36194]=2,Mt[33189]=2,Mt[36168]=1,Mt[34041]=4,Mt[35907]=4,Mt[34836]=16,Mt[34842]=8,Mt[34843]=6;var At=[6407,6408],kt=[];kt[6408]=4,kt[6407]=3;var Ct=[];Ct[5121]=1,Ct[5126]=4,Ct[36193]=2;var It=[32854,32855,36194,35907,34842,34843,34836],Tt={};function Pt(){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=5126,this.offset=0,this.stride=0,this.divisor=0}function Nt(e,n,r,i,o,a,s){function u(u){var c;null===n.next?(w(o.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=5121):(w(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(w(5121===c||5126===c,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),5126===c&&w(s.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):w(5121===c,"Reading from a framebuffer is only allowed for the type 'uint8'"));var l=0,h=0,f=i.framebufferWidth,d=i.framebufferHeight,p=null;t(u)?p=u:u&&(w.type(u,"object","invalid arguments to regl.read()"),l=0|u.x,h=0|u.y,w(l>=0&&l<i.framebufferWidth,"invalid x offset for regl.read"),w(h>=0&&h<i.framebufferHeight,"invalid y offset for regl.read"),f=0|(u.width||i.framebufferWidth-l),d=0|(u.height||i.framebufferHeight-h),p=u.data||null),p&&(5121===c?w(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):5126===c&&w(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),w(f>0&&f+l<=i.framebufferWidth,"invalid width for read pixels"),w(d>0&&d+h<=i.framebufferHeight,"invalid height for read pixels"),r();var g=f*d*4;return p||(5121===c?p=new Uint8Array(g):5126===c&&(p=p||new Float32Array(g))),w.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),w(p.byteLength>=g,"data buffer for regl.read() too small"),e.pixelStorei(3333,4),e.readPixels(l,h,f,d,6408,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=u(t)})),e}(t):u(t)}}function jt(t){return Array.prototype.slice.call(t)}function Dt(t){return jt(t).join("")}Tt[36053]="complete",Tt[36054]="incomplete attachment",Tt[36057]="incomplete dimensions",Tt[36055]="incomplete, missing attachment",Tt[36061]="unsupported";var Lt="xyzw".split(""),Rt="profile",Bt="framebuffer",Gt="vert",Ft="frag",zt="elements",Ut="primitive",Vt="count",Wt="offset",Yt="instances",Xt="vao",Ht=Bt+"Width",qt=Bt+"Height",Kt=["blend.func","blend.equation","stencil.func","stencil.opFront","stencil.opBack","sample.coverage","viewport","scissor.box","polygonOffset.offset"],Zt={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},$t=["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"],Qt={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},Jt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},te={frag:35632,vert:35633},ee={cw:2304,ccw:2305};function ne(e){return Array.isArray(e)||t(e)||L(e)}function re(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t<e?-1:1}))}function ie(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function oe(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function ae(t){return new ie(!1,!1,!1,t)}function se(t,e){var n=t.type;if(0===n){var r=t.data.length;return new ie(!0,r>=1,r>=2,e)}if(4===n){var i=t.data;return new ie(i.thisDep,i.contextDep,i.propDep,e)}if(5===n)return new ie(!1,!1,!1,e);if(6===n){for(var o=!1,a=!1,s=!1,u=0;u<t.data.length;++u){var c=t.data[u];if(1===c.type)s=!0;else if(2===c.type)a=!0;else if(3===c.type)o=!0;else if(0===c.type){o=!0;var l=c.data;l>=1&&(a=!0),l>=2&&(s=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,s=s||c.data.propDep)}return new ie(o,a,s,e)}return new ie(3===n,2===n,1===n,e)}var ue=new ie(!1,!1,!1,(function(){}));function ce(t,n,r,i,o,a,s,u,c,l,h,f,d,p,g){var v=l.Record,m={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(m.min=32775,m.max=32776);var y=r.angle_instanced_arrays,b=r.webgl_draw_buffers,x={dirty:!0,profile:g.profile},_={},S=[],E={},M={};function A(t){return t.replace(".","_")}function k(t,e,n){var r=A(t);S.push(t),_[r]=x[r]=!!n,E[r]=e}function C(t,e,n){var r=A(t);S.push(t),Array.isArray(n)?(x[r]=n.slice(),_[r]=n.slice()):x[r]=_[r]=n,M[r]=e}k("dither",3024),k("blend.enable",3042),C("blend.color","blendColor",[0,0,0,0]),C("blend.equation","blendEquationSeparate",[32774,32774]),C("blend.func","blendFuncSeparate",[1,0,1,0]),k("depth.enable",2929,!0),C("depth.func","depthFunc",513),C("depth.range","depthRange",[0,1]),C("depth.mask","depthMask",!0),C("colorMask","colorMask",[!0,!0,!0,!0]),k("cull.enable",2884),C("cull.face","cullFace",1029),C("frontFace","frontFace",2305),C("lineWidth","lineWidth",1),k("polygonOffset.enable",32823),C("polygonOffset.offset","polygonOffset",[0,0]),k("sample.alpha",32926),k("sample.enable",32928),C("sample.coverage","sampleCoverage",[1,!1]),k("stencil.enable",2960),C("stencil.mask","stencilMask",-1),C("stencil.func","stencilFunc",[519,0,-1]),C("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),C("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),k("scissor.enable",3089),C("scissor.box","scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),C("viewport","viewport",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var I={gl:t,context:d,strings:n,next:_,current:x,draw:f,elements:a,buffer:o,shader:h,attributes:l.state,vao:l,uniforms:c,framebuffer:u,extensions:r,timer:p,isBufferArgs:ne},T={primTypes:K,compareFuncs:Qt,blendFuncs:Zt,blendEquations:m,stencilOps:Jt,glTypes:z,orientationType:ee};w.optional((function(){I.isArrayLike=J})),b&&(T.backBuffer=[1029],T.drawBuffer=P(i.maxDrawbuffers,(function(t){return 0===t?[0]:P(t,(function(t){return 36064+t}))})));var N=0;function j(){var t=function(){var t=0,n=[],r=[];function i(){var n=[],r=[];return e((function(){n.push.apply(n,jt(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,jt(arguments)),n.push(";")),e},toString:function(){return Dt([r.length>0?"var "+r.join(",")+";":"",Dt(n)])}})}function o(){var t=i(),n=i(),r=t.toString,o=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,jt(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()+o()}})}var a=i(),s={};return{global:a,link:function(e){for(var i=0;i<r.length;++i)if(r[i]===e)return n[i];var o="g"+t++;return n.push(o),r.push(e),o},block:i,proc:function(t,n){var r=[];function i(){var t="a"+r.length;return r.push(t),t}n=n||0;for(var a=0;a<n;++a)i();var u=o(),c=u.toString;return s[t]=e(u,{arg:i,toString:function(){return Dt(["function(",r.join(),"){",c(),"}"])}})},scope:o,cond:function(){var t=Dt(arguments),n=o(),r=o(),i=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,jt(arguments)),this},else:function(){return r.apply(r,jt(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),Dt(["if(",t,"){",i(),"}",e])}})},compile:function(){var t=['"use strict";',a,"return {"];Object.keys(s).forEach((function(e){t.push('"',e,'":',s[e].toString(),",")})),t.push("}");var e=Dt(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(e)).apply(null,r)}}}(),r=t.link,i=t.global;t.id=N++,t.batchId="0";var o=r(I),a=t.shared={props:"a0"};Object.keys(I).forEach((function(t){a[t]=i.def(o,".",t)})),w.optional((function(){t.CHECK=r(w),t.commandStr=w.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},T.invalidBlendCombinations=$t}));var s=t.next={},u=t.current={};Object.keys(M).forEach((function(t){Array.isArray(x[t])&&(s[t]=i.def(a.next,".",t),u[t]=i.def(a.current,".",t))}));var c=t.constants={};Object.keys(T).forEach((function(t){c[t]=i.def(JSON.stringify(T[t]))})),t.invoke=function(e,n){switch(n.type){case 0:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return e.def(a.props,n.data);case 2:return e.def(a.context,n.data);case 3:return e.def("this",n.data);case 4:return n.data.append(t,e),n.data.ref;case 5:return n.data.toString();case 6:return n.data.map((function(n){return t.invoke(e,n)}))}},t.attribCache={};var h={};return t.scopeAttrib=function(t){var e=n.id(t);if(e in h)return h[e];var i=l.scope[e];return i||(i=l.scope[e]=new v),h[e]=r(i)},t}function D(t,e,s,c,f){var d=t.static,p=t.dynamic;w.optional((function(){var t=[Bt,Gt,Ft,zt,Ut,Wt,Vt,Yt,Rt,Xt].concat(S);function e(e){Object.keys(e).forEach((function(e){w.command(t.indexOf(e)>=0,'unknown parameter "'+e+'"',f.commandStr)}))}e(d),e(p)}));var g=function(t,e){var n=t.static;if("string"==typeof n[Ft]&&"string"==typeof n[Gt]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a<i.length;++a)w("number"==typeof r[i[a]],"must specify all vertex attribute locations when using vaos"),o.push([0|r[i[a]],i[a]]);return o}}return null}(t,e),b=function(t,e){var n=t.static,r=t.dynamic;if(Bt in n){var i=n[Bt];return i?(i=u.getFramebuffer(i),w.command(i,"invalid framebuffer object"),ae((function(t,e){var n=t.link(i),r=t.shared;e.set(r.framebuffer,".next",n);var o=r.context;return e.set(o,"."+Ht,n+".width"),e.set(o,"."+qt,n+".height"),n}))):ae((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+Ht,r+".drawingBufferWidth"),e.set(r,"."+qt,r+".drawingBufferHeight"),"null"}))}if(Bt in r){var o=r[Bt];return se(o,(function(t,e){var n=t.invoke(e,o),r=t.shared,i=r.framebuffer,a=e.def(i,".getFramebuffer(",n,")");w.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(i,".next",a);var s=r.context;return e.set(s,"."+Ht,a+"?"+a+".width:"+s+".drawingBufferWidth"),e.set(s,"."+qt,a+"?"+a+".height:"+s+".drawingBufferHeight"),a}))}return null}(t),x=function(t,e,n){var r=t.static,i=t.dynamic;function o(t){if(t in r){var o=r[t];w.commandType(o,"object","invalid "+t,n.commandStr);var a,s,u=!0,c=0|o.x,l=0|o.y;return"width"in o?(a=0|o.width,w.command(a>=0,"invalid "+t,n.commandStr)):u=!1,"height"in o?(s=0|o.height,w.command(s>=0,"invalid "+t,n.commandStr)):u=!1,new ie(!u&&e&&e.thisDep,!u&&e&&e.contextDep,!u&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",Ht,"-",c));var i=s;return"height"in o||(i=e.def(n,".",qt,"-",l)),[c,l,r,i]}))}if(t in i){var h=i[t],f=se(h,(function(e,n){var r=e.invoke(n,h);w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}));var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),s=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",Ht,"-",o,")"),u=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",qt,"-",a,")");return w.optional((function(){e.assert(n,s+">=0&&"+u+">=0","invalid "+t)})),[o,a,s,u]}));return e&&(f.thisDep=f.thisDep||e.thisDep,f.contextDep=f.contextDep||e.contextDep,f.propDep=f.propDep||e.propDep),f}return e?new ie(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",Ht),e.def(n,".",qt)]})):null}var a=o("viewport");if(a){var s=a;a=new ie(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=s.append(t,e),r=t.shared.context;return e.set(r,".viewportWidth",n[2]),e.set(r,".viewportHeight",n[3]),n}))}return{viewport:a,scissor_box:o("scissor.box")}}(t,b,f),_=function(t,e){var n=t.static,r=t.dynamic,i=function(){if(zt in n){var t=n[zt];ne(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),w.command(t,"invalid elements",e.commandStr));var i=ae((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return i.value=t,i}if(zt in r){var o=r[zt];return se(o,(function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,a=t.invoke(e,o),s=e.def("null"),u=e.def(r,"(",a,")"),c=t.cond(u).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return w.optional((function(){t.assert(c.else,"!"+a+"||"+s,"invalid elements")})),e.entry(c),e.exit(t.cond(u).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s}))}return null}();function o(t,o){if(t in n){var a=0|n[t];return w.command(!o||a>=0,"invalid "+t,e.commandStr),ae((function(t,e){return o&&(t.OFFSET=a),a}))}if(t in r){var s=r[t];return se(s,(function(e,n){var r=e.invoke(n,s);return o&&(e.OFFSET=r,w.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return o&&i?ae((function(t,e){return t.OFFSET="0",0})):null}var s=o(Wt,!0);return{elements:i,primitive:function(){if(Ut in n){var t=n[Ut];return w.commandParameter(t,K,"invalid primitve",e.commandStr),ae((function(e,n){return K[t]}))}if(Ut in r){var o=r[Ut];return se(o,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,o);return w.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(K))})),e.def(n,"[",r,"]")}))}return i?oe(i)?i.value?ae((function(t,e){return e.def(t.ELEMENTS,".primType")})):ae((function(){return 4})):new ie(i.thisDep,i.contextDep,i.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(Vt in n){var t=0|n[Vt];return w.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),ae((function(){return t}))}if(Vt in r){var o=r[Vt];return se(o,(function(t,e){var n=t.invoke(e,o);return w.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(oe(i)){if(i)return s?new ie(s.thisDep,s.contextDep,s.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return w.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):ae((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var a=ae((function(){return-1}));return w.optional((function(){a.MISSING=!0})),a}var u=new ie(i.thisDep||s.thisDep,i.contextDep||s.contextDep,i.propDep||s.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 w.optional((function(){u.DYNAMIC=!0})),u}return null}(),instances:o(Yt,!1),offset:s}}(t,f),E=function(t,e){var n=t.static,r=t.dynamic,o={};return S.forEach((function(t){var a=A(t);function s(e,i){if(t in n){var s=e(n[t]);o[a]=ae((function(){return s}))}else if(t in r){var u=r[t];o[a]=se(u,(function(t,e){return i(t,e,t.invoke(e,u))}))}}switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return s((function(n){return w.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return w.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case"depth.func":return s((function(n){return w.commandParameter(n,Qt,"invalid "+t,e.commandStr),Qt[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return w.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(Qt))})),n.def(i,"[",r,"]")}));case"depth.range":return s((function(t){return w.command(J(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 w.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"blend.func":return s((function(t){w.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return w.commandParameter(n,Zt,a+".srcRGB",e.commandStr),w.commandParameter(r,Zt,a+".srcAlpha",e.commandStr),w.commandParameter(i,Zt,a+".dstRGB",e.commandStr),w.commandParameter(o,Zt,a+".dstAlpha",e.commandStr),w.command(-1===$t.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Zt[n],Zt[i],Zt[r],Zt[o]]}),(function(e,n,r){var i=e.constants.blendFuncs;function o(o,a){var s=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return w.optional((function(){e.assert(n,s+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Zt))})),s}w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),s=o("dst","RGB");w.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var u=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[u,n.def(i,"[",s,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case"blend.equation":return s((function(n){return"string"==typeof n?(w.commandParameter(n,m,"invalid "+t,e.commandStr),[m[n],m[n]]):"object"==typeof n?(w.commandParameter(n.rgb,m,t+".rgb",e.commandStr),w.commandParameter(n.alpha,m,t+".alpha",e.commandStr),[m[n.rgb],m[n.alpha]]):void w.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),s=e.cond("typeof ",r,'==="string"');return w.optional((function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(m))}n(s.then,t,r),e.assert(s.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(s.else,t+".rgb",r+".rgb"),n(s.else,t+".alpha",r+".alpha")})),s.then(o,"=",a,"=",i,"[",r,"];"),s.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(s),[o,a]}));case"blend.color":return s((function(t){return w.command(J(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),P(4,(function(e){return+t[e]}))}),(function(t,e,n){return w.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),P(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case"stencil.mask":return s((function(t){return w.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return w.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case"stencil.func":return s((function(n){w.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return w.commandParameter(r,Qt,t+".cmp",e.commandStr),w.commandType(i,"number",t+".ref",e.commandStr),w.commandType(o,"number",t+".mask",e.commandStr),[Qt[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return w.optional((function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",7680),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return s((function(n){w.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return w.commandParameter(r,Jt,t+".fail",e.commandStr),w.commandParameter(i,Jt,t+".zfail",e.commandStr),w.commandParameter(o,Jt,t+".zpass",e.commandStr),["stencil.opBack"===t?1029:1028,Jt[r],Jt[i],Jt[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return w.optional((function(){e.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(Jt))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",7680)}return w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),["stencil.opBack"===t?1029:1028,o("fail"),o("zfail"),o("zpass")]}));case"polygonOffset.offset":return s((function(t){w.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return w.commandType(n,"number",a+".factor",e.commandStr),w.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case"cull.face":return s((function(t){var n=0;return"front"===t?n=1028:"back"===t&&(n=1029),w.command(!!n,a,e.commandStr),n}),(function(t,e,n){return w.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',1028,":",1029)}));case"lineWidth":return s((function(t){return w.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return w.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case"frontFace":return s((function(t){return w.commandParameter(t,ee,a,e.commandStr),ee[t]}),(function(t,e,n){return w.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?2304:2305')}));case"colorMask":return s((function(t){return w.command(J(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return w.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),P(4,(function(t){return"!!"+n+"["+t+"]"}))}));case"sample.coverage":return s((function(t){w.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return w.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 w.optional((function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),o}(t,f),M=function(t,e,r){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=n.id(i[t]);w.optional((function(){h.shader(te[t],e,w.guessCommand())}));var r=ae((function(){return e}));return r.id=e,r}if(t in o){var a=o[t];return se(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return w.optional((function(){n(e.shared.shader,".shader(",te[t],",",i,",",e.command,");")})),i}))}return null}var s,u=a(Ft),c=a(Gt),l=null;return oe(u)&&oe(c)?(l=h.program(c.id,u.id,null,r),s=ae((function(t,e){return t.link(l)}))):s=new ie(u&&u.thisDep||c&&c.thisDep,u&&u.contextDep||c&&c.contextDep,u&&u.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=u?u.append(t,e):e.def(r,".",Ft);var i=r+".program("+(c?c.append(t,e):e.def(r,".",Gt))+","+n;return w.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:u,vert:c,progVar:s,program:l}}(t,0,g);function O(t){var e=x[t];e&&(E[t]=e)}O("viewport"),O(A("scissor.box"));var k=Object.keys(E).length>0,C={framebuffer:b,draw:_,shader:M,state:E,dirty:k,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(C.profile=function(t){var e,n=t.static,r=t.dynamic;if(Rt in n){var i=!!n[Rt];(e=ae((function(t,e){return i}))).enable=i}else if(Rt in r){var o=r[Rt];e=se(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),C.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach((function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=ae((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=ae((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(w.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=ae((function(t){return t.link(o.color[0])}))):w.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else J(o)?r=ae((function(e){return e.global.def("[",P(o.length,(function(n){return w.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):w.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=o,i[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];i[t]=se(e,(function(t,n){return t.invoke(n,e)}))})),i}(s,f),C.drawVAO=C.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(Xt in n){var i=n[Xt];return null!==i&&null===l.getVAO(i)&&(i=l.createVAO(i)),ae((function(t){return t.link(l.getVAO(i))}))}if(Xt in r){var o=r[Xt];return se(o,(function(t,e){var n=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!C.drawVAO&&M.program&&!g&&r.angle_instanced_arrays){var I=!0,T=M.program.attributes.map((function(t){var n=e.static[t];return I=I&&!!n,n}));if(I&&T.length>0){var N=l.getVAO(l.createVAO(T));C.drawVAO=new ie(null,null,null,(function(t,e){return t.link(N)})),C.useVAO=!0}}return g?C.useVAO=!0:C.attributes=function(t,e){var r=t.static,i=t.dynamic,a={};return Object.keys(r).forEach((function(t){var i=r[t],s=n.id(t),u=new v;if(ne(i))u.state=1,u.buffer=o.getBuffer(o.create(i,34962,!1,!0)),u.type=0;else{var c=o.getBuffer(i);if(c)u.state=1,u.buffer=c,u.type=0;else if(w.command("object"==typeof i&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var l=i.constant;u.buffer="null",u.state=2,"number"==typeof l?u.x=l:(w.command(J(l)&&l.length>0&&l.length<=4,"invalid constant for attribute "+t,e.commandStr),Lt.forEach((function(t,e){e<l.length&&(u[t]=l[e])})))}else{c=ne(i.buffer)?o.getBuffer(o.create(i.buffer,34962,!1,!0)):o.getBuffer(i.buffer),w.command(!!c,'missing buffer for attribute "'+t+'"',e.commandStr);var h=0|i.offset;w.command(h>=0,'invalid offset for attribute "'+t+'"',e.commandStr);var f=0|i.stride;w.command(f>=0&&f<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var d=0|i.size;w.command(!("size"in i)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var p=!!i.normalized,g=0;"type"in i&&(w.commandParameter(i.type,z,"invalid type for attribute "+t,e.commandStr),g=z[i.type]);var m=0|i.divisor;"divisor"in i&&(w.command(0===m||y,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),w.command(m>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),w.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){w.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),u.buffer=c,u.state=1,u.size=d,u.normalized=p,u.type=g||c.dtype,u.offset=h,u.stride=f,u.divisor=m}}a[t]=ae((function(t,e){var n=t.attribCache;if(s in n)return n[s];var r={isStream:!1};return Object.keys(u).forEach((function(t){r[t]=u[t]})),u.buffer&&(r.buffer=t.link(u.buffer),r.type=r.type||r.buffer+".dtype"),n[s]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];a[t]=se(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,s=o.isBufferArgs,u=o.buffer;w.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+s+"("+i+")||"+u+".getBuffer("+i+")||"+u+".getBuffer("+i+".buffer)||"+s+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')}));var c={isStream:r.def(!1)},l=new v;l.state=1,Object.keys(l).forEach((function(t){c[t]=r.def(""+l[t])}));var h=c.buffer,f=c.type;function d(t){r(c[t],"=",i,".",t,"|0;")}return r("if(",s,"(",i,")){",c.isStream,"=true;",h,"=",u,".createStream(",34962,",",i,");",f,"=",h,".dtype;","}else{",h,"=",u,".getBuffer(",i,");","if(",h,"){",f,"=",h,".dtype;",'}else if("constant" in ',i,"){",c.state,"=",2,";","if(typeof "+i+'.constant === "number"){',c[Lt[0]],"=",i,".constant;",Lt.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",Lt.map((function(t,e){return c[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",h,"=",u,".createStream(",34962,",",i,".buffer);","}else{",h,"=",u,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",h,".dtype;",c.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",c.isStream,"){",u,".destroyStream(",h,");","}"),c}))})),a}(e,f),C.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=ae((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]=se(e,(function(t,n){return t.invoke(n,e)}))})),r}(c),C}function L(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach((function(o){e.save(r,"."+o);var a=n[o].append(t,e);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),e(i)}function R(t,e,n,r){var i,o=t.shared,a=o.gl,s=o.framebuffer;b&&(i=e.def(o.extensions,".webgl_draw_buffers"));var u,c=t.constants,l=c.drawBuffer,h=c.backBuffer;u=n?n.append(t,e):e.def(s,".next"),r||e("if(",u,"!==",s,".cur){"),e("if(",u,"){",a,".bindFramebuffer(",36160,",",u,".framebuffer);"),b&&e(i,".drawBuffersWEBGL(",l,"[",u,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),b&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",u,";"),r||e("}")}function B(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,s=r.current,u=r.next,c=t.cond(s,".dirty");S.forEach((function(e){var r,l,h=A(e);if(!(h in n.state))if(h in a){r=a[h],l=o[h];var f=P(x[h].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(f.map((function(t,e){return t+"!=="+l+"["+e+"]"})).join("||")).then(i,".",M[h],"(",f,");",f.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(u,".",h);var d=t.cond(r,"!==",s,".",h);c(d),h in E?d(t.cond(r).then(i,".enable(",E[h],");").else(i,".disable(",E[h],");"),s,".",h,"=",r,";"):d(i,".",M[h],"(",r,");",s,".",h,"=",r,";")}})),0===Object.keys(n.state).length&&c(s,".dirty=false;"),e(c)}function G(t,e,n,r){var i=t.shared,o=t.current,a=i.current,s=i.gl;re(Object.keys(n)).forEach((function(i){var u=n[i];if(!r||r(u)){var c=u.append(t,e);if(E[i]){var l=E[i];oe(u)?e(s,c?".enable(":".disable(",l,");"):e(t.cond(c).then(s,".enable(",l,");").else(s,".disable(",l,");")),e(a,".",i,"=",c,";")}else if(J(c)){var h=o[i];e(s,".",M[i],"(",c,");",c.map((function(t,e){return h+"["+e+"]="+t})).join(";"),";")}else e(s,".",M[i],"(",c,");",a,".",i,"=",c,";")}}))}function F(t,e){y&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function U(t,e,n,r,i){var o,a,s,u=t.shared,c=t.stats,l=u.current,h=u.timer,f=n.profile;function d(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function g(t){t(o=e.def(),"=",d(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),p&&(r?t(a=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",c,");"))}function v(t){t(c,".cpuTime+=",d(),"-",o,";"),p&&(r?t(h,".pushScopeStats(",a,",",h,".getNumPendingQueries(),",c,");"):t(h,".endQuery();"))}function m(t){var n=e.def(l,".profile");e(l,".profile=",t,";"),e.exit(l,".profile=",n,";")}if(f){if(oe(f))return void(f.enable?(g(e),v(e.exit),m("true")):m("false"));m(s=f.append(t,e))}else s=e.def(l,".profile");var y=t.block();g(y),e("if(",s,"){",y,"}");var b=t.block();v(b),e.exit("if(",s,"){",b,"}")}function V(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,s=r.name,u=n.attributes[s];if(u){if(!i(u))return;a=u.append(t,e)}else{if(!i(ue))return;var c=t.scopeAttrib(s);w.optional((function(){t.assert(e,c+".state","missing attribute "+s)})),a={},Object.keys(new v).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,i){var a=o.gl,s=e.def(n,".location"),u=e.def(o.attributes,"[",s,"]"),c=i.state,l=i.buffer,h=[i.x,i.y,i.z,i.w],f=["buffer","normalized","offset","stride"];function d(){e("if(!",u,".buffer){",a,".enableVertexAttribArray(",s,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",u,".type!==",o,"||",u,".size!==",n,"||",f.map((function(t){return u+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",34962,",",l,".buffer);",a,".vertexAttribPointer(",[s,n,o,i.normalized,i.stride,i.offset],");",u,".type=",o,";",u,".size=",n,";",f.map((function(t){return u+"."+t+"="+i[t]+";"})).join(""),"}"),y){var c=i.divisor;e("if(",u,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",u,".divisor=",c,";}")}}function p(){e("if(",u,".buffer){",a,".disableVertexAttribArray(",s,");",u,".buffer=null;","}if(",Lt.map((function(t,e){return u+"."+t+"!=="+h[e]})).join("||"),"){",a,".vertexAttrib4f(",s,",",h,");",Lt.map((function(t,e){return u+"."+t+"="+h[e]+";"})).join(""),"}")}1===c?d():2===c?p():(e("if(",c,"===",1,"){"),d(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(r.info.type),a)}))}function W(t,e,r,i,o){for(var a,s=t.shared,u=s.gl,c=0;c<i.length;++c){var l,h=i[c],f=h.name,d=h.info.type,p=r.uniforms[f],g=t.link(h)+".location";if(p){if(!o(p))continue;if(oe(p)){var v=p.value;if(w.command(null!=v,'missing uniform "'+f+'"',t.commandStr),35678===d||35680===d){w.command("function"==typeof v&&(35678===d&&("texture2d"===v._reglType||"framebuffer"===v._reglType)||35680===d&&("textureCube"===v._reglType||"framebufferCube"===v._reglType)),"invalid texture for uniform "+f,t.commandStr);var m=t.link(v._texture||v.color[0]._texture);e(u,".uniform1i(",g,",",m+".bind());"),e.exit(m,".unbind();")}else if(35674===d||35675===d||35676===d){w.optional((function(){w.command(J(v),"invalid matrix for uniform "+f,t.commandStr),w.command(35674===d&&4===v.length||35675===d&&9===v.length||35676===d&&16===v.length,"invalid length for matrix uniform "+f,t.commandStr)}));var y=t.global.def("new Float32Array(["+Array.prototype.slice.call(v)+"])"),b=2;35675===d?b=3:35676===d&&(b=4),e(u,".uniformMatrix",b,"fv(",g,",false,",y,");")}else{switch(d){case 5126:w.commandType(v,"number","uniform "+f,t.commandStr),a="1f";break;case 35664:w.command(J(v)&&2===v.length,"uniform "+f,t.commandStr),a="2f";break;case 35665:w.command(J(v)&&3===v.length,"uniform "+f,t.commandStr),a="3f";break;case 35666:w.command(J(v)&&4===v.length,"uniform "+f,t.commandStr),a="4f";break;case 35670:w.commandType(v,"boolean","uniform "+f,t.commandStr),a="1i";break;case 5124:w.commandType(v,"number","uniform "+f,t.commandStr),a="1i";break;case 35671:case 35667:w.command(J(v)&&2===v.length,"uniform "+f,t.commandStr),a="2i";break;case 35672:case 35668:w.command(J(v)&&3===v.length,"uniform "+f,t.commandStr),a="3i";break;case 35673:case 35669:w.command(J(v)&&4===v.length,"uniform "+f,t.commandStr),a="4i"}e(u,".uniform",a,"(",g,",",J(v)?Array.prototype.slice.call(v):v,");")}continue}l=p.append(t,e)}else{if(!o(ue))continue;l=e.def(s.uniforms,"[",n.id(f),"]")}35678===d?(w(!Array.isArray(l),"must specify a scalar prop for textures"),e("if(",l,"&&",l,'._reglType==="framebuffer"){',l,"=",l,".color[0];","}")):35680===d&&(w(!Array.isArray(l),"must specify a scalar prop for cube maps"),e("if(",l,"&&",l,'._reglType==="framebufferCube"){',l,"=",l,".color[0];","}")),w.optional((function(){function n(n,r){t.assert(e,n,'bad data or missing for uniform "'+f+'". '+r)}function r(t){w(!Array.isArray(l),"must not specify an array type for uniform"),n("typeof "+l+'==="'+t+'"',"invalid type, expected "+t)}function i(e,r){Array.isArray(l)?w(l.length===e,"must have length "+e):n(s.isArrayLike+"("+l+")&&"+l+".length==="+e,"invalid vector, should have length "+e,t.commandStr)}function o(e){w(!Array.isArray(l),"must not specify a value type"),n("typeof "+l+'==="function"&&'+l+'._reglType==="texture'+(3553===e?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(d){case 5124:r("number");break;case 35667:i(2);break;case 35668:i(3);break;case 35669:i(4);break;case 5126:r("number");break;case 35664:i(2);break;case 35665:i(3);break;case 35666:i(4);break;case 35670:r("boolean");break;case 35671:i(2);break;case 35672:i(3);break;case 35673:case 35674:i(4);break;case 35675:i(9);break;case 35676:i(16);break;case 35678:o(3553);break;case 35680:o(34067)}}));var x=1;switch(d){case 35678:case 35680:var _=e.def(l,"._texture");e(u,".uniform1i(",g,",",_,".bind());"),e.exit(_,".unbind();");continue;case 5124:case 35670:a="1i";break;case 35667:case 35671:a="2i",x=2;break;case 35668:case 35672:a="3i",x=3;break;case 35669:case 35673:a="4i",x=4;break;case 5126:a="1f";break;case 35664:a="2f",x=2;break;case 35665:a="3f",x=3;break;case 35666:a="4f",x=4;break;case 35674:a="Matrix2fv";break;case 35675:a="Matrix3fv";break;case 35676:a="Matrix4fv"}if(e(u,".uniform",a,"(",g,","),"M"===a.charAt(0)){var S=Math.pow(d-35674+2,2),E=t.global.def("new Float32Array(",S,")");Array.isArray(l)?e("false,(",P(S,(function(t){return E+"["+t+"]="+l[t]})),",",E,")"):e("false,(Array.isArray(",l,")||",l," instanceof Float32Array)?",l,":(",P(S,(function(t){return E+"["+t+"]="+l+"["+t+"]"})),",",E,")")}else x>1?e(P(x,(function(t){return Array.isArray(l)?l[t]:l+"["+t+"]"}))):(w(!Array.isArray(l),"uniform value must not be an array"),e(l));e(");")}}function Y(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,s=r.draw,u=function(){var i,u=s.elements,c=e;return u?((u.contextDep&&r.contextDynamic||u.propDep)&&(c=n),i=u.append(t,c)):i=c.def(a,".",zt),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=s[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(a,".",i)}var l,h,f=c(Ut),d=c(Wt),p=function(){var i,o=s.count,u=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(u=n),i=o.append(t,u),w.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(u,i+">=0","missing vertex count")}))):(i=u.def(a,".",Vt),w.optional((function(){t.assert(u,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");y&&(l=c(Yt),h=t.instancing);var g=u+".type",v=s.elements&&oe(s.elements);function m(){function t(){n(h,".drawElementsInstancedANGLE(",[f,p,g,d+"<<(("+g+"-5121)>>1)",l],");")}function e(){n(h,".drawArraysInstancedANGLE(",[f,d,p,l],");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}function b(){function t(){n(o+".drawElements("+[f,p,g,d+"<<(("+g+"-5121)>>1)"]+");")}function e(){n(o+".drawArrays("+[f,d,p]+");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}y&&("number"!=typeof l||l>=0)?"string"==typeof l?(n("if(",l,">0){"),m(),n("}else if(",l,"<0){"),b(),n("}")):m():b()}function X(t,e,n,r,i){var o=j(),a=o.proc("body",i);return w.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),y&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function H(t,e,n,r){F(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);"),V(t,e,n,r.attributes,(function(){return!0}))),W(t,e,n,r.uniforms,(function(){return!0})),Y(t,e,e,n)}function q(t,e,n,r){function i(){return!0}t.batchId="a1",F(t,e),V(t,e,n,r.attributes,i),W(t,e,n,r.uniforms,i),Y(t,e,e,n)}function Z(t,e,n,r){F(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var s=t.scope(),u=t.scope();function c(t){return t.contextDep&&i||t.propDep}function l(t){return!c(t)}if(e(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",u,"}",s.exit),n.needsContext&&L(t,u,n.context),n.needsFramebuffer&&R(t,u,n.framebuffer),G(t,u,n.state,c),n.profile&&c(n.profile)&&U(t,u,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),V(t,s,n,r.attributes,l),V(t,u,n,r.attributes,c)),W(t,s,n,r.uniforms,l),W(t,u,n,r.uniforms,c),Y(t,s,u,n);else{var h=t.global.def("{}"),f=n.shader.progVar.append(t,u),d=u.def(f,".id"),p=u.def(h,"[",d,"]");u(t.shared.gl,".useProgram(",f,".program);","if(!",p,"){",p,"=",h,"[",d,"]=",t.link((function(e){return X(q,t,n,e,2)})),"(",f,");}",p,".call(this,a0[",o,"],",o,");")}}function $(t,e,n){var r=e.static[n];if(r&&function(t){if("object"==typeof t&&!J(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(O.isDynamic(t[e[n]]))return!0;return!1}}(r)){var i=t.global,o=Object.keys(r),a=!1,s=!1,u=!1,c=t.global.def("{}");o.forEach((function(e){var n=r[e];if(O.isDynamic(n)){"function"==typeof n&&(n=r[e]=O.unbox(n));var o=se(n,null);a=a||o.thisDep,u=u||o.propDep,s=s||o.contextDep}else{switch(i(c,".",e,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(t.link(n))}i(";")}})),e.dynamic[n]=new O.DynamicVariable(4,{thisDep:a,contextDep:s,propDep:u,ref:c,append:function(t,e){o.forEach((function(n){var i=r[n];if(O.isDynamic(i)){var o=t.invoke(e,i);e(c,".",n,"=",o,";")}}))}}),delete e.static[n]}}return{next:_,current:x,procs:function(){var t=j(),e=t.proc("poll"),n=t.proc("refresh"),o=t.block();e(o),n(o);var a,s=t.shared,u=s.gl,c=s.next,l=s.current;o(l,".dirty=false;"),R(t,e),R(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 h=0;h<i.maxAttributes;++h){var f=n.def(s.attributes,"[",h,"]"),d=t.cond(f,".buffer");d.then(u,".enableVertexAttribArray(",h,");",u,".bindBuffer(",34962,",",f,".buffer.buffer);",u,".vertexAttribPointer(",h,",",f,".size,",f,".type,",f,".normalized,",f,".stride,",f,".offset);").else(u,".disableVertexAttribArray(",h,");",u,".vertexAttrib4f(",h,",",f,".x,",f,".y,",f,".z,",f,".w);",f,".buffer=null;"),n(d),y&&n(a,".vertexAttribDivisorANGLE(",h,",",f,".divisor);")}return n(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(E).forEach((function(r){var i=E[r],a=o.def(c,".",r),s=t.block();s("if(",a,"){",u,".enable(",i,")}else{",u,".disable(",i,")}",l,".",r,"=",a,";"),n(s),e("if(",a,"!==",l,".",r,"){",s,"}")})),Object.keys(M).forEach((function(r){var i,a,s=M[r],h=x[r],f=t.block();if(f(u,".",s,"("),J(h)){var d=h.length;i=t.global.def(c,".",r),a=t.global.def(l,".",r),f(P(d,(function(t){return i+"["+t+"]"})),");",P(d,(function(t){return a+"["+t+"]="+i+"["+t+"];"})).join("")),e("if(",P(d,(function(t){return i+"["+t+"]!=="+a+"["+t+"]"})).join("||"),"){",f,"}")}else i=o.def(c,".",r),a=o.def(l,".",r),f(i,");",l,".",r,"=",i,";"),e("if(",i,"!==",a,"){",f,"}");n(f)})),t.compile()}(),compile:function(t,r,i,o,a){var s=j();s.stats=s.link(a),Object.keys(r.static).forEach((function(t){$(s,r,t)})),Kt.forEach((function(e){$(s,t,e)}));var u=D(t,r,i,o,s);return function(t,e){var n=t.proc("draw",1);F(t,n),L(t,n,e.context),R(t,n,e.framebuffer),B(t,n,e),G(t,n,e.state),U(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)H(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var i=t.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",t.link((function(n){return X(H,t,e,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(s,u),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(n){var o=e.shader[n];o&&r.set(i.shader,"."+n,o.append(t,r))}L(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),re(Object.keys(e.state)).forEach((function(n){var o=e.state[n].append(t,r);J(o)?o.forEach((function(e,i){r.set(t.next[n],"["+i+"]",e)})):r.set(i.next,"."+n,o)})),U(t,r,e,!0,!0),[zt,Wt,Vt,Yt,Ut].forEach((function(n){var o=e.draw[n];o&&r.set(i.draw,"."+n,""+o.append(t,r))})),Object.keys(e.uniforms).forEach((function(o){var a=e.uniforms[o].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(i.uniforms,"["+n.id(o)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var i=e.attributes[n].append(t,r),o=t.scopeAttrib(n);Object.keys(new v).forEach((function(t){r.set(o,"."+t,i[t])}))})),e.scopeVAO&&r.set(i.vao,".targetVAO",e.scopeVAO.append(t,r)),a(Gt),a(Ft),Object.keys(e.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(s,u),function(t,e){var n=t.proc("batch",2);t.batchId="0",F(t,n);var r=!1,i=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(L(t,n,e.context),i=!1);var o=e.framebuffer,a=!1;function s(t){return t.contextDep&&r||t.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||R(t,n,o)):R(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),B(t,n,e),G(t,n,e.state,(function(t){return!s(t)})),e.profile&&s(e.profile)||U(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var u=e.shader.progVar;if(u.contextDep&&r||u.propDep)Z(t,n,e,null);else{var c=u.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Z(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var l=t.global.def("{}"),h=n.def(c,".id"),f=n.def(l,"[",h,"]");n(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",l,"[",h,"]=",t.link((function(n){return X(Z,t,e,n,2)})),"(",c,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(s,u),e(s.compile(),{destroy:function(){u.shader.program.destroy()}})}}}var le=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function s(t){a.push(t)}var u=[];function c(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,u.push(r)}var l=[],h=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,o=i.length;if(0!==o){h.length=Math.max(h.length,o+1),l.length=Math.max(l.length,o+1),l[0]=0,h[0]=0;var a=0;for(t=0,n=0;n<i.length;++n){var c=i[n];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):i[t++]=c,l[n+1]=a,h[n+1]=t}for(i.length=t,t=0,n=0;n<u.length;++n){var f=u[n],d=f.startQueryIndex,p=f.endQueryIndex;f.sum+=l[p]-l[d];var g=h[d],v=h[p];v===g?(f.stats.gpuTime+=f.sum/1e6,s(f)):(f.startQueryIndex=g,f.endQueryIndex=v,u[t++]=f)}u.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){n.push.apply(n,i);for(var t=0;t<n.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(n[t]);i.length=0,n.length=0},restore:function(){i.length=0,n.length=0}}};function he(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(n){var r=T(n);if(!r)return null;var i=r.gl,o=i.getContextAttributes(),a=i.isContextLost(),s=function(t,e){var n={};function r(e){w.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var i=0;i<e.extensions.length;++i){var o=e.extensions[i];if(!r(o))return e.onDestroy(),e.onDone('"'+o+'" 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)}))}}}(i,r);if(!s)return null;var u,c,l=(u={"":0},c=[""],{id:function(t){var e=u[t];return e||(e=u[t]=c.length,c.push(t),e)},str:function(t){return c[t]}}),h={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},f=s.extensions,d=le(0,f),p=k(),g=i.drawingBufferWidth,v=i.drawingBufferHeight,m={tick:0,time:0,viewportWidth:g,viewportHeight:v,framebufferWidth:g,framebufferHeight:v,drawingBufferWidth:g,drawingBufferHeight:v,pixelRatio:r.pixelRatio},y=function(t,e){var n=1;e.ext_texture_filter_anisotropic&&(n=t.getParameter(34047));var r=1,i=1;e.webgl_draw_buffers&&(r=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){var a=t.createTexture();t.bindTexture(3553,a),t.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var s=t.createFramebuffer();if(t.bindFramebuffer(36160,s),t.framebufferTexture2D(36160,36064,3553,a,0),t.bindTexture(3553,null),36053!==t.checkFramebufferStatus(36160))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var u=D.allocType(5126,4);t.readPixels(0,0,1,1,6408,5126,u),t.getError()?o=!1:(t.deleteFramebuffer(s),t.deleteTexture(a),o=1===u[0]),D.freeType(u)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var l=t.createTexture(),h=D.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,l),t.texImage2D(34069,0,6408,3,3,0,6408,5121,h),D.freeType(h),t.bindTexture(34067,null),t.deleteTexture(l),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:i,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:o,npotTextureCube:c}}(i,f),b=function(e,n,r,i){var o=0,a={};function s(t){this.id=o++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,r.profile&&(this.stats={size:0})}s.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},s.prototype.destroy=function(){h(this)};var u=[];function c(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function l(e,n,r,i,o,a){var s,u;if(e.usage=r,Array.isArray(n)){if(e.dtype=i||5126,n.length>0)if(Array.isArray(n[0])){s=W(n);for(var l=1,h=1;h<s.length;++h)l*=s[h];e.dimension=l,c(e,u=V(n,s,e.dtype),r),a?e.persistentData=u:D.freeType(u)}else if("number"==typeof n[0]){e.dimension=o;var f=D.allocType(e.dtype,n.length);H(f,n),c(e,f,r),a?e.persistentData=f:D.freeType(f)}else t(n[0])?(e.dimension=n[0].length,e.dtype=i||X(n[0])||5126,c(e,u=V(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=u:D.freeType(u)):w.raise("invalid buffer data")}else if(t(n))e.dtype=i||X(n),e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(L(n)){s=n.shape;var d=n.stride,p=n.offset,g=0,v=0,m=0,y=0;1===s.length?(g=s[0],v=1,m=d[0],y=0):2===s.length?(g=s[0],v=s[1],m=d[0],y=d[1]):w.raise("invalid shape"),e.dtype=i||X(n.data)||5126,e.dimension=v;var b=D.allocType(e.dtype,g*v);q(b,n.data,g,v,m,y,p),c(e,b,r),a?e.persistentData=b:D.freeType(b)}else n instanceof ArrayBuffer?(e.dtype=5121,e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n)))):w.raise("invalid buffer data")}function h(t){n.bufferCount--,i(t);var r=t.buffer;w(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(i,o,u,c){n.bufferCount++;var f=new s(o);function d(n){var i=35044,o=null,a=0,s=0,u=1;return Array.isArray(n)||t(n)||L(n)||n instanceof ArrayBuffer?o=n:"number"==typeof n?a=0|n:n&&(w.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(w(null===o||Array.isArray(o)||t(o)||L(o),"invalid data for buffer"),o=n.data),"usage"in n&&(w.parameter(n.usage,U,"invalid buffer usage"),i=U[n.usage]),"type"in n&&(w.parameter(n.type,z,"invalid buffer type"),s=z[n.type]),"dimension"in n&&(w.type(n.dimension,"number","invalid dimension"),u=0|n.dimension),"length"in n&&(w.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),f.bind(),o?l(f,o,i,s,u,c):(a&&e.bufferData(f.type,a,i),f.dtype=s||5121,f.usage=i,f.dimension=u,f.byteLength=a),r.profile&&(f.stats.size=f.byteLength*Y[f.dtype]),d}function p(t,n){w(n+t.byteLength<=f.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 "+f.byteLength),e.bufferSubData(f.type,n,t)}return a[f.id]=f,u||d(i),d._reglType="buffer",d._buffer=f,d.subdata=function(e,n){var r,i=0|(n||0);if(f.bind(),t(e)||e instanceof ArrayBuffer)p(e,i);else if(Array.isArray(e)){if(e.length>0)if("number"==typeof e[0]){var o=D.allocType(f.dtype,e.length);H(o,e),p(o,i),D.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){r=W(e);var a=V(e,r,f.dtype);p(a,i),D.freeType(a)}else w.raise("invalid buffer data")}else if(L(e)){r=e.shape;var s=e.stride,u=0,c=0,l=0,h=0;1===r.length?(u=r[0],c=1,l=s[0],h=0):2===r.length?(u=r[0],c=r[1],l=s[0],h=s[1]):w.raise("invalid shape");var g=Array.isArray(e.data)?f.dtype:X(e.data),v=D.allocType(g,u*c);q(v,e.data,u,c,l,h,e.offset),p(v,i),D.freeType(v)}else w.raise("invalid data for buffer subdata");return d},r.profile&&(d.stats=f.stats),d.destroy=function(){h(f)},d},createStream:function(t,e){var n=u.pop();return n||(n=new s(t)),n.bind(),l(n,e,35040,0,1,!1),n},destroyStream:function(t){u.push(t)},clear:function(){R(a).forEach(h),u.forEach(h)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){R(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:l}}(i,h,r,(function(t){return x.destroyBuffer(t)})),x=function(e,n,r,i,o){for(var a=r.maxAttributes,s=new Array(a),u=0;u<a;++u)s[u]=new Pt;var c=0,l={},h={Record:Pt,scope:{},state:s,currentVAO:null,targetVAO:null,restore:f()?function(){f()&&R(l).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function s(e){w(Array.isArray(e),"arguments to vertex array constructor must be an array"),w(e.length<a,"too many attributes"),w(e.length>0,"must specify at least one attribute");var i={},u=r.attributes;u.length=e.length;for(var c=0;c<e.length;++c){var l,h=e[c],f=u[c]=new Pt,d=h.data||h;Array.isArray(d)||t(d)||L(d)?(r.buffers[c]&&(l=r.buffers[c],t(d)&&l._buffer.byteLength>=d.byteLength?l.subdata(d):(l.destroy(),r.buffers[c]=null)),r.buffers[c]||(l=r.buffers[c]=o.create(h,34962,!1,!0)),f.buffer=o.getBuffer(l),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,i[c]=1):o.getBuffer(h)?(f.buffer=o.getBuffer(h),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):o.getBuffer(h.buffer)?(f.buffer=o.getBuffer(h.buffer),f.size=0|(+h.size||f.buffer.dimension),f.normalized=!!h.normalized||!1,"type"in h?(w.parameter(h.type,z,"invalid buffer type"),f.type=z[h.type]):f.type=f.buffer.dtype,f.offset=0|(h.offset||0),f.stride=0|(h.stride||0),f.divisor=0|(h.divisor||0),f.state=1,w(f.size>=1&&f.size<=4,"size must be between 1 and 4"),w(f.offset>=0,"invalid offset"),w(f.stride>=0&&f.stride<=255,"stride must be between 0 and 255"),w(f.divisor>=0,"divisor must be positive"),w(!f.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in h?(w(c>0,"first attribute must not be a constant"),f.x=+h.x||0,f.y=+h.y||0,f.z=+h.z||0,f.w=+h.w||0,f.state=2):w(!1,"invalid attribute spec for location "+c)}for(var p=0;p<r.buffers.length;++p)!i[p]&&r.buffers[p]&&(r.buffers[p].destroy(),r.buffers[p]=null);return r.refresh(),s}return i.vaoCount+=1,s.destroy=function(){for(var t=0;t<r.buffers.length;++t)r.buffers[t]&&r.buffers[t].destroy();r.buffers.length=0,r.destroy()},s._vao=r,s._reglType="vao",s(e)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(t){for(var n=0;n<s.length;++n){var r=s[n];r.buffer===t&&(e.disableVertexAttribArray(n),r.buffer=null)}},setVAO:f()?function(t){if(t!==h.currentVAO){var e=f();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),h.currentVAO=t}}:function(t){if(t!==h.currentVAO){if(t)t.bindAttrs();else for(var n=d(),r=0;r<s.length;++r){var i=s[r];i.buffer?(e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}h.currentVAO=t}},clear:f()?function(){R(l).forEach((function(t){t.destroy()}))}:function(){}};function f(){return n.oes_vertex_array_object}function d(){return n.angle_instanced_arrays}function p(){this.id=++c,this.attributes=[];var t=f();this.vao=t?t.createVertexArrayOES():null,l[this.id]=this,this.buffers=[]}return p.prototype.bindAttrs=function(){for(var t=d(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(e.enableVertexAttribArray(r),e.bindBuffer(34962,i.buffer.buffer),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<a;++o)e.disableVertexAttribArray(o)},p.prototype.refresh=function(){var t=f();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),h.currentVAO=this)},p.prototype.destroy=function(){if(this.vao){var t=f();this===h.currentVAO&&(h.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}l[this.id]&&(delete l[this.id],i.vaoCount-=1)},h}(i,f,y,h,b),_=function(e,n,r,i){var o={},a=0,s={uint8:5121,uint16:5123};function u(t){this.id=a++,o[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(s.uint32=5125),u.prototype.bind=function(){this.buffer.bind()};var c=[];function l(i,o,a,s,u,c,l){var h;if(i.buffer.bind(),o){var f=l;l||t(o)&&(!L(o)||t(o.data))||(f=n.oes_element_index_uint?5125:5123),r._initBuffer(i.buffer,o,a,f,3)}else e.bufferData(34963,c,a),i.buffer.dtype=h||5121,i.buffer.usage=a,i.buffer.dimension=3,i.buffer.byteLength=c;if(h=l,!l){switch(i.buffer.dtype){case 5121:case 5120:h=5121;break;case 5123:case 5122:h=5123;break;case 5125:case 5124:h=5125;break;default:w.raise("unsupported type for element array")}i.buffer.dtype=h}i.type=h,w(5125!==h||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var d=u;d<0&&(d=i.buffer.byteLength,5123===h?d>>=1:5125===h&&(d>>=2)),i.vertCount=d;var p=s;if(s<0){p=4;var g=i.buffer.dimension;1===g&&(p=0),2===g&&(p=1),3===g&&(p=4)}i.primType=p}function h(t){i.elementsCount--,w(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var o=r.create(null,34963,!0),a=new u(o._buffer);function c(e){if(e)if("number"==typeof e)o(e),a.primType=4,a.vertCount=0|e,a.type=5121;else{var n=null,r=35044,i=-1,u=-1,h=0,f=0;Array.isArray(e)||t(e)||L(e)?n=e:(w.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,w(Array.isArray(n)||t(n)||L(n),"invalid data for element buffer")),"usage"in e&&(w.parameter(e.usage,U,"invalid element buffer usage"),r=U[e.usage]),"primitive"in e&&(w.parameter(e.primitive,K,"invalid element buffer primitive"),i=K[e.primitive]),"count"in e&&(w("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),u=0|e.count),"type"in e&&(w.parameter(e.type,s,"invalid buffer type"),f=s[e.type]),"length"in e?h=0|e.length:(h=u,5123===f||5122===f?h*=2:5125!==f&&5124!==f||(h*=4))),l(a,n,r,i,u,h,f)}else o(),a.primType=4,a.vertCount=0,a.type=5121;return c}return i.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return o.subdata(t,e),c},c.destroy=function(){h(a)},c},createStream:function(t){var e=c.pop();return e||(e=new u(r.create(null,34963,!0,!1)._buffer)),l(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof u?t._elements:null},clear:function(){R(o).forEach(h)}}}(i,f,b,h),S=function(t,n,r,i){var o={},a={};function s(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function u(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,i){var s=35632===e?o:a,u=s[r];if(!u){var c=n.str(r);u=t.createShader(e),t.shaderSource(u,c),t.compileShader(u),w.shaderError(t,u,c,e,i),s[r]=u}return u}var l={},h=[],f=0;function d(t,e){this.id=f++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function p(e,r,o){var a,l,h=c(35632,e.fragId),f=c(35633,e.vertId),d=e.program=t.createProgram();if(t.attachShader(d,h),t.attachShader(d,f),o)for(a=0;a<o.length;++a){var p=o[a];t.bindAttribLocation(d,p[0],p[1])}t.linkProgram(d),w.linkError(t,d,n.str(e.fragId),n.str(e.vertId),r);var g=t.getProgramParameter(d,35718);i.profile&&(e.stats.uniformsCount=g);var v=e.uniforms;for(a=0;a<g;++a)if(l=t.getActiveUniform(d,a))if(l.size>1)for(var m=0;m<l.size;++m){var y=l.name.replace("[0]","["+m+"]");u(v,new s(y,n.id(y),t.getUniformLocation(d,y),l))}else u(v,new s(l.name,n.id(l.name),t.getUniformLocation(d,l.name),l));var b=t.getProgramParameter(d,35721);i.profile&&(e.stats.attributesCount=b);var x=e.attributes;for(a=0;a<b;++a)(l=t.getActiveAttrib(d,a))&&u(x,new s(l.name,n.id(l.name),t.getAttribLocation(d,l.name),l))}return i.profile&&(r.getMaxUniformsCount=function(){var t=0;return h.forEach((function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);R(o).forEach(e),o={},R(a).forEach(e),a={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,l={},r.shaderCount=0},program:function(n,i,s,u){w.command(n>=0,"missing vertex shader",s),w.command(i>=0,"missing fragment shader",s);var c=l[i];c||(c=l[i]={});var f=c[n];if(f&&(f.refCount++,!u))return f;var g=new d(i,n);return r.shaderCount++,p(g,s,u),f||(c[n]=g),h.push(g),e(g,{destroy:function(){if(g.refCount--,g.refCount<=0){t.deleteProgram(g.program);var e=h.indexOf(g);h.splice(e,1),r.shaderCount--}c[g.vertId].refCount<=0&&(t.deleteShader(a[g.vertId]),delete a[g.vertId],delete l[g.fragId][g.vertId]),Object.keys(l[g.fragId]).length||(t.deleteShader(o[g.fragId]),delete o[g.fragId],delete l[g.fragId])}})},restore:function(){o={},a={};for(var t=0;t<h.length;++t)p(h[t],null,h[t].attributes.map((function(t){return[t.location,t.name]})))},shader:c,frag:-1,vert:-1}}(i,l,h,r),E=Et(i,f,y,(function(){I.procs.poll()}),m,h,r),M=function(t,e,n,r,i){var o={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(o.srgba=35907),e.ext_color_buffer_half_float&&(o.rgba16f=34842,o.rgb16f=34843),e.webgl_color_buffer_float&&(o.rgba32f=34836);var a=[];Object.keys(o).forEach((function(t){var e=o[t];a[e]=t}));var s=0,u={};function c(t){this.id=s++,this.refCount=1,this.renderbuffer=t,this.format=32854,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function l(e){var n=e.renderbuffer;w(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(36161,null),t.deleteRenderbuffer(n),e.renderbuffer=null,e.refCount=0,delete u[e.id],r.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&l(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,s){var l=new c(t.createRenderbuffer());function h(e,r){var s=0,u=0,c=32854;if("object"==typeof e&&e){var f=e;if("shape"in f){var d=f.shape;w(Array.isArray(d)&&d.length>=2,"invalid renderbuffer shape"),s=0|d[0],u=0|d[1]}else"radius"in f&&(s=u=0|f.radius),"width"in f&&(s=0|f.width),"height"in f&&(u=0|f.height);"format"in f&&(w.parameter(f.format,o,"invalid renderbuffer format"),c=o[f.format])}else"number"==typeof e?(s=0|e,u="number"==typeof r?0|r:s):e?w.raise("invalid arguments to renderbuffer constructor"):s=u=1;if(w(s>0&&u>0&&s<=n.maxRenderbufferSize&&u<=n.maxRenderbufferSize,"invalid renderbuffer size"),s!==l.width||u!==l.height||c!==l.format)return h.width=l.width=s,h.height=l.height=u,l.format=c,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,c,s,u),w(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=Ot(l.format,l.width,l.height)),h.format=a[l.format],h}return u[l.id]=l,r.renderbufferCount++,h(e,s),h.resize=function(e,r){var o=0|e,a=0|r||o;return o===l.width&&a===l.height||(w(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),h.width=l.width=o,h.height=l.height=a,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,l.format,o,a),w(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=Ot(l.format,l.width,l.height))),h},h._reglType="renderbuffer",h._renderbuffer=l,i.profile&&(h.stats=l.stats),h.destroy=function(){l.decRef()},h},clear:function(){R(u).forEach(l)},restore:function(){R(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}}(i,f,y,h,r),C=function(t,n,r,i,o,a){var s={cur:null,next:null,dirty:!1,setFBO:null},u=["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 l=["uint8"];function h(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function f(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function d(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);w(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;w(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function p(e,n){n&&(n.texture?t.framebufferTexture2D(36160,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,n.renderbuffer._renderbuffer.renderbuffer))}function g(t){var e=3553,n=null,r=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),w.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,w(3553===e)):"textureCube"===o?(n=i,w(e>=34069&&e<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,e=36161):w.raise("invalid regl object for attachment"),new h(e,n,r)}function v(t,e,n,r,a){if(n){var s=i.create2D({width:t,height:e,format:r,type:a});return s._texture.refCount=0,new h(3553,s,null)}var u=o.create({width:t,height:e,format:r});return u._renderbuffer.refCount=0,new h(36161,null,u)}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&&l.push("half float","float16"),n.oes_texture_float&&l.push("float","float32");var b=0,x={};function _(){this.id=b++,x[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 S(t){t.colorAttachments.forEach(f),f(t.depthAttachment),f(t.stencilAttachment),f(t.depthStencilAttachment)}function E(e){var n=e.framebuffer;w(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,a.framebufferCount--,delete x[e.id]}function M(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)p(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(36160,36064+n,3553,null,0);t.framebufferTexture2D(36160,33306,3553,null,0),t.framebufferTexture2D(36160,36096,3553,null,0),t.framebufferTexture2D(36160,36128,3553,null,0),p(36096,e.depthAttachment),p(36128,e.stencilAttachment),p(33306,e.depthStencilAttachment);var o=t.checkFramebufferStatus(36160);t.isContextLost()||36053===o||w.raise("framebuffer configuration not supported, status = "+Tt[o]),t.bindFramebuffer(36160,s.next?s.next.framebuffer:null),s.cur=s.next,t.getError()}function O(t,i){var o=new _;function h(t,e){var i;w(s.next!==o,"can not update framebuffer which is currently in use");var a=0,f=0,p=!0,y=!0,b=null,x=!0,_="rgba",E="uint8",O=1,A=null,k=null,C=null,I=!1;if("number"==typeof t)a=0|t,f=0|e||a;else if(t){w.type(t,"object","invalid arguments for framebuffer");var T=t;if("shape"in T){var P=T.shape;w(Array.isArray(P)&&P.length>=2,"invalid shape for framebuffer"),a=P[0],f=P[1]}else"radius"in T&&(a=f=T.radius),"width"in T&&(a=T.width),"height"in T&&(f=T.height);("color"in T||"colors"in T)&&(b=T.color||T.colors,Array.isArray(b)&&w(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in T&&(O=0|T.colorCount,w(O>0,"invalid color buffer count")),"colorTexture"in T&&(x=!!T.colorTexture,_="rgba4"),"colorType"in T&&(E=T.colorType,x?(w(n.oes_texture_float||!("float"===E||"float32"===E),"you must enable OES_texture_float in order to use floating point framebuffer objects"),w(n.oes_texture_half_float||!("half float"===E||"float16"===E),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===E||"float16"===E?(w(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),_="rgba16f"):"float"!==E&&"float32"!==E||(w(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),_="rgba32f"),w.oneOf(E,l,"invalid color type")),"colorFormat"in T&&(_=T.colorFormat,u.indexOf(_)>=0?x=!0:c.indexOf(_)>=0?x=!1:x?w.oneOf(T.colorFormat,u,"invalid color format for texture"):w.oneOf(T.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in T||"depthStencilTexture"in T)&&(I=!(!T.depthTexture&&!T.depthStencilTexture),w(!I||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in T&&("boolean"==typeof T.depth?p=T.depth:(A=T.depth,y=!1)),"stencil"in T&&("boolean"==typeof T.stencil?y=T.stencil:(k=T.stencil,p=!1)),"depthStencil"in T&&("boolean"==typeof T.depthStencil?p=y=T.depthStencil:(C=T.depthStencil,p=!1,y=!1))}else a=f=1;var N=null,j=null,D=null,L=null;if(Array.isArray(b))N=b.map(g);else if(b)N=[g(b)];else for(N=new Array(O),i=0;i<O;++i)N[i]=v(a,f,x,_,E);w(n.webgl_draw_buffers||N.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),w(N.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||N[0].width,f=f||N[0].height,A?j=g(A):p&&!y&&(j=v(a,f,I,"depth","uint32")),k?D=g(k):y&&!p&&(D=v(a,f,!1,"stencil","uint8")),C?L=g(C):!A&&!k&&y&&p&&(L=v(a,f,I,"depth stencil","depth stencil")),w(!!A+!!k+!!C<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var R=null;for(i=0;i<N.length;++i)if(d(N[i],a,f),w(!N[i]||N[i].texture&&At.indexOf(N[i].texture._texture.format)>=0||N[i].renderbuffer&&It.indexOf(N[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),N[i]&&N[i].texture){var B=kt[N[i].texture._texture.format]*Ct[N[i].texture._texture.type];null===R?R=B:w(R===B,"all color attachments much have the same number of bits per pixel.")}return d(j,a,f),w(!j||j.texture&&6402===j.texture._texture.format||j.renderbuffer&&33189===j.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),d(D,a,f),w(!D||D.renderbuffer&&36168===D.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),d(L,a,f),w(!L||L.texture&&34041===L.texture._texture.format||L.renderbuffer&&34041===L.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),S(o),o.width=a,o.height=f,o.colorAttachments=N,o.depthAttachment=j,o.stencilAttachment=D,o.depthStencilAttachment=L,h.color=N.map(m),h.depth=m(j),h.stencil=m(D),h.depthStencil=m(L),h.width=o.width,h.height=o.height,M(o),h}return a.framebufferCount++,h(t,i),e(h,{resize:function(t,e){w(s.next!==o,"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===o.width&&r===o.height)return h;for(var i=o.colorAttachments,a=0;a<i.length;++a)y(i[a],n,r);return y(o.depthAttachment,n,r),y(o.stencilAttachment,n,r),y(o.depthStencilAttachment,n,r),o.width=h.width=n,o.height=h.height=r,M(o),h},_reglType:"framebuffer",_framebuffer:o,destroy:function(){E(o),S(o)},use:function(t){s.setFBO({framebuffer:h},t)}})}return e(s,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof _)return e}return null},create:O,createCube:function(t){var o=Array(6);function a(t){var r;w(o.indexOf(s.next)<0,"can not update framebuffer which is currently in use");var c,h={color:null},f=0,d=null,p="rgba",g="uint8",v=1;if("number"==typeof t)f=0|t;else if(t){w.type(t,"object","invalid arguments for framebuffer");var m=t;if("shape"in m){var y=m.shape;w(Array.isArray(y)&&y.length>=2,"invalid shape for framebuffer"),w(y[0]===y[1],"cube framebuffer must be square"),f=y[0]}else"radius"in m&&(f=0|m.radius),"width"in m?(f=0|m.width,"height"in m&&w(m.height===f,"must be square")):"height"in m&&(f=0|m.height);("color"in m||"colors"in m)&&(d=m.color||m.colors,Array.isArray(d)&&w(1===d.length||n.webgl_draw_buffers,"multiple render targets not supported")),d||("colorCount"in m&&(v=0|m.colorCount,w(v>0,"invalid color buffer count")),"colorType"in m&&(w.oneOf(m.colorType,l,"invalid color type"),g=m.colorType),"colorFormat"in m&&(p=m.colorFormat,w.oneOf(m.colorFormat,u,"invalid color format for texture"))),"depth"in m&&(h.depth=m.depth),"stencil"in m&&(h.stencil=m.stencil),"depthStencil"in m&&(h.depthStencil=m.depthStencil)}else f=1;if(d)if(Array.isArray(d))for(c=[],r=0;r<d.length;++r)c[r]=d[r];else c=[d];else{c=Array(v);var b={radius:f,format:p,type:g};for(r=0;r<v;++r)c[r]=i.createCube(b)}for(h.color=Array(c.length),r=0;r<c.length;++r){var x=c[r];w("function"==typeof x&&"textureCube"===x._reglType,"invalid cube map"),f=f||x.width,w(x.width===f&&x.height===f,"invalid cube map shape"),h.color[r]={target:34069,data:c[r]}}for(r=0;r<6;++r){for(var _=0;_<c.length;++_)h.color[_].target=34069+r;r>0&&(h.depth=o[0].depth,h.stencil=o[0].stencil,h.depthStencil=o[0].depthStencil),o[r]?o[r](h):o[r]=O(h)}return e(a,{width:f,height:f,color:c})}return a(t),e(a,{faces:o,resize:function(t){var e,n=0|t;if(w(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e<i.length;++e)i[e].resize(n);for(e=0;e<6;++e)o[e].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){o.forEach((function(t){t.destroy()}))}})},clear:function(){R(x).forEach(E)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,R(x).forEach((function(e){e.framebuffer=t.createFramebuffer(),M(e)}))}})}(i,f,y,E,M,h),I=ce(i,l,f,y,b,_,0,C,{},x,S,{elements:null,primitive:4,count:-1,offset:0,instances:-1},m,d,r),P=Nt(i,C,I.procs.poll,m,o,f,y),N=I.next,j=i.canvas,B=[],G=[],F=[],Z=[r.onDestroy],$=null;function Q(){if(0===B.length)return d&&d.update(),void($=null);$=A.next(Q),ut();for(var t=B.length-1;t>=0;--t){var e=B[t];e&&e(m,null,0)}i.flush(),d&&d.update()}function J(){!$&&B.length>0&&($=A.next(Q))}function tt(){$&&(A.cancel(Q),$=null)}function et(t){t.preventDefault(),a=!0,tt(),G.forEach((function(t){t()}))}function nt(t){i.getError(),a=!1,s.restore(),S.restore(),b.restore(),E.restore(),M.restore(),C.restore(),x.restore(),d&&d.restore(),I.procs.refresh(),J(),F.forEach((function(t){t()}))}function rt(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(O.isDynamic(o))r[i]=O.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a<o.length;++a)if(O.isDynamic(o[a]))return void(r[i]=O.unbox(o,i));n[i]=o}})),{dynamic:r,static:n}}w(!!t,"invalid args to regl({...})"),w.type(t,"object","invalid args to regl({...})");var r=n(t.context||{},!0),i=n(t.uniforms||{},!0),o=n(t.attributes||{},!1),s=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),u={gpuTime:0,cpuTime:0,count:0},c=I.compile(s,o,i,r,u),l=c.draw,h=c.batch,f=c.scope,d=[];return e((function(t,e){var n;if(a&&w.raise("context lost"),"function"==typeof t)return f.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(n=0;n<t;++n)f.call(this,null,e,n);else{if(!Array.isArray(t))return f.call(this,t,e,0);for(n=0;n<t.length;++n)f.call(this,t[n],e,n)}else if("number"==typeof t){if(t>0)return h.call(this,function(t){for(;d.length<t;)d.push(null);return d}(0|t),0|t)}else{if(!Array.isArray(t))return l.call(this,t);if(t.length)return h.call(this,t,t.length)}}),{stats:u,destroy:function(){c.destroy()}})}j&&(j.addEventListener("webglcontextlost",et,!1),j.addEventListener("webglcontextrestored",nt,!1));var it=C.setFBO=rt({framebuffer:O.define.call(null,1,"framebuffer")});function ot(t,e){var n=0;I.procs.poll();var r=e.color;r&&(i.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in e&&(i.clearDepth(+e.depth),n|=256),"stencil"in e&&(i.clearStencil(0|e.stencil),n|=1024),w(!!n,"called regl.clear with no buffer specified"),i.clear(n)}function at(t){return w.type(t,"function","regl.frame() callback must be a function"),B.push(t),J(),{cancel:function(){var e=he(B,t);w(e>=0,"cannot cancel a frame twice"),B[e]=function t(){var e=he(B,t);B[e]=B[B.length-1],B.length-=1,B.length<=0&&tt()}}}}function st(){var t=N.viewport,e=N.scissor_box;t[0]=t[1]=e[0]=e[1]=0,m.viewportWidth=m.framebufferWidth=m.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,m.viewportHeight=m.framebufferHeight=m.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function ut(){m.tick+=1,m.time=lt(),st(),I.procs.poll()}function ct(){E.refresh(),st(),I.procs.refresh(),d&&d.update()}function lt(){return(k()-p)/1e3}ct();var ht=e(rt,{clear:function(t){if(w("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)it(e({framebuffer:t.framebuffer.faces[n]},t),ot);else it(t,ot);else ot(0,t)},prop:O.define.bind(null,1),context:O.define.bind(null,2),this:O.define.bind(null,3),draw:rt({}),buffer:function(t){return b.create(t,34962,!1,!1)},elements:function(t){return _.create(t,!1)},texture:E.create2D,cube:E.createCube,renderbuffer:M.create,framebuffer:C.create,framebufferCube:C.createCube,vao:x.createVAO,attributes:o,frame:at,on:function(t,e){var n;switch(w.type(e,"function","listener callback must be a function"),t){case"frame":return at(e);case"lost":n=G;break;case"restore":n=F;break;case"destroy":n=Z;break;default:w.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:P,destroy:function(){B.length=0,tt(),j&&(j.removeEventListener("webglcontextlost",et),j.removeEventListener("webglcontextrestored",nt)),S.clear(),C.clear(),M.clear(),E.clear(),_.clear(),b.clear(),x.clear(),d&&d.clear(),Z.forEach((function(t){t()}))},_gl:i,_refresh:ct,poll:function(){ut(),d&&d.update()},now:lt,stats:h});return r.onDone(null,ht),ht}}()},,,,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Engine=void 0;const r=n(295),i=n(119),o=n(567),a=n(118),s=n(33);e.Engine=class{constructor(t,e){this.engineOptions=Object.assign({},e),this.viewOptions=Object.assign({fitCenter:!0,fitView:!1,groupPadding:20,leakAreaHeight:150,updateHighlight:"#fc5185"},e.view),this.animationOptions=Object.assign({enable:!0,duration:750,timingFunction:"easePolyOut"},e.animation),this.behaviorOptions=Object.assign({drag:!0,zoom:!0,dragNode:!0,selectNode:!0},e.behavior),this.modelConstructor=new r.ModelConstructor(this),this.viewContainer=new o.ViewContainer(this,t)}render(t,e=!1){if(null==t)return;let n=JSON.stringify(t);if(!1===e&&this.prevStringSource===n)return;this.prevStringSource=n;const r=this.modelConstructor.construct(t);this.viewContainer.render(r,t.enterFunction)}reLayout(){this.viewContainer.reLayout()}getGraphInstance(){return this.viewContainer.getG6Instance()}hideGroups(t){const e=Array.isArray(t)?t:[t],n=this.viewContainer.getG6Instance();this.modelConstructor.getLayoutGroupTable().forEach(t=>{const r=e.find(e=>e===t.layout);r&&!t.isHide&&(t.modelList.forEach(t=>n.hideItem(t.G6Item)),t.isHide=!0),!r&&t.isHide&&(t.modelList.forEach(t=>n.showItem(t.G6Item)),t.isHide=!1)})}getAllModels(){return[...s.Util.convertGroupTable2ModelList(this.modelConstructor.getLayoutGroupTable()),...this.viewContainer.getAccumulateLeakModels()]}updateStyle(t,e){const n=this.getAllModels(),r=this.modelConstructor.getLayoutGroupTable().get(t);r.options=e,n.forEach(e=>{if(e.group!==t)return;const n=e.getModelType(),i=r.options[n];if(i)if("addressLabel"===n)e.updateG6ModelStyle(e.generateG6ModelProps(i));else{const t=i[e.sourceType];t&&e.updateG6ModelStyle(e.generateG6ModelProps(t))}})}findNode(t){const e=this.getAllModels(),n=t.toString();return e.find(t=>t instanceof a.SVNode&&t.sourceId===n)}resize(t,e){this.viewContainer.resize(t,e)}on(t,e){"function"==typeof e&&("onFreed"!==t&&"onLeak"!==t&&"onLeakAreaUpdate"!==t?this.viewContainer.getG6Instance().on(t,t=>{e(t.item.SVModel)}):i.EventBus.on(t,e))}switchBrushSelect(t){const e=this.viewContainer.getG6Instance();t?e.setMode("brush"):e.setMode("default")}destroy(){this.modelConstructor.destroy(),this.viewContainer.destroy()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ModelConstructor=void 0;const r=n(33),i=n(175),o=n(147),a=n(118),s=n(276);e.ModelConstructor=class{constructor(t){this.engine=t,this.prevSourcesStringMap={}}construct(t){const e=new Map,n=i.SV.registeredLayout;return Object.keys(t).forEach(r=>{let i=t[r],o=i.layouter,a=n[o];if(!o||!a)return;let s=JSON.stringify(i.data),u=this.prevSourcesStringMap[r],c=[],l=[],h=[],f=[],d=[];if(u===s)return;const p=a.defineOptions(i.data),g=a.sourcesPreprocess(i.data,p),v=p.node||p.element||{},m=p.marker||{},y=p.indexLabel||{},b=p.addressLabel||{};c=this.constructNodes(r,o,v,g),d=this.constructMarkers(r,o,m,c),f=this.constructIndexLabel(r,o,y,c),h=this.constructAddressLabel(r,o,b,c),c.forEach(t=>{t.freedLabel&&l.push(t.freedLabel)}),e.set(r,{name:r,node:c,freedLabel:l,addressLabel:h,indexLabel:f,link:[],marker:d,options:p,layoutCreator:a,modelList:[...c,...d,...l,...h,...f],layout:o,isHide:!1})}),e.forEach((t,n)=>{const r=t.options.link||{},i=this.constructLinks(n,t.layout,r,t.node,e);t.link=i,t.modelList.push(...i)}),this.layoutGroupTable=e,this.layoutGroupTable}constructNodes(t,e,n,r){let i=[];return r.forEach(r=>{null!==r&&(void 0!==r.type&&null!==r.type||(r.type="default"),i.push(this.createNode(r,r.type,t,e,n[r.type])))}),i}constructLinks(t,e,n,r,i){let o=[];return Object.keys(n).forEach(a=>{for(let s=0;s<r.length;s++){let u=r[s],c=u.sourceNode[a],l=null,h=null;if(null!=c)if(Array.isArray(c))u[a]=c.map((r,s)=>{l=this.fetchTargetNodes(i,u,r);let f=this.isGeneralLink(c.toString());return l&&(h=this.createLink(a,t,e,u,l,s,n[a]),o.push(h)),f?l:null});else{l=this.fetchTargetNodes(i,u,c);let r=this.isGeneralLink(c.toString());l&&(h=this.createLink(a,t,e,u,l,null,n[a]),o.push(h)),u[a]=r?l:null}else u[a]=null}}),o}constructIndexLabel(t,e,n,r){let i=[];return Object.keys(n).forEach(o=>{for(let a=0;a<r.length;a++){let u=r[a],c=u[o];if(null==c)continue;let l=`${t}.${o}#${c}`,h=new s.SVIndexLabel(l,o,t,e,c.toString(),u,n[o]);i.push(h)}}),i}constructAddressLabel(t,e,n,r){let i=[];return r.forEach(r=>{const o=new s.SVAddressLabel(r.id+"-address-label",r.sourceType,t,e,r,n);i.push(o)}),i}constructMarkers(t,e,n,r){let i=[];return Object.keys(n).forEach(o=>{for(let a=0;a<r.length;a++){let u=r[a],c=u[o];if(!c)continue;let l=`${t}.${o}.${Array.isArray(c)?c.join("-"):c}`,h=new s.SVMarker(l,o,t,e,c,u,n[o]);i.push(h)}}),i}resolveNodeLabel(t,e){let n="";return n=Array.isArray(t)?t.map(t=>{var n;return null!==(n=this.parserNodeContent(e,t))&&void 0!==n?n:""}):this.parserNodeContent(e,t),"undefined"===n&&(n=""),null!=n?n:""}createNode(t,e,n,r,i){let o=this.resolveNodeLabel(i.label,t),u=e+"."+t.id.toString(),c=new a.SVNode(u,e,n,r,t,o,i);return c.freed&&(c.freedLabel=new s.SVFreedLabel(u+"-freed-label",e,n,r,c)),c.modelConstructor=this,c}createLink(t,e,n,r,i,a,s){let u=`${t}(${r.id}-${i.id})`;return new o.SVLink(u,t,e,n,r,i,a,s)}parserNodeContent(t,e){let n=r.Util.textParser(e);if(Array.isArray(n)){n.map(e=>t[e]).map((t,r)=>{e=e.replace("["+n[r]+"]",t)})}return e}fetchTargetNodes(t,e,n){let r,i=e.group,o=e.sourceType,a=n,s=i,u=null;if(null==n)return null;("number"==typeof n||"string"==typeof n&&!n.includes("#"))&&(n="default#"+n);let c=n.split("#");if(a=c.pop(),c.length>1)o=c.pop(),s=c.pop();else{let e=c.pop();if(t.get(s).node.find(t=>t.sourceType===e))o=e;else{if(!t.has(e))return null;s=e}}return r=t.get(s).node.filter(t=>t.sourceType===o),void 0===r?null:(u=r.find(t=>t.sourceId===a),u||null)}isGeneralLink(t){let e=0;for(let n=0;n<t.length;n++)"#"===t[n]&&e++;return e<=2}getLayoutGroupTable(){return this.layoutGroupTable}isSameGroup(t,e){return void 0!==this.layoutGroupTable.get(t.group).node.find(t=>t.id===e.id)}destroy(){this.layoutGroupTable=null,this.prevSourcesStringMap=null}}},function(t,e,n){"use strict";function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i.apply(void 0,t)}function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return c(!0===t[0],!1,t)}function o(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return c(!0===t[0],!0,t)}function a(t){if(Array.isArray(t)){for(var e=[],n=0;n<t.length;++n)e.push(a(t[n]));return e}if(s(t)){e={};for(var n in t)e[n]=a(t[n]);return e}return t}function s(t){return t&&"object"==typeof t&&!Array.isArray(t)}function u(t,e){if(!s(t))return e;for(var n in e)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(t[n]=s(t[n])&&s(e[n])?u(t[n],e[n]):e[n]);return t}function c(t,e,n){var r;!t&&s(r=n.shift())||(r={});for(var i=0;i<n.length;++i){var o=n[i];if(s(o))for(var c in o)if("__proto__"!==c&&"constructor"!==c&&"prototype"!==c){var l=t?a(o[c]):o[c];r[c]=e?u(r[c],l):l}}return r}Object.defineProperty(e,"__esModule",{value:!0}),e.isPlainObject=e.clone=e.recursive=e.merge=e.main=void 0,t.exports=e=r,e.default=r,e.main=r,r.clone=a,r.isPlainObject=s,r.recursive=o,e.merge=i,e.recursive=o,e.clone=a,e.isPlainObject=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.pageRankAsync=e.minimumSpanningTreeAsync=e.louvainAsync=e.labelPropagationAsync=e.getOutDegreeAsync=e.getNeighborsAsync=e.getInDegreeAsync=e.getDegreeAsync=e.getAdjMatrixAsync=e.floydWarshallAsync=e.findShortestPathAsync=e.findAllPathAsync=e.dijkstraAsync=e.detectCycleAsync=e.detectAllUndirectedCycleAsync=e.detectAllDirectedCycleAsync=e.detectAllCyclesAsync=e.connectedComponentAsync=e.GADDIAsync=void 0;var r,i=(r=n(298))&&r.__esModule?r:{default:r},o=n(149);e.getAdjMatrixAsync=function(t,e){return(0,i.default)(o.ALGORITHM.getAdjMatrix).apply(void 0,[t,e])};e.connectedComponentAsync=function(t,e){return(0,i.default)(o.ALGORITHM.connectedComponent).apply(void 0,[t,e])};e.getDegreeAsync=function(t){return(0,i.default)(o.ALGORITHM.getDegree)(t)};e.getInDegreeAsync=function(t,e){return(0,i.default)(o.ALGORITHM.getInDegree)(t,e)};e.getOutDegreeAsync=function(t,e){return(0,i.default)(o.ALGORITHM.getOutDegree)(t,e)};e.detectCycleAsync=function(t){return(0,i.default)(o.ALGORITHM.detectCycle)(t)};e.detectAllCyclesAsync=function(t){return(0,i.default)(o.ALGORITHM.detectAllCycles)(t)};e.detectAllDirectedCycleAsync=function(t){return(0,i.default)(o.ALGORITHM.detectAllDirectedCycle)(t)};e.detectAllUndirectedCycleAsync=function(t){return(0,i.default)(o.ALGORITHM.detectAllUndirectedCycle)(t)};e.dijkstraAsync=function(t,e,n,r){return(0,i.default)(o.ALGORITHM.dijkstra).apply(void 0,[t,e,n,r])};e.findAllPathAsync=function(t,e,n,r){return(0,i.default)(o.ALGORITHM.findAllPath).apply(void 0,[t,e,n,r])};e.findShortestPathAsync=function(t,e,n,r,a){return(0,i.default)(o.ALGORITHM.findShortestPath).apply(void 0,[t,e,n,r,a])};e.floydWarshallAsync=function(t,e){return(0,i.default)(o.ALGORITHM.floydWarshall).apply(void 0,[t,e])};e.labelPropagationAsync=function(t,e,n,r){return void 0===r&&(r=1e3),(0,i.default)(o.ALGORITHM.labelPropagation)(t,e,n,r)};e.louvainAsync=function(t,e,n,r){return(0,i.default)(o.ALGORITHM.louvain)(t,e,n,r)};e.minimumSpanningTreeAsync=function(t,e,n){return(0,i.default)(o.ALGORITHM.minimumSpanningTree).apply(void 0,[t,e,n])};e.pageRankAsync=function(t,e,n){return(0,i.default)(o.ALGORITHM.pageRank).apply(void 0,[t,e,n])};e.getNeighborsAsync=function(t,e,n){return(0,i.default)(o.ALGORITHM.getNeighbors).apply(void 0,[t,e,n])};e.GADDIAsync=function(t,e,n,r,a,s,u){return void 0===n&&(n=!1),void 0===s&&(s="cluster"),void 0===u&&(u="cluster"),(0,i.default)(o.ALGORITHM.GADDI).apply(void 0,[t,e,n,r,a,s,u])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=n(149),o=(r=n(299))&&r.__esModule?r:{default:r};var a=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new Promise((function(n,r){var a=new o.default;a.postMessage({_algorithmType:t,data:e}),a.onmessage=function(t){var e=t.data,o=e.data,s=e._algorithmType;i.MESSAGE.SUCCESS===s?n(o):r(),a.terminate()}}))}};e.default=a},function(t,e,n){"use strict";function r(t){return(r="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)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=a(e);if(n&&n.has(t))return n.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var u=o?Object.getOwnPropertyDescriptor(t,s):null;u&&(u.get||u.set)?Object.defineProperty(i,s,u):i[s]=t[s]}i.default=t,n&&n.set(t,i);return i}(n(300)),o=n(149);function a(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(a=function(t){return t?n:e})(t)}var s="undefined"!=typeof self?self:{};s.onmessage=function(t){var e=t.data,n=e._algorithmType,r=e.data;if(n)if("function"!=typeof i[n])s.postMessage({_algorithmType:o.MESSAGE.FAILURE});else{var a=i[n].apply(i,r);s.postMessage({_algorithmType:o.MESSAGE.SUCCESS,data:a})}};e.default=null},function(t,e,n){"use strict";function r(t){return(r="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)}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"GADDI",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"breadthFirstSearch",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"connectedComponent",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"depthFirstSearch",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"detectCycle",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"dijkstra",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"findAllPath",{enumerable:!0,get:function(){return h.findAllPath}}),Object.defineProperty(e,"findShortestPath",{enumerable:!0,get:function(){return h.findShortestPath}}),Object.defineProperty(e,"floydWarshall",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"getAdjMatrix",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"getDegree",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"getInDegree",{enumerable:!0,get:function(){return s.getInDegree}}),Object.defineProperty(e,"getNeighbors",{enumerable:!0,get:function(){return y.getNeighbors}}),Object.defineProperty(e,"getOutDegree",{enumerable:!0,get:function(){return s.getOutDegree}}),Object.defineProperty(e,"labelPropagation",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"louvain",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"minimumSpanningTree",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(e,"pageRank",{enumerable:!0,get:function(){return v.default}});var i=x(n(98)),o=x(n(301)),a=x(n(181)),s=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=b(e);if(n&&n.has(t))return n.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=o?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=t[a]}i.default=t,n&&n.set(t,i);return i}(n(182)),u=x(n(304)),c=x(n(183)),l=x(n(150)),h=n(305),f=x(n(184)),d=x(n(306)),p=x(n(307)),g=x(n(310)),v=x(n(313)),m=x(n(314)),y=n(47);function b(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(b=function(t){return t?n:e})(t)}function x(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(302))&&r.__esModule?r:{default:r},o=n(47);var a=function(t,e,n,r){void 0===r&&(r=!0);var a=function(t){void 0===t&&(t={});var e,n=t,r=function(){},i=(e={},function(t){var n=t.next;return!e[n]&&(e[n]=!0,!0)});return n.allowTraversal=t.allowTraversal||i,n.enter=t.enter||r,n.leave=t.leave||r,n}(n),s=new i.default,u=t.edges,c=void 0===u?[]:u;s.enqueue(e);for(var l="",h=function(){var t=s.dequeue();a.enter({current:t,previous:l}),(0,o.getNeighbors)(t,c,r?"target":void 0).forEach((function(e){a.allowTraversal({previous:l,current:t,next:e})&&s.enqueue(e)})),a.leave({current:t,previous:l}),l=t};!s.isEmpty();)h()};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(303))&&r.__esModule?r:{default:r};var o=function(){function t(){this.linkedList=new i.default}return t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)},t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LinkedListNode=void 0;var r=function(t,e){return t===e},i=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},t}();e.LinkedListNode=i;var o=function(){function t(t){void 0===t&&(t=r),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new i(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new i(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(null!==n)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},t.prototype.find=function(t){var e=t.value,n=void 0===e?void 0:e,r=t.callback,i=void 0===r?void 0:r;if(!this.head)return null;for(var o=this.head;o;){if(i&&i(o.value))return o;if(void 0!==n&&this.compare(o.value,n))return o;o=o.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach((function(t){return e.append(t)})),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map((function(e){return e.toString(t)})).toString()},t}();e.default=o},function(t,e,n){"use strict";function r(t){return(r="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)}Object.defineProperty(e,"__esModule",{value:!0}),e.detectAllUndirectedCycle=e.detectAllDirectedCycle=e.detectAllCycles=e.default=void 0;var i,o=(i=n(183))&&i.__esModule?i:{default:i},a=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=u(e);if(n&&n.has(t))return n.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var s=o?Object.getOwnPropertyDescriptor(t,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=t[a]}i.default=t,n&&n.set(t,i);return i}(n(181)),s=n(47);function u(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(u=function(t){return t?n:e})(t)}var c=function(t,e,n){var r,i;void 0===n&&(n=!0);for(var o=[],u=0,c=(0,a.default)(t,!1);u<c.length;u++){var l=c[u];if(l.length)for(var h=l[0],f=h.id,d=[h],p=((r={})[f]=h,r),g=((i={})[f]=new Set,i);d.length>0;)for(var v=d.pop(),m=v.id,y=(0,s.getNeighbors)(m,t.edges),b=function(r){var i,a=y[r],s=t.nodes.find((function(t){return t.id===a}));if(a===m)o.push(((i={})[a]=v,i));else if(a in g){if(!g[m].has(s)){for(var u=!0,c=[s,v],l=p[m];g[a].size&&!g[a].has(l)&&(c.push(l),l!==p[l.id]);)l=p[l.id];if(c.push(l),e&&n?(u=!1,c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!0)):e&&!n&&c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!1),u){for(var h={},f=1;f<c.length;f+=1)h[c[f-1].id]=c[f];c.length&&(h[c[c.length-1].id]=c[0]),o.push(h)}g[a].add(v)}}else p[a]=v,d.push(s),g[a]=new Set([v])},x=0;x<y.length;x+=1)b(x)}return o};e.detectAllUndirectedCycle=c;var l=function(t,e,n){void 0===n&&(n=!0);for(var r=[],i=new Set,o=[],u=[],c={},l={},h=function t(a,s,l){var h=!1;if(e&&!1===n&&e.indexOf(a.id)>-1)return h;r.push(a),i.add(a);for(var f=l[a.id],d=0;d<f.length;d+=1){if((v=c[f[d]])===s){for(var p={},g=1;g<r.length;g+=1)p[r[g-1].id]=r[g];r.length&&(p[r[r.length-1].id]=r[0]),u.push(p),h=!0}else i.has(v)||t(v,s,l)&&(h=!0)}if(h)!function(t){for(var e=[t];e.length>0;){var n=e.pop();i.has(n)&&(i.delete(n),o[n.id].forEach((function(t){e.push(t)})),o[n.id].clear())}}(a);else for(d=0;d<f.length;d+=1){var v=c[f[d]];o[v.id].has(a)||o[v.id].add(a)}return r.pop(),h},f=t.nodes,d=void 0===f?[]:f,p=0;p<d.length;p+=1){var g=d[p],v=g.id;l[v]=p,c[p]=g}if(e&&n){var m=function(t){var n=e[t];l[d[t].id]=l[n],l[n]=0,c[0]=d.find((function(t){return t.id===n})),c[l[d[t].id]]=d[t]};for(p=0;p<e.length;p++)m(p)}for(var y=function(r){for(var i,o,a=1/0,c=0;c<r.length;c+=1)for(var h=r[c],f=0;f<h.length;f++){var d=l[h[f].id];d<a&&(a=d,o=c)}var p=r[o],g=[];for(c=0;c<p.length;c+=1){var v=p[c];g[v.id]=[];for(var m=0,y=(0,s.getNeighbors)(v.id,t.edges,"target").filter((function(t){return p.map((function(t){return t.id})).indexOf(t)>-1}));m<y.length;m++){var b=y[m];b!==v.id||!1===n&&e.indexOf(v.id)>-1?g[v.id].push(l[b]):u.push(((i={})[v.id]=v,i))}}return{component:p,adjList:g,minIdx:a}},b=0;b<d.length;){var x=d.filter((function(t){return l[t.id]>=b})),w=(0,a.detectStrongConnectComponents)({nodes:x,edges:t.edges}).filter((function(t){return t.length>1}));if(0===w.length)break;var _=y(w),S=_.minIdx,E=_.adjList,M=_.component;if(!(M.length>1))break;M.forEach((function(t){o[t.id]=new Set}));var O=c[S];if(e&&n&&-1===e.indexOf(O.id))return u;h(O,O,E),b=S+1}return u};e.detectAllDirectedCycle=l;e.detectAllCycles=function(t,e,n,r){return void 0===r&&(r=!0),e?l(t,n,r):c(t,n,r)};var h=function(t){var e=null,n=t.nodes,r={},i={},a={},s={};(void 0===n?[]:n).forEach((function(t){i[t.id]=t}));for(var u={enter:function(t){var n=t.current,o=t.previous;if(a[n]){e={};for(var s=n,u=o;u!==n;)e[s]=u,s=u,u=r[u];e[s]=u}else a[n]=n,delete i[n],r[n]=o},leave:function(t){var e=t.current;s[e]=e,delete a[e]},allowTraversal:function(t){var n=t.next;return!e&&!s[n]}};Object.keys(i).length;){var c=Object.keys(i)[0];(0,o.default)(t,c,u)}return e};e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findShortestPath=e.findAllPath=void 0;var r,i=(r=n(150))&&r.__esModule?r:{default:r},o=n(47);e.findShortestPath=function(t,e,n,r,o){var a=(0,i.default)(t,e,r,o),s=a.length,u=a.path,c=a.allPath;return{length:s[n],path:u[n],allPath:c[n]}};e.findAllPath=function(t,e,n,r){var i;if(e===n)return[[e]];var a=t.edges,s=void 0===a?[]:a,u=[e],c=((i={})[e]=!0,i),l=[],h=[],f=r?(0,o.getNeighbors)(e,s,"target"):(0,o.getNeighbors)(e,s);for(l.push(f);u.length>0&&l.length>0;){var d=l[l.length-1];if(d.length){var p=d.shift();if(p&&(u.push(p),c[p]=!0,f=r?(0,o.getNeighbors)(p,s,"target"):(0,o.getNeighbors)(p,s),l.push(f.filter((function(t){return!c[t]})))),u[u.length-1]===n){var g=u.map((function(t){return t}));h.push(g);v=u.pop();c[v]=!1,l.pop()}}else{var v=u.pop();c[v]=!1,l.pop()}}return h}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(98))&&r.__esModule?r:{default:r},o=n(47);var a=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===r&&(r=1e3);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,c=void 0===u?[]:u,l={},h={};s.forEach((function(t,e){var n=(0,o.uniqueId)();t.clusterId=n,l[n]={id:n,nodes:[t]},h[t.id]={node:t,idx:e}}));var f=(0,i.default)(t,e),d=[],p={};f.forEach((function(t,e){var n=0,r=s[e].id;p[r]={},t.forEach((function(t,e){if(t){n+=t;var i=s[e].id;p[r][i]=t}})),d.push(n)}));for(var g=0,v=function(){var t=!1;if(s.forEach((function(e){var n={};Object.keys(p[e.id]).forEach((function(t){var r=p[e.id][t],i=h[t].node.clusterId;n[i]||(n[i]=0),n[i]+=r}));var r=-1/0,i=[];if(Object.keys(n).forEach((function(t){r<n[t]?(r=n[t],i=[t]):r===n[t]&&i.push(t)})),1!==i.length||i[0]!==e.clusterId){var o=i.indexOf(e.clusterId);if(o>=0&&i.splice(o,1),i&&i.length){t=!0;var a=l[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*i.length),c=l[i[u]];c.nodes.push(e),e.clusterId=c.id}}})),!t)return"break";g++};g<r;){if("break"===v())break}Object.keys(l).forEach((function(t){var e=l[t];e.nodes&&e.nodes.length||delete l[t]}));var m=[],y={};c.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=h[e].node.clusterId,a=h[r].node.clusterId,s="".concat(o,"---").concat(a);if(y[s])y[s].weight+=i,y[s].count++;else{var u={source:o,target:a,weight:i,count:1};y[s]=u,m.push(u)}}));var b=[];return Object.keys(l).forEach((function(t){b.push(l[t])})),{clusters:b,clusterEdges:m}};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(0),i=s(n(98)),o=s(n(308)),a=n(309);function s(t){return t&&t.__esModule?t:{default:t}}var u=function(t,e,n,r){for(var i=e.length,o=2*r,a=0,s=0;s<i;s++)for(var u=t[s].clusterId,c=0;c<i;c++){if(u===t[c].clusterId)a+=(e[s][c]||0)-(n[s]||0)*(n[c]||0)/o}return a*=1/o},c=function(t,e){return e.map((function(e){if(t.hasOwnProperty(e)){if(!isNaN(Number(t[e])))return Number(t[e]);if(t[e].match(a.secondReg)||t[e].match(a.dateReg))return Number(Date.parse(new Date(t[e])))/1e3}return 0}))},l=function(t,e){void 0===t&&(t=[]);for(var n=t.length,r=new o.default([]),i=0;i<n;i++)r=r.add(new o.default(e[i]));var a=r.avg(n);a.normalize();var s=0;for(i=0;i<n;i++){s+=(c=new o.default(e[i])).squareEuclideanDistance(a)}var u=[];t.forEach((function(){u.push([])}));for(i=0;i<n;i++){var c=new o.default(e[i]);t[i].clusterInertial=0;for(var l=0;l<n;l++)if(i!==l){var h=new o.default(e[l]);u[i][l]=c.squareEuclideanDistance(h),t[i].clusterInertial+=u[i][l]}else u[i][l]=0}var f=0,d=2*n*s;for(i=0;i<n;i++){var p=t[i].clusterId;for(l=0;l<n;l++){var g=t[l].clusterId;if(i!==l&&p===g)f+=t[i].clusterInertial*t[l].clusterInertial/Math.pow(d,2)-u[i][l]/d}}return Number(f.toFixed(4))},h=function(t,e,n,o,s,h){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===o&&(o=1e-4),void 0===s&&(s=!1),void 0===h&&(h=1);var f=t.nodes,d=void 0===f?[]:f,p=t.edges,g=void 0===p?[]:p,v=[];if(s){d.forEach((function(t,e){t.properties=t.properties||{},t.originIndex=e}));var m=[];d.every((function(t){return t.hasOwnProperty("nodeType")}))&&(m=Array.from(new Set(d.map((function(t){return t.nodeType})))),d.forEach((function(t){t.properties.nodeType=m.findIndex((function(e){return e===t.nodeType}))})));var y=function(t){void 0===t&&(t=[]);var e={};t.forEach((function(t){Object.keys(t.properties).forEach((function(n){!"".concat(t.properties[n]).match(a.secondReg)&&!"".concat(t.properties[n]).match(a.dateReg)&&isNaN(Number(t.properties[n]))||"id"===n?e.hasOwnProperty(n)&&delete e[n]:e.hasOwnProperty(n)?e[n]+=1:e[n]=1}))}));var n=Object.keys(e).sort((function(t,n){return e[n]-e[t]}));return n.length<100?n:n.slice(0,100)}(d);v=function(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=c(e[r].properties,t);return n}(y,d)}var b=1,x={},w={};d.forEach((function(t,e){var n=String(b++);t.clusterId=n,x[n]={id:n,nodes:[t]},w[t.id]={node:t,idx:e}}));var _=(0,i.default)(t,e),S=[],E={},M=0;_.forEach((function(t,e){var n=0,r=d[e].id;E[r]={},t.forEach((function(t,e){if(t){n+=t;var i=d[e].id;E[r][i]=t,M+=t}})),S.push(n)})),M/=2;for(var O=1/0,A=1/0,k=0,C=[],I={};;){O=s&&d.every((function(t){return t.hasOwnProperty("properties")}))?u(d,_,S,M)+l(d,v)*h:u(d,_,S,M),0===k&&(A=O,C=d,I=x);var T=O>0&&O>A&&O-A<o;if(O>A&&(C=d.map((function(t){return{node:t,clusterId:t.clusterId}})),I=(0,r.clone)(x),A=O),T||k>100)break;k++,Object.keys(x).forEach((function(t){var e=0;g.forEach((function(r){var i=r.source,o=r.target,a=w[i].node.clusterId,s=w[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=r[n]||1)})),x[t].sumTot=e})),d.forEach((function(t,e){var r,i=x[t.clusterId],o=0,a=S[e]/(2*M),u=0,c=i.nodes;c.forEach((function(t){var n=w[t.id].idx;u+=_[e][n]||0}));var f=u-i.sumTot*a,d=c.filter((function(e){return e.id!==t.id})),p=[];d.forEach((function(t,e){p[e]=v[t.originIndex]}));var m=l(d,v)*h,y=E[t.id];if(Object.keys(y).forEach((function(n){var i=w[n].node.clusterId;if(i!==t.clusterId){var u=x[i],c=u.nodes;if(c&&c.length){var d=0;c.forEach((function(t){var n=w[t.id].idx;d+=_[e][n]||0}));var p=d-u.sumTot*a,g=c.concat([t]),y=[];g.forEach((function(t,e){y[e]=v[t.originIndex]}));var b=l(g,v)*h,S=p-f;s&&(S=p+b-(f+m)),S>o&&(o=S,r=u)}}})),o>0){r.nodes.push(t);var b=t.clusterId;t.clusterId=r.id;var O=i.nodes.indexOf(t);i.nodes.splice(O,1);var A=0,k=0;g.forEach((function(t){var e=t.source,i=t.target,o=w[e].node.clusterId,a=w[i].node.clusterId;(o===r.id&&a!==r.id||a===r.id&&o!==r.id)&&(A+=t[n]||1),(o===b&&a!==b||a===b&&o!==b)&&(k+=t[n]||1)})),r.sumTot=A,i.sumTot=k}}))}var P={},N=0;Object.keys(I).forEach((function(t){var e=I[t];if(e.nodes&&e.nodes.length){var n=String(N+1);n!==t&&(e.id=n,e.nodes=e.nodes.map((function(t){return{id:t.id,clusterId:n}})),I[n]=e,P[t]=n,delete I[t],N++)}else delete I[t]})),C.forEach((function(t){var e=t.node,n=t.clusterId;e.clusterId=n,e.clusterId&&P[e.clusterId]&&(e.clusterId=P[e.clusterId])}));var j=[],D={};g.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=w[e].node.clusterId,a=w[r].node.clusterId,s="".concat(o,"---").concat(a);if(D[s])D[s].weight+=i,D[s].count++;else{var u={source:o,target:a,weight:i,count:1};D[s]=u,j.push(u)}}));var L=[];return Object.keys(I).forEach((function(t){L.push(I[t])})),{clusters:L,clusterEdges:j}};e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(0),i=function(){function t(t){this.arr=t}return t.prototype.add=function(e){var n,r=e.arr;if(!(null===(n=this.arr)||void 0===n?void 0:n.length))return new t(r);if(!(null==r?void 0:r.length))return new t(this.arr);if(this.arr.length===r.length){var i=[];for(var o in this.arr)i[o]=this.arr[o]+r[o];return new t(i)}},t.prototype.subtract=function(e){var n,r=e.arr;if(!(null===(n=this.arr)||void 0===n?void 0:n.length))return new t(r);if(!(null==r?void 0:r.length))return new t(this.arr);if(this.arr.length===r.length){var i=[];for(var o in this.arr)i[o]=this.arr[o]-r[o];return new t(i)}},t.prototype.avg=function(e){var n=[];for(var r in this.arr)n[r]=this.arr[r]/e;return new t(n)},t.prototype.negate=function(){var e=[];for(var n in this.arr)e[n]=-this.arr[n];return new t(e)},t.prototype.squareEuclideanDistance=function(t){var e,n=t.arr;if(!(null===(e=this.arr)||void 0===e?void 0:e.length)||!(null==n?void 0:n.length))return 0;if(this.arr.length===n.length){var r=0;for(var i in this.arr)r+=Math.pow(this.arr[i]-t.arr[i],2);return r}},t.prototype.normalize=function(){var e=[],n=(0,r.clone)(this.arr);n.sort((function(t,e){return t-e}));var i=n[n.length-1],o=n[0];for(var a in this.arr)e[a]=(this.arr[a]-o)/(i-o);return new t(e)},t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.secondReg=e.dateReg=void 0;e.secondReg=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;e.dateReg=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n(311)),i=a(n(312)),o=n(47);function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,e){var n=[],r=t.nodes,a=void 0===r?[]:r,s=t.edges,u=void 0===s?[]:s;if(0===a.length)return n;var c=a[0],l=new Set;l.add(c);var h=new i.default((function(t,n){return e?t.weight-n.weight:0}));for((0,o.getEdgesByNodeId)(c.id,u).forEach((function(t){h.insert(t)}));!h.isEmpty();){var f=h.delMin(),d=f.source,p=f.target;l.has(d)&&l.has(p)||(n.push(f),l.has(d)||(l.add(d),(0,o.getEdgesByNodeId)(d,u).forEach((function(t){h.insert(t)}))),l.has(p)||(l.add(p),(0,o.getEdgesByNodeId)(p,u).forEach((function(t){h.insert(t)}))))}return n},u=function(t,e){var n=[],i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a;if(0===o.length)return n;var u=s.map((function(t){return t}));e&&u.sort((function(t,e){return t.weight-e.weight}));for(var c=new r.default(o.map((function(t){return t.id})));u.length>0;){var l=u.shift(),h=l.source,f=l.target;c.connected(h,f)||(n.push(l),c.union(h,f))}return n},c=function(t,e,n){return n?{prim:s,kruskal:u}[n](t,e):u(t,e)};e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var r=n[e];this.parent[r]=r}}return t.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},t.prototype.union=function(t,e){var n=this.find(t),r=this.find(e);n!==r&&(n<r?(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]):(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]))},t.prototype.connected=function(t,e){return this.find(t)===this.find(e)},t}();e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(t,e){return t-e},i=function(){function t(t){void 0===t&&(t=r),this.compareFn=t,this.list=[]}return t.prototype.getLeft=function(t){return 2*t+1},t.prototype.getRight=function(t){return 2*t+2},t.prototype.getParent=function(t){return 0===t?null:Math.floor((t-1)/2)},t.prototype.isEmpty=function(){return this.list.length<=0},t.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},t.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,r=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==r&&r<o&&this.compareFn(this.list[n],this.list[r])>0?n=r:null!==i&&i<o&&this.compareFn(this.list[n],this.list[i])>0&&(n=i),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(182))&&r.__esModule?r:{default:r},o=n(47);var a=function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var r,a=1,s=0,u=1e3,c=t.nodes,l=void 0===c?[]:c,h=t.edges,f=void 0===h?[]:h,d=l.length,p={},g={},v=0;v<d;++v){p[y=(S=l[v]).id]=1/d,g[y]=1/d}for(var m=(0,i.default)(t);u>0&&a>e;){s=0;for(v=0;v<d;++v){var y=(S=l[v]).id;if(r=0,0===m[S.id].inDegree)p[y]=0;else{for(var b=(0,o.getNeighbors)(y,f,"source"),x=0;x<b.length;++x){var w=b[x],_=m[w].outDegree;_>0&&(r+=g[w]/_)}p[y]=n*r,s+=p[y]}}s=(1-s)/d,a=0;for(v=0;v<d;++v){var S;r=p[y=(S=l[v]).id]+s,a+=Math.abs(r-g[y]),g[y]=r}u-=1}return g};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(1),i=u(n(184)),o=u(n(315)),a=u(n(150)),s=n(47);function u(t){return t&&t.__esModule?t:{default:t}}var c=function(t,e,n,r){void 0===n&&(n="cluster"),void 0===r&&(r=2);var i=[],o=t.nodes;return e.forEach((function(t,e){i.push(l(o,t,e,n,r))})),i},l=function(t,e,n,r,i){var o=[n],a=[],s={};return e.forEach((function(e,u){if(e<=i&&n!==u){o.push(u),a.push(t[u]);var c=t[u][r];s[c]?(s[c].count++,s[c].dists.push(e)):s[c]={count:1,dists:[e]}}})),Object.keys(s).forEach((function(t){s[t].dists=s[t].dists.sort((function(t,e){return t-e}))})),{nodeIdx:n,nodeId:t[n].id,nodeIdxs:o,neighbors:a,neighborNum:o.length-1,nodeLabelCountMap:s}},h=function(t,e,n,r){var i=n.nodes;return r||(r={}),Object.keys(t).forEach((function(o){var a,s;if(!r||!r[o]){r[o]={nodes:[],edges:[]};var u=t[o],c=null===(a=e[u.start])||void 0===a?void 0:a.nodeIdxs,l=null===(s=e[u.end])||void 0===s?void 0:s.nodeIdxs;if(c&&l){var h=new Set(l),f=c.filter((function(t){return h.has(t)}));if(f&&f.length){for(var d={},p=f.length,g=0;g<p;g++){var v=i[f[g]];r[o].nodes.push(v),d[v.id]=!0}n.edges.forEach((function(t){d[t.source]&&d[t.target]&&r[o].edges.push(t)}))}}}})),r},f=function(t,e,n,r){var i,o,a={};t.nodes.forEach((function(t){a[t.id]=t}));var s=0;return!(null===(i=null==e?void 0:e.edges)||void 0===i?void 0:i.length)||(null===(o=null==e?void 0:e.nodes)||void 0===o?void 0:o.length)<2?0:(t.edges.forEach((function(t){var i=a[t.source][n],o=a[t.target][n],u=null==e?void 0:e.nodes[0][n],c=null==e?void 0:e.nodes[1][n],l=null==e?void 0:e.edges[0][r];t[r]===l&&(i===u&&o===c||i===c&&o===u)&&s++})),s)},d=function(t,e){var n={},r={};return t.forEach((function(t,i){n[t.id]={idx:i,node:t,degree:0,inDegree:0,outDegree:0};var o=t[e];r[o]||(r[o]=[]),r[o].push(t)})),{nodeMap:n,nodeLabelMap:r}},p=function(t,e,n){var r={},i={};return t.forEach((function(t,o){r["".concat(s.uniqueId)]={idx:o,edge:t};var a=t[e];i[a]||(i[a]=[]),i[a].push(t);var u=n[t.source];u&&(u.degree++,u.outDegree++);var c=n[t.target];c&&(c.degree++,c.inDegree++)})),{edgeMap:r,edgeLabelMap:i}},g=function(t,e,n){var r=e.length,i={};return e.forEach((function(e,o){for(var a=n?0:o+1,s=t[o].id,u=a;u<r;u++)if(o!==u){var c=t[u].id,l=e[u];i["".concat(s,"-").concat(c)]=l,n||(i["".concat(c,"-").concat(s)]=l)}})),i},v=function(t,e,n,r,i,o,a,s,u,c,l){var d,p="".concat(e.id,"-").concat(n.id);if(c&&c[p])return c[p];var g=l?l[p]:void 0;if(!g){var v=((d={})[p]={start:r[e.id].idx,end:r[n.id].idx,distance:i},d);g=(l=h(v,o,t,l))[p]}return f(g,a,s,u)},m=function(t,e,n,r){var i,o,a,s=null===(i=t[e])||void 0===i?void 0:i.degree,u=null===(o=t[e])||void 0===o?void 0:o.inDegree,c=null===(a=t[e])||void 0===a?void 0:a.outDegree;return void 0===t[e]&&(s=1/0,u=1/0,c=1/0,r[e].forEach((function(t){var e=n[t.id].degree;s>e&&(s=e);var r=n[t.id].inDegree;u>r&&(u=r);var i=n[t.id].outDegree;c>i&&(c=i)})),t[e]={degree:s,inDegree:u,outDegree:c}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:c}},y=function(t,e,n,s,u,y,b){var x;if(void 0===n&&(n=!1),void 0===y&&(y="cluster"),void 0===b&&(b="cluster"),t&&t.nodes){var w=t.nodes.length;if(w){var _=(0,i.default)(t,n),S=(0,i.default)(e,n),E=g(t.nodes,_,n),M=g(e.nodes,S,n),O=d(t.nodes,y),A=O.nodeMap,k=O.nodeLabelMap,C=d(e.nodes,y),I=C.nodeMap,T=C.nodeLabelMap;p(t.edges,b,A);var P=p(e.edges,b,I).edgeLabelMap,N=[];null==S||S.forEach((function(t){N=N.concat(t)})),u||(u=Math.max.apply(Math,(0,r.__spreadArray)((0,r.__spreadArray)([],N,!1),[2],!1))),s||(s=u);var j=c(t,_,y,s),D=c(e,S,y,s),L=function(t,e,n,r,i){var o=Math.ceil(n/e),a={},s=0;return r.forEach((function(t,r){for(var u=0,c=0,l=t.nodeIdxs,h=t.neighborNum-1;u<o;){for(var f=l[1+Math.floor(Math.random()*h)],d=0;(a["".concat(r,"-").concat(f)]||a["".concat(f,"-").concat(r)])&&(f=Math.floor(Math.random()*e),!(++d>2*e)););if(d<2*e&&(a["".concat(r,"-").concat(f)]={start:r,end:f,distance:i[r][f]},u++,++s>=n))return a;if(++c>2*e)break}u<o&&(o=(o+(o-u))/(e-r-1))})),a}(0,w,Math.min(100,w*(w-1)/2),D,_),R=h(L,j,t),B={graphs:R,nodeLabelProp:y,edgeLabelProp:b,minSupport:1,minNodeNum:1,maxNodeNum:4,directed:n},G=(0,o.default)(B).slice(0,10),F=G.length,z=[];G.forEach((function(t,e){z[e]={},Object.keys(R).forEach((function(n){var r=R[n],i=f(r,t,y,b);z[e][n]=i}))}));var U=function(t,e,n){for(var r=1/0,i=0,o=function(e){var n=t[e],o=Object.keys(n).sort((function(t,e){return n[t]-n[e]})),a=[];o.forEach((function(t,e){a[e%10]||(a[e%10]={graphs:[],totalCount:0,aveCount:0}),a[e%10].graphs.push(t),a[e%10].totalCount+=n[t]}));var s=0,u=[];a.forEach((function(t){var e=t.totalCount/t.graphs.length;t.aveCount=e,u.push(e);var r=0,i=t.length;t.graphs.forEach((function(e,i){var o=n[e];t.graphs.forEach((function(t,e){i!==e&&(r+=Math.abs(o-n[t]))}))})),s+=r/=i*(i-1)/2})),s/=a.length;var c=0;u.forEach((function(t,e){u.forEach((function(n,r){e!==r&&(c+=Math.abs(t-n))})),c/=u.length*(u.length-1)/2}));var l=c-s;r<l&&(r=l,i=e)},a=0;a<e;a++)o(a);return{structure:n[i],structureCountMap:t[i]}}(z,F,G),V=U.structure,W=U.structureCountMap,Y=e.nodes[0],X=[],H=null===(x=e.nodes[0])||void 0===x?void 0:x[y],q=-1/0;e.nodes.forEach((function(t){var e=t[y],n=k[e];(null==n?void 0:n.length)>q&&(q=n.length,X=n,H=e,Y=t)}));var K={},Z={},$={},Q={},J={},tt={};Object.keys(T).forEach((function(r,i){J[r]=[],n&&(tt[r]=[]);var o=-1/0,a=T[r],s={};a.forEach((function(t){var e=M["".concat(Y.id,"-").concat(t.id)];if(e&&J[r].push(e),o<e&&(o=e),s["".concat(Y.id,"-").concat(t.id)]={start:0,end:I[t.id].idx,distance:e},n){var i=M["".concat(t.id,"-").concat(Y.id)];i&&tt[r].push(i)}})),J[r]=J[r].sort((function(t,e){return t-e})),n&&(tt[r]=tt[r].sort((function(t,e){return t-e}))),Z=h(s,D,e,Z);var u=[];if(Object.keys(s).forEach((function(t){if($[t])u.push($[t]);else{var e=Z[t];$[t]=f(e,V,y,b),u.push($[t])}})),u=u.sort((function(t,e){return e-t})),Q["".concat(Y.id,"-").concat(r)]=u,r!==H)for(var c=function(e){var n=X[e],i=j[A[n.id].idx],o=i.nodeLabelCountMap[r],a=T[r].length;if(!o||o.count<a)return X.splice(e,1),"continue";for(var s=!1,c=0;c<a;c++)if(o.dists[c]>J[r][c]){s=!0;break}if(s)return X.splice(e,1),"continue";var l={};i.neighbors.forEach((function(t){var e=E["".concat(n.id,"-").concat(t.id)];l["".concat(n.id,"-").concat(t.id)]={start:A[n.id].idx,end:A[t.id].idx,distance:e}})),R=h(l,j,t,R);var d=[];Object.keys(l).forEach((function(t){if(W[t])d.push(W[t]);else{var e=R[t];W[t]=f(e,V,y,b),d.push(W[t])}})),d=d.sort((function(t,e){return e-t}));var p=!1;for(c=0;c<a;c++)if(d[c]<u[c]){p=!0;break}return p?(X.splice(e,1),"continue"):void 0},l=((null==X?void 0:X.length)||0)-1;l>=0;l--)c(l)}));var et=[];null==X||X.forEach((function(r){for(var i=A[r.id].idx,o=l(t.nodes,_[i],i,y,u).neighbors,a=!1,s=o.length-1;s>=0;s--){if(o.length+1<e.nodes.length)return void(a=!0);var c=o[s],h=c[y];if(T[h]&&T[h].length)if(J[h]&&J[h].length){var f="".concat(r.id,"-").concat(c.id),d=E[f],p=J[h].length-1;if(d>J[h][p])o.splice(s,1);else{if(n){var g="".concat(c.id,"-").concat(r.id),x=E[g];if(p=tt[h].length-1,x>tt[h][p]){o.splice(s,1);continue}}var w=W[f]?W[f]:v(t,r,c,A,d,j,V,y,b,W,R),S="".concat(Y.id,"-").concat(h);if(w<Q[S][Q[S].length-1])o.splice(s,1);else{var M=m(K,h,I,T),O=M.minPatternNodeLabelDegree;M.minPatternNodeLabelInDegree,M.minPatternNodeLabelOutDegree;A[c.id].degree<O&&o.splice(s,1)}}}else o.splice(s,1);else o.splice(s,1)}a||et.push({nodes:[r].concat(o)})}));var nt=(0,a.default)(e,Y.id,!1).length,rt={};n?(Object.keys(nt).forEach((function(t){var e=I[t].node[y];rt[e]?rt[e].push(nt[t]):rt[e]=[nt[t]]})),Object.keys(rt).forEach((function(t){rt[t].sort((function(t,e){return t-e}))}))):rt=J;for(var it=function(r){var i=et[r],o=i.nodes[0],s={},u={};i.nodes.forEach((function(t,e){u[t.id]={idx:e,node:t,degree:0,inDegree:0,outDegree:0};var n=t[y];s[n]?s[n]++:s[n]=1}));var c=[],l={};t.edges.forEach((function(t){u[t.source]&&u[t.target]&&(c.push(t),l[t[b]]?l[t[b]]++:l[t[b]]=1,u[t.source].degree++,u[t.target].degree++,u[t.source].outDegree++,u[t.target].inDegree++)}));for(var h=Object.keys(P).length,f=!1,d=0;d<h;d++){var p=Object.keys(P)[d];if(!l[p]||l[p]<P[p].length){f=!0;break}}if(f)return et.splice(r,1),"continue";var g=c.length;if(g<e.edges.length)return et.splice(r,1),"break";var v=!1,x=function(t){var e=c[t],r=e[b],i=P[r];if(!i||!i.length)return l[r]--,i&&l[r]<i.length?(v=!0,"break"):(c.splice(t,1),u[e.source].degree--,u[e.target].degree--,u[e.source].outDegree--,u[e.target].inDegree--,"continue");var o=u[e.source].node[y],a=u[e.target].node[y],s=!1;return i.forEach((function(t){var e=I[t.source].node,r=I[t.target].node;e[y]===o&&r[y]===a&&(s=!0),n||e[y]!==a||r[y]!==o||(s=!0)})),s?void 0:(l[r]--,i&&l[r]<i.length?(v=!0,"break"):(c.splice(t,1),u[e.source].degree--,u[e.target].degree--,u[e.source].outDegree--,u[e.target].inDegree--,"continue"))};for(d=g-1;d>=0;d--){if("break"===x(d))break}if(v)return et.splice(r,1),"continue";i.edges=c;var w=(0,a.default)(i,i.nodes[0].id,!1).length;if(Object.keys(w).reverse().forEach((function(t){if(t!==i.nodes[0].id&&!v){if(w[t]===1/0){var e=u[t].node[y];if(s[e]--,s[e]<T[e].length)return void(v=!0);var n=i.nodes.indexOf(u[t].node);return i.nodes.splice(n,1),void(u[t]=void 0)}var r=A[t].node[y];if(!rt[r]||!rt[r].length||w[t]>rt[r][rt[r].length-1]){e=u[t].node[y];if(s[e]--,s[e]<T[e].length)return void(v=!0);n=i.nodes.indexOf(u[t].node);i.nodes.splice(n,1),u[t]=void 0}}})),v)return et.splice(r,1),"continue";for(var _=!0,S=0;_&&!v;){if(_=!1,n?u[o.id].degree<I[Y.id].degree||u[o.id].inDegree<I[Y.id].inDegree||u[o.id].outDegree<I[Y.id].outDegree:u[o.id].degree<I[Y.id].degree){v=!0;break}if(s[o[y]]<T[o[y]].length){v=!0;break}for(var E=i.nodes.length-1;E>=0;E--){var M=i.nodes[E],O=u[M.id].degree,k=u[M.id].inDegree,C=u[M.id].outDegree,N=M[y],j=m(K,N,I,T),D=j.minPatternNodeLabelDegree,L=j.minPatternNodeLabelInDegree,R=j.minPatternNodeLabelOutDegree;if(n?O<D||k<L||C<R:O<D){if(s[M[y]]--,s[M[y]]<T[M[y]].length){v=!0;break}i.nodes.splice(E,1),u[M.id]=void 0,_=!0}}if(v||!_&&0!==S)break;for(var B=(g=c.length)-1;B>=0;B--){var G=c[B];if(!u[G.source]||!u[G.target]){c.splice(B,1);var F=G[b];if(l[F]--,u[G.source]&&(u[G.source].degree--,u[G.source].outDegree--),u[G.target]&&(u[G.target].degree--,u[G.target].inDegree--),P[F]&&l[F]<P[F].length){v=!0;break}_=!0}}S++}return v||v||i.nodes.length<e.nodes.length||c.length<e.edges.length?(et.splice(r,1),"continue"):void 0},ot=et.length-1;ot>=0;ot--){if("break"===it(ot))break}var at=et.length,st=function(t){var e=et[t],n={};e.edges.forEach((function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);n[e]?n[e]++:n[e]=1}));for(var r=function(t){var e=et[t],r={};e.edges.forEach((function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1}));var i=!0;Object.keys(r).length!==Object.keys(n).length?i=!1:Object.keys(n).forEach((function(t){r[t]!==n[t]&&(i=!1)})),i&&et.splice(t,1)},i=at-1;i>t;i--)r(i);at=et.length};for(ot=0;ot<=at-1;ot++)st(ot);return et}}};e.default=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(0),i=n(316),o=function(){function t(t,e,n,r,o){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||i.VACANT_NODE_LABEL,edgeLabel:r||i.VACANT_EDGE_LABEL,nodeLabel2:o||i.VACANT_NODE_LABEL}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),a=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var n=0;n<e;n++)if(this.dfsEdgeList[n]!==t[n])return!1;return!0},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t.prototype.pushBack=function(t,e,n,r,i){return this.dfsEdgeList.push(new o(t,e,n,r,i)),this.dfsEdgeList},t.prototype.toGraph=function(t,e){void 0===t&&(t=i.VACANT_GRAPH_ID),void 0===e&&(e=!1);var n=new i.Graph(t,!0,e);return this.dfsEdgeList.forEach((function(t){var e=t.fromNode,r=t.toNode,o=t.nodeEdgeNodeLabel,a=o.nodeLabel1,s=o.edgeLabel,u=o.nodeLabel2;a!==i.VACANT_NODE_LABEL&&n.addNode(e,a),u!==i.VACANT_NODE_LABEL&&n.addNode(r,u),a!==i.VACANT_NODE_LABEL&&u!==a&&n.addEdge(void 0,e,r,s)})),n},t.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length-1;e>=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,i=n.toNode;r<i&&(void 0===t||i===t)&&(this.rmpath.push(e),t=r)}return this.rmpath},t.prototype.getNodeNum=function(){var t={};return this.dfsEdgeList.forEach((function(e){t[e.fromNode]||(t[e.fromNode]=!0),t[e.toNode]||(t[e.toNode]=!0)})),Object.keys(t).length},t}(),s=function(){function t(t){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],t){for(;t;){var e=t.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,t=t.preNode}this.edges=this.edges.reverse()}}return t.prototype.hasNode=function(t){return 1===this.nodesUsed[t.id]},t.prototype.hasEdge=function(t){return 1===this.edgesUsed[t.id]},t}(),u=function(){function t(t){var e=t.graphs,n=t.minSupport,r=void 0===n?2:n,i=t.minNodeNum,o=void 0===i?1:i,s=t.maxNodeNum,u=void 0===s?4:s,c=t.top,l=void 0===c?10:c,h=t.directed,f=void 0!==h&&h,d=t.verbose,p=void 0!==d&&d;this.graphs=e,this.dfsCode=new a,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=r,this.top=l,this.directed=f,this.counter=0,this.maxNodeNum=u,this.minNodeNum=o,this.verbose=p,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return t.prototype.findForwardRootEdges=function(t,e){var n=this,r=[],i=t.nodeMap;return e.edges.forEach((function(t){(n.directed||e.label<=i[t.to].label)&&r.push(t)})),r},t.prototype.findBackwardEdge=function(t,e,n,r){if(!this.directed&&e===n)return null;for(var i=t.nodeMap,o=i[n.to].edges,a=o.length,s=0;s<a;s++){var u=o[s];if(!r.hasEdge(u)&&u.to===e.from)if(this.directed){if(i[e.from].label<i[n.to].label||i[e.from].label===i[n.to].label&&e.label<=u.label)return u}else if(e.label<u.label||e.label===u.label&&i[e.to].label<=i[n.to].label)return u}return null},t.prototype.findForwardPureEdges=function(t,e,n,r){for(var i=[],o=e.to,a=t.nodeMap[o].edges,s=a.length,u=0;u<s;u++){var c=a[u],l=t.nodeMap[c.to];n<=l.label&&!r.hasNode(l)&&i.push(c)}return i},t.prototype.findForwardRmpathEdges=function(t,e,n,r){for(var i=[],o=t.nodeMap,a=o[e.to].label,s=o[e.from].edges,u=s.length,c=0;c<u;c++){var l=s[c],h=o[l.to].label;e.to===l.to||n>h||r.hasNode(o[l.to])||(e.label<l.label||e.label===l.label&&a<=h)&&i.push(l)}return i},t.prototype.getSupport=function(t){var e={};return t.forEach((function(t){e[t.graphId]||(e[t.graphId]=!0)})),Object.keys(e).length},t.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach((function(n){var r=t[n],i=r.nodeLabel1,o=r.edgeLabel,a=r.nodeLabel2;e?(i<e.nodeLabel1||i===e.nodeLabel1&&o<e.edgeLabel||i===e.nodeLabel1&&o===e.edgeLabel&&a<e.nodeLabel2)&&(e={nodeLabel1:i,edgeLabel:o,nodeLabel2:a}):e={nodeLabel1:i,edgeLabel:o,nodeLabel2:a}})),e},t.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),1===e.dfsEdgeList.length)return!0;var n=this.directed,r=e.toGraph(i.VACANT_GRAPH_ID,n),u=r.nodeMap,c=new a,l={};r.nodes.forEach((function(e){t.findForwardRootEdges(r,e).forEach((function(t){var n=u[t.to],i="".concat(e.label,"-").concat(t.label,"-").concat(n.label);l[i]||(l[i]={projected:[],nodeLabel1:e.label,edgeLabel:t.label,nodeLabel2:n.label});var o={graphId:r.id,edge:t,preNode:null};l[i].projected.push(o)}))}));var h=this.findMinLabel(l);if(h){c.dfsEdgeList.push(new o(0,1,h.nodeLabel1,h.edgeLabel,h.nodeLabel2));var f="".concat(h.nodeLabel1,"-").concat(h.edgeLabel,"-").concat(h.nodeLabel2);return function a(l){for(var h=c.buildRmpath(),f=c.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,d=c.dfsEdgeList[h[0]].toNode,p={},g=!1,v=0,m=n?-1:0,y=function(e){if(g)return"break";l.forEach((function(n){var i=new s(n),o=t.findBackwardEdge(r,i.edges[h[e]],i.edges[h[0]],i);o&&(p[o.label]||(p[o.label]={projected:[],edgeLabel:o.label}),p[o.label].projected.push({graphId:r.id,edge:p,preNode:n}),v=c.dfsEdgeList[h[e]].fromNode,g=!0)}))},b=h.length-1;b>m;b--){if("break"===y(b))break}if(g){var x=t.findMinLabel(p);c.dfsEdgeList.push(new o(d,v,i.VACANT_NODE_LABEL,x.edgeLabel,i.VACANT_NODE_LABEL));var w=c.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[w]===c.dfsEdgeList[w]&&a(p[x.edgeLabel].projected)}var _={};g=!1;var S=0;l.forEach((function(e){var n=new s(e),i=t.findForwardPureEdges(r,n.edges[h[0]],f,n);i.length>0&&(g=!0,S=d,i.forEach((function(t){var n="".concat(t.label,"-").concat(u[t.to].label);_[n]||(_[n]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}));var E=h.length,M=function(e){if(g)return"break";var n=h[e];l.forEach((function(e){var i=new s(e),o=t.findForwardRmpathEdges(r,i.edges[n],f,i);o.length>0&&(g=!0,S=c.dfsEdgeList[n].fromNode,o.forEach((function(t){var n="".concat(t.label,"-").concat(u[t.to].label);_[n]||(_[n]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}))};for(b=0;b<E;b++){if("break"===M(b))break}if(!g)return!0;var O=t.findMinLabel(_);c.dfsEdgeList.push(new o(S,d+1,i.VACANT_NODE_LABEL,O.edgeLabel,O.nodeLabel2));var A=c.dfsEdgeList.length-1;return e.dfsEdgeList[A]===c.dfsEdgeList[A]&&a(_["".concat(O.edgeLabel,"-").concat(O.nodeLabel2)].projected)}(l[f].projected)}},t.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push((0,r.clone)(t))}},t.prototype.subGraphMining=function(t){var e=this;if(!(this.getSupport(t)<this.minSupport)&&this.isMin()){this.report();var n=this.dfsCode.getNodeNum(),r=this.dfsCode.buildRmpath(),a=this.dfsCode.dfsEdgeList[r[0]].toNode,u=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,c={},l={};t.forEach((function(t){for(var i=e.graphs[t.graphId],o=i.nodeMap,h=new s(t),f=r.length-1;f>=0;f--){var d=e.findBackwardEdge(i,h.edges[r[f]],h.edges[r[0]],h);if(d){var p="".concat(e.dfsCode.dfsEdgeList[r[f]].fromNode,"-").concat(d.label);l[p]||(l[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[f]].fromNode,edgeLabel:d.label}),l[p].projected.push({graphId:t.graphId,edge:d,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(i,h.edges[r[0]],u,h).forEach((function(e){var n="".concat(a,"-").concat(e.label,"-").concat(o[e.to].label);c[n]||(c[n]={projected:[],fromNodeId:a,edgeLabel:e.label,nodeLabel2:o[e.to].label}),c[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var g=function(n){e.findForwardRmpathEdges(i,h.edges[r[n]],u,h).forEach((function(i){var a="".concat(e.dfsCode.dfsEdgeList[r[n]].fromNode,"-").concat(i.label,"-").concat(o[i.to].label);c[a]||(c[a]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[r[n]].fromNode,edgeLabel:i.label,nodeLabel2:o[i.to].label}),c[a].projected.push({graphId:t.graphId,edge:i,preNode:t})}))};for(f=0;f<r.length;f++)g(f)}})),Object.keys(l).forEach((function(t){var n=l[t],r=n.toNodeId,i=n.edgeLabel;e.dfsCode.dfsEdgeList.push(new o(a,r,"-1",i,"-1")),e.subGraphMining(l[t].projected),e.dfsCode.dfsEdgeList.pop()})),Object.keys(c).forEach((function(t){var n=c[t],r=n.fromNodeId,s=n.edgeLabel,u=n.nodeLabel2;e.dfsCode.dfsEdgeList.push(new o(r,a+1,i.VACANT_NODE_LABEL,s,u)),e.subGraphMining(c[t].projected),e.dfsCode.dfsEdgeList.pop()}))}},t.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,n=this.minSupport,r=this.frequentSize1Subgraphs,i={},o={},a={},s={};return Object.keys(t).forEach((function(n){var r=t[n],u=r.nodeMap;r.nodes.forEach((function(t,r){var c=t.label,l="".concat(n,"-").concat(c);if(!a[l]){var h=i[c]||0;h++,i[c]=h}a[l]={graphKey:n,label:c},t.edges.forEach((function(t){var r=c,i=u[t.to].label;if(!e&&r>i){var a=i;i=r,r=a}var l=t.label,h="".concat(n,"-").concat(r,"-").concat(l,"-").concat(i),f="".concat(r,"-").concat(l,"-").concat(i);if(!o[f]){var d=o[f]||0;d++,o[f]=d}s[h]={graphId:n,nodeLabel1:r,edgeLabel:l,nodeLabel2:i}}))}))})),Object.keys(i).forEach((function(t){if(!(i[t]<n)){var e={nodes:[],edges:[]};e.nodes.push({id:"0",label:t}),r.push(e)}})),r},t.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs,n=(this.directed,{});Object.keys(e).forEach((function(r){var i=e[r],o=i.nodeMap;i.nodes.forEach((function(e){t.findForwardRootEdges(i,e).forEach((function(t){var i=o[t.to],a="".concat(e.label,"-").concat(t.label,"-").concat(i.label);n[a]||(n[a]={projected:[],nodeLabel1:e.label,edgeLabel:t.label,nodeLabel2:i.label});var s={graphId:r,edge:t,preNode:null};n[a].projected.push(s)}))}))})),Object.keys(n).forEach((function(e){var r=n[e],i=r.projected,a=r.nodeLabel1,s=r.edgeLabel,u=r.nodeLabel2;t.dfsCode.dfsEdgeList.push(new o(0,1,a,s,u)),t.subGraphMining(i),t.dfsCode.dfsEdgeList.pop()}))}},t}(),c=function(t){var e=t.graphs,n=t.directed,r=void 0!==n&&n,o=t.nodeLabelProp,a=void 0===o?"cluster":o,s=t.edgeLabelProp,c=void 0===s?"cluster":s,l=function(t,e,n,r){var o={};return Object.keys(t).forEach((function(a,s){var u=t[a],c=new i.Graph(s,!0,e),l={};u.nodes.forEach((function(t,e){c.addNode(e,t[n]),l[t.id]=e})),u.edges.forEach((function(t,e){var n=l[t.source],i=l[t.target];c.addEdge(-1,n,i,t[r])})),c&&c.getNodeNum()&&(o[c.id]=c)})),o}(e,r,a,c),h=t.minSupport,f=t.maxNodeNum,d=t.minNodeNum,p=t.verbose,g=t.top,v=new u({graphs:l,minSupport:h,maxNodeNum:f,minNodeNum:d,top:g,verbose:p,directed:r});return v.run(),function(t,e,n){var r=[];return t.forEach((function(t){var i={nodes:[],edges:[]};t.nodes.forEach((function(t){var n;i.nodes.push(((n={id:"".concat(t.id)})[e]=t.label,n))})),t.edges.forEach((function(t){var e;i.edges.push(((e={source:"".concat(t.from),target:"".concat(t.to)})[n]=t.label,e))})),r.push(i)})),r}(v.frequentSubgraphs,a,c)};e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VACANT_NODE_LABEL=e.VACANT_NODE_ID=e.VACANT_GRAPH_ID=e.VACANT_EDGE_LABEL=e.VACANT_EDGE_ID=e.Node=e.Graph=e.Edge=e.AUTO_EDGE_ID=void 0;e.VACANT_EDGE_ID=-1;e.VACANT_NODE_ID=-1;e.VACANT_EDGE_LABEL="-1";e.VACANT_NODE_LABEL="-1";e.VACANT_GRAPH_ID=-1;e.AUTO_EDGE_ID="-1";var r=function(t,e,n,r){void 0===t&&(t=-1),void 0===e&&(e=-1),void 0===n&&(n=-1),void 0===r&&(r="-1"),this.id=t,this.from=e,this.to=n,this.label=r};e.Edge=r;var i=function(){function t(t,e){void 0===t&&(t=-1),void 0===e&&(e="-1"),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return t.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},t}();e.Node=i;var o=function(){function t(t,e,n){void 0===t&&(t=-1),void 0===e&&(e=!0),void 0===n&&(n=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return t.prototype.getNodeNum=function(){return this.nodes.length},t.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new i(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},t.prototype.addEdge=function(t,e,n,i){if((this.edgeIdAutoIncrease||void 0===t)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[t])){var o=new r(t,e,n,i);if(this.edges.push(o),this.edgeMap[t]=o,this.nodeMap[e].addEdge(o),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(o),!this.directed){var a=new r(t,n,e,i);this.nodeMap[n].addEdge(a),this.edgeLabelMap[i].push(a)}}},t}();e.Graph=o},function(t,e,n){var r=n(318),i=n(319),o=Object.hasOwnProperty,a={};for(var s in r)o.call(r,s)&&(a[r[s]]=s);var u=t.exports={to:{},get:{}};function c(t,e,n){return Math.min(Math.max(e,t),n)}function l(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),n="hsl";break;case"hwb":e=u.get.hwb(t),n="hwb";break;default:e=u.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,n,i,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var s=2*n;a[n]=parseInt(e.slice(s,s+2),16)}i&&(a[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)a[n]=parseInt(e[n]+e[n],16);i&&(a[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)a[n]=parseInt(e[n+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:o.call(r,e[1])?((a=r[e[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=c(a[n],0,255);return a[3]=c(a[3],0,1),a},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},u.to.hex=function(){var t=i(arguments);return"#"+l(t[0])+l(t[1])+l(t[2])+(t[3]<1?l(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=i(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=i(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},u.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return a[t.slice(0,3)]}},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){"use strict";var r=n(320),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var s=t[n];r(s)?e=i.call(e,o.call(s)):e.push(s)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},function(t,e){t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},function(t,e,n){var r=n(185),i=n(323),o={};Object.keys(r).forEach((function(t){o[t]={},Object.defineProperty(o[t],"channels",{value:r[t].channels}),Object.defineProperty(o[t],"labels",{value:r[t].labels});var e=i(t);Object.keys(e).forEach((function(n){var r=e[n];o[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var r=n.length,i=0;i<r;i++)n[i]=Math.round(n[i]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}(r),o[t][n].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(r)}))})),t.exports=o},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){var r=n(185);function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i<n;i++)t[e[i]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;)for(var i=n.pop(),o=Object.keys(r[i]),a=o.length,s=0;s<a;s++){var u=o[s],c=e[u];-1===c.distance&&(c.distance=e[i].distance+1,c.parent=i,n.unshift(u))}return e}function o(t,e){return function(n){return e(t(n))}}function a(t,e){for(var n=[e[t].parent,t],i=r[e[t].parent][t],a=e[t].parent;e[a].parent;)n.unshift(e[a].parent),i=o(r[e[a].parent][a],i),a=e[a].parent;return i.conversion=n,i}t.exports=function(t){for(var e=i(t),n={},r=Object.keys(e),o=r.length,s=0;s<o;s++){var u=r[s];null!==e[u].parent&&(n[u]=a(u,e))}return n}},function(t,e,n){var r=n(325);t.exports={Graph:r.Graph,json:n(427),alg:n(428),version:r.version}},function(t,e,n){t.exports={Graph:n(151),version:n(426)}},function(t,e,n){var r=n(186);t.exports=function(t){return r(t,4)}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(101),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(101);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(101);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(101);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(100);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(100),i=n(152),o=n(153);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(88),i=n(340),o=n(45),a=n(189),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,h=c.hasOwnProperty,f=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?f:s).test(a(t))}},function(t,e,n){var r=n(74),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r,i=n(341),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},function(t,e,n){var r=n(49)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(344),i=n(100),o=n(152);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(345),i=n(346),o=n(347),a=n(348),s=n(349);function u(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])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e,n){var r=n(102);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(102),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(102),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},function(t,e,n){var r=n(102);t.exports=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}},function(t,e,n){var r=n(103);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(103);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(103);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(103);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},function(t,e,n){var r=n(89),i=n(60);t.exports=function(t,e){return t&&r(e,i(e),t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(66),i=n(51);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(66),i=n(156),o=n(51),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 o(t)&&i(t.length)&&!!a[r(t)]}},function(t,e,n){var r=n(192)(Object.keys,Object);t.exports=r},function(t,e,n){var r=n(89),i=n(67);t.exports=function(t,e){return t&&r(e,i(e),t)}},function(t,e,n){var r=n(45),i=n(108),o=n(363),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=i(t),n=[];for(var s in t)("constructor"!=s||!e&&a.call(t,s))&&n.push(s);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){var r=n(89),i=n(159);t.exports=function(t,e){return r(t,i(t),e)}},function(t,e,n){var r=n(89),i=n(197);t.exports=function(t,e){return r(t,i(t),e)}},function(t,e,n){var r=n(199),i=n(197),o=n(67);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(65)(n(49),"DataView");t.exports=r},function(t,e,n){var r=n(65)(n(49),"Promise");t.exports=r},function(t,e,n){var r=n(65)(n(49),"WeakMap");t.exports=r},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},function(t,e,n){var r=n(161),i=n(372),o=n(373),a=n(374),s=n(202);t.exports=function(t,e,n){var u=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new u(+t);case"[object DataView]":return i(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 s(t,n);case"[object Map]":return new u;case"[object Number]":case"[object String]":return new u(t);case"[object RegExp]":return o(t);case"[object Set]":return new u;case"[object Symbol]":return a(t)}}},function(t,e,n){var r=n(161);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},function(t,e){var n=/\w*$/;t.exports=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}},function(t,e,n){var r=n(74),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;t.exports=function(t){return o?Object(o.call(t)):{}}},function(t,e,n){var r=n(376),i=n(107),o=n(157),a=o&&o.isMap,s=a?i(a):r;t.exports=s},function(t,e,n){var r=n(76),i=n(51);t.exports=function(t){return i(t)&&"[object Map]"==r(t)}},function(t,e,n){var r=n(378),i=n(107),o=n(157),a=o&&o.isSet,s=a?i(a):r;t.exports=s},function(t,e,n){var r=n(76),i=n(51);t.exports=function(t){return i(t)&&"[object Set]"==r(t)}},function(t,e){t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}},function(t,e,n){var r=n(54);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,a=e?o:-1,s=Object(n);(e?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},function(t,e,n){var r=n(110);t.exports=function(t,e){var n=[];return r(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}},function(t,e,n){var r=n(383),i=n(391),o=n(214);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(99),i=n(209);t.exports=function(t,e,n,o){var a=n.length,s=a,u=!o;if(null==t)return!s;for(t=Object(t);a--;){var c=n[a];if(u&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++a<s;){var l=(c=n[a])[0],h=t[l],f=c[1];if(u&&c[2]){if(void 0===h&&!(l in t))return!1}else{var d=new r;if(o)var p=o(h,f,l,t,e,d);if(!(void 0===p?i(f,h,3,o,d):p))return!1}}return!0}},function(t,e,n){var r=n(99),i=n(210),o=n(388),a=n(390),s=n(76),u=n(32),c=n(75),l=n(91),h="[object Object]",f=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,d,p,g){var v=u(t),m=u(e),y=v?"[object Array]":s(t),b=m?"[object Array]":s(e),x=(y="[object Arguments]"==y?h:y)==h,w=(b="[object Arguments]"==b?h:b)==h,_=y==b;if(_&&c(t)){if(!c(e))return!1;v=!0,x=!1}if(_&&!x)return g||(g=new r),v||l(t)?i(t,e,n,d,p,g):o(t,e,y,n,d,p,g);if(!(1&n)){var S=x&&f.call(t,"__wrapped__"),E=w&&f.call(e,"__wrapped__");if(S||E){var M=S?t.value():t,O=E?e.value():e;return g||(g=new r),p(M,O,n,d,g)}}return!!_&&(g||(g=new r),a(t,e,n,d,p,g))}},function(t,e){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=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}},function(t,e,n){var r=n(74),i=n(201),o=n(73),a=n(210),s=n(389),u=n(165),c=r?r.prototype:void 0,l=c?c.valueOf:void 0;t.exports=function(t,e,n,r,c,h,f){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||!h(new i(t),new i(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+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 d=s;case"[object Set]":var p=1&r;if(d||(d=u),t.size!=e.size&&!p)return!1;var g=f.get(t);if(g)return g==e;r|=2,f.set(t,e);var v=a(d(t),d(e),r,c,h,f);return f.delete(t),v;case"[object Symbol]":if(l)return l.call(t)==l.call(e)}return!1}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},function(t,e,n){var r=n(198),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,o,a,s){var u=1&n,c=r(t),l=c.length;if(l!=r(e).length&&!u)return!1;for(var h=l;h--;){var f=c[h];if(!(u?f in e:i.call(e,f)))return!1}var d=s.get(t),p=s.get(e);if(d&&p)return d==e&&p==t;var g=!0;s.set(t,e),s.set(e,t);for(var v=u;++h<l;){var m=t[f=c[h]],y=e[f];if(o)var b=u?o(y,m,f,e,t,s):o(m,y,f,t,e,s);if(!(void 0===b?m===y||a(m,y,n,o,s):b)){g=!1;break}v||(v="constructor"==f)}if(g&&!v){var x=t.constructor,w=e.constructor;x==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(g=!1)}return s.delete(t),s.delete(e),g}},function(t,e,n){var r=n(213),i=n(60);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],a=t[o];e[n]=[o,a,r(a)]}return e}},function(t,e,n){var r=n(209),i=n(393),o=n(216),a=n(166),s=n(213),u=n(214),c=n(92);t.exports=function(t,e){return a(t)&&s(e)?u(c(t),e):function(n){var a=i(n,t);return void 0===a&&a===e?o(n,t):r(e,a,3)}}},function(t,e,n){var r=n(111);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},function(t,e,n){var r=n(395),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,(function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)})),e}));t.exports=a},function(t,e,n){var r=n(396);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},function(t,e,n){var r=n(153);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,t.exports=i},function(t,e,n){var r=n(74),i=n(113),o=n(32),a=n(77),s=r?r.prototype:void 0,u=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(218),i=n(400),o=n(166),a=n(92);t.exports=function(t){return o(t)?r(a(t)):i(t)}},function(t,e,n){var r=n(111);t.exports=function(t){return function(e){return r(e,t)}}},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&n.call(t,e)}},function(t,e,n){var r=n(158),i=n(76),o=n(90),a=n(32),s=n(54),u=n(75),c=n(108),l=n(91),h=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(s(t)&&(a(t)||"string"==typeof t||"function"==typeof t.splice||u(t)||l(t)||o(t)))return!t.length;var e=i(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(c(t))return!r(t).length;for(var n in t)if(h.call(t,n))return!1;return!0}},function(t,e){t.exports=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}},function(t,e){t.exports=function(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}},function(t,e,n){var r=n(158),i=n(76),o=n(54),a=n(406),s=n(407);t.exports=function(t){if(null==t)return 0;if(o(t))return a(t)?s(t):t.length;var e=i(t);return"[object Map]"==e||"[object Set]"==e?t.size:r(t).length}},function(t,e,n){var r=n(66),i=n(32),o=n(51);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==r(t)}},function(t,e,n){var r=n(408),i=n(409),o=n(410);t.exports=function(t){return i(t)?o(t):r(t)}},function(t,e,n){var r=n(218)("length");t.exports=r},function(t,e){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return n.test(t)}},function(t,e){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+i+")"+"?",c="[\\ufe0e\\ufe0f]?"+u+("(?:\\u200d(?:"+[o,a,s].join("|")+")[\\ufe0e\\ufe0f]?"+u+")*"),l="(?:"+[o+r+"?",r,a,s,n].join("|")+")",h=RegExp(i+"(?="+i+")|"+l+c,"g");t.exports=function(t){for(var e=h.lastIndex=0;h.test(t);)++e;return e}},function(t,e,n){var r=n(154),i=n(204),o=n(163),a=n(55),s=n(109),u=n(32),c=n(75),l=n(88),h=n(45),f=n(91);t.exports=function(t,e,n){var d=u(t),p=d||c(t)||f(t);if(e=a(e,4),null==n){var g=t&&t.constructor;n=p?d?new g:[]:h(t)&&l(g)?i(s(t)):{}}return(p?r:o)(t,(function(t,r,i){return e(n,t,r,i)})),n}},function(t,e,n){var r=n(167),i=n(114),o=n(417),a=n(227),s=i((function(t){return o(r(t,1,a,!0))}));t.exports=s},function(t,e,n){var r=n(74),i=n(90),o=n(32),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||i(t)||!!(a&&t&&t[a])}},function(t,e){t.exports=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)}},function(t,e,n){var r=n(162),i=n(190),o=n(68),a=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:o;t.exports=a},function(t,e){var n=Date.now;t.exports=function(t){var e=0,r=0;return function(){var i=n(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(211),i=n(418),o=n(422),a=n(212),s=n(423),u=n(165);t.exports=function(t,e,n){var c=-1,l=i,h=t.length,f=!0,d=[],p=d;if(n)f=!1,l=o;else if(h>=200){var g=e?null:s(t);if(g)return u(g);f=!1,l=a,p=new r}else p=e?[]:d;t:for(;++c<h;){var v=t[c],m=e?e(v):v;if(v=n||0!==v?v:0,f&&m==m){for(var y=p.length;y--;)if(p[y]===m)continue t;e&&p.push(m),d.push(v)}else l(p,m,n)||(p!==d&&p.push(m),d.push(v))}return d}},function(t,e,n){var r=n(419);t.exports=function(t,e){return!!(null==t?0:t.length)&&r(t,e,0)>-1}},function(t,e,n){var r=n(226),i=n(420),o=n(421);t.exports=function(t,e,n){return e==e?o(t,e,n):r(t,i,n)}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}},function(t,e){t.exports=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}},function(t,e,n){var r=n(200),i=n(424),o=n(165),a=r&&1/o(new r([,-0]))[1]==1/0?function(t){return new r(t)}:i;t.exports=a},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(113);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},function(t,e){t.exports="2.1.8"},function(t,e,n){var r=n(44),i=n(151);function o(t){return r.map(t.nodes(),(function(e){var n=t.node(e),i=t.parent(e),o={v:e};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(t){return r.map(t.edges(),(function(e){var n=t.edge(e),i={v:e.v,w:e.w};return r.isUndefined(e.name)||(i.name=e.name),r.isUndefined(n)||(i.value=n),i}))}t.exports={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:o(t),edges:a(t)};r.isUndefined(t.graph())||(e.value=r.clone(t.graph()));return e},read:function(t){var e=new i(t.options).setGraph(t.value);return r.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),r.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}}},function(t,e,n){t.exports={components:n(429),dijkstra:n(229),dijkstraAll:n(430),findCycles:n(431),floydWarshall:n(432),isAcyclic:n(433),postorder:n(434),preorder:n(435),prim:n(436),tarjan:n(231),topsort:n(232)}},function(t,e,n){var r=n(44);t.exports=function(t){var e,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,e.push(i),r.each(t.successors(i),o),r.each(t.predecessors(i),o))}return r.each(t.nodes(),(function(t){e=[],o(t),e.length&&i.push(e)})),i}},function(t,e,n){var r=n(229),i=n(44);t.exports=function(t,e,n){return i.transform(t.nodes(),(function(i,o){i[o]=r(t,o,e,n)}),{})}},function(t,e,n){var r=n(44),i=n(231);t.exports=function(t){return r.filter(i(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))}},function(t,e,n){var r=n(44);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],s=r.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)}))}))})),r}(t,e||i,n||function(e){return t.outEdges(e)})};var i=r.constant(1)},function(t,e,n){var r=n(232);t.exports=function(t){try{r(t)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},function(t,e,n){var r=n(233);t.exports=function(t,e){return r(t,e,"post")}},function(t,e,n){var r=n(233);t.exports=function(t,e){return r(t,e,"pre")}},function(t,e,n){var r=n(44),i=n(151),o=n(230);t.exports=function(t,e){var n,a=new i,s={},u=new o;function c(t){var r=t.v===n?t.w:t.v,i=u.priority(r);if(void 0!==i){var o=e(t);o<i&&(s[r]=n,u.decrease(r,o))}}if(0===t.nodeCount())return a;r.each(t.nodes(),(function(t){u.add(t,Number.POSITIVE_INFINITY),a.setNode(t)})),u.decrease(t.nodes()[0],0);var l=!1;for(;u.size()>0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(n).forEach(c)}return a}},function(t,e,n){"use strict";var r=n(29),i=n(477),o=n(480),a=n(481),s=n(38).normalizeRanks,u=n(483),c=n(38).removeEmptyRanks,l=n(484),h=n(485),f=n(486),d=n(487),p=n(496),g=n(38),v=n(48).Graph,m=n(498);t.exports=function(t,e){var n=e&&e.debugTiming?g.time:g.notime;n("layout",(function(){e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",(function(){var n,i,o;n=t,i=e.prevGraph,o=i._nodes,r.forEach(n.nodes(),(function(t){var e=n.node(t);void 0!==o[t]?(e.fixorder=o[t]._order,delete o[t]._order):delete e.fixorder}))}));var k=n(" buildLayoutGraph",(function(){return function(t){var e=new v({multigraph:!0,compound:!0}),n=A(t.graph());return e.setGraph(r.merge({},b,O(n,y),r.pick(n,x))),r.forEach(t.nodes(),(function(n){var i=A(t.node(n));e.setNode(n,r.defaults(O(i,w),_)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var i=A(t.edge(n));e.setEdge(n,r.merge({},E,O(i,S),r.pick(i,M)))})),e}(t)}));e&&!1===e.edgeLabelSpace||n(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.nodes(),(function(e){var n=t.node(e);isNaN(n.layer)||(n.layer*=2)})),r.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)}))}(k)}));try{n(" runLayout",(function(){!function(t,e,n){e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){i.run(t)})),e(" nestingGraph.run",(function(){l.run(t)})),e(" rank",(function(){a(g.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};g.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){c(t)})),e(" nestingGraph.cleanup",(function(){l.cleanup(t)})),e(" normalizeRanks",(function(){s(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=r.max(e,i.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){r.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(){o.run(t)})),e(" parentDummyChains",(function(){u(t)})),e(" addBorderSegments",(function(){h(t)})),n&&n.keepNodeOrder&&e(" initDataOrder",(function(){m(t,n.nodeOrder)}));e(" order",(function(){d(t)})),e(" insertSelfEdges",(function(){!function(t){var e=g.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,i){var o=t.node(e);o.order=i+n,r.forEach(o.selfEdges,(function(e){g.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){f.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(r.last(n.borderLeft)),s=t.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){o.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.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(){f.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=t.graph(),s=a.marginx||0,u=a.marginy||0;function c(t){var r=t.x,a=t.y,s=t.width,u=t.height;e=Math.min(e,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-u/2),o=Math.max(o,a+u/2)}r.forEach(t.nodes(),(function(e){c(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&c(n)})),e-=s,i-=u,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i})),r.forEach(t.edges(),(function(n){var o=t.edge(n);r.forEach(o.points,(function(t){t.x-=e,t.y-=i})),r.has(o,"x")&&(o.x-=e),r.has(o,"y")&&(o.y-=i)})),a.width=n-e+s,a.height=o-i+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){i.undo(t)}))}(k,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){r.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,r._order=i.order,r._rank=i.rank,e.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(t.edges(),(function(n){var i=t.edge(n),o=e.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,k)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},x=["acyclicer","ranker","rankdir","align"],w=["width","height","layer","fixorder"],_={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},M=["labelpos"];function O(t,e){return r.mapValues(r.pick(t,e),Number)}function A(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},function(t,e,n){var r=n(186);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(114),i=n(73),o=n(115),a=n(67),s=Object.prototype,u=s.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&o(e[0],e[1],c)&&(r=1);++n<r;)for(var l=e[n],h=a(l),f=-1,d=h.length;++f<d;){var p=h[f],g=t[p];(void 0===g||i(g,s[p])&&!u.call(t,p))&&(t[p]=l[p])}return t}));t.exports=c},function(t,e,n){var r=n(441)(n(442));t.exports=r},function(t,e,n){var r=n(55),i=n(54),o=n(60);t.exports=function(t){return function(e,n,a){var s=Object(e);if(!i(e)){var u=r(n,3);e=o(e),n=function(t){return u(s[t],t,s)}}var c=t(e,n,a);return c>-1?s[u?e[c]:c]:void 0}}},function(t,e,n){var r=n(226),i=n(55),o=n(443),a=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var u=null==n?0:o(n);return u<0&&(u=a(s+u,0)),r(t,i(e,3),u)}},function(t,e,n){var r=n(234);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(445),i=n(45),o=n(77),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=s.test(t);return n||u.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e,n){var r=n(446),i=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(i,""):t}},function(t,e){var n=/\s/;t.exports=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}},function(t,e,n){var r=n(164),i=n(207),o=n(67);t.exports=function(t,e){return null==t?t:r(t,i(e),o)}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(105),i=n(163),o=n(55);t.exports=function(t,e){var n={};return e=o(e,3),i(t,(function(t,i,o){r(n,i,e(t,i,o))})),n}},function(t,e,n){var r=n(168),i=n(451),o=n(68);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e){t.exports=function(t,e){return t>e}},function(t,e,n){var r=n(453),i=n(457)((function(t,e,n){r(t,e,n)}));t.exports=i},function(t,e,n){var r=n(99),i=n(236),o=n(164),a=n(454),s=n(45),u=n(67),c=n(237);t.exports=function t(e,n,l,h,f){e!==n&&o(n,(function(o,u){if(f||(f=new r),s(o))a(e,n,u,l,t,h,f);else{var d=h?h(c(e,u),o,u+"",e,n,f):void 0;void 0===d&&(d=o),i(e,u,d)}}),u)}},function(t,e,n){var r=n(236),i=n(193),o=n(202),a=n(194),s=n(203),u=n(90),c=n(32),l=n(227),h=n(75),f=n(88),d=n(45),p=n(455),g=n(91),v=n(237),m=n(456);t.exports=function(t,e,n,y,b,x,w){var _=v(t,n),S=v(e,n),E=w.get(S);if(E)r(t,n,E);else{var M=x?x(_,S,n+"",t,e,w):void 0,O=void 0===M;if(O){var A=c(S),k=!A&&h(S),C=!A&&!k&&g(S);M=S,A||k||C?c(_)?M=_:l(_)?M=a(_):k?(O=!1,M=i(S,!0)):C?(O=!1,M=o(S,!0)):M=[]:p(S)||u(S)?(M=_,u(_)?M=m(_):d(_)&&!f(_)||(M=s(S))):O=!1}O&&(w.set(S,M),b(M,S,y,x,w),w.delete(S)),r(t,n,M)}}},function(t,e,n){var r=n(66),i=n(109),o=n(51),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},function(t,e,n){var r=n(89),i=n(67);t.exports=function(t){return r(t,i(t))}},function(t,e,n){var r=n(114),i=n(115);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++r<o;){var u=n[r];u&&t(e,u,r,a)}return e}))}},function(t,e,n){var r=n(168),i=n(238),o=n(68);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e,n){var r=n(168),i=n(55),o=n(238);t.exports=function(t,e){return t&&t.length?r(t,i(e,2),o):void 0}},function(t,e,n){var r=n(49);t.exports=function(){return r.Date.now()}},function(t,e,n){var r=n(462),i=n(465)((function(t,e){return null==t?{}:r(t,e)}));t.exports=i},function(t,e,n){var r=n(463),i=n(216);t.exports=function(t,e){return r(t,e,(function(e,n){return i(t,n)}))}},function(t,e,n){var r=n(111),i=n(464),o=n(112);t.exports=function(t,e,n){for(var a=-1,s=e.length,u={};++a<s;){var c=e[a],l=r(t,c);n(l,c)&&i(u,o(c,t),l)}return u}},function(t,e,n){var r=n(104),i=n(112),o=n(106),a=n(45),s=n(92);t.exports=function(t,e,n,u){if(!a(t))return t;for(var c=-1,l=(e=i(e,t)).length,h=l-1,f=t;null!=f&&++c<l;){var d=s(e[c]),p=n;if("__proto__"===d||"constructor"===d||"prototype"===d)return t;if(c!=h){var g=f[d];void 0===(p=u?u(g,d,f):void 0)&&(p=a(g)?g:o(e[c+1])?[]:{})}r(f,d,p),f=f[d]}return t}},function(t,e,n){var r=n(235),i=n(224),o=n(225);t.exports=function(t){return o(i(t,void 0,r),t+"")}},function(t,e,n){var r=n(467)();t.exports=r},function(t,e,n){var r=n(468),i=n(115),o=n(234);t.exports=function(t){return function(e,n,a){return a&&"number"!=typeof a&&i(e,n,a)&&(n=a=void 0),e=o(e),void 0===n?(n=e,e=0):n=o(n),a=void 0===a?e<n?1:-1:o(a),r(e,n,a,t)}}},function(t,e){var n=Math.ceil,r=Math.max;t.exports=function(t,e,i,o){for(var a=-1,s=r(n((e-t)/(i||1)),0),u=Array(s);s--;)u[o?s:++a]=t,t+=i;return u}},function(t,e,n){var r=n(167),i=n(470),o=n(114),a=n(115),s=o((function(t,e){if(null==t)return[];var n=e.length;return n>1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=s},function(t,e,n){var r=n(113),i=n(111),o=n(55),a=n(222),s=n(471),u=n(107),c=n(472),l=n(68),h=n(32);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return h(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[l];var f=-1;e=r(e,u(o));var d=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++f,value:t}}));return s(d,(function(t,e){return c(t,e,n)}))}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(473);t.exports=function(t,e,n){for(var i=-1,o=t.criteria,a=e.criteria,s=o.length,u=n.length;++i<s;){var c=r(o[i],a[i]);if(c)return i>=u?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(77);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,a=r(t),s=void 0!==e,u=null===e,c=e==e,l=r(e);if(!u&&!l&&!a&&t>e||a&&s&&c&&!u&&!l||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!l&&t<e||l&&n&&o&&!i&&!a||u&&n&&o||!s&&o||!c)return-1}return 0}},function(t,e,n){var r=n(215),i=0;t.exports=function(t){var e=++i;return r(t)+e}},function(t,e,n){var r=n(104),i=n(476);t.exports=function(t,e){return i(t||[],e||[],r)}},function(t,e){t.exports=function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:void 0;n(a,t[r],s)}return a}},function(t,e,n){"use strict";var r=n(29),i=n(478);t.exports={run:function(t){var e="greedy"===t.graph().acyclicer?i(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},i={};function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(t.outEdges(a),(function(t){r.has(n,t.w)?e.push(t):o(t.w)})),delete n[a])}return r.forEach(t.nodes(),o),e}(t);r.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,r.uniqueId("rev"))}))},undo:function(t){r.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)}}))}}},function(t,e,n){var r=n(29),i=n(48).Graph,o=n(479);t.exports=function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new i,a=0,s=0;r.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),r.forEach(t.edges(),(function(t){var r=n.edge(t.v,t.w)||0,i=e(t),o=r+i;n.setEdge(t.v,t.w,o),s=Math.max(s,n.node(t.v).out+=i),a=Math.max(a,n.node(t.w).in+=i)}));var c=r.range(s+a+3).map((function(){return new o})),l=a+1;return r.forEach(n.nodes(),(function(t){u(c,l,n.node(t))})),{graph:n,buckets:c,zeroIdx:l}}(t,e||a),c=function(t,e,n){var r,i=[],o=e[e.length-1],a=e[0];for(;t.nodeCount();){for(;r=a.dequeue();)s(t,e,n,r);for(;r=o.dequeue();)s(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){i=i.concat(s(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(e){return t.outEdges(e.v,e.w)})),!0)};var a=r.constant(1);function s(t,e,n,i,o){var a=o?[]:void 0;return r.forEach(t.inEdges(i.v),(function(r){var i=t.edge(r),s=t.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,u(e,n,s)})),r.forEach(t.outEdges(i.v),(function(r){var i=t.edge(r),o=r.w,a=t.node(o);a.in-=i,u(e,n,a)})),t.removeNode(i.v),a}function u(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)}},function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){if("_next"!==t&&"_prev"!==t)return e}t.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return r(e),e},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},function(t,e,n){"use strict";var r=n(29),i=n(38);t.exports={run:function(t){t.graph().dummyChains=[],r.forEach(t.edges(),(function(e){!function(t,e){var n,r,o,a=e.v,s=t.node(a).rank,u=e.w,c=t.node(u).rank,l=e.name,h=t.edge(e),f=h.labelRank;if(c===s+1)return;for(t.removeEdge(e),o=0,++s;s<c;++o,++s)h.points=[],r={width:0,height:0,edgeLabel:h,edgeObj:e,rank:s},n=i.addDummyNode(t,"edge",r,"_d"),s===f&&(r.width=h.width,r.height=h.height,r.dummy="edge-label",r.labelpos=h.labelpos),t.setEdge(a,n,{weight:h.weight},l),0===o&&t.graph().dummyChains.push(n),a=n;t.setEdge(a,u,{weight:h.weight},l)}(t,e)}))},undo:function(t){r.forEach(t.graph().dummyChains,(function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}}},function(t,e,n){"use strict";var r=n(116).longestPathWithLayer,i=n(239).feasibleTreeWithLayer,o=n(482);t.exports=function(t){switch(t.graph().ranker){case"network-simplex":!function(t){o(t)}(t);break;case"tight-tree":s(t);break;case"longest-path":a(t);break;default:s(t)}};var a=r;function s(t){r(t),i(t)}},function(t,e,n){"use strict";var r=n(29),i=n(239).feasibleTree,o=n(116).slack,a=n(116).longestPath,s=n(48).alg.preorder,u=n(48).alg.postorder,c=n(38).simplify;function l(t){t=c(t),a(t);var e,n=i(t);for(d(n),h(n,t);e=g(n);)m(n,t,e,v(n,t,e))}function h(t,e){var n=u(t,t.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=f(t,e,n)}(t,e,n)}))}function f(t,e,n){var i=t.node(n).parent,o=!0,a=e.edge(n,i),s=0;return a||(o=!1,a=e.edge(i,n)),s=a.weight,r.forEach(e.nodeEdges(n),(function(r){var a,u,c=r.v===n,l=c?r.w:r.v;if(l!==i){var h=c===o,f=e.edge(r).weight;if(s+=h?f:-f,a=n,u=l,t.hasEdge(a,u)){var d=t.edge(n,l).cutvalue;s+=h?-d:d}}})),s}function d(t,e){arguments.length<2&&(e=t.nodes()[0]),p(t,{},1,e)}function p(t,e,n,i,o){var a=n,s=t.node(i);return e[i]=!0,r.forEach(t.neighbors(i),(function(o){r.has(e,o)||(n=p(t,e,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function g(t){return r.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function v(t,e,n){var i=n.v,a=n.w;e.hasEdge(i,a)||(i=n.w,a=n.v);var s=t.node(i),u=t.node(a),c=s,l=!1;s.lim>u.lim&&(c=u,l=!0);var h=r.filter(e.edges(),(function(e){return l===y(t,t.node(e.v),c)&&l!==y(t,t.node(e.w),c)}));return r.minBy(h,(function(t){return o(e,t)}))}function m(t,e,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),d(t),h(t,e),function(t,e){var n=r.find(t.nodes(),(function(t){return!e.node(t).parent})),i=s(t,n);i=i.slice(1),r.forEach(i,(function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function y(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=l,l.initLowLimValues=d,l.initCutValues=h,l.calcCutValue=f,l.leaveEdge=g,l.enterEdge=v,l.exchangeEdges=m},function(t,e,n){var r=n(29);t.exports=function(t){var e=function(t){var e={},n=0;function i(o){var a=n;r.forEach(t.children(o),i),e[o]={low:a,lim:n++}}return r.forEach(t.children(),i),e}(t);r.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,o=function(t,e,n,r){var i,o,a=[],s=[],u=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||c>e[i].lim));o=i,i=r;for(;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,c=a[u],l=!0;n!==i.w;){if(r=t.node(n),l){for(;(c=a[u])!==s&&t.node(c).maxRank<r.rank;)u++;c===s&&(l=!1)}if(!l){for(;u<a.length-1&&t.node(c=a[u+1]).minRank<=r.rank;)u++;c=a[u]}t.setParent(n,c),n=t.successors(n)[0]}}))}},function(t,e,n){var r=n(29),i=n(38);t.exports={run:function(t){var e=i.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};return r.forEach(t.children(),(function(n){!function n(i,o){var a=t.children(i);a&&a.length&&r.forEach(a,(function(t){n(t,o+1)}));e[i]=o}(n,1)})),e}(t),o=r.max(r.values(n))-1,a=2*o+1;t.graph().nestingRoot=e,r.forEach(t.edges(),(function(e){t.edge(e).minlen*=a}));var s=function(t){return r.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;r.forEach(t.children(),(function(u){!function t(e,n,o,a,s,u,c){var l=e.children(c);if(!l.length)return void(c!==n&&e.setEdge(n,c,{weight:0,minlen:o}));var h=i.addBorderNode(e,"_bt"),f=i.addBorderNode(e,"_bb"),d=e.node(c);e.setParent(h,c),d.borderTop=h,e.setParent(f,c),d.borderBottom=f,r.forEach(l,(function(r){t(e,n,o,a,s,u,r);var i=e.node(r),l=i.borderTop?i.borderTop:r,d=i.borderBottom?i.borderBottom:r,p=i.borderTop?a:2*a,g=l!==d?1:s-u[c]+1;e.setEdge(h,l,{weight:p,minlen:g,nestingEdge:!0}),e.setEdge(d,f,{weight:p,minlen:g,nestingEdge:!0})})),e.parent(c)||e.setEdge(n,h,{weight:0,minlen:s+u[c]})}(t,e,a,s,o,n,u)})),t.graph().nodeRankFactor=a},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,r.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}}},function(t,e,n){var r=n(29),i=n(38);function o(t,e,n,r,o,a){var s={width:0,height:0,rank:a,borderType:e},u=o[e][a-1],c=i.addDummyNode(t,"border",s,n);o[e][a]=c,t.setParent(c,r),u&&t.setEdge(u,c,{weight:1})}t.exports=function(t){r.forEach(t.children(),(function e(n){var i=t.children(n),a=t.node(n);if(i.length&&r.forEach(i,e),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,u=a.maxRank+1;s<u;++s)o(t,"borderLeft","_bl",n,a,s),o(t,"borderRight","_br",n,a,s)}}))}},function(t,e,n){"use strict";var r=n(29);function i(t){r.forEach(t.nodes(),(function(e){o(t.node(e))})),r.forEach(t.edges(),(function(e){o(t.edge(e))}))}function o(t){var e=t.width;t.width=t.height,t.height=e}function a(t){t.y=-t.y}function s(t){var e=t.x;t.x=t.y,t.y=e}t.exports={adjust:function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||i(t)},undo:function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){r.forEach(t.nodes(),(function(e){a(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(t);"lr"!==e&&"rl"!==e||(!function(t){r.forEach(t.nodes(),(function(e){s(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(t),i(t))}}},function(t,e,n){"use strict";var r=n(29),i=n(488),o=n(489),a=n(490),s=n(494),u=n(495),c=n(48).Graph,l=n(38);function h(t,e,n){return r.map(e,(function(e){return s(t,e,n)}))}function f(t,e,n){var i=new c;r.forEach(t,(function(t){var o=t.graph().root,s=a(t,o,i,e,n);r.forEach(s.vs,(function(e,n){t.node(e).order=n})),u(t,i,s.vs)}))}function d(t,e){r.forEach(e,(function(e){r.forEach(e,(function(e,n){t.node(e).order=n}))}))}t.exports=function(t){var e=l.maxRank(t),n=h(t,r.range(1,e+1),"inEdges"),a=h(t,r.range(e-1,-1,-1),"outEdges"),s=i(t);d(t,s);for(var u,c=Number.POSITIVE_INFINITY,p=0,g=0;g<4;++p,++g){f(p%2?n:a,p%4>=2),s=l.buildLayerMatrix(t);var v=o(t,s);v<c&&(g=0,u=r.cloneDeep(s),c=v)}for(s=i(t),d(t,s),p=0,g=0;g<4;++p,++g)f(p%2?n:a,p%4>=2,!0),s=l.buildLayerMatrix(t),(v=o(t,s))<c&&(g=0,u=r.cloneDeep(s),c=v);d(t,u)}},function(t,e,n){"use strict";var r=n(29);t.exports=function(t){var e={},n=r.filter(t.nodes(),(function(e){return!t.children(e).length})),i=r.max(r.map(n,(function(e){return t.node(e).rank}))),o=r.map(r.range(i+1),(function(){return[]}));var a=r.sortBy(n,(function(e){return t.node(e).rank})),s=r.sortBy(r.filter(a,(function(e){return void 0!==t.node(e).fixorder})),(function(e){return t.node(e).fixorder}));return r.forEach(s,(function(n){o[t.node(n).rank].push(n),e[n]=!0})),r.forEach(a,(function n(i){if(r.has(e,i))return;e[i]=!0;var a=t.node(i);o[a.rank].push(i),r.forEach(t.successors(i),n)})),o}},function(t,e,n){"use strict";var r=n(29);function i(t,e,n){for(var i=r.zipObject(n,r.map(n,(function(t,e){return e}))),o=r.flatten(r.map(e,(function(e){return r.sortBy(r.map(t.outEdges(e),(function(e){return{pos:i[e.w],weight:t.edge(e).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var u=r.map(new Array(s),(function(){return 0})),c=0;return r.forEach(o.forEach((function(t){var e=t.pos+a;u[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;c+=t.weight*n}))),c}t.exports=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=i(t,e[r-1],e[r]);return n}},function(t,e,n){var r=n(29),i=n(491),o=n(492),a=n(493);t.exports=function t(e,n,s,u,c){var l=e.children(n),h=e.node(n),f=h?h.borderLeft:void 0,d=h?h.borderRight:void 0,p={};f&&(l=r.filter(l,(function(t){return t!==f&&t!==d})));var g=i(e,l);r.forEach(g,(function(n){if(e.children(n.v).length){var i=t(e,n.v,s,u);p[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var v=o(g,s);(function(t,e){r.forEach(t,(function(t){t.vs=r.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))})(v,p),r.forEach(v,(function(t){var n=e.node(t.vs[0]);t.fixorder=n.fixorder,t.order=n.order}));var m=a(v,u,c);if(f&&(m.vs=r.flatten([f,m.vs,d],!0),e.predecessors(f).length)){var y=e.node(e.predecessors(f)[0]),b=e.node(e.predecessors(d)[0]);r.has(m,"barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+y.order+b.order)/(m.weight+2),m.weight+=2}return m}},function(t,e,n){var r=n(29);t.exports=function(t,e){return r.map(e,(function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}}))}},function(t,e,n){"use strict";var r=n(29);t.exports=function(t,e){var n={};return r.forEach(t,(function(t,e){var i=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};r.isUndefined(t.barycenter)||(i.barycenter=t.barycenter,i.weight=t.weight)})),r.forEach(e.edges(),(function(t){var e=n[t.v],i=n[t.w];r.isUndefined(e)||r.isUndefined(i)||(i.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(r.isUndefined(e.barycenter)||r.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 i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(e,(function(t){return!t.merged})),(function(t){return r.pick(t,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(t){return!t.indegree})))}},function(t,e,n){var r=n(29),i=n(38);function o(t,e,n){for(var i;e.length&&(i=r.last(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}t.exports=function(t,e,n){var a=i.partition(t,(function(t){return r.has(t,"fixorder")&&!isNaN(t.fixorder)||r.has(t,"barycenter")})),s=a.lhs,u=r.sortBy(a.rhs,(function(t){return-t.i})),c=[],l=0,h=0,f=0;s.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=o(c,u,f),r.forEach(s,(function(t){f+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,f=o(c,u,f)}));var d={vs:r.flatten(c,!0)};h&&(d.barycenter=l/h,d.weight=h);return d}},function(t,e,n){var r=n(29),i=n(48).Graph;t.exports=function(t,e,n){var o=function(t){var e;for(;t.hasNode(e=r.uniqueId("_root")););return e}(t),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return t.node(e)}));return r.forEach(t.nodes(),(function(i){var s=t.node(i),u=t.parent(i);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(a.setNode(i),a.setParent(i,u||o),r.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:t.edge(e).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),a}},function(t,e,n){var r=n(29);t.exports=function(t,e,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=t.parent(n);s;){if((r=t.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void e.setEdge(a,s);s=r}}))}},function(t,e,n){"use strict";var r=n(29),i=n(38),o=n(497).positionX;t.exports=function(t){(function(t){var e=i.buildLayerMatrix(t),n=t.graph().ranksep,o=0;r.forEach(e,(function(e){var i=r.max(r.map(e,(function(e){return t.node(e).height})));r.forEach(e,(function(e){t.node(e).y=o+i/2})),o+=i+n}))})(t=i.asNonCompoundGraph(t)),r.forEach(o(t),(function(e,n){t.node(n).x=e}))}},function(t,e,n){"use strict";var r=n(29),i=n(48).Graph,o=n(38);function a(t,e){var n={};return r.reduce(e,(function(e,i){var o=0,a=0,s=e.length,c=r.last(i);return r.forEach(i,(function(e,l){var h=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),f=h?t.node(h).order:s;(h||e===c)&&(r.forEach(i.slice(a,l+1),(function(e){r.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(a<o||f<a)||i.dummy&&t.node(e).dummy||u(n,r,e)}))})),a=l+1,o=f)})),i})),n}function s(t,e){var n={};function i(e,i,o,a,s){var c;r.forEach(r.range(i,o),(function(i){c=e[i],t.node(c).dummy&&r.forEach(t.predecessors(c),(function(e){var r=t.node(e);r.dummy&&(r.order<a||r.order>s)&&u(n,e,c)}))}))}return r.reduce(e,(function(e,n){var o,a=-1,s=0;return r.forEach(n,(function(r,u){if("border"===t.node(r).dummy){var c=t.predecessors(r);c.length&&(o=t.node(c[0]).order,i(n,s,u,a,o),s=u,a=o)}i(n,s,n.length,o,e.length)})),n})),n}function u(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function c(t,e,n){if(e>n){var i=e;e=n,n=i}return r.has(t[e],n)}function l(t,e,n,i){var o={},a={},s={};return r.forEach(e,(function(t){r.forEach(t,(function(t,e){o[t]=t,a[t]=t,s[t]=e}))})),r.forEach(e,(function(t){var e=-1;r.forEach(t,(function(t){var u=i(t);if(u.length)for(var l=((u=r.sortBy(u,(function(t){return s[t]}))).length-1)/2,h=Math.floor(l),f=Math.ceil(l);h<=f;++h){var d=u[h];a[t]===t&&e<s[d]&&!c(n,t,d)&&(a[d]=t,a[t]=o[t]=o[d],e=s[d])}}))})),{root:o,align:a}}function h(t,e,n,o,a){var s={},u=function(t,e,n,o){var a=new i,s=t.graph(),u=function(t,e,n){return function(i,o,a){var s,u=i.node(o),c=i.node(a),l=0;if(l+=u.width/2,r.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=-u.width/2;break;case"r":s=u.width/2}if(s&&(l+=n?s:-s),s=0,l+=(u.dummy?e:t)/2,l+=(c.dummy?e:t)/2,l+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(l+=n?s:-s),s=0,l}}(s.nodesep,s.edgesep,o);return r.forEach(e,(function(e){var i;r.forEach(e,(function(e){var r=n[e];if(a.setNode(r),i){var o=n[i],s=a.edge(o,r);a.setEdge(o,r,Math.max(u(t,e,i),s||0))}i=e}))})),a}(t,e,n,a),c=a?"borderLeft":"borderRight";function l(t,e){for(var n=u.nodes(),r=n.pop(),i={};r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return l((function(t){s[t]=u.inEdges(t).reduce((function(t,e){return Math.max(t,s[e.v]+u.edge(e))}),0)}),u.predecessors.bind(u)),l((function(e){var n=u.outEdges(e).reduce((function(t,e){return Math.min(t,s[e.w]-u.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(s[e]=Math.max(s[e],n))}),u.successors.bind(u)),r.forEach(o,(function(t){s[t]=s[n[t]]})),s}function f(t,e){return r.minBy(r.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(e,(function(e,r){var o=function(t,e){return t.node(e).width}(t,r)/2;n=Math.max(e+o,n),i=Math.min(e-o,i)})),n-i}))}function d(t,e){var n=r.values(e),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,u=n+a,c=t[u];if(c!==e){var l=r.values(c);(s="l"===a?i-r.min(l):o-r.max(l))&&(t[u]=r.mapValues(c,(function(t){return t+s})))}}))}))}function p(t,e){return r.mapValues(t.ul,(function(n,i){if(e)return t[e.toLowerCase()][i];var o=r.sortBy(r.map(t,i));return(o[1]+o[2])/2}))}t.exports={positionX:function(t){var e,n=o.buildLayerMatrix(t),i=r.merge(a(t,n),s(t,n)),u={};r.forEach(["u","d"],(function(o){e="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(e=r.map(e,(function(t){return r.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),s=l(t,e,i,a),c=h(t,e,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,(function(t){return-t}))),u[o+n]=c}))}));var c=f(t,u);return d(u,c),p(u,t.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:u,hasConflict:c,verticalAlignment:l,horizontalCompaction:h,alignCoordinates:d,findSmallestWidthAlignment:f,balance:p}},function(t,e,n){"use strict";var r=n(29);t.exports=function(t,e){var n=r.filter(t.nodes(),(function(e){return!t.children(e).length})),i=r.max(r.map(n,(function(e){return t.node(e).rank}))),o=r.map(r.range(i+1),(function(){return[]}));r.forEach(e,(function(e){var n=t.node(e);n.dummy||(n.fixorder=o[n.rank].length,o[n.rank].push(e))}))}},function(t,e,n){var r=n(29),i=n(38),o=n(48).Graph;t.exports={debugOrdering:function(t){var e=i.buildLayerMatrix(t),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),r.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),r.forEach(e,(function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}}},function(t,e){t.exports="0.1.1"},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof h?e:h,o=Object.create(i.prototype),a=new S(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return M()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function d(){}var p={};s(p,i,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(E([])));v&&v!==e&&n.call(v,i)&&(p=v);var m=d.prototype=h.prototype=Object.create(p);function y(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var r;this._invoke=function(i,o){function a(){return new e((function(r,a){!function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}(i,o,r,a)}))}return r=r?r.then(a,a):a()}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.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,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(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){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return f.prototype=d,s(m,"constructor",d),s(d,"constructor",f),f.displayName=s(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,a,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},y(b.prototype),s(b.prototype,o,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new b(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(m),s(m,a,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=E,S.prototype={constructor:S,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)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;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,l):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),l},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),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:E(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var a=n(506),s=n(42),u=n(56),c=n(34),l=n(243),h=n(507),f=n(514),d=n(516),p=n(69),g=n(93),v=n(519),m=n(520),y=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+s.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=u.BindingScopeEnum.Transient;else if(e.defaultScope!==u.BindingScopeEnum.Singleton&&e.defaultScope!==u.BindingScopeEnum.Transient&&e.defaultScope!==u.BindingScopeEnum.Request)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=p.id(),this._bindingDictionary=new m.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new l.MetadataReader}return t.merge=function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var a=new t,s=o([e,n],r).map((function(t){return h.getBindingDictionary(t)})),u=h.getBindingDictionary(a);function c(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return s.forEach((function(t){c(t,u)})),a},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;r<i.length;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r(this,void 0,void 0,(function(){var e,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,i.label=1;case 1:return n<r.length?(o=r[n],a=e(o.id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=r(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=this.options.defaultScope||u.BindingScopeEnum.Transient,n=new a.Binding(t,e);return this._bindingDictionary.add(t,n),new d.BindingToSyntax(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(s.CANNOT_UNBIND+" "+g.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new m.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,c.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var r=!1;if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t),o=h.createMockRequest(this,t,e,n);r=i.some((function(t){return t.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(t,e,n)),r},t.prototype.snapshot=function(){this._snapshots.push(v.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(s.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,u.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,u.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,c.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,u.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,u.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,c.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),this._appliedMiddleware.forEach((function(t){e.applyMiddleware(t)})),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(r){var i=t.rebind.bind(t)(r);return e(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=t.bind.bind(t)(n);return e(r,i),r}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(r),unbindFunction:function(e){t.unbind.bind(t)(e)}};var i}},t.prototype._get=function(t,e,n,r,i,o){var a=null,u={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(u)))throw new Error(s.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(u);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=h.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),f.resolve(n)}},t}();e.Container=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var r=n(56),i=n(69),o=function(){function t(t,e){this.id=i.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=r.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===r.BindingScopeEnum.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0;var r=n(508),i=n(42),o=n(56),a=n(34),s=n(244),u=n(93),c=n(509),l=n(50),h=n(510),f=n(511),d=n(513),p=n(246);function g(t){return t._bindingDictionary}function v(t,e,n,o,a){var s=m(n.container,a.serviceIdentifier),c=[];return s.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof a.serviceIdentifier&&t.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),s=m(n.container,a.serviceIdentifier)),c=e?s:s.filter((function(t){var e=new d.Request(t.serviceIdentifier,n,o,t,a);return t.constraint(e)})),function(t,e,n,o){switch(e.length){case r.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var a=u.getServiceIdentifierAsString(t),s=i.NOT_REGISTERED;throw s+=u.listMetadataForTarget(a,n),s+=u.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(s);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;a=u.getServiceIdentifierAsString(t),s=i.AMBIGUOUS_MATCH+" "+a;throw s+=u.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(s)}}(a.serviceIdentifier,c,a,n.container),c}function m(t,e){var n=[],r=g(t);return r.hasKey(e)?n=r.get(e):null!==t.parent&&(n=m(t.parent,e)),n}e.getBindingDictionary=g,e.plan=function(t,e,n,r,g,m,y,b){void 0===b&&(b=!1);var x=new c.Context(e),w=function(t,e,n,r,i,o){var s=t?a.MULTI_INJECT_TAG:a.INJECT_TAG,u=new l.Metadata(s,n),c=new p.Target(e,r,n,u);if(void 0!==i){var h=new l.Metadata(i,o);c.metadata.push(h)}return c}(n,r,g,"",m,y);try{return function t(e,n,r,a,s,u){var c,l;if(null===s){c=v(e,n,a,null,u),l=new d.Request(r,a,null,c,u);var p=new h.Plan(a,l);a.addPlan(p)}else c=v(e,n,a,s,u),l=s.addChildRequest(u.serviceIdentifier,c,u);c.forEach((function(n){var r=null;if(u.isArray())r=l.addChildRequest(n.serviceIdentifier,n,u);else{if(n.cache)return;r=l}if(n.type===o.BindingTypeEnum.Instance&&null!==n.implementationType){var s=f.getDependencies(e,n.implementationType);if(!a.container.options.skipBaseClassChecks){var c=f.getBaseClassDependencyCount(e,n.implementationType);if(s.length<c){var h=i.ARGUMENTS_LENGTH_MISMATCH(f.getFunctionName(n.implementationType));throw new Error(h)}}s.forEach((function(n){t(e,!1,n.serviceIdentifier,a,r,n)}))}}))}(t,b,g,x,null,w),x}catch(t){throw s.isStackOverflowExeption(t)&&x.plan&&u.circularDependencyToException(x.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new p.Target(o.TargetTypeEnum.Variable,"",e,new l.Metadata(n,r)),a=new c.Context(t);return new d.Request(e,a,null,[],i)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0;e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var r=n(69),i=function(){function t(t){this.id=r.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0;var r=function(t,e){this.parentContext=t,this.rootRequest=e};e.Plan=r},function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.getFunctionName=e.getBaseClassDependencyCount=e.getDependencies=void 0;var i=n(245),o=n(42),a=n(56),s=n(34),u=n(93);Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return u.getFunctionName}});var c=n(246);function l(t,e,n,i){var s=t.getConstructorMetadata(n),u=s.compilerGeneratedMetadata;if(void 0===u){var l=o.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(l)}var d=s.userGeneratedMetadata,p=Object.keys(d),g=0===n.length&&p.length>0,v=p.length>n.length,m=function(t,e,n,r,i){for(var o=[],a=0;a<i;a++){var s=h(a,t,e,n,r);null!==s&&o.push(s)}return o}(i,e,u,d,g||v?p.length:n.length),y=function t(e,n){for(var i=e.getPropertiesMetadata(n),o=[],s=Object.keys(i),u=0,l=s;u<l.length;u++){var h=l[u],d=i[h],p=f(i[h]),g=p.targetName||h,v=p.inject||p.multiInject,m=new c.Target(a.TargetTypeEnum.ClassProperty,g,v);m.metadata=d,o.push(m)}var y=Object.getPrototypeOf(n.prototype).constructor;if(y!==Object){var b=t(e,y);o=r(r([],o),b)}return o}(t,n);return r(r([],m),y)}function h(t,e,n,r,s){var u=s[t.toString()]||[],l=f(u),h=!0!==l.unmanaged,d=r[t],p=l.inject||l.multiInject;if((d=p||d)instanceof i.LazyServiceIdentifer&&(d=d.unwrap()),h){if(!e&&(d===Object||d===Function||void 0===d)){var g=o.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".";throw new Error(g)}var v=new c.Target(a.TargetTypeEnum.ConstructorArgument,l.targetName,d);return v.metadata=u,v}return null}function f(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[s.INJECT_TAG],multiInject:e[s.MULTI_INJECT_TAG],targetName:e[s.NAME_TAG],unmanaged:e[s.UNMANAGED_TAG]}}e.getDependencies=function(t,e){return l(t,u.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var i=l(e,u.getFunctionName(r),r,!0),o=i.map((function(t){return t.metadata.filter((function(t){return t.key===s.UNMANAGED_TAG}))})),a=[].concat.apply([],o).length,c=i.length-a;return c>0?c:t(e,r)}return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var r=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(69),i=function(){function t(t,e,n,i,o){this.id=r.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=n(42),i=n(56),o=n(244),a=n(93),s=n(515),u=function(t,e,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},c=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,o=e.childRequests,l=e.target&&e.target.isArray(),h=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(l&&h)return o.map((function(e){return c(t)(e)}));var f=null;if(!e.target.isOptional()||0!==n.length){var d=n[0],p=d.scope===i.BindingScopeEnum.Singleton,g=d.scope===i.BindingScopeEnum.Request;if(p&&d.activated)return d.cache;if(g&&null!==t&&t.has(d.id))return t.get(d.id);if(d.type===i.BindingTypeEnum.ConstantValue)f=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Function)f=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Constructor)f=d.implementationType;else if(d.type===i.BindingTypeEnum.DynamicValue&&null!==d.dynamicValue)f=u("toDynamicValue",d.serviceIdentifier,(function(){return d.dynamicValue(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Factory&&null!==d.factory)f=u("toFactory",d.serviceIdentifier,(function(){return d.factory(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Provider&&null!==d.provider)f=u("toProvider",d.serviceIdentifier,(function(){return d.provider(e.parentContext)}));else{if(d.type!==i.BindingTypeEnum.Instance||null===d.implementationType){var v=a.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+v)}f=s.resolveInstance(d.implementationType,o,c(t))}return"function"==typeof d.onActivation&&(f=d.onActivation(e.parentContext,f)),p&&(d.cache=f,d.activated=!0),g&&null!==t&&!t.has(d.id)&&t.set(d.id,f),f}}};e.resolve=function(t){return c(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveInstance=void 0;var i=n(42),o=n(56),a=n(34);e.resolveInstance=function(t,e,n){var s,u,c=null;if(e.length>0){var l=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ConstructorArgument})).map(n);u=l,c=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value();var o=i[n];t[r]=o})),t}(c=new((s=t).bind.apply(s,r([void 0],u))),e,n)}else c=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(i.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,c),c}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(42),i=n(56),o=n(517),a=n(247),s=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=t,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(r.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=i.BindingTypeEnum.Function,this._binding.scope=i.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(518),i=n(169),o=n(170),a=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(56),i=n(247),o=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var r=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(42),i=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(r.NULL_ARGUMENT);if(null==e)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(r.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(r.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(69),i=function(t){this.id=r.id(),this.registry=t};e.ContainerModule=i;var o=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(42),i=n(34);e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,t))throw new Error(r.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(i.PARAM_TYPES,e,t),t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(50),i=n(61);e.tagged=function(t,e){return function(n,o,a){var s=new r.Metadata(t,e);"number"==typeof a?i.tagParameter(n,o,a,s):i.tagProperty(n,o,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(34),i=n(50),o=n(61);e.named=function(t){return function(e,n,a){var s=new i.Metadata(r.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(34),i=n(50),o=n(61);e.optional=function(){return function(t,e,n){var a=new i.Metadata(r.OPTIONAL_TAG,!0);"number"==typeof n?o.tagParameter(t,e,n,a):o.tagProperty(t,e,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(34),i=n(50),o=n(61);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(34),i=n(50),o=n(61);e.multiInject=function(t){return function(e,n,a){var s=new i.Metadata(r.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var r=n(34),i=n(50),o=n(61);e.targetName=function(t){return function(e,n,a){var s=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(42),i=n(34),o=n(50);e.postConstruct=function(){return function(t,e,n){var a=new o.Metadata(i.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,t.constructor))throw new Error(r.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,t.constructor)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0;e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,n(e,r)}t.exports=n,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Symbol.for("INJECTION");function i(t,e,n,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i&&!Reflect.hasMetadata(r,this,e)&&Reflect.defineMetadata(r,n(),this,e),Reflect.hasMetadata(r,this,e)?Reflect.getMetadata(r,this,e):n()},set:function(t){Reflect.defineMetadata(r,t,this,e)}})}e.makePropertyInjectDecorator=function(t,e){return function(n){return function(r,o){i(r,o,(function(){return t.get(n)}),e)}}},e.makePropertyInjectNamedDecorator=function(t,e){return function(n,r){return function(o,a){i(o,a,(function(){return t.getNamed(n,r)}),e)}}},e.makePropertyInjectTaggedDecorator=function(t,e){return function(n,r,o){return function(a,s){i(a,s,(function(){return t.getTagged(n,r,o)}),e)}}},e.makePropertyMultiInjectDecorator=function(t,e){return function(n){return function(r,o){i(r,o,(function(){return t.getAll(n)}),e)}}}},function(t,e,n){var r=n(242);t.exports=function(t){if(Array.isArray(t))return r(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=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.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){var e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}},function(t,e){t.exports=function(t,e){var n=new Float32Array(2);return n[0]=t,n[1]=e,n}},function(t,e){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}},function(t,e,n){t.exports=function(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r*Math.max(1,Math.abs(i),Math.abs(a))};var r=n(264)},function(t,e){t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},function(t,e,n){t.exports=n(171)},function(t,e,n){t.exports=n(268)},function(t,e,n){t.exports=n(269)},function(t,e){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}},function(t,e){t.exports=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}},function(t,e){t.exports=function(t,e,n){var r=Math.cos(n),i=Math.sin(n),o=e[0],a=e[1];return t[0]=o*r-a*i,t[1]=o*i+a*r,t}},function(t,e){t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}},function(t,e){t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}},function(t,e){t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}},function(t,e){t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}},function(t,e,n){t.exports=n(270)},function(t,e,n){t.exports=n(271)},function(t,e,n){t.exports=n(272)},function(t,e,n){t.exports=n(273)},function(t,e){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t}},function(t,e){t.exports=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}},function(t,e){t.exports=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}},function(t,e){t.exports=function(t,e){e=e||1;var n=2*Math.random()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}},function(t,e,n){t.exports=function(t,e,n,i,o,a){var s,u;e||(e=2);n||(n=0);u=i?Math.min(i*e+n,t.length):t.length;for(s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],o(r,r,a),t[s]=r[0],t[s+1]=r[1];return t};var r=n(265)()},function(t,e){t.exports=function(t,e,n){var r=e[0]*e[0]+e[1]*e[1];if(r>n*n){var i=Math.sqrt(r);t[0]=e[0]/i*n,t[1]=e[1]/i*n}else t[0]=e[0],t[1]=e[1];return t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewContainer=void 0;const r=n(568),i=n(33),o=n(569),a=n(570),s=n(119),u=n(174),c=n(572),l=n(277);e.ViewContainer=class{constructor(t,e){const n=c.InitG6Behaviors(t,this);this.engine=t,this.layoutProvider=new r.LayoutProvider(t,this),this.renderer=new o.Renderer(t,e,n),this.reconcile=new a.Reconcile(t,this.renderer),this.layoutGroupTable=new Map,this.prevModelList=[],this.accumulateLeakModels=[],this.hasLeak=!1,this.brushSelectedModels=[],this.clickSelectNode=null;this.renderer.getG6Instance();const i=this.engine.viewOptions.leakAreaHeight,s=this.getG6Instance().getHeight(),{drag:u,zoom:h}=this.engine.behaviorOptions;this.leakAreaY=s-i,l.SolveNodeAppendagesDrag(this),l.SolveBrushSelectDrag(this),u&&l.SolveDragCanvasWithLeak(this),h&&l.SolveZoomCanvasWithLeak(this)}reLayout(){const t=this.getG6Instance(),e=t.getGroup().getMatrix();if(e){let n=e[6],r=e[7];t.translate(-n,-r)}this.layoutProvider.layoutAll(this.layoutGroupTable,this.accumulateLeakModels,[]),t.refresh()}getG6Instance(){return this.renderer.getG6Instance()}getAccumulateLeakModels(){return this.accumulateLeakModels}getLayoutGroupTable(){return this.layoutGroupTable}refresh(){this.renderer.getG6Instance().refresh()}resize(t,e){const n=this.getG6Instance(),r=n.getHeight(),i=new u.Group;i.add(...this.prevModelList,...this.accumulateLeakModels),this.renderer.changeSize(t,e);const o=n.getHeight()-r;i.translate(0,o),this.renderer.refresh(),this.leakAreaY+=o,s.EventBus.emit("onLeakAreaUpdate",{leakAreaY:this.leakAreaY,hasLeak:this.hasLeak})}render(t,e){const n=i.Util.convertGroupTable2ModelList(t),r=this.reconcile.diff(this.layoutGroupTable,this.prevModelList,n,this.accumulateLeakModels),o=[...n,...r.REMOVE,...r.LEAKED,...r.ACCUMULATE_LEAK];!0===this.hasLeak&&0===this.accumulateLeakModels.length&&(this.hasLeak=!1,s.EventBus.emit("onLeakAreaUpdate",{leakAreaY:this.leakAreaY,hasLeak:this.hasLeak})),r.LEAKED.length&&(this.hasLeak=!0,s.EventBus.emit("onLeakAreaUpdate",{leakAreaY:this.leakAreaY,hasLeak:this.hasLeak})),this.renderer.build(o),this.layoutProvider.layoutAll(t,this.accumulateLeakModels,r.LEAKED),this.beforeRender(),this.renderer.render(o),this.reconcile.patch(r),this.afterRender(),this.accumulateLeakModels.push(...r.LEAKED),this.layoutGroupTable=t,this.prevModelList=n}destroy(){this.renderer.destroy(),this.reconcile.destroy(),this.layoutProvider=null,this.layoutGroupTable=null,this.prevModelList.length=0,this.accumulateLeakModels.length=0,this.brushSelectedModels.length=0}afterRender(){this.prevModelList.forEach(t=>{!1===t.leaked&&(t.discarded=!0)})}beforeRender(){}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LayoutProvider=void 0;const r=n(172),i=n(174),o=n(33),a=n(173);e.LayoutProvider=class{constructor(t,e){this.engine=t,this.viewOptions=this.engine.viewOptions,this.viewContainer=e}preLayoutProcess(t){o.Util.convertGroupTable2ModelList(t).forEach(t=>{t.preLayout=!0,t.set("rotation",t.get("rotation")),t.set({x:0,y:0})})}postLayoutProcess(t){o.Util.convertGroupTable2ModelList(t).forEach(t=>{t.preLayout=!1,t.layoutX=t.get("x"),t.layoutY=t.get("y")})}layoutMarker(t,e){t.forEach(t=>{var n,r,i;const o=e[t.sourceType],s=null!==(n=o.offset)&&void 0!==n?n:8,u=null!==(r=t.anchor)&&void 0!==r?r:0,c=null!==(i=o.labelOffset)&&void 0!==i?i:2;let l,h,f=t.target.getBound(),d=t.target.shadowG6Item.getAnchorPoints()[u],p=[f.x+f.width/2,f.y+f.height/2],g=[d.x,d.y],v=a.Vector.subtract(g,p),m=0,y=a.Vector.length(v)+s;m=0===v[0]?v[1]>0?-Math.PI:0:Math.sign(v[0])*(Math.PI/2-Math.atan(v[1]/v[0]));const b=t.get("size")[1],x=t.getLabelSizeRadius()/2;v=a.Vector.normalize(v),l=a.Vector.location(p,v,y),h=a.Vector.location(p,v,b+y+x+c),h=a.Vector.subtract(h,l),t.set({x:l[0],y:l[1],rotation:m,markerEndPosition:h})})}layoutFreedLabel(t){t.forEach(t=>{const e=t.target.getBound();t.set({x:e.x+e.width/2,y:e.y+1.5*e.height,size:[e.width,0]})})}layoutIndexLabel(t,e){const n={top:(t,e,n)=>({x:t.x+t.width/2,y:t.y-n}),right:(t,e,n)=>({x:t.x+t.width+n,y:t.y+t.height/2}),bottom:(t,e,n)=>({x:t.x+t.width/2,y:t.y+t.height+n}),left:(t,e,n)=>({x:t.x-e.width-n,y:t.y+t.height/2})};t.forEach(t=>{var r,i;const o=e[t.sourceType],a=t.target.getBound(),s=t.getBound(),u=null!==(r=o.offset)&&void 0!==r?r:20,c=null!==(i=o.position)&&void 0!==i?i:"bottom",l=n[c](a,s,u);t.set(l)})}layoutAddressLabel(t,e){const n=e.offset||16;t.forEach(t=>{const e=t.target.getBound();t.set({x:e.x+e.width/2,y:e.y-n})})}layoutModels(t){const e=[];return t.forEach(t=>{const n=t.modelList,r=new i.Group,o=t.options.layout;n.forEach(t=>{r.add(t)}),t.layoutCreator.layout(t.node,o),e.push(r)}),t.forEach(t=>{const e=t.options.marker||{},n=t.options.indexLabel||{},r=t.options.addressLabel||{};this.layoutIndexLabel(t.indexLabel,n),this.layoutFreedLabel(t.freedLabel),this.layoutAddressLabel(t.addressLabel,r),this.layoutMarker(t.marker,e)}),e}layoutLeakModels(t,e){const n=new i.Group,a=this.viewContainer.getG6Instance().getHeight()-this.engine.viewOptions.leakAreaHeight;let s;t.forEach(t=>{t.set({x:t.layoutX,y:t.layoutY})});const u=e.length?r.Bound.union(...e.map(t=>t.getBound())):{x:0,y:a,width:0,height:0},c=o.Util.groupBy(t,"group");Object.keys(c).forEach(t=>{n.add(...c[t]);const e=n.getBound(),i=s?s.x+s.width:0,{x:o,y:a}=e,l=u.x+u.width+i+60-o,h=u.y-a;n.translate(l,h),n.clear(),r.Bound.translate(e,l,h),s=e})}layoutGroups(t){let e,n,o,a=new i.Group,s=[],u=0;for(let i=0;i<t.length;i++)e=t[i],o=e.getPaddingBound(this.viewOptions.groupPadding),u=n?n.x+n.width-o.x:o.x,e.translate(u,0),r.Bound.translate(o,u,0),s.push(o),a.add(e),n=o;return a}fitCenter(t){let e=this.viewContainer.getG6Instance().getWidth(),n=this.viewContainer.getG6Instance().getHeight(),r=t.getBound(),i=this.engine.viewOptions.leakAreaHeight;const o=n/2;let a=e/2-(r.x+r.width/2),s=0;if(this.viewContainer.hasLeak){s=n-i-100-(r.y+r.height)}else{s=o-(r.y+r.height/2)}t.translate(a,s)}layoutAll(t,e,n){this.preLayoutProcess(t);const r=this.layoutModels(t),i=this.layoutGroups(r);n.length&&this.layoutLeakModels(n,e),this.fitCenter(i),this.postLayoutProcess(t)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Renderer=void 0;const r=n(33),i=n(78);e.Renderer=class{constructor(t,e,n){this.engine=t;const r=this.engine.animationOptions.enable,o=this.engine.animationOptions.duration,a=this.engine.animationOptions.timingFunction,s=new i.Tooltip({offsetX:10,offsetY:20,shouldBegin:t=>t.item.SVModel.isNode(),getContent:t=>this.getTooltipContent(t.item.SVModel,{address:"sourceId",data:"data"}),itemTypes:["node"]});this.shadowG6Instance=new i.Graph({container:e.cloneNode()}),this.g6Instance=new i.Graph({container:e,width:e.offsetWidth,height:e.offsetHeight,groupByTypes:!1,animate:r,animateCfg:{duration:o,easing:a},fitView:!1,modes:n,plugins:[s]})}getTooltipContent(t,e){const n=document.createElement("div");if(null==t)return n;if(Object.keys(e).map(r=>{let i=t[e[r]];if(null!=i){let e=document.createElement("div");e.innerHTML=`${r}:${""!==i?i:t.G6ModelProps.label}`,n.appendChild(e)}}),t.freed){let t=document.createElement("div");t.innerHTML="(freed)",n.appendChild(t)}return n}build(t){const e=r.Util.convertModelList2G6Data(t);this.shadowG6Instance.clear(),this.shadowG6Instance.read(e),t.forEach(t=>{t.shadowG6Item=this.shadowG6Instance.findById(t.id),t.shadowG6Instance=this.shadowG6Instance})}render(t){const e=r.Util.convertModelList2G6Data(t);this.g6Instance.changeData(e),t.forEach(t=>{t.g6Instance=this.g6Instance,t.G6Item=this.g6Instance.findById(t.id),t.G6Item.SVModel=t}),this.g6Instance.getEdges().forEach(t=>t.toFront()),this.g6Instance.paint()}removeModel(t){this.g6Instance.removeItem(t.G6Item),this.shadowG6Instance.removeItem(t.shadowG6Item)}getG6Instance(){return this.g6Instance}refresh(){this.g6Instance.refresh(),this.shadowG6Instance.refresh()}changeSize(t,e){this.g6Instance.changeSize(t,e),this.shadowG6Instance.changeSize(t,e)}destroy(){this.shadowG6Instance.destroy(),this.g6Instance.destroy()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Reconcile=void 0;const r=n(119),i=n(33),o=n(147),a=n(118),s=n(276),u=n(571);e.Reconcile=class{constructor(t,e){this.engine=t,this.renderer=e,this.isFirstPatch=!0}getContinuousModels(t,e){return e.filter(e=>t.find(t=>e.id===t.id))}getAppendModels(t,e,n){const r=e.filter(e=>!t.find(t=>t.id===e.id));return r.forEach(t=>{let e=n.findIndex(e=>t.id===e.id);e>-1&&n.splice(e,1)}),r}getLeakModels(t,e,n){let r=e.filter(t=>!n.find(e=>e.id===t.id)&&!t.freed);const s=[],u=r.filter(t=>t.isNode()),c=i.Util.groupBy(u,"group");return r=r.filter(t=>!1===t.isNode()),Object.keys(c).forEach(e=>{const n=t.get(e).layoutCreator.defineLeakRule;n&&"function"==typeof n&&r.push(...n(c[e]))}),r.forEach(t=>{t instanceof a.SVNode&&(t.leaked=!0,s.push(t),t.appendages.forEach(t=>{t.leaked=!0,s.push(t)}))}),r.forEach(t=>{t instanceof o.SVLink&&!1!==t.node.leaked&&!1!==t.target.leaked&&(t.leaked=!0,s.push(t))}),s.forEach(t=>{t.G6Item=null}),s}getRemoveModels(t,e){let n=[];for(let r=0;r<t.length;r++){let i=t[r];void 0!==e.find(t=>t.id===i.id)||i.leaked||n.push(i)}return n}getReTargetMarkers(t,e){const n=t.filter(t=>t instanceof s.SVMarker);return e.filter(t=>t instanceof s.SVMarker).filter(t=>n.find(e=>e.id===t.id&&e.target.id!==t.target.id))}getLabelChangeModels(t,e){let n=[];return e.forEach(e=>{const r=t.find(t=>t.id===e.id);if(void 0===r)return;const i=r.get("label"),o=e.get("label");String(i)!==String(o)&&n.push(e)}),n}getFreedModels(t,e){const n=e.filter(t=>t instanceof a.SVNode&&t.freed);return n.forEach(e=>{const n=t.find(t=>e.id===t.id);n&&e.set("label",n.get("label"))}),n}handleContinuousModels(t){for(let e=0;e<t.length;e++){let n=t[e];if(n instanceof a.SVNode){n.G6Item.getContainer().attr({opacity:1})}}}handleAppendModels(t){let{duration:e,timingFunction:n}=this.engine.animationOptions;t.forEach(t=>{if(t instanceof s.SVNodeAppendage)if(t instanceof s.SVAddressLabel){t.G6Item.getContainer().attr({opacity:0})}else u.Animations.FADE_IN(t.G6Item,{duration:e,timingFunction:n});else u.Animations.APPEND(t.G6Item,{duration:e,timingFunction:n})})}handleRemoveModels(t){let{duration:e,timingFunction:n}=this.engine.animationOptions;t.forEach(t=>{u.Animations.REMOVE(t.G6Item,{duration:e,timingFunction:n,callback:()=>{this.renderer.removeModel(t)}})})}handleLeakModels(t){let{duration:e,timingFunction:n}=this.engine.animationOptions;t.forEach(t=>{t instanceof s.SVAddressLabel&&u.Animations.FADE_IN(t.G6Item,{duration:e,timingFunction:n}),t.G6Item.enableCapture(!1)}),r.EventBus.emit("onLeak",t)}handleAccumulateLeakModels(t){t.forEach(t=>{t.generalStyle&&t.set("style",Object.assign({},t.generalStyle))})}handleFreedModels(t){const{duration:e,timingFunction:n}=this.engine.animationOptions;t.forEach(t=>{const r=t.G6Item.getContainer();if(t.set("style",{fill:"#ccc"}),r.attr({opacity:.4}),t.marker){const e=t.marker.G6Item.getContainer();t.marker.set("style",{fill:"#ccc"}),e.attr({opacity:.9})}t.freedLabel.G6Item.toFront(),u.Animations.FADE_IN(t.freedLabel.G6Item,{duration:e,timingFunction:n})}),r.EventBus.emit("onFreed",t)}handleChangeModels(t){const e=this.engine.viewOptions.updateHighlight;e&&"string"==typeof e&&t.forEach(t=>{void 0===t.generalStyle&&(t.generalStyle=i.Util.objectClone(t.G6ModelProps.style)),t instanceof o.SVLink?t.set("style",{stroke:e}):t.set("style",{fill:e})})}diff(t,e,n,r){const i=this.getContinuousModels(e,n),o=this.getLeakModels(t,e,n),a=this.getAppendModels(e,n,r),s=this.getRemoveModels(e,n),u=[...this.getReTargetMarkers(e,n),...this.getLabelChangeModels(e,n),...a,...o];return{CONTINUOUS:i,APPEND:a,REMOVE:s,FREED:this.getFreedModels(e,n),LEAKED:o,UPDATE:u,ACCUMULATE_LEAK:[...r]}}patch(t){const{APPEND:e,REMOVE:n,FREED:r,LEAKED:i,UPDATE:o,CONTINUOUS:a,ACCUMULATE_LEAK:s}=t;this.handleAccumulateLeakModels(s),!1===this.isFirstPatch&&this.handleChangeModels(o),this.handleContinuousModels(a),this.handleFreedModels(r),this.handleAppendModels(e),this.handleLeakModels(i),this.handleRemoveModels(n),this.isFirstPatch&&(this.isFirstPatch=!1)}destroy(){}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Animations=void 0;const r=n(78);e.Animations={APPEND(t,e){const n=t.getType(),i=t.getContainer(),o=r.Util.mat3,a={duration:e.duration,easing:e.timingFunction,callback:e.callback};if("node"===n){let t=i.getMatrix(),e=o.clone(t);o.scale(t,t,[0,0]),o.scale(e,e,[1,1]),i.attr({matrix:t,opacity:0}),i.animate({matrix:e,opacity:1},a)}if("edge"===n){const t=i.get("children")[0],e=t.getTotalLength();t.attr({lineDash:[0,e],opacity:0}),t.animate({lineDash:[e,0],opacity:1},a)}},REMOVE(t,e){const n=t.getType(),i=t.getContainer(),o=r.Util.mat3,a={duration:e.duration,easing:e.timingFunction,callback:e.callback};if("node"===n){let t=o.clone(i.getMatrix());o.scale(t,t,[0,0]),i.animate({opacity:0,matrix:t},a)}if("edge"===n){const t=i.get("children")[0],e=t.getTotalLength();t.animate({lineDash:[0,e],opacity:0},a)}},FADE_IN(t,e){const n=t.getContainer(),r={duration:e.duration,easing:e.timingFunction,callback:e.callback};n.attr({opacity:0}),n.animate({opacity:1},r)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InitG6Behaviors=void 0;const r=n(277);e.InitG6Behaviors=function(t,e){const n={type:"drag-node",shouldBegin:t=>{let n=t.item,i=n.SVModel;if(null===n||!1===i.isNode())return!1;if(!1===r.DetermineNodeDrag(e.getLayoutGroupTable(),i,e.brushSelectedModels))return!1;if(e.clickSelectNode){void 0===e.brushSelectedModels.find(t=>t.id===e.clickSelectNode.id)&&(e.clickSelectNode.setSelectedState(!1),e.clickSelectNode=null)}return i.setSelectedState(!0),i.appendages.forEach(t=>{t.setSelectedState(!0)}),!0}};return{default:[n,{type:"drag-canvas"},{type:"click-select",multiple:!1,shouldBegin:t=>{let n=t.item,r=n.SVModel;return null!==n&&!1!==r.isNode()&&(e.clickSelectNode=r,!0)}}],brush:[{type:"brush-select",trigger:"drag",includeEdges:!1,shouldUpdate:t=>{const e=t.SVModel;return!e.leaked&&!1!==e.isNode()&&(e.setSelectedState(!0),!0)}},n]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("pointer",{draw(t,e){const n=e.addShape("path",{attrs:{path:this.getPath(t),fill:t.style.fill,matrix:t.style.matrix},name:"pointer-path"});if(t.label){const r=t.labelCfg&&t.labelCfg.style||{},i=e.addShape("rect",{attrs:{x:0,y:0,text:t.label,fill:null,radius:2},name:"bgRect"}),o=e.addShape("text",{attrs:{x:0,y:0,textAlign:"center",textBaseline:"middle",text:t.label,fill:r.fill||"#999",fontSize:r.fontSize||16},name:"pointer-text-shape"}),{width:a,height:s}=o.getBBox(),{width:u,height:c}=n.getBBox();i.attr({width:a+u+6,height:s+c+6});const l=t.markerEndPosition;if(l){let t=l[0],e=l[1];o.attr({x:t,y:e}),i.attr({x:t-a/2-3,y:e-s/2-3})}return i}return n},getPath(t){let e=t.size[0],n=t.size[1],r=e+4,i=.3*n;return[["M",0,0],["L",-e/2-r/2,-i],["L",-e/2,-i],["L",-e/2,-n],["L",e/2,-n],["L",e/2,-i],["L",e/2+r/2,-i],["Z"]]}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("link-list-node",{draw(t,e){t.size=t.size||[30,10];const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke||"#333",fill:t.style.backgroundFill||"#eee",cursor:t.style.cursor},name:"wrapper"});e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n*(2/3),height:r,fill:t.style.fill,stroke:t.style.stroke||"#333",cursor:t.style.cursor},name:"main-rect",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};return t.label&&e.addShape("text",{attrs:{x:n*(5/6),y:r,textAlign:"center",textBaseline:"middle",text:t.label,fill:o.fill||"#000",fontSize:o.fontSize||16},name:"text",draggable:!0}),t.next||t.loopNext||e.addShape("text",{attrs:{x:n*(4/3),y:1.2*r,textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:18,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[5/6,0],[5/6,.5],[1,.5],[5/6,1],[.5,1],[0,.5],[1/3,1]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("binary-tree-node",{draw(t,e){t.size=t.size;const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke||"#333",cursor:t.style.cursor,fill:t.style.backgroundFill||"#eee"},name:"wrapper"});e.addShape("rect",{attrs:{x:n/4+n/2,y:r/2,width:n/2,height:r,fill:t.style.fill,stroke:t.style.stroke||"#333",cursor:t.style.cursor},name:"mid",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};return t.label&&e.addShape("text",{attrs:{x:n,y:r,textAlign:"center",textBaseline:"middle",text:t.label,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0}),"0x0"==t.child[0]&&e.addShape("text",{attrs:{x:n*(5/8),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:18,cursor:t.style.cursor},name:"text",draggable:!0}),"0x0"==t.child[1]&&e.addShape("text",{attrs:{x:n*(11/8),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:18,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[.875,.5],[.5,1],[.125,.5]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(78),i=n(33);function o(t,e,n){const r=n(t.getMatrix(),[["r",e]]);t.setMatrix(r)}function a(t,e,n,r){const i=r(t.getMatrix(),[["t",e,n]]);t.setMatrix(i)}function s(t,e){let n=Math.cos(t)*e,r=-Math.sin(t)*e;return console.log(n,r,e),{offsetX:n,offsetY:r}}e.default=o,i.Util.registerShape("clen-queue-pointer",{draw(t,e){let n=t.id;const i=parseInt(n.split("-")[1]),u=parseInt(n.split("-")[2]),c=e.addShape("path",{attrs:{x:0,y:0,path:this.getPath(t),fill:t.style.fill},name:"pointer-path"}),l=i*Math.PI*2/u;if(t.label){const n=t.labelCfg&&t.labelCfg.style||{};e.addShape("rect",{attrs:{x:0,y:0,width:0,height:0,text:t.label,fill:null,radius:2},name:"bgRect"});let i=t.label.split("-")[0],o="front"==i?30:15;a(e.addShape("text",{attrs:{x:s(Math.PI/2-l,o).offsetX,y:s(Math.PI/2-l,o).offsetY,textAlign:"center",textBaseline:"middle",text:i,fill:n.fill||"#999",fontSize:n.fontSize||16},name:"pointer-text-shape"}),0,-75,r.default.Util.transform)}return o(c,l,r.default.Util.transform),a(c,0,-75,r.default.Util.transform),c},getPath:t=>[["M",0,0],["L",-.5,0],["L",-.5,-38],["L",-3,-38],["L",0,-49.4],["L",3,-38],["L",.5,-38],["L",.5,0],["Z"]]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("two-cell-node",{draw(t,e){t.size=t.size||[30,10];const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke,fill:t.style.backgroundFill||"#eee"},name:"wrapper"});e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n/2,height:r,fill:t.style.fill,stroke:t.style.stroke},name:"left-rect",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};if(t.label)if(Array.isArray(t.label)){let i=t.label[0],a=t.label[1];e.addShape("text",{attrs:{x:n*(3/4),y:r,textAlign:"center",textBaseline:"middle",text:i,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n*(5/4),y:r,textAlign:"center",textBaseline:"middle",text:a,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0})}else e.addShape("text",{attrs:{x:n*(3/4),y:r,textAlign:"center",textBaseline:"middle",text:t.label,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0});return t.id.includes("tableHeadNode")&&!t.headNext&&e.addShape("text",{attrs:{x:n*(5/4),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:20,cursor:t.style.cursor},name:"text",draggable:!0}),t.id.includes("head")&&!t.start&&e.addShape("text",{attrs:{x:n*(5/4),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:20,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[3/4,.5],[.5,1],[0,.5]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(78);e.default=r.registerNode("three-cell",{draw(t,e){t.size=t.size||[30,10];const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke,fill:t.style.backgroundFill||"#eee"},name:"wrapper"});e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n/3,height:r,fill:t.style.fill,stroke:t.style.stroke},name:"left-rect",draggable:!0}),e.addShape("rect",{attrs:{x:n*(5/6),y:r/2,width:n/3,height:r,fill:t.style.fill,stroke:t.style.stroke},name:"middle-rect",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};return t.root&&t.rootLabel&&(e.addShape("text",{attrs:{x:n*(2/3),y:0,textAlign:"center",textBaseline:"middle",text:t.rootLabel[0],fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n,y:0,textAlign:"center",textBaseline:"middle",text:t.rootLabel[1],fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n*(4/3),y:0,textAlign:"center",textBaseline:"middle",text:t.rootLabel[2],fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0})),null!==t.index&&e.addShape("text",{attrs:{x:.4*n,y:r,textAlign:"center",textBaseline:"middle",text:t.index,fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0}),t.label&&(e.addShape("text",{attrs:{x:n*(2/3),y:r,textAlign:"center",textBaseline:"middle",text:t.label[0],fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n,y:r,textAlign:"center",textBaseline:"middle",text:t.label[1],fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0})),t.headNext||e.addShape("text",{attrs:{x:n*(4/3),y:1.2*r,textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:25,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[5/6,.5],[.5,1],[0,.5]]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("array-node",{getAnchorPoints:()=>[[.5,0],[1,.5],[.5,1],[0,.5]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("cursor",{draw(t,e){const n=e.addShape("path",{attrs:{path:this.getPath(t),fill:t.style.fill,matrix:t.style.matrix},name:"cursor-path"});if(t.label){const n=t.labelCfg&&t.labelCfg.style||{},r=e.addShape("rect",{attrs:{x:0,y:0,text:t.label,fill:"transparent",radius:2},name:"bgRect"}),i=e.addShape("text",{attrs:{x:0,y:0,textAlign:"center",textBaseline:"middle",text:t.label,fill:n.fill||"#999",fontSize:n.fontSize||16},name:"cursor-text-shape"}),{width:o,height:a}=i.getBBox();r.attr({width:o+6,height:a+6});const s=t.markerEndPosition;if(s){let t=s[0],e=s[1];i.attr({x:t,y:e}),r.attr({x:t-o/2-3,y:e-a/2-3})}}return n},getPath(t){let e=t.size[0],n=t.size[1];return[["M",0,0],["L",-e/2,-n],["L",e/2,-n],["L",0,0],["Z"]]}})}])})); |