!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.G6=e():t.G6=e()}(this,(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=547)}([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)} /*! ***************************************************************************** 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. ***************************************************************************** */n.r(e),n.d(e,"__extends",(function(){return o})),n.d(e,"__assign",(function(){return a})),n.d(e,"__rest",(function(){return s})),n.d(e,"__decorate",(function(){return u})),n.d(e,"__param",(function(){return c})),n.d(e,"__metadata",(function(){return l})),n.d(e,"__awaiter",(function(){return f})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return d})),n.d(e,"__exportStar",(function(){return p})),n.d(e,"__values",(function(){return g})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return y})),n.d(e,"__spreadArrays",(function(){return m})),n.d(e,"__spreadArray",(function(){return b})),n.d(e,"__await",(function(){return x})),n.d(e,"__asyncGenerator",(function(){return w})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return S})),n.d(e,"__makeTemplateObject",(function(){return E})),n.d(e,"__importStar",(function(){return M})),n.d(e,"__importDefault",(function(){return k})),n.d(e,"__classPrivateFieldGet",(function(){return A})),n.d(e,"__classPrivateFieldSet",(function(){return C}));var i=function(t,e){return(i=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 o(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}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0;u--)(o=t[u])&&(s=(a<3?o(s):a>3?o(e,n,s):o(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s}function c(t,e){return function(n,r){e(n,r,t)}}function l(t,e){if("object"===("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function f(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]=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 v(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 y(){for(var t=[],e=0;e1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof x?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 _(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:x(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function S(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=g(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 E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var O=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)&&d(e,t,n);return O(e,t),e}function k(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 C(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 pn})),n.d(e,"e",(function(){return Dt})),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 f})),n.d(r,"fromValues",(function(){return h})),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 y})),n.d(r,"determinant",(function(){return m})),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 O})),n.d(r,"fromMat2d",(function(){return M})),n.d(r,"fromQuat",(function(){return k})),n.d(r,"normalFromMat4",(function(){return A})),n.d(r,"projection",(function(){return C})),n.d(r,"str",(function(){return T})),n.d(r,"frob",(function(){return I})),n.d(r,"add",(function(){return P})),n.d(r,"subtract",(function(){return D})),n.d(r,"multiplyScalar",(function(){return N})),n.d(r,"multiplyScalarAndAdd",(function(){return j})),n.d(r,"exactEquals",(function(){return R})),n.d(r,"equals",(function(){return L})),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 X})),n.d(i,"transpose",(function(){return Y})),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 Q})),n.d(i,"scale",(function(){return $})),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 ft})),n.d(i,"getScaling",(function(){return ht})),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 yt})),n.d(i,"perspective",(function(){return mt})),n.d(i,"perspectiveFromFieldOfView",(function(){return bt})),n.d(i,"ortho",(function(){return xt})),n.d(i,"lookAt",(function(){return wt})),n.d(i,"targetTo",(function(){return _t})),n.d(i,"str",(function(){return St})),n.d(i,"frob",(function(){return Et})),n.d(i,"add",(function(){return Ot})),n.d(i,"subtract",(function(){return Mt})),n.d(i,"multiplyScalar",(function(){return kt})),n.d(i,"multiplyScalarAndAdd",(function(){return At})),n.d(i,"exactEquals",(function(){return Ct})),n.d(i,"equals",(function(){return Tt})),n.d(i,"mul",(function(){return It})),n.d(i,"sub",(function(){return Pt}));var o={};n.r(o),n.d(o,"create",(function(){return Nt})),n.d(o,"clone",(function(){return jt})),n.d(o,"fromValues",(function(){return Rt})),n.d(o,"copy",(function(){return Lt})),n.d(o,"set",(function(){return Bt})),n.d(o,"add",(function(){return Gt})),n.d(o,"subtract",(function(){return Ft})),n.d(o,"multiply",(function(){return zt})),n.d(o,"divide",(function(){return Ut})),n.d(o,"ceil",(function(){return Vt})),n.d(o,"floor",(function(){return Wt})),n.d(o,"min",(function(){return Xt})),n.d(o,"max",(function(){return Yt})),n.d(o,"round",(function(){return Ht})),n.d(o,"scale",(function(){return qt})),n.d(o,"scaleAndAdd",(function(){return Kt})),n.d(o,"distance",(function(){return Zt})),n.d(o,"squaredDistance",(function(){return Qt})),n.d(o,"length",(function(){return $t})),n.d(o,"squaredLength",(function(){return Jt})),n.d(o,"negate",(function(){return te})),n.d(o,"inverse",(function(){return ee})),n.d(o,"normalize",(function(){return ne})),n.d(o,"dot",(function(){return re})),n.d(o,"cross",(function(){return ie})),n.d(o,"lerp",(function(){return oe})),n.d(o,"random",(function(){return ae})),n.d(o,"transformMat4",(function(){return se})),n.d(o,"transformQuat",(function(){return ue})),n.d(o,"zero",(function(){return ce})),n.d(o,"str",(function(){return le})),n.d(o,"exactEquals",(function(){return fe})),n.d(o,"equals",(function(){return he})),n.d(o,"sub",(function(){return pe})),n.d(o,"mul",(function(){return ge})),n.d(o,"div",(function(){return ve})),n.d(o,"dist",(function(){return ye})),n.d(o,"sqrDist",(function(){return me})),n.d(o,"len",(function(){return be})),n.d(o,"sqrLen",(function(){return xe})),n.d(o,"forEach",(function(){return we}));var a={};n.r(a),n.d(a,"create",(function(){return _e})),n.d(a,"identity",(function(){return Se})),n.d(a,"setAxisAngle",(function(){return Ee})),n.d(a,"getAxisAngle",(function(){return Oe})),n.d(a,"getAngle",(function(){return Me})),n.d(a,"multiply",(function(){return ke})),n.d(a,"rotateX",(function(){return Ae})),n.d(a,"rotateY",(function(){return Ce})),n.d(a,"rotateZ",(function(){return Te})),n.d(a,"calculateW",(function(){return Ie})),n.d(a,"exp",(function(){return Pe})),n.d(a,"ln",(function(){return De})),n.d(a,"pow",(function(){return Ne})),n.d(a,"slerp",(function(){return je})),n.d(a,"random",(function(){return Re})),n.d(a,"invert",(function(){return Le})),n.d(a,"conjugate",(function(){return Be})),n.d(a,"fromMat3",(function(){return Ge})),n.d(a,"fromEuler",(function(){return Fe})),n.d(a,"str",(function(){return ze})),n.d(a,"clone",(function(){return qe})),n.d(a,"fromValues",(function(){return Ke})),n.d(a,"copy",(function(){return Ze})),n.d(a,"set",(function(){return Qe})),n.d(a,"add",(function(){return $e})),n.d(a,"mul",(function(){return Je})),n.d(a,"scale",(function(){return tn})),n.d(a,"dot",(function(){return en})),n.d(a,"lerp",(function(){return nn})),n.d(a,"length",(function(){return rn})),n.d(a,"len",(function(){return on})),n.d(a,"squaredLength",(function(){return an})),n.d(a,"sqrLen",(function(){return sn})),n.d(a,"normalize",(function(){return un})),n.d(a,"exactEquals",(function(){return cn})),n.d(a,"equals",(function(){return ln})),n.d(a,"rotationTo",(function(){return fn})),n.d(a,"sqlerp",(function(){return hn})),n.d(a,"setAxes",(function(){return dn}));var s=n(12);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 f(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 h(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],f=l*a-s*c,h=-l*o+s*u,d=c*o-a*u,p=n*f+r*h+i*d;return p?(p=1/p,t[0]=f*p,t[1]=(-l*r+i*c)*p,t[2]=(s*r-i*a)*p,t[3]=h*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 y(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 m(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],f=e[8],h=n[0],d=n[1],p=n[2],g=n[3],v=n[4],y=n[5],m=n[6],b=n[7],x=n[8];return t[0]=h*r+d*a+p*c,t[1]=h*i+d*s+p*l,t[2]=h*o+d*u+p*f,t[3]=g*r+v*a+y*c,t[4]=g*i+v*s+y*l,t[5]=g*o+v*u+y*f,t[6]=m*r+b*a+x*c,t[7]=m*i+b*s+x*l,t[8]=m*o+b*u+x*f,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],f=e[8],h=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]=h*r+d*a+c,t[7]=h*i+d*s+l,t[8]=h*o+d*u+f,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],f=e[8],h=Math.sin(n),d=Math.cos(n);return t[0]=d*r+h*a,t[1]=d*i+h*s,t[2]=d*o+h*u,t[3]=d*a-h*r,t[4]=d*s-h*i,t[5]=d*u-h*o,t[6]=c,t[7]=l,t[8]=f,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 O(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 M(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 k(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,f=r*s,h=i*a,d=i*s,p=i*u,g=o*a,v=o*s,y=o*u;return t[0]=1-f-p,t[3]=l-y,t[6]=h+v,t[1]=l+y,t[4]=1-c-p,t[7]=d-g,t[2]=h-v,t[5]=d+g,t[8]=1-c-f,t}function A(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],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=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-f*p,O=l*v-h*p,M=l*y-d*p,k=f*v-h*g,A=f*y-d*g,C=h*y-d*v,T=m*C-b*A+x*k+w*M-_*O+S*E;return T?(T=1/T,t[0]=(s*C-u*A+c*k)*T,t[1]=(u*M-a*C-c*O)*T,t[2]=(a*A-s*M+c*E)*T,t[3]=(i*A-r*C-o*k)*T,t[4]=(n*C-i*M+o*O)*T,t[5]=(r*M-n*A-o*E)*T,t[6]=(g*S-v*_+y*w)*T,t[7]=(v*x-p*S-y*b)*T,t[8]=(p*_-g*x+y*m)*T,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 T(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function I(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 D(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,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 j(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 R(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 L(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],f=t[8],h=e[0],d=e[1],p=e[2],g=e[3],v=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return Math.abs(n-h)<=s.b*Math.max(1,Math.abs(n),Math.abs(h))&&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-y)<=s.b*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=s.b*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(l-b)<=s.b*Math.max(1,Math.abs(l),Math.abs(b))&&Math.abs(f-x)<=s.b*Math.max(1,Math.abs(f),Math.abs(x))}var B=b,G=D;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,f,h,d,p,g,v){var y=new s.a(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=o,y[6]=a,y[7]=u,y[8]=c,y[9]=l,y[10]=f,y[11]=h,y[12]=d,y[13]=p,y[14]=g,y[15]=v,y}function W(t,e,n,r,i,o,a,s,u,c,l,f,h,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]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=v,t}function X(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 Y(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],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=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-f*p,O=l*v-h*p,M=l*y-d*p,k=f*v-h*g,A=f*y-d*g,C=h*y-d*v,T=m*C-b*A+x*k+w*M-_*O+S*E;return T?(T=1/T,t[0]=(s*C-u*A+c*k)*T,t[1]=(i*A-r*C-o*k)*T,t[2]=(g*S-v*_+y*w)*T,t[3]=(h*_-f*S-d*w)*T,t[4]=(u*M-a*C-c*O)*T,t[5]=(n*C-i*M+o*O)*T,t[6]=(v*x-p*S-y*b)*T,t[7]=(l*S-h*x+d*b)*T,t[8]=(a*A-s*M+c*E)*T,t[9]=(r*M-n*A-o*E)*T,t[10]=(p*_-g*x+y*m)*T,t[11]=(f*x-l*_-d*m)*T,t[12]=(s*O-a*k-u*E)*T,t[13]=(n*k-r*O+i*E)*T,t[14]=(g*b-p*w-v*m)*T,t[15]=(l*w-f*b+h*m)*T,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],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],y=e[15];return t[0]=s*(h*y-d*v)-f*(u*y-c*v)+g*(u*d-c*h),t[1]=-(r*(h*y-d*v)-f*(i*y-o*v)+g*(i*d-o*h)),t[2]=r*(u*y-c*v)-s*(i*y-o*v)+g*(i*c-o*u),t[3]=-(r*(u*d-c*h)-s*(i*d-o*h)+f*(i*c-o*u)),t[4]=-(a*(h*y-d*v)-l*(u*y-c*v)+p*(u*d-c*h)),t[5]=n*(h*y-d*v)-l*(i*y-o*v)+p*(i*d-o*h),t[6]=-(n*(u*y-c*v)-a*(i*y-o*v)+p*(i*c-o*u)),t[7]=n*(u*d-c*h)-a*(i*d-o*h)+l*(i*c-o*u),t[8]=a*(f*y-d*g)-l*(s*y-c*g)+p*(s*d-c*f),t[9]=-(n*(f*y-d*g)-l*(r*y-o*g)+p*(r*d-o*f)),t[10]=n*(s*y-c*g)-a*(r*y-o*g)+p*(r*c-o*s),t[11]=-(n*(s*d-c*f)-a*(r*d-o*f)+l*(r*c-o*s)),t[12]=-(a*(f*v-h*g)-l*(s*v-u*g)+p*(s*h-u*f)),t[13]=n*(f*v-h*g)-l*(r*v-i*g)+p*(r*h-i*f),t[14]=-(n*(s*v-u*g)-a*(r*v-i*g)+p*(r*u-i*s)),t[15]=n*(s*h-u*f)-a*(r*h-i*f)+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],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],v=t[15];return(e*a-n*o)*(f*v-h*g)-(e*s-r*o)*(l*v-h*p)+(e*u-i*o)*(l*g-f*p)+(n*s-r*a)*(c*v-h*d)-(n*u-i*a)*(c*g-f*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],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],v=e[13],y=e[14],m=e[15],b=n[0],x=n[1],w=n[2],_=n[3];return t[0]=b*r+x*s+w*f+_*g,t[1]=b*i+x*u+w*h+_*v,t[2]=b*o+x*c+w*d+_*y,t[3]=b*a+x*l+w*p+_*m,b=n[4],x=n[5],w=n[6],_=n[7],t[4]=b*r+x*s+w*f+_*g,t[5]=b*i+x*u+w*h+_*v,t[6]=b*o+x*c+w*d+_*y,t[7]=b*a+x*l+w*p+_*m,b=n[8],x=n[9],w=n[10],_=n[11],t[8]=b*r+x*s+w*f+_*g,t[9]=b*i+x*u+w*h+_*v,t[10]=b*o+x*c+w*d+_*y,t[11]=b*a+x*l+w*p+_*m,b=n[12],x=n[13],w=n[14],_=n[15],t[12]=b*r+x*s+w*f+_*g,t[13]=b*i+x*u+w*h+_*v,t[14]=b*o+x*c+w*d+_*y,t[15]=b*a+x*l+w*p+_*m,t}function Q(t,e,n){var r,i,o,a,s,u,c,l,f,h,d,p,g=n[0],v=n[1],y=n[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*y+e[12],t[13]=e[1]*g+e[5]*v+e[9]*y+e[13],t[14]=e[2]*g+e[6]*v+e[10]*y+e[14],t[15]=e[3]*g+e[7]*v+e[11]*y+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],f=e[8],h=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]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*v+f*y+e[12],t[13]=i*g+u*v+h*y+e[13],t[14]=o*g+c*v+d*y+e[14],t[15]=a*g+l*v+p*y+e[15]),t}function $(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,f,h,d,p,g,v,y,m,b,x,w,_,S,E,O,M,k,A,C=r[0],T=r[1],I=r[2],P=Math.hypot(C,T,I);return P0?(n[0]=2*(u*a+f*r+c*o-l*i)/h,n[1]=2*(c*a+f*i+l*r-u*o)/h,n[2]=2*(l*a+f*o+u*i-c*r)/h):(n[0]=2*(u*a+f*r+c*o-l*i),n[1]=2*(c*a+f*i+l*r-u*o),n[2]=2*(l*a+f*o+u*i-c*r)),ct(t,e,n),t}function ft(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function ht(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);ht(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,f=e[5]*i,h=e[6]*o,d=e[8]*r,p=e[9]*i,g=e[10]*o,v=a+f+g,y=0;return v>0?(y=2*Math.sqrt(v+1),t[3]=.25*y,t[0]=(h-p)/y,t[1]=(d-c)/y,t[2]=(u-l)/y):a>f&&a>g?(y=2*Math.sqrt(1+a-f-g),t[3]=(h-p)/y,t[0]=.25*y,t[1]=(u+l)/y,t[2]=(d+c)/y):f>g?(y=2*Math.sqrt(1+f-a-g),t[3]=(d-c)/y,t[0]=(u+l)/y,t[1]=.25*y,t[2]=(h+p)/y):(y=2*Math.sqrt(1+g-a-f),t[3]=(u-l)/y,t[0]=(d+c)/y,t[1]=(h+p)/y,t[2]=.25*y),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,f=i*u,h=i*c,d=i*l,p=o*c,g=o*l,v=a*l,y=s*u,m=s*c,b=s*l,x=r[0],w=r[1],_=r[2];return t[0]=(1-(p+v))*x,t[1]=(h+b)*x,t[2]=(d-m)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(f+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(d+m)*_,t[9]=(g-y)*_,t[10]=(1-(f+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,f=s+s,h=o*c,d=o*l,p=o*f,g=a*l,v=a*f,y=s*f,m=u*c,b=u*l,x=u*f,w=r[0],_=r[1],S=r[2],E=i[0],O=i[1],M=i[2],k=(1-(g+y))*w,A=(d+x)*w,C=(p-b)*w,T=(d-x)*_,I=(1-(h+y))*_,P=(v+m)*_,D=(p+b)*S,N=(v-m)*S,j=(1-(h+g))*S;return t[0]=k,t[1]=A,t[2]=C,t[3]=0,t[4]=T,t[5]=I,t[6]=P,t[7]=0,t[8]=D,t[9]=N,t[10]=j,t[11]=0,t[12]=n[0]+E-(k*E+T*O+D*M),t[13]=n[1]+O-(A*E+I*O+N*M),t[14]=n[2]+M-(C*E+P*O+j*M),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,f=r*s,h=i*a,d=i*s,p=i*u,g=o*a,v=o*s,y=o*u;return t[0]=1-f-p,t[1]=l+y,t[2]=h-v,t[3]=0,t[4]=l-y,t[5]=1-c-p,t[6]=d+g,t[7]=0,t[8]=h+v,t[9]=d-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function yt(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 mt(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}function bt(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 xt(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}function wt(t,e,n,r){var i,o,a,u,c,l,f,h,d,p,g=e[0],v=e[1],y=e[2],m=r[0],b=r[1],x=r[2],w=n[0],_=n[1],S=n[2];return Math.abs(g-w)0&&(l*=d=1/Math.sqrt(d),f*=d,h*=d);var p=u*h-c*f,g=c*l-s*h,v=s*f-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]=f*v-h*g,t[5]=h*p-l*v,t[6]=l*g-f*p,t[7]=0,t[8]=l,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function St(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 Et(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 Ot(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 Mt(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 kt(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 At(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 Ct(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 Tt(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],f=t[8],h=t[9],d=t[10],p=t[11],g=t[12],v=t[13],y=t[14],m=t[15],b=e[0],x=e[1],w=e[2],_=e[3],S=e[4],E=e[5],O=e[6],M=e[7],k=e[8],A=e[9],C=e[10],T=e[11],I=e[12],P=e[13],D=e[14],N=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-O)<=s.b*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-M)<=s.b*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(f-k)<=s.b*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(h-A)<=s.b*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(d-C)<=s.b*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(p-T)<=s.b*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-I)<=s.b*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(v-P)<=s.b*Math.max(1,Math.abs(v),Math.abs(P))&&Math.abs(y-D)<=s.b*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(m-N)<=s.b*Math.max(1,Math.abs(m),Math.abs(N))}var It=Z,Pt=Mt,Dt=n(38);function Nt(){var t=new s.a(4);return s.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function jt(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 Rt(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 Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Bt(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function Gt(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 Ft(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 zt(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 Ut(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 Vt(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 Wt(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 Xt(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 Yt(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 Ht(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 Kt(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 Zt(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 Qt(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 $t(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function Jt(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function te(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function ee(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 ne(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 re(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function ie(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],f=e[1],h=e[2],d=e[3];return t[0]=f*c-h*u+d*s,t[1]=-l*c+h*a-d*o,t[2]=l*u-f*a+d*i,t[3]=-l*s+f*o-h*i,t}function oe(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 ae(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 se(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 ue(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,f=c*i+u*r-a*o,h=c*o+a*i-s*r,d=-a*r-s*i-u*o;return t[0]=l*c+d*-a+f*-u-h*-s,t[1]=f*c+d*-s+h*-a-l*-u,t[2]=h*c+d*-u+l*-s-f*-a,t[3]=e[3],t}function ce(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function le(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function fe(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function he(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 de,pe=Ft,ge=zt,ve=Ut,ye=Zt,me=Qt,be=$t,xe=Jt,we=(de=Nt(),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;as.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 Me(t,e){var n=en(t,e);return Math.acos(2*n*n-1)}function ke(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 Ae(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 Ce(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 Te(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 Ie(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 Pe(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 De(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 Ne(t,e,n){return De(t,e),tn(t,t,n),Pe(t,t),t}function je(t,e,n,r){var i,o,a,u,c,l=e[0],f=e[1],h=e[2],d=e[3],p=n[0],g=n[1],v=n[2],y=n[3];return(o=l*p+f*g+h*v+d*y)<0&&(o=-o,p=-p,g=-g,v=-v,y=-y),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*f+c*g,t[2]=u*h+c*v,t[3]=u*d+c*y,t}function Re(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 Le(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 Be(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Ge(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 Fe(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 ze(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Ue,Ve,We,Xe,Ye,He,qe=jt,Ke=Rt,Ze=Lt,Qe=Bt,$e=Gt,Je=ke,tn=qt,en=re,nn=oe,rn=$t,on=rn,an=Jt,sn=an,un=ne,cn=fe,ln=he,fn=(Ue=Dt.create(),Ve=Dt.fromValues(1,0,0),We=Dt.fromValues(0,1,0),function(t,e,n){var r=Dt.dot(e,n);return r<-.999999?(Dt.cross(Ue,Ve,e),Dt.len(Ue)<1e-6&&Dt.cross(Ue,We,e),Dt.normalize(Ue,Ue),Ee(t,Ue,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(Dt.cross(Ue,e,n),t[0]=Ue[0],t[1]=Ue[1],t[2]=Ue[2],t[3]=1+r,un(t,t))}),hn=(Xe=_e(),Ye=_e(),function(t,e,n,r,i,o){return je(Xe,e,i,o),je(Ye,n,r,o),je(t,Xe,Ye,2*o*(1-o)),t}),dn=(He=u(),function(t,e,n,r){return He[0]=n[0],He[3]=n[1],He[6]=n[2],He[1]=r[0],He[4]=r[1],He[7]=r[2],He[2]=-e[0],He[5]=-e[1],He[8]=-e[2],un(t,Ge(t,He))}),pn=n(79)},function(t,e,n){"use strict";n.d(e,"AST_TOKEN_TYPES",(function(){return f})),n.d(e,"STORAGE_CLASS",(function(){return d})),n.d(e,"Target",(function(){return p})),n.d(e,"DefineValuePlaceholder",(function(){return v}));n(228),n(25),n(132),n(134),n(119),n(120),n(121),n(122),n(123),n(124),n(68),n(126),n(127),n(128),n(129);var r=n(118);n.d(e,"createEntity",(function(){return r.b}));var i=n(13);n.d(e,"IDENTIFIER",(function(){return i.a}));var o=n(91);n.d(e,"createWorldContainer",(function(){return o.a}));var a=n(237);n.d(e,"generateAABBFromVertices",(function(){return a.a}));var s=n(238);n.d(e,"isSafari",(function(){return s.a}));n(267);var u=n(268);n.d(e,"AABB",(function(){return u.a})),n.d(e,"Frustum",(function(){return u.b}));var c=n(114);n.o(c,"gl")&&n.d(e,"gl",(function(){return c.gl}));var l=n(250);n.o(l,"gl")&&n.d(e,"gl",(function(){return l.gl}));var f,h,d,p,g=n(251);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",t.Vector3Float="vec3",t.Vector4Float="vec4",t.Vector2Boolean="vec2",t.Vector3Boolean="vec3",t.Vector4Boolean="vec4",t.Vector2Uint="vec2",t.Vector3Uint="vec3",t.Vector4Uint="vec4",t.Vector2Int="vec2",t.Vector3Int="vec3",t.Vector4Int="vec4",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3",t.Matrix4x4Float="mat4x4",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4[]"}(f||(f={})),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"}(h||(h={})),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,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 x})),n.d(e,"findIndex",(function(){return w})),n.d(e,"firstValue",(function(){return _})),n.d(e,"flatten",(function(){return S})),n.d(e,"flattenDeep",(function(){return E})),n.d(e,"getRange",(function(){return k})),n.d(e,"pull",(function(){return I})),n.d(e,"pullAt",(function(){return D})),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 G})),n.d(e,"uniq",(function(){return B})),n.d(e,"valuesOfKey",(function(){return F})),n.d(e,"head",(function(){return z})),n.d(e,"last",(function(){return U})),n.d(e,"startsWith",(function(){return V})),n.d(e,"endsWith",(function(){return W})),n.d(e,"filter",(function(){return o})),n.d(e,"every",(function(){return X})),n.d(e,"some",(function(){return Y})),n.d(e,"group",(function(){return Z})),n.d(e,"groupBy",(function(){return q})),n.d(e,"groupToMap",(function(){return K})),n.d(e,"getWrapBehavior",(function(){return Q})),n.d(e,"wrapBehavior",(function(){return $})),n.d(e,"number2color",(function(){return tt})),n.d(e,"parseRadius",(function(){return et})),n.d(e,"clamp",(function(){return nt})),n.d(e,"fixedBase",(function(){return rt})),n.d(e,"isDecimal",(function(){return ot})),n.d(e,"isEven",(function(){return at})),n.d(e,"isInteger",(function(){return st})),n.d(e,"isNegative",(function(){return ut})),n.d(e,"isNumberEqual",(function(){return ct})),n.d(e,"isOdd",(function(){return lt})),n.d(e,"isPositive",(function(){return ft})),n.d(e,"max",(function(){return O})),n.d(e,"maxBy",(function(){return ht})),n.d(e,"min",(function(){return M})),n.d(e,"minBy",(function(){return dt})),n.d(e,"mod",(function(){return pt})),n.d(e,"toDegree",(function(){return vt})),n.d(e,"toInteger",(function(){return yt})),n.d(e,"toRadian",(function(){return bt})),n.d(e,"forIn",(function(){return xt})),n.d(e,"has",(function(){return wt})),n.d(e,"hasKey",(function(){return _t})),n.d(e,"hasValue",(function(){return Et})),n.d(e,"keys",(function(){return g})),n.d(e,"isMatch",(function(){return v})),n.d(e,"values",(function(){return St})),n.d(e,"lowerCase",(function(){return Mt})),n.d(e,"lowerFirst",(function(){return kt})),n.d(e,"substitute",(function(){return At})),n.d(e,"upperCase",(function(){return Ct})),n.d(e,"upperFirst",(function(){return Tt})),n.d(e,"getType",(function(){return Pt})),n.d(e,"isArguments",(function(){return Dt})),n.d(e,"isArray",(function(){return f})),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 Rt})),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 Bt})),n.d(e,"isNumber",(function(){return it})),n.d(e,"isObject",(function(){return d})),n.d(e,"isObjectLike",(function(){return m})),n.d(e,"isPlainObject",(function(){return b})),n.d(e,"isPrototype",(function(){return Ft})),n.d(e,"isRegExp",(function(){return zt})),n.d(e,"isString",(function(){return R})),n.d(e,"isType",(function(){return u})),n.d(e,"isUndefined",(function(){return Ut})),n.d(e,"isElement",(function(){return Vt})),n.d(e,"requestAnimationFrame",(function(){return Wt})),n.d(e,"clearAnimationFrame",(function(){return Xt})),n.d(e,"augment",(function(){return qt})),n.d(e,"clone",(function(){return Zt})),n.d(e,"debounce",(function(){return Qt})),n.d(e,"memoize",(function(){return $t})),n.d(e,"deepMix",(function(){return te})),n.d(e,"each",(function(){return p})),n.d(e,"extend",(function(){return ee})),n.d(e,"indexOf",(function(){return ne})),n.d(e,"isEmpty",(function(){return ie})),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 Ht})),n.d(e,"assign",(function(){return Ht})),n.d(e,"get",(function(){return le})),n.d(e,"set",(function(){return fe})),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 Ot})),n.d(e,"uniqueId",(function(){return me})),n.d(e,"noop",(function(){return be})),n.d(e,"identity",(function(){return xe})),n.d(e,"size",(function(){return we})),n.d(e,"Cache",(function(){return _e}));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-1;)C.call(t,o,1);return t},P=Array.prototype.splice,D=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,P.call(t,a,1))}return t},N=function(t,e,n){if(!f(t)&&!b(t))return t;var r=n;return p(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;++ie[i])return 1;if(t[i]n?n:t},rt=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))},it=function(t){return u(t,"Number")},ot=function(t){return it(t)&&t%1!=0},at=function(t){return it(t)&&t%2==0},st=Number.isInteger?Number.isInteger:function(t){return it(t)&&t%1==0},ut=function(t){return it(t)&&t<0};function ct(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)0},ht=function(t,e){if(f(t)){for(var n,r=-1/0,i=0;ir&&(n=o,r=a)}return n}},dt=function(t,e){if(f(t)){for(var n,r=1/0,i=0;ie?(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):[]},ye={},me=function(t){return ye[t=t||"g"]?ye[t]+=1:ye[t]=1,t+ye[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=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){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";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(32);e.METADATA_KEY=r;var i=n(485);Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return i.Container}});var o=n(53);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(501);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(502);Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return s.injectable}});var u=n(503);Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return u.tagged}});var c=n(504);Object.defineProperty(e,"named",{enumerable:!0,get:function(){return c.named}});var l=n(233);Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return l.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return l.LazyServiceIdentifer}});var f=n(505);Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return f.optional}});var h=n(506);Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return h.unmanaged}});var d=n(507);Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return d.multiInject}});var p=n(508);Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return p.targetName}});var g=n(509);Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return g.postConstruct}});var v=n(231);Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return v.MetadataReader}});var y=n(66);Object.defineProperty(e,"id",{enumerable:!0,get:function(){return y.id}});var m=n(58);Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return m.decorate}});var b=n(236);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(90);Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return x.getServiceIdentifierAsString}});var w=n(510);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"),Renderable:Symbol("Factory"),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){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(3);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.maxXt.maxY||e.maxY=0;return n?o?2*Math.PI-r:r:o?r:2*Math.PI-r}function f(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(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(3);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 m})),n.d(e,"b",(function(){return E})),n.d(e,"a",(function(){return I})),n.d(e,"c",(function(){return h})),n.d(e,"d",(function(){return L})),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 f=n(79),h={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(f.exactEquals(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];f.normalize(s,s);var u=[i-t,o-e];return Math.abs(f.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 f=1/l,h=f/10,d=0;d<=l;d++){var p=d*f,g=[i.apply(null,t.concat([p])),i.apply(null,e.concat([p]))];(b=a(c[0],c[1],g[0],g[1]))=0&&b=0?[i]:[]}function v(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function y(t,e,n,r,i,o,a){var s=p(t,n,i,a),u=p(e,r,o,a),c=h.pointAt(t,e,n,r,a),l=h.pointAt(n,r,i,o,a);return[[t,e,c.x,c.y,s,u],[s,u,l.x,l.y,i,o]]}var m={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=y(e,n,r,i,o,s,.5),l=c[0],f=c[1];return l.push(u-1),f.push(u-1),t.apply(null,l)+t.apply(null,f)}(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 y(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,f=[];if(s(u,0))s(c,0)||(i=-l/c)>=0&&i<=1&&f.push(i);else{var h=c*c-4*u*l;s(h,0)?f.push(-c/(2*u)):h>0&&(o=(-c-(a=Math.sqrt(h)))/(2*u),(i=(-c+a)/(2*u))>=0&&i<=1&&f.push(i),o>=0&&o<=1&&f.push(o))}return f}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),f=h.pointAt(t,e,n,r,u),d=h.pointAt(n,r,i,o,u),p=h.pointAt(i,o,a,s,u),g=h.pointAt(f.x,f.y,d.x,d.y,u),v=h.pointAt(d.x,d.y,p.x,p.y,u);return[[t,e,f.x,f.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;i0?n:-1*n}var M=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,f=o-e,h=Math.abs(l),d=Math.abs(f),p=a*a,g=s*s,v=Math.PI/4,y=0;y<4;y++){u=a*Math.cos(v),c=s*Math.sin(v);var m=(p-g)*Math.pow(Math.cos(v),3)/a,b=(g-p)*Math.pow(Math.sin(v),3)/s,x=u-m,w=c-b,_=h-m,S=d-b,E=Math.hypot(w,x),M=Math.hypot(S,_);v+=E*Math.asin((x*S-w*_)/(E*M))/Math.sqrt(p+g-u*u-c*c),v=Math.min(Math.PI/2,Math.max(0,v))}return{x:t+O(u,l),y:e+O(c,f)}};function k(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function A(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 T(t,e,n){var r=Math.cos(n),i=Math.sin(n);return[t*r-e*i,t*i+e*r]}var I={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],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;oc&&(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,y=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var m=p+f;ov&&(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=T(s-t,u-e,-i),l=c[0],f=c[1],h=M(0,0,n,r,l,f),d=function(t,e,n,r){return(Math.atan2(r*t,n*e)+2*Math.PI)%(2*Math.PI)}(n,r,h.x,h.y);da&&(h=C(n,r,a));var p=T(h.x,h.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:k(t,0,n,r,i,u),y:A(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),f=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(f,c))}};function P(t){for(var e=0,n=[],r=0;r1||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=o&&e<=o+f){var d=(e-o)/f;a=h.pointAt(c[0],c[1],l[0],l[1],d);break}o+=f}return a}function j(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=o&&e<=o+f){a=Math.atan2(l[1]-c[1],l[0]-c[0]);break}o+=f}return a}function R(t,e,n){for(var r=1/0,i=0;i-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-1){var n=this.entities[e];if(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);ee)n.insertBefore(t,i);else if(o_?w:_,A=w>_?1:w/_,C=w>_?_/w:1;e.translate(b,x),e.rotate(O),e.scale(A,C),e.arc(0,0,k,S,E,1-M),e.scale(1/A,1/C),e.rotate(-O),e.translate(-b,-x)}break;case"Z":e.closePath()}if("Z"===p)c=l;else{var T=d.length;c=[d[T-2],d[T-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 y(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 m(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.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 d})),n.d(e,"a",(function(){return p}));var r=n(0),i=n(54);function o(t){return(o="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 a=Math.sin,s=Math.cos,u=Math.atan2,c=Math.PI;function l(t,e,n,r,o,l,f){var h=e.stroke,d=e.lineWidth,p=u(r-l,n-o),g=new i.Path({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*s(c/6)+","+10*a(c/6)+" L0,0 L"+10*s(c/6)+",-"+10*a(c/6),stroke:h,lineWidth:d}});g.translate(o,l),g.rotateAtPoint(o,l,p),t.set(f?"startArrowShape":"endArrowShape",g)}function f(t,e,n,o,c,l,f){var h=e.startArrow,d=e.endArrow,p=e.stroke,g=e.lineWidth,v=f?h:d,y=v.d,m=v.fill,b=v.stroke,x=v.lineWidth,w=Object(r.__rest)(v,["d","fill","stroke","lineWidth"]),_=u(o-l,n-c);y&&(c-=s(_)*y,l-=a(_)*y);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:m})});S.translate(c,l),S.rotateAtPoint(c,l,_),t.set(f?"startArrowShape":"endArrowShape",S)}function h(t,e,n,r,i){var o=u(r-e,n-t);return{dx:s(o)*i,dy:a(o)*i}}function d(t,e,n,r,i,a){"object"===o(e.startArrow)?f(t,e,n,r,i,a,!0):e.startArrow?l(t,e,n,r,i,a,!0):t.set("startArrowShape",null)}function p(t,e,n,r,i,a){"object"===o(e.endArrow)?f(t,e,n,r,i,a,!1):e.endArrow?l(t,e,n,r,i,a,!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(26);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(28),i=n(45).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";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],f=t[8],h=e[0],d=e[1],p=e[2],g=e[3],v=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return n[0]=h*r+d*a+p*c,n[1]=h*i+d*s+p*l,n[2]=h*o+d*u+p*f,n[3]=g*r+v*a+y*c,n[4]=g*i+v*s+y*l,n[5]=g*o+v*u+y*f,n[6]=m*r+b*a+x*c,n[7]=m*i+b*s+x*l,n[8]=m*o+b*u+x*f,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],f=l*a-s*c,h=-l*o+s*u,d=c*o-a*u,p=n*f+r*h+i*d;return p?(p=1/p,e[0]=f*p,e[1]=(-l*r+i*c)*p,e[2]=(s*r-i*a)*p,e[3]=h*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 f})),n.d(e,"multiply",(function(){return h})),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 y})),n.d(e,"round",(function(){return m})),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 O})),n.d(e,"normalize",(function(){return M})),n.d(e,"dot",(function(){return k})),n.d(e,"cross",(function(){return A})),n.d(e,"lerp",(function(){return C})),n.d(e,"hermite",(function(){return T})),n.d(e,"bezier",(function(){return I})),n.d(e,"random",(function(){return P})),n.d(e,"transformMat4",(function(){return D})),n.d(e,"transformMat3",(function(){return N})),n.d(e,"transformQuat",(function(){return j})),n.d(e,"rotateX",(function(){return R})),n.d(e,"rotateY",(function(){return L})),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 X})),n.d(e,"mul",(function(){return Y})),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 Q})),n.d(e,"forEach",(function(){return $}));var r=n(12);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 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 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 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 y(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 m(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 O(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function M(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 k(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function A(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 T(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 I(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,c=s*a,l=3*o*s,f=3*u*a,h=u*o;return t[0]=e[0]*c+n[0]*l+r[0]*f+i[0]*h,t[1]=e[1]*c+n[1]*l+r[1]*f+i[1]*h,t[2]=e[2]*c+n[2]*l+r[2]*f+i[2]*h,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 D(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 N(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 j(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,f=o*s-r*c,h=r*u-i*s,d=i*h-o*f,p=o*l-r*h,g=r*f-i*l,v=2*a;return l*=v,f*=v,h*=v,d*=2,p*=2,g*=2,t[0]=s+l+d,t[1]=u+f+p,t[2]=c+h+g,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[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 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[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&&k(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,X=f,Y=h,H=d,q=w,K=_,Z=a,Q=S,$=(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= 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=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);n2&&(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,f=0;"M"===t[0][0]&&(a=i=+t[0][1],l=o=+t[0][2],f++,r[0]=["M",i,o]);for(var h=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),d=void 0,p=void 0,g=f,v=t.length;g1&&(r*=_=Math.sqrt(_),i*=_);var S=r*r,E=i*i,O=(a===s?-1:1)*Math.sqrt(Math.abs((S*E-S*w*w-E*x*x)/(S*w*w+E*x*x)));p=O*r*w/i+(e+u)/2,g=O*-i*x/r+(n+c)/2,h=Math.asin(((n-g)/i).toFixed(9)),d=Math.asin(((c-g)/i).toFixed(9)),h=ed&&(h-=2*Math.PI),!s&&d>h&&(d-=2*Math.PI)}var M=d-h;if(Math.abs(M)>v){var k=d,A=u,C=c;d=h+v*(s&&d>h?1:-1),m=t(u=p+r*Math.cos(d),c=g+i*Math.sin(d),r,i,o,0,s,A,C,[d,k,p,g])}M=d-h;var T=Math.cos(h),I=Math.sin(h),P=Math.cos(d),D=Math.sin(d),N=Math.tan(M/4),j=4/3*r*N,R=4/3*i*N,L=[e,n],B=[e+j*I,n-R*T],G=[u+j*D,c-R*P],F=[u,c];if(B[0]=2*L[0]-B[0],B[1]=2*L[1]-B[1],l)return[B,G,F].concat(m);for(var z=[],U=0,V=(m=[B,G,F].concat(m).join().split(",")).length;U7){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)}},y=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 m=0;m1?1:u<0?0:u)/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,d=0;d<12;d++){var p=c*l[d]+c,g=y(p,t,n,i,a),v=y(p,e,r,o,s),m=g*g+v*v;h+=f[d]*Math.sqrt(m)}return c*h},b=function(t,e,n,r,i,o,a,s){for(var u,c,l,f,h=[],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;(f=-l/c)>0&&f<1&&h.push(f)}else{var g=c*c-4*l*u,v=Math.sqrt(g);if(!(g<0)){var y=(-c+v)/(2*u);y>0&&y<1&&h.push(y);var m=(-c-v)/(2*u);m>0&&m<1&&h.push(m)}}for(var b,x=h.length,w=x;x--;)b=1-(f=h[x]),d[0][x]=b*b*b*t+3*b*b*f*n+3*b*f*f*i+f*f*f*a,d[1][x]=b*b*b*e+3*b*b*f*r+3*b*f*f*o+f*f*f*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.max(i,a)||Math.max(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,f=+c.toFixed(2),h=+l.toFixed(2);if(!(f<+Math.min(t,n).toFixed(2)||f>+Math.max(t,n).toFixed(2)||f<+Math.min(i,a).toFixed(2)||f>+Math.max(i,a).toFixed(2)||h<+Math.min(e,r).toFixed(2)||h>+Math.max(e,r).toFixed(2)||h<+Math.min(o,s).toFixed(2)||h>+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)},O=function(t,e,n,r,i,o,a,s,u){var c=1-u,l=Math.pow(c,3),f=Math.pow(c,2),h=u*u,d=h*u,p=t+2*u*(n-t)+h*(i-2*n+t),g=e+2*u*(r-e)+h*(o-2*r+e),v=n+2*u*(i-n)+h*(a-2*i+n),y=r+2*u*(o-r)+h*(s-2*o+r);return{x:l*t+3*f*u*n+3*c*u*u*i+d*a,y:l*e+3*f*u*r+3*c*u*u*o+d*s,m:{x:p,y:g},n:{x:v,y:y},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-y)/Math.PI}},M=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.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}(E(t),E(e)))return n?0:[];for(var r=~~(m.apply(0,t)/8),i=~~(m.apply(0,e)/8),o=[],a=[],s={},u=n?0:[],c=0;c=0&&_<=1&&M>=0&&M<=1&&(n?u+=1:u.push({x:b.x,y:b.y,t1:_,t2:M}))}}return u},k=function(t,e){return function(t,e,n){var r,i,o,a,s,u,c,l,f,h;t=p(t),e=p(e);for(var d=n?0:[],g=0,v=t.length;g=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},T=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=0;u--)a=o[u].index,"add"===o[u].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var f=i-(r=t.length);if(r0)){t[r]=e[r];break}n=N(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=N(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=N(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(84),i=n(147);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){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)}var i=n(363),o=n(373),a=n(65),s=n(31),u=n(380);t.exports=function(t){return"function"==typeof t?t:null==t?a:"object"==r(t)?s(t)?o(t[0],t[1]):i(t):u(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 h})),n.d(e,"Image",(function(){return p})),n.d(e,"Line",(function(){return m})),n.d(e,"Marker",(function(){return _})),n.d(e,"Path",(function(){return D})),n.d(e,"Polygon",(function(){return j})),n.d(e,"Polyline",(function(){return R})),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 h})),n.d(r,"Image",(function(){return p})),n.d(r,"Line",(function(){return m})),n.d(r,"Marker",(function(){return _})),n.d(r,"Path",(function(){return D})),n.d(r,"Polygon",(function(){return j})),n.d(r,"Polyline",(function(){return R})),n.d(r,"Rect",(function(){return B})),n.d(r,"Text",(function(){return G}));var i=n(0),o=n(21),a=n(15),s=n(30),u=n(75),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,f=Object(a.b)(s,u,t,e);return r&&n?f<=c+l:r?f<=c:!!n&&(f>=c-l&&f<=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 f(t,e,n,r){return t/(n*n)+e/(r*r)}var h=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,h=(t-s)*(t-s),d=(e-u)*(e-u);return r&&n?f(h,d,c+a,l+a)<=1:r?f(h,d,c,l)<=1:!!n&&(f(h,d,c-a,l-a)>=1&&f(h,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,f=e.img;(f instanceof Image||d(f))&&(Object(a.i)(s)||Object(a.i)(u)||Object(a.i)(c)||Object(a.i)(l)?t.drawImage(f,n,r,i,o):t.drawImage(f,s,u,c,l,n,r,i,o))},e}(c),g=n(20);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),f=i/2;return o>=s-f&&o<=u+f&&a>=c-f&&a<=l+f&&g.c.pointToLine(t,e,n,r,o,a)<=i/2}var y=n(33),m=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&&y.b(this,t,r,i,e,n),a&&y.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=y.c(n,r,i,o,e.startArrow.d)),s&&s.d&&(c=y.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(3),x=n(55),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.b)(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 O(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 M(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o0!=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 k=n(17),A=n(38);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(ci)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 T=k.a.transform;var I=Object(i.__assign)({hasArc:function(t){for(var e=!1,n=t.length,r=0;r0&&r.push(i),{polygons:n,polylines:r}},isPointInStroke:function(t,e,n,r,i){for(var o=!1,s=e/2,u=0;ux?b:x,M=T(null,[["t",-y,-m],["r",-S],["s",1/(b>x?1:b/x),1/(b>x?x/b:1)]]);A.transformMat3(E,E,M),o=C(0,0,O,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=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",I.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 N(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a=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),L=n(139);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,f=o.radius;if(f){var h=!1;return n&&(h=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,f,i,t,e)),!h&&r&&(h=S(this,t,e)),h}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(L.a)(a),u=s[0],c=s[1],l=s[2],f=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+f,r+o),0!==f&&t.arc(n+f,r+o-f,f,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,f=this._getSpaceingY(),h=Object(o.getTextHeight)(i.text,i.fontSize,i.lineHeight);Object(a.c)(e,(function(e,i){r=c+i*(f+l)-h+l,"middle"===s&&(r+=h-l-(h-l)/2),"top"===s&&(r+=h-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,"a",(function(){return s})),n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return x}));var r=n(3),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};function s(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}var u="\t\n\v\f\r 聽釟€釥庘€€鈥佲€傗€冣€勨€呪€嗏€団€堚€夆€娾€仧銆€\u2028\u2029",c=new RegExp("([a-z])["+u+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+u+"]*,?["+u+"]*)+)","ig"),l=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+u+"]*,?["+u+"]*","ig");var f=/[a-z]/;function h(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function d(t){var e=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(c,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(l,(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}(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,i=0;i=0){n=!0;break}}if(!n)return e;var a=[],s=0,u=0,d=0,p=0,g=0,v=e[0];"M"!==v[0]&&"m"!==v[0]||(d=s=+v[1],p=u=+v[2],g++,a[0]=["M",s,u]);i=g;for(var y=e.length;i1&&(n*=Math.sqrt(p),i*=Math.sqrt(p));var m=n*n*(d*d)+i*i*(h*h),b=m?Math.sqrt((n*n*(i*i)-m)/m):1;a===s&&(b*=-1),isNaN(b)&&(b=0);var x=i?b*n*d/i:0,w=n?b*-i*h/n:0,_=(u+l)/2+Math.cos(o)*x-Math.sin(o)*w,S=(c+f)/2+Math.sin(o)*x+Math.cos(o)*w,E=[(h-x)/n,(d-w)/i],O=[(-1*h-x)/n,(-1*d-w)/i],M=v([1,0],E),k=v(E,O);return g(E,O)<=-1&&(k=Math.PI),g(E,O)>=1&&(k=0),0===s&&k>0&&(k-=2*Math.PI),1===s&&k<0&&(k+=2*Math.PI),{cx:_,cy:S,rx:y(t,[l,f])?0:n,ry:y(t,[l,f])?0:i,startAngle:M,endAngle:M+k,xRotation:o,arcFlag:a,sweepFlag:s}}function b(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function x(t){for(var e=[],n=null,r=null,i=null,o=0,s=(t=a(t)).length,u=0;u1?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=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 D(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nf||d<0||p>h||p<0))return c(e.pickingFBO,(function(){0===(r=u({x:Math.round(d),y:Math.round(h-(a+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]&&0===r[1]&&0===r[2]||(i=Object(T.a)(r),e.highlightEnabled&&e.highlightPickedFeature(r,n))})),i}}return O()(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",j),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=k()(c.prototype,"engine",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),f=k()(c.prototype,"resourcePool",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),h=k()(c.prototype,"renderPassFactory",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),d=k()(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(34),i=n(26);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 f=t.get("children");f&&f.length&&Object(i.d)(t,(function(t,e){return f.indexOf(t)-f.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(46).Symbol;t.exports=r},function(t,e,n){(function(t){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)}var i=n(46),o=n(339),a="object"==r(e)&&e&&!e.nodeType&&e,s=a&&"object"==r(t)&&t&&!t.nodeType&&t,u=s&&s.exports===a?i.Buffer:void 0,c=(u?u.isBuffer:void 0)||o;t.exports=c}).call(this,n(87)(t))},function(t,e,n){var r=n(348),i=n(144),o=n(349),a=n(188),s=n(350),u=n(63),c=n(177),l=c(r),f=c(i),h=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 f:return"[object Map]";case h:return"[object Promise]";case d:return"[object Set]";case p:return"[object WeakMap]"}return e}),t.exports=g},function(t,e,n){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)}var i=n(63),o=n(48);t.exports=function(t){return"symbol"==r(t)||o(t)&&"[object Symbol]"==i(t)}},function(t,e,n){"use strict";var r=n(0),i=n(21),o=n(54),a=n(30),s=n(3),u=n(15),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 f=l.getViewRange();this.set("isInView",Object(u.f)(r,f))}}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(0),i=n(21),o=n(3),a=n(78),s=n(69),u=n(34),c=n(16),l=n(26),f=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=f},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(6),i=n.n(r),o=n(7),a=n.n(o),s=n(1),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,f=r-s,h=r+s,d=i-u,p=i+u,g=t.center,v=g[0],y=g[1],m=g[2],b=t.halfExtents,x=b[0],w=b[1],_=b[2],S=v-x,E=v+x,O=y-w,M=y+w,k=m-_,A=m+_;Sl&&(l=E),Oh&&(h=M),kp&&(p=A),e[0]=.5*(c+l),e[1]=.5*(f+h),e[2]=.5*(d+p),o[0]=.5*(l-c),o[1]=.5*(h-f),o[2]=.5*(p-d),this.min[0]=c,this.min[1]=f,this.min[2]=d,this.max[0]=l,this.max[1]=h,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]n[0]||t[1]n[1]||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 f})),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 m})),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 O})),n.d(e,"Text",(function(){return T}));var r={};n.r(r),n.d(r,"Base",(function(){return f})),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 m})),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 O})),n.d(r,"Text",(function(){return T}));var i=n(0),o=n(21),a=n(34),s=n(26),u=n(69),c=n(16),l=n(76),f=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,f=i-c;return{x:l,y:f,minX:l,minY:f,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,f=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&&f.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&&f.setAttribute(c.b.strokeOpacity,u),l&&f.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),h=n(3),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(h.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}(f),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(h.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}(f),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(h.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}(f),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(h.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(h.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(h.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}(f),y=n(20),m=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(h.each)(e||n,(function(e,i){if("startArrow"===i||"endArrow"===i)if(e){var o=Object(h.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 y.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 y.c.pointAt(n,r,i,o,t)},e}(f),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(h.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(h.isFunction)(o)?o:x.get(o))?t(n,r,i):(console.warn(t+" symbol is not exist."),null)},e.symbolsFactory=x,e}(f),_=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(h.each)(e||r,(function(e,o){if("path"===o&&Object(h.isArray)(e))i.setAttribute("d",n._formatPath(e));else if("startArrow"===o||"endArrow"===o)if(e){var a=Object(h.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}(f),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(h.each)(e||n,(function(t,e){"points"===e&&Object(h.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}(f),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(h.each)(e||n,(function(t,e){"points"===e&&Object(h.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(h.isNil)(e)?(this.set("totalLength",y.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(h.each)(i,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),y.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(h.each)(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=y.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}(f);var O=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(h.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(h.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(h.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}(f),M=n(138),k={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},A={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"},T=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(h.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(M.a)();i&&"firefox"===i.name?t.setAttribute("dominant-baseline",A[n]||"alphabetic"):t.setAttribute("alignment-baseline",k[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(h.each)(a,(function(t,e){0===e?"alphabetic"===o?u+=''+t+"":"top"===o?u+=''+t+"":"middle"===o?u+=''+t+"":"bottom"===o?u+=''+t+"":"hanging"===o&&(u+=''+t+""):u+=''+t+""})),e.innerHTML=u}else e.innerHTML=t;else e.innerHTML=""},e}(f)},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 f})),n.d(e,"divide",(function(){return h})),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 y})),n.d(e,"scale",(function(){return m})),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 O})),n.d(e,"normalize",(function(){return M})),n.d(e,"dot",(function(){return k})),n.d(e,"cross",(function(){return A})),n.d(e,"lerp",(function(){return C})),n.d(e,"random",(function(){return T})),n.d(e,"transformMat2",(function(){return I})),n.d(e,"transformMat2d",(function(){return P})),n.d(e,"transformMat3",(function(){return D})),n.d(e,"transformMat4",(function(){return N})),n.d(e,"rotate",(function(){return j})),n.d(e,"angle",(function(){return R})),n.d(e,"zero",(function(){return L})),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 X})),n.d(e,"dist",(function(){return Y})),n.d(e,"sqrDist",(function(){return H})),n.d(e,"sqrLen",(function(){return q})),n.d(e,"forEach",(function(){return K}));var r=n(12);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 f(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 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 y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function m(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 O(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function M(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 k(t,e){return t[0]*e[0]+t[1]*e[1]}function A(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 T(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 I(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 D(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 N(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 j(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 R(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 L(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=f,X=h,Y=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-1}},function(t,e,n){"use strict";e.a=function(t){var e=a(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"===a(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 f=t.getBoundingBox();e.isHorizontal?f.top<0&&t.translate(0,-f.top):f.left<0&&t.translate(-f.left,0)}var h=e.fixedRoot;return void 0===h&&(h=!0),h&&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 f=0;f-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;++oe[r])return 1;if(t[r]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)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])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 f=i+r.prelim+r.w-(a+o.prelim);f>0&&(a+=f,s(t,e,n.index,f));var h=l(r),d=l(o);h<=d&&null!==(r=c(r))&&(i+=r.mod),h>=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 f(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 h=n.fromNode(t,i);return function t(e){if(0!==e.cs){t(e.c[0]);for(var n=f(l(e.c[0].el),0,null),r=1;ra&&(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 f=o(e,t),h=f.left,d=f.right;i(h,r,c),h.right2left(),i(d,r,c);var p=h.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;ie.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)}}])},"object"===a(e)&&"object"===a(t)?t.exports=o():(r=[],void 0===(i="function"==typeof(n=o)?n.apply(e,r):n)||(t.exports=i))}).call(this,n(87)(t))},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)}var i=n(298),o=n(302),a=[].slice,s=["keyword","gray","hex"],u={};Object.keys(o).forEach((function(t){u[a.call(o[t].labels).sort().join("")]=t}));var c={};function l(t,e){if(!(this instanceof l))return new l(t,e);if(e&&e in s&&(e=null),e&&!(e in o))throw new Error("Unknown model: "+e);var n,r;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof l)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var f=i.get(t);if(null===f)throw new Error("Unable to parse color from string: "+t);this.model=f.model,r=o[this.model].channels,this.color=f.value.slice(0,r),this.valpha="number"==typeof f.value[r]?f.value[r]:1}else if(t.length){this.model=e||"rgb",r=o[this.model].channels;var h=a.call(t,0,r);this.color=p(h,r),this.valpha="number"==typeof t[r]?t[r]: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 d=Object.keys(t);"alpha"in t&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var g=d.sort().join("");if(!(g in u))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=u[g];var v=o[this.model].labels,y=[];for(n=0;nn?(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 l.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 '+r(t));var n=t.rgb(),i=this.rgb(),o=void 0===e?.5:e,a=2*o-1,s=n.alpha()-i.alpha(),u=((a*s==-1?a:(a+s)/(1+a*s))+1)/2,c=1-u;return l.rgb(u*n.red()+c*i.red(),u*n.green()+c*i.green(),u*n.blue()+c*i.blue(),n.alpha()*o+i.alpha()*(1-o))}},Object.keys(o).forEach((function(t){if(-1===s.indexOf(t)){var e=o[t].channels;l.prototype[t]=function(){if(this.model===t)return new l(this);if(arguments.length)return new l(arguments,t);var n="number"==typeof arguments[e]?e:this.valpha;return new l(d(o[this.model][t].raw(this.color)).concat(n),t)},l[t]=function(n){return"number"==typeof n&&(n=p(a.call(arguments),e)),new l(n,t)}}})),t.exports=l},function(t,e,n){var r=n(63),i=n(42);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(101),i=n(102);t.exports=function(t,e,n,o){var a=!n;n||(n={});for(var s=-1,u=e.length;++s1&&(n*=Math.sqrt(v),i*=Math.sqrt(v));var y=n*n*(g*g)+i*i*(p*p),m=y?Math.sqrt((n*n*(i*i)-y)/y):1;u===c&&(m*=-1),isNaN(m)&&(m=0);var b=i?m*n*g/i:0,x=n?m*-i*p/n:0,w=(l+h)/2+Math.cos(s)*b-Math.sin(s)*x,_=(f+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],O=a([1,0],S),M=a(S,E);return o(S,E)<=-1&&(M=Math.PI),o(S,E)>=1&&(M=0),0===c&&M>0&&(M-=2*Math.PI),1===c&&M<0&&(M+=2*Math.PI),{cx:w,cy:_,rx:Object(r.j)(t,[h,d])?0:n,ry:Object(r.j)(t,[h,d])?0:i,startAngle:O,endAngle:O+M,xRotation:s,arcFlag:u,sweepFlag:c}}},function(t,e,n){var r;function i(t){return(i="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(o){var a=/^\s+/,s=/\s+$/,u=0,c=o.round,l=o.min,f=o.max,h=o.random;function d(t,e){if(e=e||{},(t=t||"")instanceof d)return t;if(!(this instanceof d))return new d(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,u=null,c=null,h=!1,d=!1;"string"==typeof t&&(t=function(t){t=t.replace(a,"").replace(s,"").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=W.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=W.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=W.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=W.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=W.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=W.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=W.hex8.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),a:F(e[4]),format:n?"name":"hex8"};if(e=W.hex6.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),format:n?"name":"hex"};if(e=W.hex4.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),a:F(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=W.hex3.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==i(t)&&(X(t.r)&&X(t.g)&&X(t.b)?(p=t.r,g=t.g,v=t.b,e={r:255*N(p,255),g:255*N(g,255),b:255*N(v,255)},h=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):X(t.h)&&X(t.s)&&X(t.v)?(r=B(t.s),u=B(t.v),e=function(t,e,n){t=6*N(t,360),e=N(e,100),n=N(n,100);var r=o.floor(t),i=t-r,a=n*(1-e),s=n*(1-i*e),u=n*(1-(1-i)*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,u),h=!0,d="hsv"):X(t.h)&&X(t.s)&&X(t.l)&&(r=B(t.s),c=B(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,c),h=!0,d="hsl"),t.hasOwnProperty("a")&&(n=t.a));var p,g,v;return n=D(n),{ok:h,format:t.format||d,r:l(255,f(e.r,0)),g:l(255,f(e.g,0)),b:l(255,f(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=c(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=n.ok,this._tc_id=u++}function p(t,e,n){t=N(t,255),e=N(e,255),n=N(n,255);var r,i,o=f(t,e,n),a=l(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>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(d(r));return o}function T(t,e){e=e||6;for(var n=d(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(d({h:r,s:i,v:o})),o=(o+s)%1;return a}d.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:o.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:o.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=D(t),this._roundA=c(100*this._a)/100,this},toHsv:function(){var t=g(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=g(this._r,this._g,this._b),e=c(360*t.h),n=c(100*t.s),r=c(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=p(this._r,this._g,this._b),e=c(360*t.h),n=c(100*t.s),r=c(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return v(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(c(t).toString(16)),L(c(e).toString(16)),L(c(n).toString(16)),L(G(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:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(100*N(this._r,255))+"%",g:c(100*N(this._g,255))+"%",b:c(100*N(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+c(100*N(this._r,255))+"%, "+c(100*N(this._g,255))+"%, "+c(100*N(this._b,255))+"%)":"rgba("+c(100*N(this._r,255))+"%, "+c(100*N(this._g,255))+"%, "+c(100*N(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(P[v(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+y(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=d(t);n="#"+y(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 d(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(w,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(S,arguments)},desaturate:function(){return this._applyModification(m,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(E,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(C,arguments)},complement:function(){return this._applyCombination(O,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(M,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},d.fromRatio=function(t,e){if("object"==i(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:B(t[r]));t=n}return d(t,e)},d.equals=function(t,e){return!(!t||!e)&&d(t).toRgbString()==d(e).toRgbString()},d.random=function(){return d.fromRatio({r:h(),g:h(),b:h()})},d.mix=function(t,e,n){n=0===n?0:n||50;var r=d(t).toRgb(),i=d(e).toRgb(),o=n/100;return d({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})},d.readability=function(t,e){var n=d(t),r=d(e);return(o.max(n.getLuminance(),r.getLuminance())+.05)/(o.min(n.getLuminance(),r.getLuminance())+.05)},d.isReadable=function(t,e,n){var r,i,o=d.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},d.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;cu&&(u=r,s=d(e[c]));return d.isReadable(t,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,d.mostReadable(t,["#fff","#000"],n))};var I=d.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"},P=d.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(I);function D(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=l(e,f(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),o.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function j(t){return l(1,f(0,t))}function R(t){return parseInt(t,16)}function L(t){return 1==t.length?"0"+t:""+t}function B(t){return t<=1&&(t=100*t+"%"),t}function G(t){return o.round(255*parseFloat(t)).toString(16)}function F(t){return R(t)/255}var z,U,V,W=(U="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",V="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+U),rgba:new RegExp("rgba"+V),hsl:new RegExp("hsl"+U),hsla:new RegExp("hsla"+V),hsv:new RegExp("hsv"+U),hsva:new RegExp("hsva"+V),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 X(t){return!!W.CSS_UNIT.exec(t)}t.exports?t.exports=d:void 0===(r=function(){return d}.call(e,n,e,t))||(t.exports=r)}(Math)},function(t,e,n){t.exports={EPSILON:n(252),create:n(253),clone:n(516),fromValues:n(517),copy:n(518),set:n(254),equals:n(519),exactEquals:n(520),add:n(255),subtract:n(162),sub:n(521),multiply:n(256),mul:n(522),divide:n(257),div:n(523),inverse:n(524),min:n(525),max:n(526),rotate:n(527),floor:n(528),ceil:n(529),round:n(530),scale:n(531),scaleAndAdd:n(532),distance:n(258),dist:n(533),squaredDistance:n(259),sqrDist:n(534),length:n(260),len:n(535),squaredLength:n(261),sqrLen:n(536),negate:n(537),normalize:n(262),dot:n(263),cross:n(538),lerp:n(539),random:n(540),transformMat2:n(541),transformMat2d:n(542),transformMat3:n(543),transformMat4:n(544),forEach:n(545),limit:n(546)}},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(97),i=n(313),o=n(314),a=n(315),s=n(316),u=n(317);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(308),i=n(309),o=n(310),a=n(311),s=n(312);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t0&&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(6),a=n.n(o),s=n(7),u=n.n(s),c=n(22),l=n.n(c),f=n(23),h=n.n(f),d=n(24),p=n.n(d),g=n(18),v=n.n(g),y=n(2);function m(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=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);n0)return I.b.OUTSIDE;A.e.dot(u,t.getPositiveFarPoint(n[i]))+c>0&&(r|=a)}}return r}}]),t}(),f=k()(l.prototype,"mesh",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),h=k()(l.prototype,"cullable",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),d=k()(l.prototype,"geometry",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),p=k()(l.prototype,"hierarchy",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g=k()(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(6),i=n.n(r),o=n(7),a=n.n(o),s=n(1),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,f,h,d,p,g=n(9),v=n.n(g),y=n(14),m=n.n(y),b=n(10),x=n.n(b),w=n(6),_=n.n(w),S=n(7),E=n.n(S),O=n(11),M=n.n(O),k=(n(29),n(5)),A=n(13),C=n(81),T=n(68),I=n(49),P=(r=Object(k.injectable)(),i=Object(k.inject)(A.a.Systems),o=Object(k.named)(A.a.FrameGraphSystem),a=Object(k.inject)(A.a.RenderPassFactory),s=Object(k.inject)(A.a.ConfigService),u=Object(k.inject)(A.a.ResourcePool),r((l=function(){function t(){_()(this,t),x()(this,"frameGraphSystem",f,this),x()(this,"renderPassFactory",h,this),x()(this,"configService",d,this),x()(this,"resourcePool",p,this)}var e;return E()(t,[{key:"execute",value:(e=m()(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(I.a.IDENTIFIER),r=n.setup,i=n.execute,this.frameGraphSystem.addPass(I.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(T.a.IDENTIFIER).pick(t,e)}}]),t}(),f=M()(l.prototype,"frameGraphSystem",[i,o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),h=M()(l.prototype,"renderPassFactory",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),d=M()(l.prototype,"configService",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),p=M()(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(6),i=n.n(r),o=n(22),a=n.n(o),s=n(23),u=n.n(s),c=n(24),l=n.n(c),f=n(18),h=n.n(f);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=h()(t);if(e){var i=h()(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(25).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var r,i,o,a,s,u,c,l,f,h=n(9),d=n.n(h),p=n(14),g=n.n(p),v=n(10),y=n.n(v),m=n(6),b=n.n(m),x=n(7),w=n.n(x),_=n(11),S=n.n(_),E=(n(29),n(1)),O=n(5),M=n(13),k=(r=Object(O.injectable)(),i=Object(O.inject)(M.a.HierarchyComponentManager),o=Object(O.inject)(M.a.TransformComponentManager),a=Object(O.inject)(M.a.MeshComponentManager),r((u=function(){function t(){b()(this,t),y()(this,"hierarchy",c,this),y()(this,"transform",l,this),y()(this,"mesh",f,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;a0&&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(25).a);y.DIRTY=1},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r,i=n(6),o=n.n(i),a=n(7),s=n.n(a),u=n(5),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(6),a=n.n(o),s=n(7),u=n.n(s),c=n(5);!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(59),i=n.n(r),o=n(9),a=n.n(o),s=n(14),u=n.n(s),c=n(10),l=n.n(c),f=n(6),h=n.n(f),d=n(7),p=n.n(d),g=n(11),v=n.n(g),y=(n(29),n(5)),m=n(13),b=function t(){h()(this,t),this.index=void 0},x=function t(){h()(this,t),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0},w=function(){function t(){h()(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(23),S=n.n(_),E=n(24),O=n.n(E),M=n(18),k=n.n(M);function A(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=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var C,T,I,P,D,N=function(t){S()(n,t);var e=A(n);function n(){var t;h()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o=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 L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&(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 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=h(r),u=s.content,c=s.uniforms,l=h(o),f=l.content,d=l.uniforms;this.rawContentCache[t]={fs:f,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,f=c,h=(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)||(f="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n#endif\n"+c),this.moduleCache[t]={fs:f.trim(),uniforms:h,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 k}));var r=n(4),i=n.n(r),o=n(6),a=n.n(o),s=n(7),u=n.n(s),c=n(22),l=n.n(c),f=n(23),h=n.n(f),d=n(24),p=n.n(d),g=n(18),v=n.n(g),y=n(1),m=n(25),b=n(40),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 O(t){for(var e=1;e0)}));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=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(0),i=n(3),o=n(17),a=n(19),s=n(37),u=n(116),c=o.a.transform,l=["zIndex","capture","visible","type"],f=["repeat"];function h(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!==f.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+rt.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;n0?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=0&&s<.5*Math.PI?(r={x:l.minX,y:l.minY},o={x:l.maxX,y:l.maxY}):.5*Math.PI<=s&&sh[e.id]+s?(h[a]=h[e.id]+s,d[a]=[e.id]):h[a]===h[e.id]+s&&d[a].push(e.id)}))},v=0;va){var s=o;o=a,a=s}return o+""+a+""+(i.isUndefined(r)?"\0":r)}function c(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 l(t,e){return u(t,e.v,e.w,e.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(t){return this._label=t,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(t){return i.isFunction(t)||(t=i.constant(t)),this._defaultNodeLabelFn=t,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return i.keys(this._nodes)},o.prototype.sources=function(){var t=this;return i.filter(this.nodes(),(function(e){return i.isEmpty(t._in[e])}))},o.prototype.sinks=function(){var t=this;return i.filter(this.nodes(),(function(e){return i.isEmpty(t._out[e])}))},o.prototype.setNodes=function(t,e){var n=arguments,r=this;return i.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},o.prototype.setNode=function(t,e){return i.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)},o.prototype.node=function(t){return this._nodes[t]},o.prototype.hasNode=function(t){return i.has(this._nodes,t)},o.prototype.removeNode=function(t){var e=this;if(i.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],i.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),i.each(i.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],i.each(i.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},o.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(i.isUndefined(e))e="\0";else{for(var n=e+="";!i.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},o.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},o.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},o.prototype.children=function(t){if(i.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return i.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},o.prototype.predecessors=function(t){var e=this._preds[t];if(e)return i.keys(e)},o.prototype.successors=function(t){var e=this._sucs[t];if(e)return i.keys(e)},o.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return i.union(e,this.successors(t))},o.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},o.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;i.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),i.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};return this._isCompound&&i.each(e.nodes(),(function(t){e.setParent(t,function t(i){var o=n.parent(i);return void 0===o||e.hasNode(o)?(r[i]=o,o):o in r?r[o]:t(o)}(t))})),e},o.prototype.setDefaultEdgeLabel=function(t){return i.isFunction(t)||(t=i.constant(t)),this._defaultEdgeLabelFn=t,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return i.values(this._edgeObjs)},o.prototype.setPath=function(t,e){var n=this,r=arguments;return i.reduce(t,(function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this},o.prototype.setEdge=function(){var t,e,n,o,s=!1,l=arguments[0];"object"===r(l)&&null!==l&&"v"in l?(t=l.v,e=l.w,n=l.name,2===arguments.length&&(o=arguments[1],s=!0)):(t=l,e=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),t=""+t,e=""+e,i.isUndefined(n)||(n=""+n);var f=u(this._isDirected,t,e,n);if(i.has(this._edgeLabels,f))return s&&(this._edgeLabels[f]=o),this;if(!i.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[f]=s?o:this._defaultEdgeLabelFn(t,e,n);var h=c(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[f]=h,a(this._preds[e],t),a(this._sucs[t],e),this._in[e][f]=h,this._out[t][f]=h,this._edgeCount++,this},o.prototype.edge=function(t,e,n){var r=1===arguments.length?l(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?l(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return i.has(this._edgeLabels,r)},o.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?l(this._isDirected,arguments[0]):u(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],s(this._preds[e],t),s(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},o.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=i.values(n);return e?i.filter(r,(function(t){return t.v===e})):r}},o.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=i.values(n);return e?i.filter(r,(function(t){return t.w===e})):r}},o.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(62)(n(46),"Map");t.exports=r},function(t,e,n){var r=n(324),i=n(331),o=n(333),a=n(334),s=n(335);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){(function(t){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)}var i=n(175),o="object"==r(e)&&e&&!e.nodeType&&e,a=o&&"object"==r(t)&&t&&!t.nodeType&&t,s=a&&a.exports===o&&i.process,u=function(){try{var t=a&&a.require&&a.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=u}).call(this,n(87)(t))},function(t,e,n){var r=n(105),i=n(341),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(183),i=n(184),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;++n0&&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(74);t.exports=function(t,e,n){for(var i=-1,o=t.length;++i1)for(var n=1;n=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 f=this.attrs;if(f.shadowColor){var h=f.shadowBlur,d=void 0===h?0:h,p=f.shadowOffsetX,g=void 0===p?0:p,v=f.shadowOffsetY,y=void 0===v?0:v,m=n-d+g,b=i+d+g,x=r-d+y,w=a+d+y;n=Math.min(n,m),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(44),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;c0;)h.push(u.pop());a.push(h)}}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=[],f=0,h=function t(e){u[e.id]=f,c[e.id]=f,f+=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})),h=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;d0;){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;dr[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(303),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),f=function(t){return(c-t)/6/l+.5};return 0===l?i=o=0:(o=l/c,e=f(a),n=f(s),r=f(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.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,f=c+l;switch(f>1&&(c/=f,l/=f),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(96),i=n(146),o=n(101),a=n(336),s=n(342),u=n(181),c=n(182),l=n(345),f=n(346),h=n(186),d=n(347),p=n(73),g=n(351),v=n(352),y=n(191),m=n(31),b=n(72),x=n(356),w=n(42),_=n(358),S=n(57),E=n(64),O={};O["[object Arguments]"]=O["[object Array]"]=O["[object ArrayBuffer]"]=O["[object DataView]"]=O["[object Boolean]"]=O["[object Date]"]=O["[object Float32Array]"]=O["[object Float64Array]"]=O["[object Int8Array]"]=O["[object Int16Array]"]=O["[object Int32Array]"]=O["[object Map]"]=O["[object Number]"]=O["[object Object]"]=O["[object RegExp]"]=O["[object Set]"]=O["[object String]"]=O["[object Symbol]"]=O["[object Uint8Array]"]=O["[object Uint8ClampedArray]"]=O["[object Uint16Array]"]=O["[object Uint32Array]"]=!0,O["[object Error]"]=O["[object Function]"]=O["[object WeakMap]"]=!1,t.exports=function t(e,n,M,k,A,C){var T,I=1&n,P=2&n,D=4&n;if(M&&(T=A?M(e,k,A,C):M(e)),void 0!==T)return T;if(!w(e))return e;var N=m(e);if(N){if(T=g(e),!I)return c(e,T)}else{var j=p(e),R="[object Function]"==j||"[object GeneratorFunction]"==j;if(b(e))return u(e,I);if("[object Object]"==j||"[object Arguments]"==j||R&&!A){if(T=P||R?{}:y(e),!I)return P?f(e,s(T,e)):l(e,a(T,e))}else{if(!O[j])return A?e:{};T=v(e,j,I)}}C||(C=new r);var L=C.get(e);if(L)return L;C.set(e,T),_(e)?e.forEach((function(r){T.add(t(r,n,M,r,e,C))})):x(e)&&e.forEach((function(r,i){T.set(i,t(r,n,M,i,e,C))}));var B=N?void 0:(D?P?d:h:P?E:S)(e);return i(B||e,(function(r,i){B&&(r=e[i=r]),o(T,i,t(r,n,M,i,e,C))})),T}},function(t,e,n){(function(e){function n(t){return(n="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 r="object"==(void 0===e?"undefined":n(e))&&e&&e.Object===Object&&e;t.exports=r}).call(this,n(176))},function(t,e){function n(t){return(n="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 r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}t.exports=r},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(62),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e,n){var r=n(337),i=n(86),o=n(31),a=n(72),s=n(103),u=n(88),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),l=!n&&i(t),f=!n&&!l&&a(t),h=!n&&!l&&!f&&u(t),d=n||l||f||h,p=d?r(t.length,String):[],g=p.length;for(var v in t)!e&&!c.call(t,v)||d&&("length"==v||f&&("offset"==v||"parent"==v)||h&&("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){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)}var i=n(46),o="object"==r(e)&&e&&!e.nodeType&&e,a=o&&"object"==r(t)&&t&&!t.nodeType&&t,s=a&&a.exports===o?i.Buffer:void 0,u=s?s.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(87)(t))},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++nl))return!1;var h=u.get(t),d=u.get(e);if(h&&d)return h==e&&d==t;var p=-1,g=!0,v=2&n?new r:void 0;for(u.set(t,e),u.set(e,t);++p0&&(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(41);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>1].priority=0&&t=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=0;--n){var r=(0,t[n])(e);if(!_(r)&&!S(r)){if(!C(r))throw new TypeError;e=r}}return e}(t,e)}if(!k(t))throw new TypeError;if(!E(e))throw new TypeError;if(!E(r)&&!_(r)&&!S(r))throw new TypeError;return S(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(!_(o)&&!S(o)){if(!E(o))throw new TypeError;r=o}}return r}(t,e,n=M(n),r)})),e("metadata",(function(t,e){return function(n,r){if(!E(n))throw new TypeError;if(!_(r)&&!function(t){switch(w(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;b(t,e,n,r)}})),e("defineMetadata",(function(t,e,n,r){if(!E(n))throw new TypeError;return _(r)||(r=M(r)),b(t,e,n,r)})),e("hasMetadata",(function(t,e,n){if(!E(e))throw new TypeError;return _(n)||(n=M(n)),function t(e,n,r){if(y(e,n,r))return!0;var i=D(n);return!S(i)&&t(e,i,r)}(t,e,n)})),e("hasOwnMetadata",(function(t,e,n){if(!E(e))throw new TypeError;return _(n)||(n=M(n)),y(t,e,n)})),e("getMetadata",(function(t,e,n){if(!E(e))throw new TypeError;return _(n)||(n=M(n)),function t(e,n,r){if(y(e,n,r))return m(e,n,r);var i=D(n);return S(i)?void 0:t(e,i,r)}(t,e,n)})),e("getOwnMetadata",(function(t,e,n){if(!E(e))throw new TypeError;return _(n)||(n=M(n)),m(t,e,n)})),e("getMetadataKeys",(function(t,e){if(!E(t))throw new TypeError;return _(e)||(e=M(e)),function t(e,n){var r=x(e,n),i=D(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 p,s=[],u=0,c=r;u0)return!0;var i=g.get(e);return i.delete(n),i.size>0||g.delete(e),!0}))}(a)}()}(r||(r={}))}).call(this,n(166),n(176))},function(t,e,n){var r=n(230);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);no[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";var r={};n.r(r),n.d(r,"easeLinear",(function(){return k})),n.d(r,"easeQuad",(function(){return T})),n.d(r,"easeQuadIn",(function(){return A})),n.d(r,"easeQuadOut",(function(){return C})),n.d(r,"easeQuadInOut",(function(){return T})),n.d(r,"easeCubic",(function(){return D})),n.d(r,"easeCubicIn",(function(){return I})),n.d(r,"easeCubicOut",(function(){return P})),n.d(r,"easeCubicInOut",(function(){return D})),n.d(r,"easePoly",(function(){return R})),n.d(r,"easePolyIn",(function(){return N})),n.d(r,"easePolyOut",(function(){return j})),n.d(r,"easePolyInOut",(function(){return R})),n.d(r,"easeSin",(function(){return z})),n.d(r,"easeSinIn",(function(){return G})),n.d(r,"easeSinOut",(function(){return F})),n.d(r,"easeSinInOut",(function(){return z})),n.d(r,"easeExp",(function(){return X})),n.d(r,"easeExpIn",(function(){return V})),n.d(r,"easeExpOut",(function(){return W})),n.d(r,"easeExpInOut",(function(){return X})),n.d(r,"easeCircle",(function(){return q})),n.d(r,"easeCircleIn",(function(){return Y})),n.d(r,"easeCircleOut",(function(){return H})),n.d(r,"easeCircleInOut",(function(){return q})),n.d(r,"easeBounce",(function(){return Q})),n.d(r,"easeBounceIn",(function(){return Z})),n.d(r,"easeBounceOut",(function(){return Q})),n.d(r,"easeBounceInOut",(function(){return $})),n.d(r,"easeBack",(function(){return et})),n.d(r,"easeBackIn",(function(){return J})),n.d(r,"easeBackOut",(function(){return tt})),n.d(r,"easeBackInOut",(function(){return et})),n.d(r,"easeElastic",(function(){return it})),n.d(r,"easeElasticIn",(function(){return rt})),n.d(r,"easeElasticOut",(function(){return it})),n.d(r,"easeElasticInOut",(function(){return ot}));var i=n(0),o=n(138),a=n(136),s=n(19),u=n(3);function c(t){return(c="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 l,f,h=0,d=0,p=0,g=0,v=0,y=0,m="object"===("undefined"==typeof performance?"undefined":c(performance))&&performance.now?performance:Date,b="object"===("undefined"==typeof window?"undefined":c(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function x(){return v||(b(w),v=m.now()+y)}function w(){v=0}function _(){this._call=this._time=this._next=null}function S(t,e,n){var r=new _;return r.restart(t,e,n),r}function E(){v=(g=m.now())+y,h=d=0;try{!function(){x(),++h;for(var t,e=l;e;)(t=v-e._time)>=0&&e._call.call(null,t),e=e._next;--h}()}finally{h=0,function(){var t,e,n=l,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:l=e);f=t,M(r)}(),v=0}}function O(){var t=m.now(),e=t-g;e>1e3&&(y-=e,g=t)}function M(t){h||(d&&(d=clearTimeout(d)),t-v>24?(t<1/0&&(d=setTimeout(E,t-m.now()-y)),p&&(p=clearInterval(p))):(p||(g=m.now(),p=setInterval(O,1e3)),h=1,b(E)))}function k(t){return+t}function A(t){return t*t}function C(t){return t*(2-t)}function T(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function I(t){return t*t*t}function P(t){return--t*t*t+1}function D(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}_.prototype=S.prototype={constructor:_,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?x():+n)+(null==e?0:+e),this._next||f===this||(f?f._next=this:l=this,f=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),R=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,B=L/2;function G(t){return 1==+t?1:1-Math.cos(t*B)}function F(t){return Math.sin(t*B)}function z(t){return(1-Math.cos(L*t))/2}function U(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function V(t){return U(1-+t)}function W(t){return 1-U(t)}function X(t){return((t*=2)<=1?U(1-t):2-U(t-1))/2}function Y(t){return 1-Math.sqrt(1-t*t)}function H(t){return Math.sqrt(1- --t*t)}function q(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var K=7.5625;function Z(t){return 1-Q(1-t)}function Q(t){return(t=+t)<4/11?K*t*t:t<8/11?K*(t-=6/11)*t+3/4:t<10/11?K*(t-=9/11)*t+15/16:K*(t-=21/22)*t+63/64}function $(t){return((t*=2)<=1?1-Q(1-t):Q(t-1)+1)/2}var J=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(1.70158),tt=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(1.70158),et=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),nt=2*Math.PI,rt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return e*U(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*nt)},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/=nt);function i(t){return 1-e*U(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),ot=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return((t=2*t-1)<0?e*U(-t)*Math.sin((r-t)/n):2-e*U(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),at=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function st(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ut(){}var ct="\\s*([+-]?\\d+)\\s*",lt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",ft="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ht=/^#([0-9a-f]{3,8})$/,dt=new RegExp("^rgb\\("+[ct,ct,ct]+"\\)$"),pt=new RegExp("^rgb\\("+[ft,ft,ft]+"\\)$"),gt=new RegExp("^rgba\\("+[ct,ct,ct,lt]+"\\)$"),vt=new RegExp("^rgba\\("+[ft,ft,ft,lt]+"\\)$"),yt=new RegExp("^hsl\\("+[lt,ft,ft]+"\\)$"),mt=new RegExp("^hsla\\("+[lt,ft,ft,lt]+"\\)$"),bt={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 xt(){return this.rgb().formatHex()}function wt(){return this.rgb().formatRgb()}function _t(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ht.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?St(e):3===n?new kt(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Et(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Et(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=dt.exec(t))?new kt(e[1],e[2],e[3],1):(e=pt.exec(t))?new kt(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=gt.exec(t))?Et(e[1],e[2],e[3],e[4]):(e=vt.exec(t))?Et(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=yt.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]):bt.hasOwnProperty(t)?St(bt[t]):"transparent"===t?new kt(NaN,NaN,NaN,0):null}function St(t){return new kt(t>>16&255,t>>8&255,255&t,1)}function Et(t,e,n,r){return r<=0&&(t=e=n=NaN),new kt(t,e,n,r)}function Ot(t){return t instanceof ut||(t=_t(t)),t?new kt((t=t.rgb()).r,t.g,t.b,t.opacity):new kt}function Mt(t,e,n,r){return 1===arguments.length?Ot(t):new kt(t,e,n,null==r?1:r)}function kt(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function At(){return"#"+Tt(this.r)+Tt(this.g)+Tt(this.b)}function Ct(){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 Tt(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 Dt(t,e,n,r)}function Pt(t){if(t instanceof Dt)return new Dt(t.h,t.s,t.l,t.opacity);if(t instanceof ut||(t=_t(t)),!t)return new Dt;if(t instanceof Dt)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*(n0&&u<1?0:a,new Dt(a,s,u,t.opacity)}function Dt(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}at(ut,_t,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:xt,formatHex:xt,formatHsl:function(){return Pt(this).formatHsl()},formatRgb:wt,toString:wt}),at(kt,Mt,st(ut,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new kt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new kt(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:Ct,toString:Ct})),at(Dt,(function(t,e,n,r){return 1===arguments.length?Pt(t):new Dt(t,e,n,null==r?1:r)}),st(ut,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Dt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Dt(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 kt(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 Rt=function(t){return function(){return t}};function Lt(t,e){return function(n){return t+n*e}}function Bt(t){return 1==(t=+t)?Gt: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):Rt(isNaN(e)?n:e)}}function Gt(t,e){var n=e-t;return n?Lt(t,n):Rt(isNaN(t)?e:t)}var Ft=function t(e){var n=Bt(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=Gt(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 zt(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=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=ro&&(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=Zt.lastIndex;return od.length?(h=te.parsePathString(o[f]),d=te.parsePathString(i[f]),d=te.fillPathByDiff(d,h),d=te.formatPath(d,h),e.fromAttrs.path=d,e.toAttrs.path=h):e.pathFormatted||(h=te.parsePathString(o[f]),d=te.parsePathString(i[f]),d=te.formatPath(d,h),e.fromAttrs.path=d,e.toAttrs.path=h,e.pathFormatted=!0),r[f]=[];for(var p=0;p0){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],ne(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}(),ie=n(115),oe=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function ae(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function se(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(s.g)(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var ue=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(s.a)(oe,(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(s.a)(oe,(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 ie.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,ae(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||se(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{ae(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}(),ce=Object(o.a)(),le=ce&&"firefox"===ce.name,fe=function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return Object(i.__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(s.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 ue({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new re(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");s.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");s.c&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(le&&!Object(s.e)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(s.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}(a.a);e.a=fe},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(20);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 f=n(67),h=n(55),d=n(3);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'})),n}var v=function(){function t(t){this.cfg={};var e=null,n=Object(f.uniqueId)("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var n,r,i=h.exec(t),o=Object(f.mod)(Object(f.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';e.innerHTML=n},t}(),x=function(){function t(t,e){this.cfg={};var n=Object(u.b)("marker"),r=Object(f.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(f.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(f.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(f.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(f.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=u.minX&&e<=u.maxX&&n>=u.minY&&n<=u.maxY}var s=n(54),u=n(75),c=n(15),l=n(30),f=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,f=o(c,n,r),h=f[0],d=f[1];l.isInShape(h,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=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getAdjMatrixAsync",{enumerable:!0,get:function(){return r.getAdjMatrixAsync}}),Object.defineProperty(e,"connectedComponentAsync",{enumerable:!0,get:function(){return r.connectedComponentAsync}}),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,"getOutDegreeAsync",{enumerable:!0,get:function(){return r.getOutDegreeAsync}}),Object.defineProperty(e,"detectCycleAsync",{enumerable:!0,get:function(){return r.detectCycleAsync}}),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,"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,"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}}),Object.defineProperty(e,"getNeighborsAsync",{enumerable:!0,get:function(){return r.getNeighborsAsync}}),Object.defineProperty(e,"GADDIAsync",{enumerable:!0,get:function(){return r.GADDIAsync}}),e.default=e.detectDirectedCycleAsync=void 0;var r=n(280),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(512);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){var r,i,o;function a(t){return(a="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)}o=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=0&&(0|t)===t||n("invalid parameter type, ("+t+")"+i(e)+". must be a nonnegative integer")},oneOf:s,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 u=g(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)}))}(u,l),Object.keys(u).forEach((function(t){var e=u[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(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),i(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(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(c("| ",6)),i(c("^^^",e+3)+"\n","font-weight:bold"),i(c("| ",6)),i(r+"\n","font-weight:bold")})),i(c("| ",6)+"\n")}else i(c(t.number,4)+"| "),i(t.line+"\n","color:red")})),"undefined"==typeof document||window.chrome?console.log(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, "+u[0].name)}},linkError:function(t,e,n,i,o){if(!t.getProgramParameter(e,t.LINK_STATUS)){var a=t.getProgramInfoLog(e),s=g(n,o),u='Error linking program with vertex shader, "'+g(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:p,saveCommandRef:v,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}))}v(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?s(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):s(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:d,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(w(o)&&w(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(w(o)&&w(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<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>f,p=a>>f;r(c.mipmask&1<1&&n===r&&('"'===n||"'"===n))return['"'+O(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['"'+O(e)+'"'];for(var a=[],s=0;s0,"invalid pixel ratio"))):_.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){_("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=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(!v)return null;i=v.canvas,g=v.onDestroy}void 0===c.premultipliedAlpha&&(c.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,c)}return o?{gl:o,canvas:i,container:r,extensions:l,optionalExtensions:f,pixelRatio:h,profile:d,onDone:p,onDestroy:g}:(g(),p("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function D(t,e){for(var n=Array(t),r=0;r65535)<<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=D(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 R=j();function L(e){return!!e&&"object"===a(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))}R.zero=j();var B=function(t){return Object.keys(t).map((function(e){return t[e]}))},G={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>>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 tt(e){return Array.isArray(e)||t(e)}var et=function(t){return!(t&t-1||!t)},nt=[9984,9986,9985,9987],rt=[0,6409,6410,6407,6408],it={};function ot(t){return"[object "+t+"]"}it[6409]=it[6406]=it[6402]=1,it[34041]=it[6410]=2,it[6407]=it[35904]=3,it[6408]=it[35906]=4;var at=ot("HTMLCanvasElement"),st=ot("OffscreenCanvas"),ut=ot("CanvasRenderingContext2D"),ct=ot("ImageBitmap"),lt=ot("HTMLImageElement"),ft=ot("HTMLVideoElement"),ht=Object.keys(z).concat([at,st,ut,ct,lt,ft]),dt=[];dt[5121]=1,dt[5126]=4,dt[36193]=2,dt[5123]=2,dt[5125]=4;var pt=[];function gt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function vt(t){return!!Array.isArray(t)&&!(0===t.length||!tt(t[0]))}function yt(t){return Object.prototype.toString.call(t)}function mt(t){return yt(t)===at}function bt(t){return yt(t)===st}function xt(t){if(!t)return!1;var e=yt(t);return ht.indexOf(e)>=0||gt(t)||vt(t)||L(t)}function wt(t){return 0|z[Object.prototype.toString.call(t)]}function _t(t,e){return R.allocType(36193===t.type?5126:t.type,e)}function St(t,e){36193===t.type?(t.data=J(e),R.freeType(e)):t.data=e}function Et(t,e,n,r,i,o){var a;if(a=void 0!==pt[t]?pt[t]:it[t]*dt[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 Ot(n,r,i,o,s,u,c){var l={"don't care":4352,"dont care":4352,nice:4354,fast:4353},f={repeat:10497,clamp:33071,mirror:33648},h={nearest:9728,linear:9729},d=e({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},h),p={none:0,browser:37444},g={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},v={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},y={};r.ext_srgb&&(v.srgb=35904,v.srgba=35906),r.oes_texture_float&&(g.float32=g.float=5126),r.oes_texture_half_float&&(g.float16=g["half float"]=36193),r.webgl_depth_texture&&(e(v,{depth:6402,"depth stencil":34041}),e(g,{uint16:5123,uint32:5125,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(y,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&e(y,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(y,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(y["rgb etc1"]=36196);var m=Array.prototype.slice.call(n.getParameter(34467));Object.keys(y).forEach((function(t){var e=y[t];m.indexOf(e)>=0&&(v[t]=e)}));var b=Object.keys(v);i.textureFormats=b;var x=[];Object.keys(v).forEach((function(t){var e=v[t];x[e]=t}));var w=[];Object.keys(g).forEach((function(t){var e=g[t];w[e]=t}));var S=[];Object.keys(h).forEach((function(t){S[h[t]]=t}));var E=[];Object.keys(d).forEach((function(t){var e=d[t];E[e]=t}));var O=[];Object.keys(f).forEach((function(t){O[f[t]]=t}));var M=b.reduce((function(t,e){var n=v[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 k(){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 C(t,e){if("object"===a(e)&&e){if("premultiplyAlpha"in e&&(_.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(_.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(_.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(_.parameter(e.colorSpace,p,"invalid colorSpace"),t.colorSpace=p[e.colorSpace]),"type"in e){var n=e.type;_(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),_(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),_(r.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."),_.parameter(n,g,"invalid texture type"),t.type=g[n]}var o=t.width,s=t.height,u=t.channels,c=!1;"shape"in e?(_(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],s=e.shape[1],3===e.shape.length&&(u=e.shape[2],_(u>0&&u<=4,"invalid number of channels"),c=!0),_(o>=0&&o<=i.maxTextureSize,"invalid width"),_(s>=0&&s<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=s=e.radius,_(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,_(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(s=e.height,_(s>=0&&s<=i.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,_(u>0&&u<=4,"invalid number of channels"),c=!0)),t.width=0|o,t.height=0|s,t.channels=0|u;var l=!1;if("format"in e){var f=e.format;_(r.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),_.parameter(f,v,"invalid texture format");var h=t.internalformat=v[f];t.format=M[h],f in g&&("type"in e||(t.type=g[f])),f in y&&(t.compressed=!0),l=!0}!c&&l?t.channels=it[t.format]:c&&!l?t.channels!==rt[t.format]&&(t.format=t.internalformat=rt[t.channels]):l&&c&&_(t.channels===it[t.format],"number of channels inconsistent with specified format")}}function T(t){n.pixelStorei(37440,t.flipY),n.pixelStorei(37441,t.premultiplyAlpha),n.pixelStorei(37443,t.colorSpace),n.pixelStorei(3317,t.unpackAlignment)}function I(){k.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function P(e,n){var r=null;if(xt(n)?r=n:n&&(_.type(n,"object","invalid pixel data type"),C(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),xt(n.data)&&(r=n.data)),_(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){_(!r,"can not specify copy and data field for the same texture");var o=s.viewportWidth,a=s.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||a-e.yOffset,e.needsCopy=!0,_(e.xOffset>=0&&e.xOffset=0&&e.yOffset0&&e.width<=o&&e.height>0&&e.height<=a,"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=wt(r));else if(gt(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=R.allocType(t.type,n);r.set(e),t.data=r;break;case 36193:t.data=J(e);break;default:_.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=wt(u));var c,l,f,h,d,p,g=r.shape,v=r.stride;3===g.length?(f=g[2],p=v[2]):(_(2===g.length,"invalid ndarray pixel data, must be 2 or 3D"),f=1,p=1),c=g[0],l=g[1],h=v[0],d=v[1],e.alignment=1,e.width=c,e.height=l,e.channels=f,e.format=e.internalformat=rt[f],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,s=t.height,u=t.channels,c=_t(t,a*s*u),l=0,f=0;f=0,"oes_texture_float extension not enabled"):36193===e.type&&_(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function D(t,e,r){var i=t.element,a=t.data,s=t.internalformat,u=t.format,c=t.type,l=t.width,f=t.height;T(t),i?n.texImage2D(e,r,u,u,c,i):t.compressed?n.compressedTexImage2D(e,r,s,l,f,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,u,t.xOffset,t.yOffset,l,f,0)):n.texImage2D(e,r,u,l,f,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,f=t.type,h=t.width,d=t.height;T(t),s?n.texSubImage2D(e,a,r,i,l,f,s):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,h,d,u):t.needsCopy?(o(),n.copyTexSubImage2D(e,a,r,i,t.xOffset,t.yOffset,h,d)):n.texSubImage2D(e,a,r,i,h,d,l,f,u)}var j=[];function F(){return j.pop()||new I}function z(t){t.needsFree&&R.freeType(t.data),I.call(t),j.push(t)}function U(){k.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function V(t,e,n){var r=t.images[0]=F();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function W(t,e){var n=null;if(xt(e))A(n=t.images[0]=F(),t),P(n,e),t.mipmask=1;else if(C(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i>=i,n.height>>=i,P(n,r[i]),t.mipmask|=1<=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;_.parameter(r,h),t.magFilter=h[r]}var o=t.wrapS,s=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(_.parameter(u,f),o=s=f[u]):Array.isArray(u)&&(_.parameter(u[0],f),_.parameter(u[1],f),o=f[u[0]],s=f[u[1]])}else{if("wrapS"in e){var c=e.wrapS;_.parameter(c,f),o=f[c]}if("wrapT"in e){var p=e.wrapT;_.parameter(p,f),s=f[p]}}if(t.wrapS=o,t.wrapT=s,"anisotropic"in e){var g=e.anisotropic;_("number"==typeof g&&g>=1&&g<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var v=!1;switch(a(e.mipmap)){case"string":_.parameter(e.mipmap,l,"invalid mipmap hint"),t.mipmapHint=l[e.mipmap],t.genMipmaps=!0,v=!0;break;case"boolean":v=t.genMipmaps=e.mipmap;break;case"object":_(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:_.raise("invalid mipmap type")}v&&!("min"in e)&&(t.minFilter=9984)}}function Q(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,ot={},at=i.maxTextureUnits,st=Array(at).map((function(){return null}));function ht(t){k.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 K,c.profile&&(this.stats={size:0})}function dt(t){n.activeTexture(33984),n.bindTexture(t.target,t.texture)}function pt(){var t=st[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(3553,null)}function Ot(t){var e=t.texture;_(e,"must not double destroy texture");var r=t.unit,i=t.target;r>=0&&(n.activeTexture(33984+r),n.bindTexture(i,null),st[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete ot[t.id],u.textureCount--}return e(ht.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(t<0){for(var e=0;e0)continue;r.unit=-1}st[e]=this,t=e;break}t>=at&&_.raise("insufficient number of texture units"),c.profile&&u.maxTextureUnits>u)-a,c.height=c.height||(r.height>>u)-s,_(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),_(a>=0&&s>=0&&a+c.width<=r.width&&s+c.height<=r.height,"texture.subimage write out of bounds"),_(r.mipmask&1<>s;++s){var u=i>>s,l=a>>s;if(!u||!l)break;n.texImage2D(3553,s,r.format,u,l,0,r.format,r.type,null)}return pt(),c.profile&&(r.stats.size=Et(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,c.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(t,e,r,o,s,l){var f=new ht(34067);ot[f.id]=f,u.cubeCount++;var h=new Array(6);function d(t,e,n,r,o,s){var u,l=f.texInfo;for(K.call(l),u=0;u<6;++u)h[u]=H();if("number"!=typeof t&&t)if("object"===a(t))if(e)W(h[0],t),W(h[1],e),W(h[2],n),W(h[3],r),W(h[4],o),W(h[5],s);else if(Z(l,t),C(f,t),"faces"in t){var p=t.faces;for(_(Array.isArray(p)&&6===p.length,"cube faces must be a length 6 array"),u=0;u<6;++u)_("object"===a(p[u])&&!!p[u],"invalid input for cube map face"),A(h[u],f),W(h[u],p[u])}else for(u=0;u<6;++u)W(h[u],t);else _.raise("invalid arguments to cube map");else{var g=0|t||1;for(u=0;u<6;++u)V(h[u],g,g)}for(A(f,h[0]),i.npotTextureCube||_(et(f.width)&&et(f.height),"your browser does not support non power or two texture dimensions"),l.genMipmaps?f.mipmask=(h[0].width<<1)-1:f.mipmask=h[0].mipmask,_.textureCube(f,l,h,i),f.internalformat=h[0].internalformat,d.width=h[0].width,d.height=h[0].height,dt(f),u=0;u<6;++u)X(h[u],34069+u);for(Q(l,34067),pt(),c.profile&&(f.stats.size=Et(f.internalformat,f.type,d.width,d.height,l.genMipmaps,!0)),d.format=x[f.internalformat],d.type=w[f.type],d.mag=S[l.magFilter],d.min=E[l.minFilter],d.wrapS=O[l.wrapS],d.wrapT=O[l.wrapT],u=0;u<6;++u)q(h[u]);return d}return d(t,e,r,o,s,l),d.subimage=function(t,e,n,r,i){_(!!e,"must specify image data"),_("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,s=0|i,u=F();return A(u,f),u.width=0,u.height=0,P(u,e),u.width=u.width||(f.width>>s)-o,u.height=u.height||(f.height>>s)-a,_(f.type===u.type&&f.format===u.format&&f.internalformat===u.internalformat,"incompatible format for texture.subimage"),_(o>=0&&a>=0&&o+u.width<=f.width&&a+u.height<=f.height,"texture.subimage write out of bounds"),_(f.mipmask&1<>i;++i)n.texImage2D(34069+r,i,f.format,e>>i,e>>i,0,f.format,f.type,null);return pt(),c.profile&&(f.stats.size=Et(f.internalformat,f.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=f,c.profile&&(d.stats=f.stats),d.destroy=function(){f.decRef()},d},clear:function(){for(var t=0;t>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);Q(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t=0&&l=0&&f0&&h+l<=i.framebufferWidth,"invalid width for read pixels"),_(d>0&&d+f<=i.framebufferHeight,"invalid height for read pixels"),r();var g=h*d*4;return p||(5121===c?p=new Uint8Array(g):5126===c&&(p=p||new Float32Array(g))),_.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),_(p.byteLength>=g,"data buffer for regl.read() too small"),e.pixelStorei(3333,4),e.readPixels(l,f,h,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 Rt(t){return jt(t).join("")}Pt[36053]="complete",Pt[36054]="incomplete attachment",Pt[36057]="incomplete dimensions",Pt[36055]="incomplete, missing attachment",Pt[36061]="unsupported";var Lt="xyzw".split(""),Bt="profile",Gt="framebuffer",Ft="vert",zt="frag",Ut="elements",Vt="primitive",Wt="count",Xt="offset",Yt="instances",Ht="vao",qt=Gt+"Width",Kt=Gt+"Height",Zt=["blend.func","blend.equation","stencil.func","stencil.opFront","stencil.opBack","sample.coverage","viewport","scissor.box","polygonOffset.offset"],Qt={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"],Jt={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},te={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},ee={frag:35632,vert:35633},ne={cw:2304,ccw:2305};function re(e){return Array.isArray(e)||t(e)||L(e)}function ie(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t=1,r>=2,e)}if(4===n){var i=t.data;return new oe(i.thisDep,i.contextDep,i.propDep,e)}if(5===n)return new oe(!1,!1,!1,e);if(6===n){for(var o=!1,a=!1,s=!1,u=0;u=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 oe(o,a,s,e)}return new oe(3===n,2===n,1===n,e)}var ce=new oe(!1,!1,!1,(function(){}));function le(t,n,r,i,o,s,u,c,l,f,h,d,p,g,v){var y=f.Record,m={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(m.min=32775,m.max=32776);var b=r.angle_instanced_arrays,x=r.webgl_draw_buffers,w={dirty:!0,profile:v.profile},S={},E=[],O={},M={};function A(t){return t.replace(".","_")}function C(t,e,n){var r=A(t);E.push(t),S[r]=w[r]=!!n,O[r]=e}function T(t,e,n){var r=A(t);E.push(t),Array.isArray(n)?(w[r]=n.slice(),S[r]=n.slice()):w[r]=S[r]=n,M[r]=e}C("dither",3024),C("blend.enable",3042),T("blend.color","blendColor",[0,0,0,0]),T("blend.equation","blendEquationSeparate",[32774,32774]),T("blend.func","blendFuncSeparate",[1,0,1,0]),C("depth.enable",2929,!0),T("depth.func","depthFunc",513),T("depth.range","depthRange",[0,1]),T("depth.mask","depthMask",!0),T("colorMask","colorMask",[!0,!0,!0,!0]),C("cull.enable",2884),T("cull.face","cullFace",1029),T("frontFace","frontFace",2305),T("lineWidth","lineWidth",1),C("polygonOffset.enable",32823),T("polygonOffset.offset","polygonOffset",[0,0]),C("sample.alpha",32926),C("sample.enable",32928),T("sample.coverage","sampleCoverage",[1,!1]),C("stencil.enable",2960),T("stencil.mask","stencilMask",-1),T("stencil.func","stencilFunc",[519,0,-1]),T("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),T("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),C("scissor.enable",3089),T("scissor.box","scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),T("viewport","viewport",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var I={gl:t,context:p,strings:n,next:S,current:w,draw:d,elements:s,buffer:o,shader:h,attributes:f.state,vao:f,uniforms:l,framebuffer:c,extensions:r,timer:g,isBufferArgs:re},P={primTypes:Z,compareFuncs:Jt,blendFuncs:Qt,blendEquations:m,stencilOps:te,glTypes:U,orientationType:ne};_.optional((function(){I.isArrayLike=tt})),x&&(P.backBuffer=[1029],P.drawBuffer=D(i.maxDrawbuffers,(function(t){return 0===t?[0]:D(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 Rt([r.length>0?"var "+r.join(",")+";":"",Rt(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=0,'unknown parameter "'+e+'"',d.commandStr)}))}e(p),e(g)}));var v=function(t,e){var n=t.static;if("string"==typeof n[zt]&&"string"==typeof n[Ft]){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=0,"invalid "+t,n.commandStr)):u=!1,"height"in o?(s=0|o.height,_.command(s>=0,"invalid "+t,n.commandStr)):u=!1,new oe(!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,".",qt,"-",c));var i=s;return"height"in o||(i=e.def(n,".",Kt,"-",l)),[c,l,r,i]}))}if(t in i){var f=i[t],h=ue(f,(function(e,n){var r=e.invoke(n,f);_.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,".",qt,"-",o,")"),u=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",Kt,"-",a,")");return _.optional((function(){e.assert(n,s+">=0&&"+u+">=0","invalid "+t)})),[o,a,s,u]}));return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new oe(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",qt),e.def(n,".",Kt)]})):null}var a=o("viewport");if(a){var s=a;a=new oe(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,x,d),S=function(t,e){var n=t.static,r=t.dynamic,i=function(){if(Ut in n){var t=n[Ut];re(t)?t=s.getElements(s.create(t,!0)):t&&(t=s.getElements(t),_.command(t,"invalid elements",e.commandStr));var i=se((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(Ut in r){var o=r[Ut];return ue(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 _.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 _.command(!o||a>=0,"invalid "+t,e.commandStr),se((function(t,e){return o&&(t.OFFSET=a),a}))}if(t in r){var s=r[t];return ue(s,(function(e,n){var r=e.invoke(n,s);return o&&(e.OFFSET=r,_.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return o&&i?se((function(t,e){return t.OFFSET="0",0})):null}var a=o(Xt,!0);return{elements:i,primitive:function(){if(Vt in n){var t=n[Vt];return _.commandParameter(t,Z,"invalid primitve",e.commandStr),se((function(e,n){return Z[t]}))}if(Vt in r){var o=r[Vt];return ue(o,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,o);return _.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(Z))})),e.def(n,"[",r,"]")}))}return i?ae(i)?i.value?se((function(t,e){return e.def(t.ELEMENTS,".primType")})):se((function(){return 4})):new oe(i.thisDep,i.contextDep,i.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(Wt in n){var t=0|n[Wt];return _.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),se((function(){return t}))}if(Wt in r){var o=r[Wt];return ue(o,(function(t,e){var n=t.invoke(e,o);return _.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(ae(i)){if(i)return a?new oe(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return _.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):se((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var s=se((function(){return-1}));return _.optional((function(){s.MISSING=!0})),s}var u=new oe(i.thisDep||a.thisDep,i.contextDep||a.contextDep,i.propDep||a.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 _.optional((function(){u.DYNAMIC=!0})),u}return null}(),instances:o(Yt,!1),offset:a}}(t,d),O=function(t,e){var n=t.static,r=t.dynamic,o={};return E.forEach((function(t){var s=A(t);function u(e,i){if(t in n){var a=e(n[t]);o[s]=se((function(){return a}))}else if(t in r){var u=r[t];o[s]=ue(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 u((function(n){return _.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return _.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case"depth.func":return u((function(n){return _.commandParameter(n,Jt,"invalid "+t,e.commandStr),Jt[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return _.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(Jt))})),n.def(i,"[",r,"]")}));case"depth.range":return u((function(t){return _.command(tt(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 _.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 u((function(t){_.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return _.commandParameter(n,Qt,s+".srcRGB",e.commandStr),_.commandParameter(r,Qt,s+".srcAlpha",e.commandStr),_.commandParameter(i,Qt,s+".dstRGB",e.commandStr),_.commandParameter(o,Qt,s+".dstAlpha",e.commandStr),_.command(-1===$t.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Qt[n],Qt[i],Qt[r],Qt[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 _.optional((function(){e.assert(n,s+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Qt))})),s}_.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");_.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 u((function(n){return"string"==typeof n?(_.commandParameter(n,m,"invalid "+t,e.commandStr),[m[n],m[n]]):"object"===a(n)?(_.commandParameter(n.rgb,m,t+".rgb",e.commandStr),_.commandParameter(n.alpha,m,t+".alpha",e.commandStr),[m[n.rgb],m[n.alpha]]):void _.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 _.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 u((function(t){return _.command(tt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),D(4,(function(e){return+t[e]}))}),(function(t,e,n){return _.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),D(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case"stencil.mask":return u((function(t){return _.commandType(t,"number",s,e.commandStr),0|t}),(function(t,e,n){return _.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case"stencil.func":return u((function(n){_.commandType(n,"object",s,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return _.commandParameter(r,Jt,t+".cmp",e.commandStr),_.commandType(i,"number",t+".ref",e.commandStr),_.commandType(o,"number",t+".mask",e.commandStr),[Jt[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return _.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 u((function(n){_.commandType(n,"object",s,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return _.commandParameter(r,te,t+".fail",e.commandStr),_.commandParameter(i,te,t+".zfail",e.commandStr),_.commandParameter(o,te,t+".zpass",e.commandStr),["stencil.opBack"===t?1029:1028,te[r],te[i],te[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return _.optional((function(){e.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(te))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",7680)}return _.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 u((function(t){_.commandType(t,"object",s,e.commandStr);var n=0|t.factor,r=0|t.units;return _.commandType(n,"number",s+".factor",e.commandStr),_.commandType(r,"number",s+".units",e.commandStr),[n,r]}),(function(e,n,r){return _.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 u((function(t){var n=0;return"front"===t?n=1028:"back"===t&&(n=1029),_.command(!!n,s,e.commandStr),n}),(function(t,e,n){return _.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',1028,":",1029)}));case"lineWidth":return u((function(t){return _.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 _.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case"frontFace":return u((function(t){return _.commandParameter(t,ne,s,e.commandStr),ne[t]}),(function(t,e,n){return _.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 u((function(t){return _.command(tt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return _.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),D(4,(function(t){return"!!"+n+"["+t+"]"}))}));case"sample.coverage":return u((function(t){_.command("object"===a(t)&&t,s,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return _.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 _.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,d),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]);_.optional((function(){h.shader(ee[t],e,_.guessCommand())}));var r=se((function(){return e}));return r.id=e,r}if(t in o){var a=o[t];return ue(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return _.optional((function(){n(e.shared.shader,".shader(",ee[t],",",i,",",e.command,");")})),i}))}return null}var s,u=a(zt),c=a(Ft),l=null;return ae(u)&&ae(c)?(l=h.program(c.id,u.id,null,r),s=se((function(t,e){return t.link(l)}))):s=new oe(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,".",zt);var i=r+".program("+(c?c.append(t,e):e.def(r,".",Ft))+","+n;return _.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:u,vert:c,progVar:s,program:l}}(t,0,v);function k(t){var e=w[t];e&&(O[t]=e)}k("viewport"),k(A("scissor.box"));var C=Object.keys(O).length>0,T={framebuffer:x,draw:S,shader:M,state:O,dirty:C,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(T.profile=function(t){var e,n=t.static,r=t.dynamic;if(Bt in n){var i=!!n[Bt];(e=se((function(t,e){return i}))).enable=i}else if(Bt in r){var o=r[Bt];e=ue(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),T.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=se((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=se((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(_.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=se((function(t){return t.link(o.color[0])}))):_.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else tt(o)?r=se((function(e){return e.global.def("[",D(o.length,(function(n){return _.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):_.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]=ue(e,(function(t,n){return t.invoke(n,e)}))})),i}(u,d),T.drawVAO=T.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(Ht in n){var i=n[Ht];return null!==i&&null===f.getVAO(i)&&(i=f.createVAO(i)),se((function(t){return t.link(f.getVAO(i))}))}if(Ht in r){var o=r[Ht];return ue(o,(function(t,e){var n=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!T.drawVAO&&M.program&&!v&&r.angle_instanced_arrays){var I=!0,P=M.program.attributes.map((function(t){var n=e.static[t];return I=I&&!!n,n}));if(I&&P.length>0){var N=f.getVAO(f.createVAO(P));T.drawVAO=new oe(null,null,null,(function(t,e){return t.link(N)})),T.useVAO=!0}}return v?T.useVAO=!0:T.attributes=function(t,e){var r=t.static,i=t.dynamic,s={};return Object.keys(r).forEach((function(t){var i=r[t],u=n.id(t),c=new y;if(re(i))c.state=1,c.buffer=o.getBuffer(o.create(i,34962,!1,!0)),c.type=0;else{var l=o.getBuffer(i);if(l)c.state=1,c.buffer=l,c.type=0;else if(_.command("object"===a(i)&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var f=i.constant;c.buffer="null",c.state=2,"number"==typeof f?c.x=f:(_.command(tt(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),Lt.forEach((function(t,e){e=0,'invalid offset for attribute "'+t+'"',e.commandStr);var d=0|i.stride;_.command(d>=0&&d<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var p=0|i.size;_.command(!("size"in i)||p>0&&p<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var g=!!i.normalized,v=0;"type"in i&&(_.commandParameter(i.type,U,"invalid type for attribute "+t,e.commandStr),v=U[i.type]);var m=0|i.divisor;"divisor"in i&&(_.command(0===m||b,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),_.command(m>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),_.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){_.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),c.buffer=l,c.state=1,c.size=p,c.normalized=g,c.type=v||l.dtype,c.offset=h,c.stride=d,c.divisor=m}}s[t]=se((function(t,e){var n=t.attribCache;if(u in n)return n[u];var r={isStream:!1};return Object.keys(c).forEach((function(t){r[t]=c[t]})),c.buffer&&(r.buffer=t.link(c.buffer),r.type=r.type||r.buffer+".dtype"),n[u]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];s[t]=ue(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,s=o.isBufferArgs,u=o.buffer;_.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 y;l.state=1,Object.keys(l).forEach((function(t){c[t]=r.def(""+l[t])}));var f=c.buffer,h=c.type;function d(t){r(c[t],"=",i,".",t,"|0;")}return r("if(",s,"(",i,")){",c.isStream,"=true;",f,"=",u,".createStream(",34962,",",i,");",h,"=",f,".dtype;","}else{",f,"=",u,".getBuffer(",i,");","if(",f,"){",h,"=",f,".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)){",f,"=",u,".createStream(",34962,",",i,".buffer);","}else{",f,"=",u,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",f,".dtype;",c.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",c.isStream,"){",u,".destroyStream(",f,");","}"),c}))})),s}(e,d),T.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=se((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]=ue(e,(function(t,n){return t.invoke(n,e)}))})),r}(l),T}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 B(t,e,n,r){var i,o=t.shared,a=o.gl,s=o.framebuffer;x&&(i=e.def(o.extensions,".webgl_draw_buffers"));var u,c=t.constants,l=c.drawBuffer,f=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);"),x&&e(i,".drawBuffersWEBGL(",l,"[",u,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),x&&e(i,".drawBuffersWEBGL(",f,");"),e("}",s,".cur=",u,";"),r||e("}")}function G(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");E.forEach((function(e){var r,l,f=A(e);if(!(f in n.state))if(f in a){r=a[f],l=o[f];var h=D(w[f].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(h.map((function(t,e){return t+"!=="+l+"["+e+"]"})).join("||")).then(i,".",M[f],"(",h,");",h.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(u,".",f);var d=t.cond(r,"!==",s,".",f);c(d),f in O?d(t.cond(r).then(i,".enable(",O[f],");").else(i,".disable(",O[f],");"),s,".",f,"=",r,";"):d(i,".",M[f],"(",r,");",s,".",f,"=",r,";")}})),0===Object.keys(n.state).length&&c(s,".dirty=false;"),e(c)}function F(t,e,n,r){var i=t.shared,o=t.current,a=i.current,s=i.gl;ie(Object.keys(n)).forEach((function(i){var u=n[i];if(!r||r(u)){var c=u.append(t,e);if(O[i]){var l=O[i];ae(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(tt(c)){var f=o[i];e(s,".",M[i],"(",c,");",c.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";")}else e(s,".",M[i],"(",c,");",a,".",i,"=",c,";")}}))}function z(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function V(t,e,n,r,i){var o,a,s,u=t.shared,c=t.stats,l=u.current,f=u.timer,h=n.profile;function d(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function p(t){t(o=e.def(),"=",d(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),g&&(r?t(a=e.def(),"=",f,".getNumPendingQueries();"):t(f,".beginQuery(",c,");"))}function v(t){t(c,".cpuTime+=",d(),"-",o,";"),g&&(r?t(f,".pushScopeStats(",a,",",f,".getNumPendingQueries(),",c,");"):t(f,".endQuery();"))}function y(t){var n=e.def(l,".profile");e(l,".profile=",t,";"),e.exit(l,".profile=",n,";")}if(h){if(ae(h))return void(h.enable?(p(e),v(e.exit),y("true")):y("false"));y(s=h.append(t,e))}else s=e.def(l,".profile");var m=t.block();p(m),e("if(",s,"){",m,"}");var b=t.block();v(b),e.exit("if(",s,"){",b,"}")}function W(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(ce))return;var c=t.scopeAttrib(s);_.optional((function(){t.assert(e,c+".state","missing attribute "+s)})),a={},Object.keys(new y).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,f=[i.x,i.y,i.z,i.w],h=["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,"||",h.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,";",h.map((function(t){return u+"."+t+"="+i[t]+";"})).join(""),"}"),b){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+"!=="+f[e]})).join("||"),"){",a,".vertexAttrib4f(",s,",",f,");",Lt.map((function(t,e){return u+"."+t+"="+f[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 X(t,e,r,i,o){for(var a,s=t.shared,u=s.gl,c=0;c1?e(D(x,(function(t){return Array.isArray(l)?l[t]:l+"["+t+"]"}))):(_(!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,".",Ut),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,f,h=c(Vt),d=c(Xt),p=function(){var i,o=s.count,u=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(u=n),i=o.append(t,u),_.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,".",Wt),_.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("}");b&&(l=c(Yt),f=t.instancing);var g=u+".type",v=s.elements&&ae(s.elements);function y(){function t(){n(f,".drawElementsInstancedANGLE(",[h,p,g,d+"<<(("+g+"-5121)>>1)",l],");")}function e(){n(f,".drawArraysInstancedANGLE(",[h,d,p,l],");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}function m(){function t(){n(o+".drawElements("+[h,p,g,d+"<<(("+g+"-5121)>>1)"]+");")}function e(){n(o+".drawArrays("+[h,d,p]+");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}b&&("number"!=typeof l||l>=0)?"string"==typeof l?(n("if(",l,">0){"),y(),n("}else if(",l,"<0){"),m(),n("}")):y():m()}function H(t,e,n,r,i){var o=j(),a=o.proc("body",i);return _.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),b&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function q(t,e,n,r){z(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),W(t,e,n,r.attributes,(function(){return!0}))),X(t,e,n,r.uniforms,(function(){return!0})),Y(t,e,e,n)}function K(t,e,n,r){function i(){return!0}t.batchId="a1",z(t,e),W(t,e,n,r.attributes,i),X(t,e,n,r.uniforms,i),Y(t,e,e,n)}function Q(t,e,n,r){z(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&&B(t,u,n.framebuffer),F(t,u,n.state,c),n.profile&&c(n.profile)&&V(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);"),W(t,s,n,r.attributes,l),W(t,u,n,r.attributes,c)),X(t,s,n,r.uniforms,l),X(t,u,n,r.uniforms,c),Y(t,s,u,n);else{var f=t.global.def("{}"),h=n.shader.progVar.append(t,u),d=u.def(h,".id"),p=u.def(f,"[",d,"]");u(t.shared.gl,".useProgram(",h,".program);","if(!",p,"){",p,"=",f,"[",d,"]=",t.link((function(e){return H(K,t,n,e,2)})),"(",h,");}",p,".call(this,a0[",o,"],",o,");")}}function $(t,e,n){var r=e.static[n];if(r&&function(t){if("object"===a(t)&&!tt(t)){for(var e=Object.keys(t),n=0;n0&&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),ie(Object.keys(e.state)).forEach((function(n){var o=e.state[n].append(t,r);tt(o)?o.forEach((function(e,i){r.set(t.next[n],"["+i+"]",e)})):r.set(i.next,"."+n,o)})),V(t,r,e,!0,!0),[Ut,Xt,Wt,Yt,Vt].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 y).forEach((function(t){r.set(o,"."+t,i[t])}))})),e.scopeVAO&&r.set(i.vao,".targetVAO",e.scopeVAO.append(t,r)),a(Ft),a(zt),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",z(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||B(t,n,o)):B(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),G(t,n,e),F(t,n,e.state,(function(t){return!s(t)})),e.profile&&s(e.profile)||V(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)Q(t,n,e,null);else{var c=u.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Q(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var l=t.global.def("{}"),f=n.def(c,".id"),h=n.def(l,"[",f,"]");n(t.cond(h).then(h,".call(this,a0,a1);").else(h,"=",l,"[",f,"]=",t.link((function(n){return H(Q,t,e,n,2)})),"(",c,");",h,".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 fe=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=[],f=[];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){f.length=Math.max(f.length,o+1),l.length=Math.max(l.length,o+1),l[0]=0,f[0]=0;var a=0;for(t=0,n=0;n0)if(Array.isArray(n[0])){s=X(n);for(var l=1,f=1;f0)if("number"==typeof e[0]){var o=R.allocType(h.dtype,e.length);q(o,e),p(o,i),R.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){r=X(e);var a=W(e,r,h.dtype);p(a,i),R.freeType(a)}else _.raise("invalid buffer data")}else if(L(e)){r=e.shape;var s=e.stride,u=0,c=0,l=0,f=0;1===r.length?(u=r[0],c=1,l=s[0],f=0):2===r.length?(u=r[0],c=r[1],l=s[0],f=s[1]):_.raise("invalid shape");var g=Array.isArray(e.data)?h.dtype:H(e.data),v=R.allocType(g,u*c);K(v,e.data,u,c,l,f,e.offset),p(v,i),R.freeType(v)}else _.raise("invalid data for buffer subdata");return d},r.profile&&(d.stats=h.stats),d.destroy=function(){f(h)},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(){B(a).forEach(f),u.forEach(f)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){B(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 w.destroyBuffer(t)})),w=function(e,n,r,i,o){for(var a=r.maxAttributes,s=new Array(a),u=0;u0,"must specify at least one attribute");var i={},u=r.attributes;u.length=e.length;for(var c=0;c=d.byteLength?l.subdata(d):(l.destroy(),r.buffers[c]=null)),r.buffers[c]||(l=r.buffers[c]=o.create(f,34962,!1,!0)),h.buffer=o.getBuffer(l),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,i[c]=1):o.getBuffer(f)?(h.buffer=o.getBuffer(f),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(f.buffer)?(h.buffer=o.getBuffer(f.buffer),h.size=0|(+f.size||h.buffer.dimension),h.normalized=!!f.normalized||!1,"type"in f?(_.parameter(f.type,U,"invalid buffer type"),h.type=U[f.type]):h.type=h.buffer.dtype,h.offset=0|(f.offset||0),h.stride=0|(f.stride||0),h.divisor=0|(f.divisor||0),h.state=1,_(h.size>=1&&h.size<=4,"size must be between 1 and 4"),_(h.offset>=0,"invalid offset"),_(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),_(h.divisor>=0,"divisor must be positive"),_(!h.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in f?(_(c>0,"first attribute must not be a constant"),h.x=+f.x||0,h.y=+f.y||0,h.z=+f.z||0,h.w=+f.w||0,h.state=2):_(!1,"invalid attribute spec for location "+c)}for(var p=0;p>=1:5125===f&&(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 f(t){i.elementsCount--,_(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,f=0,h=0;Array.isArray(e)||t(e)||L(e)?n=e:(_.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,_(Array.isArray(n)||t(n)||L(n),"invalid data for element buffer")),"usage"in e&&(_.parameter(e.usage,V,"invalid element buffer usage"),r=V[e.usage]),"primitive"in e&&(_.parameter(e.primitive,Z,"invalid element buffer primitive"),i=Z[e.primitive]),"count"in e&&(_("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),u=0|e.count),"type"in e&&(_.parameter(e.type,s,"invalid buffer type"),h=s[e.type]),"length"in e?f=0|e.length:(f=u,5123===h||5122===h?f*=2:5125!==h&&5124!==h||(f*=4))),l(a,n,r,i,u,f,h)}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(){f(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(){B(o).forEach(f)}}}(i,d,x,h),E=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;n1)for(var y=0;yt&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return f.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);B(o).forEach(e),o={},B(a).forEach(e),a={},f.forEach((function(e){t.deleteProgram(e.program)})),f.length=0,l={},r.shaderCount=0},program:function(n,i,s,u){_.command(n>=0,"missing vertex shader",s),_.command(i>=0,"missing fragment shader",s);var c=l[i];c||(c=l[i]={});var h=c[n];if(h&&(h.refCount++,!u))return h;var g=new d(i,n);return r.shaderCount++,p(g,s,u),h||(c[n]=g),f.push(g),e(g,{destroy:function(){if(g.refCount--,g.refCount<=0){t.deleteProgram(g.program);var e=f.indexOf(g);f.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=2,"invalid renderbuffer shape"),u=0|p[0],c=0|p[1]}else"radius"in d&&(u=c=0|d.radius),"width"in d&&(u=0|d.width),"height"in d&&(c=0|d.height);"format"in d&&(_.parameter(d.format,o,"invalid renderbuffer format"),l=o[d.format])}else"number"==typeof e?(u=0|e,c="number"==typeof r?0|r:u):e?_.raise("invalid arguments to renderbuffer constructor"):u=c=1;if(_(u>0&&c>0&&u<=n.maxRenderbufferSize&&c<=n.maxRenderbufferSize,"invalid renderbuffer size"),u!==f.width||c!==f.height||l!==f.format)return h.width=f.width=u,h.height=f.height=c,f.format=l,t.bindRenderbuffer(36161,f.renderbuffer),t.renderbufferStorage(36161,l,u,c),_(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=kt(f.format,f.width,f.height)),h.format=s[f.format],h}return c[f.id]=f,r.renderbufferCount++,h(e,u),h.resize=function(e,r){var o=0|e,a=0|r||o;return o===f.width&&a===f.height||(_(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),h.width=f.width=o,h.height=f.height=a,t.bindRenderbuffer(36161,f.renderbuffer),t.renderbufferStorage(36161,f.format,o,a),_(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=kt(f.format,f.width,f.height))),h},h._reglType="renderbuffer",h._renderbuffer=f,i.profile&&(h.stats=f.stats),h.destroy=function(){f.decRef()},h},clear:function(){B(c).forEach(f)},restore:function(){B(c).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,d,b,h,r),T=function(t,n,r,i,o,s){var u={cur:null,next:null,dirty:!1,setFBO:null},c=["rgba"],l=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&l.push("srgba"),n.ext_color_buffer_half_float&&l.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&l.push("rgba32f");var f=["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 d(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function p(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);_(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;_(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function g(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 v(t){var e=3553,n=null,r=null,i=t;"object"===a(t)&&(i=t.data,"target"in t&&(e=0|t.target)),_.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,_(3553===e)):"textureCube"===o?(n=i,_(e>=34069&&e<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,e=36161):_.raise("invalid regl object for attachment"),new h(e,n,r)}function y(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 b(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&f.push("half float","float16"),n.oes_texture_float&&f.push("float","float32");var x=0,w={};function S(){this.id=x++,w[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function E(t){t.colorAttachments.forEach(d),d(t.depthAttachment),d(t.stencilAttachment),d(t.depthStencilAttachment)}function O(e){var n=e.framebuffer;_(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,s.framebufferCount--,delete w[e.id]}function M(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;n=2,"invalid shape for framebuffer"),s=P[0],h=P[1]}else"radius"in I&&(s=h=I.radius),"width"in I&&(s=I.width),"height"in I&&(h=I.height);("color"in I||"colors"in I)&&(b=I.color||I.colors,Array.isArray(b)&&_(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in I&&(O=0|I.colorCount,_(O>0,"invalid color buffer count")),"colorTexture"in I&&(x=!!I.colorTexture,w="rgba4"),"colorType"in I&&(S=I.colorType,x?(_(n.oes_texture_float||!("float"===S||"float32"===S),"you must enable OES_texture_float in order to use floating point framebuffer objects"),_(n.oes_texture_half_float||!("half float"===S||"float16"===S),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===S||"float16"===S?(_(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),w="rgba16f"):"float"!==S&&"float32"!==S||(_(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),w="rgba32f"),_.oneOf(S,f,"invalid color type")),"colorFormat"in I&&(w=I.colorFormat,c.indexOf(w)>=0?x=!0:l.indexOf(w)>=0?x=!1:x?_.oneOf(I.colorFormat,c,"invalid color format for texture"):_.oneOf(I.colorFormat,l,"invalid color format for renderbuffer"))),("depthTexture"in I||"depthStencilTexture"in I)&&(T=!(!I.depthTexture&&!I.depthStencilTexture),_(!T||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in I&&("boolean"==typeof I.depth?d=I.depth:(k=I.depth,g=!1)),"stencil"in I&&("boolean"==typeof I.stencil?g=I.stencil:(A=I.stencil,d=!1)),"depthStencil"in I&&("boolean"==typeof I.depthStencil?d=g=I.depthStencil:(C=I.depthStencil,d=!1,g=!1))}else s=h=1;var D=null,N=null,j=null,R=null;if(Array.isArray(b))D=b.map(v);else if(b)D=[v(b)];else for(D=new Array(O),i=0;i=0||D[i].renderbuffer&&It.indexOf(D[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),D[i]&&D[i].texture){var B=Ct[D[i].texture._texture.format]*Tt[D[i].texture._texture.type];null===L?L=B:_(L===B,"all color attachments much have the same number of bits per pixel.")}return p(N,s,h),_(!N||N.texture&&6402===N.texture._texture.format||N.renderbuffer&&33189===N.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),p(j,s,h),_(!j||j.renderbuffer&&36168===j.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),p(R,s,h),_(!R||R.texture&&34041===R.texture._texture.format||R.renderbuffer&&34041===R.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),E(o),o.width=s,o.height=h,o.colorAttachments=D,o.depthAttachment=N,o.stencilAttachment=j,o.depthStencilAttachment=R,a.color=D.map(m),a.depth=m(N),a.stencil=m(j),a.depthStencil=m(R),a.width=o.width,a.height=o.height,M(o),a}return s.framebufferCount++,a(t,i),e(a,{resize:function(t,e){_(u.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 a;for(var i=o.colorAttachments,s=0;s=2,"invalid shape for framebuffer"),_(m[0]===m[1],"cube framebuffer must be square"),h=m[0]}else"radius"in y&&(h=0|y.radius),"width"in y?(h=0|y.width,"height"in y&&_(y.height===h,"must be square")):"height"in y&&(h=0|y.height);("color"in y||"colors"in y)&&(d=y.color||y.colors,Array.isArray(d)&&_(1===d.length||n.webgl_draw_buffers,"multiple render targets not supported")),d||("colorCount"in y&&(v=0|y.colorCount,_(v>0,"invalid color buffer count")),"colorType"in y&&(_.oneOf(y.colorType,f,"invalid color type"),g=y.colorType),"colorFormat"in y&&(p=y.colorFormat,_.oneOf(y.colorFormat,c,"invalid color format for texture"))),"depth"in y&&(l.depth=y.depth),"stencil"in y&&(l.stencil=y.stencil),"depthStencil"in y&&(l.depthStencil=y.depthStencil)}else h=1;if(d)if(Array.isArray(d))for(s=[],r=0;r0&&(l.depth=o[0].depth,l.stencil=o[0].stencil,l.depthStencil=o[0].depthStencil),o[r]?o[r](l):o[r]=k(l)}return e(a,{width:h,height:h,color:s})}return a(t),e(a,{faces:o,resize:function(t){var e,n=0|t;if(_(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e=0;--t){var e=G[t];e&&e(m,null,0)}i.flush(),p&&p.update()}function tt(){!$&&G.length>0&&($=A.next(J))}function et(){$&&(A.cancel(J),$=null)}function nt(t){t.preventDefault(),s=!0,et(),F.forEach((function(t){t()}))}function rt(t){i.getError(),s=!1,u.restore(),E.restore(),x.restore(),O.restore(),M.restore(),T.restore(),w.restore(),p&&p.restore(),I.procs.refresh(),tt(),z.forEach((function(t){t()}))}function it(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(k.isDynamic(o))r[i]=k.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a0)return f.call(this,function(t){for(;d.length=0,"cannot cancel a frame twice"),G[e]=function t(){var e=he(G,t);G[e]=G[G.length-1],G.length-=1,G.length<=0&&et()}}}}function ut(){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 ct(){m.tick+=1,m.time=ft(),ut(),I.procs.poll()}function lt(){O.refresh(),ut(),I.procs.refresh(),p&&p.update()}function ft(){return(C()-g)/1e3}lt();var ht=e(it,{clear:function(t){if(_("object"===a(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)ot(e({framebuffer:t.framebuffer.faces[n]},t),at);else ot(t,at);else at(0,t)},prop:k.define.bind(null,1),context:k.define.bind(null,2),this:k.define.bind(null,3),draw:it({}),buffer:function(t){return x.create(t,34962,!1,!1)},elements:function(t){return S.create(t,!1)},texture:O.create2D,cube:O.createCube,renderbuffer:M.create,framebuffer:T.create,framebufferCube:T.createCube,vao:w.createVAO,attributes:o,frame:st,on:function(t,e){var n;switch(_.type(e,"function","listener callback must be a function"),t){case"frame":return st(e);case"lost":n=F;break;case"restore":n=z;break;case"destroy":n=Q;break;default:_.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t=0},read:D,destroy:function(){G.length=0,et(),j&&(j.removeEventListener("webglcontextlost",nt),j.removeEventListener("webglcontextrestored",rt)),E.clear(),T.clear(),M.clear(),O.clear(),S.clear(),x.clear(),w.clear(),p&&p.clear(),Q.forEach((function(t){t()}))},_gl:i,_refresh:lt,poll:function(){ct(),p&&p.update()},now:ft,stats:h});return r.onDone(null,ht),ht}},"object"===a(e)&&void 0!==t?t.exports=o():void 0===(i="function"==typeof(r=o)?r.call(e,n,e,t):r)||(t.exports=i)},,,,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GADDIAsync=e.getNeighborsAsync=e.pageRankAsync=e.minimumSpanningTreeAsync=e.louvainAsync=e.labelPropagationAsync=e.floydWarshallAsync=e.findShortestPathAsync=e.findAllPathAsync=e.dijkstraAsync=e.detectAllUndirectedCycleAsync=e.detectAllDirectedCycleAsync=e.detectAllCyclesAsync=e.detectCycleAsync=e.getOutDegreeAsync=e.getInDegreeAsync=e.getDegreeAsync=e.connectedComponentAsync=e.getAdjMatrixAsync=void 0;var r,i=(r=n(281))&&r.__esModule?r:{default:r},o=n(141);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(141),o=(r=n(282))&&r.__esModule?r:{default:r};var a=function(t){return function(){for(var e=[],n=0;n0;)for(var v=d.pop(),y=v.id,m=(0,s.getNeighbors)(y,t.edges),b=function(r){var i,a=m[r],s=t.nodes.find((function(t){return t.id===a}));if(a===y)o.push(((i={})[a]=v,i));else if(a in g){if(!g[y].has(s)){for(var u=!0,c=[s,v],l=p[y];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 f={},h=1;h-1)return f;r.push(a),i.add(a);for(var h=l[a.id],d=0;d0;){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-1}));y-1?g[v.id].push(l[b]):u.push(((i={})[v.id]=v,i))}}return{component:p,adjList:g,minIdx:a}},b=0;b=b})),w=(0,a.detectStrongConnectComponents)({nodes:x,edges:t.edges}).filter((function(t){return t.length>1}));if(0===w.length)break;var _=m(w),S=_.minIdx,E=_.adjList,O=_.component;if(!(O.length>1))break;O.forEach((function(t){o[t.id]=new Set}));var M=c[S];if(e&&n&&-1===e.indexOf(M.id))return u;f(M,M,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 f=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=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findAllPath=e.findShortestPath=void 0;var r,i=(r=n(142))&&r.__esModule?r:{default:r},o=n(44);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=[],f=[],h=r?(0,o.getNeighbors)(e,s,"target"):(0,o.getNeighbors)(e,s);for(l.push(h);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,h=r?(0,o.getNeighbors)(p,s,"target"):(0,o.getNeighbors)(p,s),l.push(h.filter((function(t){return!c[t]})))),u[u.length-1]===n){var g=u.map((function(t){return t}));f.push(g);v=u.pop();c[v]=!1,l.pop()}}else{var v=u.pop();c[v]=!1,l.pop()}}return f}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(95))&&r.__esModule?r:{default:r},o=n(44);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={},f={};s.forEach((function(t,e){var n=(0,o.uniqueId)();t.clusterId=n,l[n]={id:n,nodes:[t]},f[t.id]={node:t,idx:e}}));var h=(0,i.default)(t,e),d=[],p={};h.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=f[t].node.clusterId;n[i]||(n[i]=0),n[i]+=r}));var r=-1/0,i=[];if(Object.keys(n).forEach((function(t){r=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++};g100);)m=y,b++,Object.keys(f).forEach((function(t){var e=0;c.forEach((function(r){var i=r.source,o=r.target,a=h[i].node.clusterId,s=h[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=r[n]||1)})),f[t].sumTot=e})),s.forEach((function(t,e){var r,i=f[t.clusterId],o=0,a=p[e]/(2*v),s=0;i.nodes.forEach((function(t){var n=h[t.id].idx;s+=d[e][n]||0}));var u=s-i.sumTot*a,l=g[t.id];if(Object.keys(l).forEach((function(n){var i=h[n].node.clusterId;if(i!==t.clusterId){var s=f[i],c=s.nodes;if(c&&c.length){var l=0;c.forEach((function(t){var n=h[t.id].idx;l+=d[e][n]||0}));var p=l-s.sumTot*a-u;p>o&&(o=p,r=s)}}})),o>0){r.nodes.push(t);var y=t.clusterId;t.clusterId=r.id;var m=i.nodes.indexOf(t);i.nodes.splice(m,1);var b=0,x=0;c.forEach((function(t){var e=t.source,i=t.target,o=h[e].node.clusterId,a=h[i].node.clusterId;(o===r.id&&a!==r.id||a===r.id&&o!==r.id)&&(b+=t[n]||1),(o===y&&a!==y||a===y&&o!==y)&&(x+=t[n]||1)})),r.sumTot=b,i.sumTot=x}}));var x={},w=0;Object.keys(f).forEach((function(t){var e=f[t];if(e.nodes&&e.nodes.length){var n=String(w+1);n!==t&&(e.id=n,e.nodes=e.nodes.map((function(t){return{id:t.id,clusterId:n}})),f[n]=e,x[t]=n,delete f[t],w++)}else delete f[t]})),s.forEach((function(t){t.clusterId&&x[t.clusterId]&&(t.clusterId=x[t.clusterId])}));var _=[],S={};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=o+"---"+a;if(S[s])S[s].weight+=i,S[s].count++;else{var u={source:o,target:a,weight:i,count:1};S[s]=u,_.push(u)}}));var E=[];return Object.keys(f).forEach((function(t){E.push(f[t])})),{clusters:E,clusterEdges:_}};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n(292)),i=a(n(293)),o=n(44);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 f=new i.default((function(t,n){return e?t.weight-n.weight:0}));for((0,o.getEdgesByNodeId)(c.id,u).forEach((function(t){f.insert(t)}));!f.isEmpty();){var h=f.delMin(),d=h.source,p=h.target;l.has(d)&&l.has(p)||(n.push(h),l.has(d)||(l.add(d),(0,o.getEdgesByNodeId)(d,u).forEach((function(t){f.insert(t)}))),l.has(p)||(l.add(p),(0,o.getEdgesByNodeId)(p,u).forEach((function(t){f.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(),f=l.source,h=l.target;c.connected(f,h)||(n.push(l),c.union(f,h))}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;e0&&(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&&r0?n=r:null!==i&&i0&&(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(170))&&r.__esModule?r:{default:r},o=n(44);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,f=t.edges,h=void 0===f?[]:f,d=l.length,p={},g={},v=0;v0&&a>e;){s=0;for(v=0;v0&&(r+=g[w]/_)}p[m]=n*r,s+=p[m]}}s=(1-s)/d,a=0;for(v=0;ve&&(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}},m=function(t,e,n,s,u,m,b){if(void 0===n&&(n=!1),void 0===m&&(m="cluster"),void 0===b&&(b="cluster"),t&&t.nodes){var x=t.nodes.length;if(x){var w=(0,i.default)(t,n),_=(0,i.default)(e,n),S=g(t.nodes,w,n),E=g(e.nodes,_,n),O=d(t.nodes,m),M=O.nodeMap,k=O.nodeLabelMap,A=d(e.nodes,m),C=A.nodeMap,T=A.nodeLabelMap;p(t.edges,b,M);var I=p(e.edges,b,C).edgeLabelMap;u||(u=Math.max.apply(Math,(0,r.__spreadArray)((0,r.__spreadArray)([],_[0]),[2]))),s||(s=u);var P=c(t,w,m,s),D=c(e,_,m,s),N=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,f=t.neighborNum-1;u2*e)););if(d<2*e&&(a[r+"-"+h]={start:r,end:h,distance:i[r][h]},u++,++s>=n))return a;if(++c>2*e)break}uZ[r][c]){s=!0;break}if(s)return X.splice(e,1),"continue";var l={};i.neighbors.forEach((function(t){var e=S[n.id+"-"+t.id];l[n.id+"-"+t.id]={start:M[n.id].idx,end:M[t.id].idx,distance:e}})),j=f(l,P,t,j);var d=[];Object.keys(l).forEach((function(t){if(U[t])d.push(U[t]);else{var e=j[t];U[t]=h(e,z,m,b),d.push(U[t])}})),d=d.sort((function(t,e){return e-t}));var p=!1;for(c=0;c=0;l--)c(l)}));var $=[];X.forEach((function(r){for(var i=M[r.id].idx,o=l(t.nodes,w[i],i,m,u).neighbors,a=!1,s=o.length-1;s>=0;s--){if(o.length+1Z[f][p])o.splice(s,1);else{if(n){var g=c.id+"-"+r.id,x=S[g];if(p=Q[f].length-1,x>Q[f][p]){o.splice(s,1);continue}}var _=U[h]?U[h]:v(t,r,c,M,d,P,z,m,b,U,j),E=V.id+"-"+f;if(_=0;d--){if("break"===x(d))break}if(v)return $.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[m];if(s[e]--,s[e]tt[r][tt[r].length-1]){e=u[t].node[m];if(s[e]--,s[e]=0;E--){var O=i.nodes[E],k=u[O.id].degree,A=u[O.id].inDegree,P=u[O.id].outDegree,D=O[m],N=y(Y,D,C,T),j=N.minPatternNodeLabelDegree,R=N.minPatternNodeLabelInDegree,L=N.minPatternNodeLabelOutDegree;if(n?k=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--),I[F]&&l[F]=0;nt--){if("break"===et(nt))break}var rt=$.length,it=function(t){var e=$[t],n={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+t.label;n[e]?n[e]++:n[e]=1}));for(var r=function(t){var e=$[t],r={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+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&&$.splice(t,1)},i=rt-1;i>t;i--)r(i);rt=$.length};for(nt=0;nt<=rt-1;nt++)it(nt);return $}}};e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(3),i=n(297),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=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,i=n.toNode;rf||r.hasNode(o[l.to])||(e.labely;b--){if("break"===m(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[f[0]],h,n);i.length>0&&(g=!0,S=d,i.forEach((function(t){var n=t.label+"-"+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=f.length,O=function(e){if(g)return"break";var n=f[e];l.forEach((function(e){var i=new s(e),o=t.findForwardRmpathEdges(r,i.edges[n],h,i);o.length>0&&(g=!0,S=c.dfsEdgeList[n].fromNode,o.forEach((function(t){var n=t.label+"-"+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=0;h--){var d=e.findBackwardEdge(i,f.edges[r[h]],f.edges[r[0]],f);if(d){var p=e.dfsCode.dfsEdgeList[r[h]].fromNode+"-"+d.label;l[p]||(l[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[h]].fromNode,edgeLabel:d.label}),l[p].projected.push({graphId:t.graphId,edge:d,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(i,f.edges[r[0]],u,f).forEach((function(e){var n=a+"-"+e.label+"-"+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,f.edges[r[n]],u,f).forEach((function(i){var a=e.dfsCode.dfsEdgeList[r[n]].fromNode+"-"+i.label+"-"+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(h=0;hi){var a=i;i=r,r=a}var l=t.label,f=n+"-"+r+"-"+l+"-"+i,h=r+"-"+l+"-"+i;if(!o[h]){var d=o[h]||0;d++,o[h]=d}s[f]={graphId:n,nodeLabel1:r,edgeLabel:l,nodeLabel2:i}}))}))})),Object.keys(i).forEach((function(t){if(!(i[t]=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},s.to.keyword=function(t){return o[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(301),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},function(t,e,n){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)}var i=n(173),o=n(304),a={};Object.keys(i).forEach((function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:i[t].channels}),Object.defineProperty(a[t],"labels",{value:i[t].labels});var e=o(t);Object.keys(e).forEach((function(n){var i=e[n];a[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"===r(n))for(var i=n.length,o=0;o1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))})),t.exports=a},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(173);function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i-1}},function(t,e,n){var r=n(98);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(97);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(97),i=n(144),o=n(145);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(84),i=n(321),o=n(42),a=n(177),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,h=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?h:s).test(a(t))}},function(t,e,n){var r=n(71),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(322),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(46)["__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(325),i=n(97),o=n(144);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(326),i=n(327),o=n(328),a=n(329),s=n(330);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(199),i=n(399),o=n(403),a=n(200),s=n(404),u=n(156);t.exports=function(t,e,n){var c=-1,l=i,f=t.length,h=!0,d=[],p=d;if(n)h=!1,l=o;else if(f>=200){var g=e?null:s(t);if(g)return u(g);h=!1,l=a,p=new r}else p=e?[]:d;t:for(;++c-1}},function(t,e,n){var r=n(214),i=n(401),o=n(402);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;++r1||1===e.length&&t.hasEdge(e[0],e[0])}))}},function(t,e,n){var r=n(41);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;s0;){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(28),i=n(458),o=n(461),a=n(462),s=n(36).normalizeRanks,u=n(464),c=n(36).removeEmptyRanks,l=n(465),f=n(466),h=n(467),d=n(468),p=n(477),g=n(36),v=n(45).Graph;t.exports=function(t,e){var n=e&&e.debugTiming?g.time:g.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new v({multigraph:!0,compound:!0}),n=M(t.graph());return e.setGraph(r.merge({},m,O(n,y),r.pick(n,b))),r.forEach(t.nodes(),(function(n){var i=M(t.node(n));e.setNode(n,r.defaults(O(i,x),w)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var i=M(t.edge(n));e.setEdge(n,r.merge({},S,O(i,_),r.pick(i,E)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=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)}))}(t)})),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(){f(t)})),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(){h.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(){h.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)}))}(e,n)})),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,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,e)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},_=["minlen","weight","width","height","labeloffset"],S={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},E=["labelpos"];function O(t,e){return r.mapValues(r.pick(t,e),Number)}function M(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},function(t,e,n){var r=n(174);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(111),i=n(70),o=n(112),a=n(64),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-1?s[u?e[c]:c]:void 0}}},function(t,e,n){var r=n(214),i=n(52),o=n(424),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(222);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(426),i=n(42),o=n(74),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(427),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(155),i=n(195),o=n(64);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(102),i=n(154),o=n(52);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(159),i=n(432),o=n(65);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(434),i=n(438)((function(t,e,n){r(t,e,n)}));t.exports=i},function(t,e,n){var r=n(96),i=n(224),o=n(155),a=n(435),s=n(42),u=n(64),c=n(225);t.exports=function t(e,n,l,f,h){e!==n&&o(n,(function(o,u){if(h||(h=new r),s(o))a(e,n,u,l,t,f,h);else{var d=f?f(c(e,u),o,u+"",e,n,h):void 0;void 0===d&&(d=o),i(e,u,d)}}),u)}},function(t,e,n){var r=n(224),i=n(181),o=n(190),a=n(182),s=n(191),u=n(86),c=n(31),l=n(215),f=n(72),h=n(84),d=n(42),p=n(436),g=n(88),v=n(225),y=n(437);t.exports=function(t,e,n,m,b,x,w){var _=v(t,n),S=v(e,n),E=w.get(S);if(E)r(t,n,E);else{var O=x?x(_,S,n+"",t,e,w):void 0,M=void 0===O;if(M){var k=c(S),A=!k&&f(S),C=!k&&!A&&g(S);O=S,k||A||C?c(_)?O=_:l(_)?O=a(_):A?(M=!1,O=i(S,!0)):C?(M=!1,O=o(S,!0)):O=[]:p(S)||u(S)?(O=_,u(_)?O=y(_):d(_)&&!h(_)||(O=s(S))):M=!1}M&&(w.set(S,O),b(O,S,m,x,w),w.delete(S)),r(t,n,O)}}},function(t,e,n){var r=n(63),i=n(106),o=n(48),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(85),i=n(64);t.exports=function(t){return r(t,i(t))}},function(t,e,n){var r=n(111),i=n(112);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);++r1&&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(110),i=n(108),o=n(52),a=n(210),s=n(452),u=n(104),c=n(453),l=n(65),f=n(31);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return f(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[l];var h=-1;e=r(e,u(o));var d=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++h,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(454);t.exports=function(t,e,n){for(var i=-1,o=t.criteria,a=e.criteria,s=o.length,u=n.length;++i=u?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(74);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&&t0;--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(28),i=n(36);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,f=t.edge(e),h=f.labelRank;if(c===s+1)return;for(t.removeEdge(e),o=0,++s;su.lim&&(c=u,l=!0);var f=r.filter(e.edges(),(function(e){return l===m(t,t.node(e.v),c)&&l!==m(t,t.node(e.w),c)}));return r.minBy(f,(function(t){return o(e,t)}))}function y(t,e,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),d(t),f(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 m(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=l,l.initLowLimValues=d,l.initCutValues=f,l.calcCutValue=h,l.leaveEdge=g,l.enterEdge=v,l.exchangeEdges=y},function(t,e,n){var r=n(28);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=2),s=l.buildLayerMatrix(t);var v=o(t,s);v0;)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=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(28),i=n(36);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){var n=i.partition(t,(function(t){return r.has(t,"barycenter")})),a=n.lhs,s=r.sortBy(n.rhs,(function(t){return-t.i})),u=[],c=0,l=0,f=0;a.sort((h=!!e,function(t,e){return t.barycentere.barycenter?1:h?e.i-t.i:t.i-e.i})),f=o(u,s,f),r.forEach(a,(function(t){f+=t.vs.length,u.push(t.vs),c+=t.barycenter*t.weight,l+=t.weight,f=o(u,s,f)}));var h;var d={vs:r.flatten(u,!0)};l&&(d.barycenter=c/l,d.weight=l);return d}},function(t,e,n){var r=n(28),i=n(45).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(28);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(28),i=n(36),o=n(478).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(28),i=n(45).Graph,o=n(36);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 f=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),h=f?t.node(f).order:s;(f||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;!(as)&&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,f=Math.floor(l),h=Math.ceil(l);f<=h;++f){var d=u[f];a[t]===t&&e=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),f}},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;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}("object"===e(t)?t.exports:{});try{regeneratorRuntime=n}catch(t){"object"===("undefined"==typeof globalThis?"undefined":e(globalThis))?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}).call(this,n(87)(t))},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";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)}var i=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())}))},o=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]0,v=p.length>n.length,y=function(t,e,n,r,i){for(var o=[],a=0;a0?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(66),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(39),i=n(53),o=n(232),a=n(90),s=n(495),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}};e.resolve=function(t){return function t(e){return function(n){n.parentContext.setCurrentRequest(n);var o=n.bindings,c=n.childRequests,l=n.target&&n.target.isArray(),f=!(n.parentRequest&&n.parentRequest.target&&n.target&&n.parentRequest.target.matchesArray(n.target.serviceIdentifier));if(l&&f)return c.map((function(n){return t(e)(n)}));var h=null;if(!n.target.isOptional()||0!==o.length){var d=o[0],p=d.scope===i.BindingScopeEnum.Singleton,g=d.scope===i.BindingScopeEnum.Request;if(p&&d.activated)return d.cache;if(g&&null!==e&&e.has(d.id))return e.get(d.id);if(d.type===i.BindingTypeEnum.ConstantValue)h=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Function)h=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Constructor)h=d.implementationType;else if(d.type===i.BindingTypeEnum.DynamicValue&&null!==d.dynamicValue)h=u("toDynamicValue",d.serviceIdentifier,(function(){return d.dynamicValue(n.parentContext)}));else if(d.type===i.BindingTypeEnum.Factory&&null!==d.factory)h=u("toFactory",d.serviceIdentifier,(function(){return d.factory(n.parentContext)}));else if(d.type===i.BindingTypeEnum.Provider&&null!==d.provider)h=u("toProvider",d.serviceIdentifier,(function(){return d.provider(n.parentContext)}));else{if(d.type!==i.BindingTypeEnum.Instance||null===d.implementationType){var v=a.getServiceIdentifierAsString(n.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+v)}h=s.resolveInstance(d.implementationType,c,t(e))}return"function"==typeof d.onActivation&&(h=d.onActivation(n.parentContext,h)),p&&(d.cache=h,d.activated=!0),g&&null!==e&&!e.has(d.id)&&e.set(d.id,h),h}}}(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;n0){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(39),i=n(53),o=n(497),a=n(235),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(498),i=n(160),o=n(161),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(53),i=n(235),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(39),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(66),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(39),i=n(32);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(47),i=n(58);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(32),i=n(47),o=n(58);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(32),i=n(47),o=n(58);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(32),i=n(47),o=n(58);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(32),i=n(47),o=n(58);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(32),i=n(47),o=n(58);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(39),i=n(32),o=n(47);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;rn*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";n.r(e),n.d(e,"G6GraphEvent",(function(){return yn})),n.d(e,"G6Event",(function(){return Cr})),n.d(e,"Node",(function(){return Gn})),n.d(e,"Edge",(function(){return Bn})),n.d(e,"Combo",(function(){return Fn})),n.d(e,"Hull",(function(){return pr})),n.d(e,"registerNode",(function(){return Br})),n.d(e,"registerCombo",(function(){return Fr})),n.d(e,"AbstractGraph",(function(){return vr})),n.d(e,"registerEdge",(function(){return Gr})),n.d(e,"registerBehavior",(function(){return zr})),n.d(e,"AbstractLayout",(function(){return Rr})),n.d(e,"AbstractEvent",(function(){return Lr})),n.d(e,"BaseGlobal",(function(){return Ur})),n.d(e,"Graph",(function(){return vg})),n.d(e,"TreeGraph",(function(){return bg})),n.d(e,"Util",(function(){return Hp})),n.d(e,"Layout",(function(){return jp})),n.d(e,"TreeLayout",(function(){return Kp})),n.d(e,"registerLayout",(function(){return Zp})),n.d(e,"Global",(function(){return xi})),n.d(e,"Minimap",(function(){return Ob})),n.d(e,"Grid",(function(){return Eb})),n.d(e,"Bundling",(function(){return Mb})),n.d(e,"Menu",(function(){return kb})),n.d(e,"Fisheye",(function(){return Ab})),n.d(e,"Algorithm",(function(){return Sb})),n.d(e,"ToolBar",(function(){return Cb})),n.d(e,"Tooltip",(function(){return Tb})),n.d(e,"TimeBar",(function(){return Ib})),n.d(e,"ImageMinimap",(function(){return Pb})),n.d(e,"EdgeFilterLens",(function(){return Db})),n.d(e,"SnapLine",(function(){return Nb})),n.d(e,"Legend",(function(){return jb})),n.d(e,"Arrow",(function(){return Tr})),n.d(e,"Marker",(function(){return Ir})),n.d(e,"Shape",(function(){return Pr})),n.d(e,"version",(function(){return Lb}));var r={};n.r(r),n.d(r,"getAdjMatrix",(function(){return nt})),n.d(r,"breadthFirstSearch",(function(){return lt})),n.d(r,"connectedComponent",(function(){return ht})),n.d(r,"getDegree",(function(){return pt})),n.d(r,"getInDegree",(function(){return gt})),n.d(r,"getOutDegree",(function(){return vt})),n.d(r,"detectCycle",(function(){return wt})),n.d(r,"detectDirectedCycle",(function(){return re})),n.d(r,"detectAllCycles",(function(){return xt})),n.d(r,"detectAllDirectedCycle",(function(){return bt})),n.d(r,"detectAllUndirectedCycle",(function(){return mt})),n.d(r,"depthFirstSearch",(function(){return yt})),n.d(r,"dijkstra",(function(){return St})),n.d(r,"findAllPath",(function(){return Mt})),n.d(r,"findShortestPath",(function(){return Ot})),n.d(r,"floydWarshall",(function(){return kt})),n.d(r,"labelPropagation",(function(){return At})),n.d(r,"louvain",(function(){return Tt})),n.d(r,"minimumSpanningTree",(function(){return Rt})),n.d(r,"pageRank",(function(){return Lt})),n.d(r,"getNeighbors",(function(){return st})),n.d(r,"Stack",(function(){return ne})),n.d(r,"GADDI",(function(){return ee})),n.d(r,"default",(function(){return ie}));var i={};n.r(i),n.d(i,"compare",(function(){return ae})),n.d(i,"getLineIntersect",(function(){return ue})),n.d(i,"getRectIntersectByPoint",(function(){return ce})),n.d(i,"getCircleIntersectByPoint",(function(){return le})),n.d(i,"getEllipseIntersectByPoint",(function(){return fe})),n.d(i,"applyMatrix",(function(){return he})),n.d(i,"invertMatrix",(function(){return de})),n.d(i,"getCircleCenterByPoints",(function(){return pe})),n.d(i,"distance",(function(){return ge})),n.d(i,"scaleMatrix",(function(){return ve})),n.d(i,"floydWarshall",(function(){return ye})),n.d(i,"getAdjMatrix",(function(){return me})),n.d(i,"translate",(function(){return be})),n.d(i,"move",(function(){return xe})),n.d(i,"scale",(function(){return we})),n.d(i,"rotate",(function(){return _e})),n.d(i,"getDegree",(function(){return Se})),n.d(i,"isPointInPolygon",(function(){return Oe})),n.d(i,"intersectBBox",(function(){return Me})),n.d(i,"isPolygonsIntersect",(function(){return ke})),n.d(i,"Line",(function(){return Ae})),n.d(i,"getBBoxBoundLine",(function(){return Ce})),n.d(i,"itemIntersectByLine",(function(){return Ie})),n.d(i,"fractionToLine",(function(){return Pe})),n.d(i,"getPointsCenter",(function(){return De})),n.d(i,"squareDist",(function(){return Ne})),n.d(i,"pointLineSquareDist",(function(){return je})),n.d(i,"isPointsOverlap",(function(){return Re})),n.d(i,"pointRectSquareDist",(function(){return Le})),n.d(i,"pointLineDistance",(function(){return Be}));var o={};n.r(o),n.d(o,"getBBox",(function(){return en})),n.d(o,"getLoopCfgs",(function(){return nn})),n.d(o,"getLabelPosition",(function(){return rn})),n.d(o,"traverseTree",(function(){return an})),n.d(o,"traverseTreeUp",(function(){return sn})),n.d(o,"getLetterWidth",(function(){return un})),n.d(o,"getTextSize",(function(){return cn})),n.d(o,"plainCombosToTrees",(function(){return ln})),n.d(o,"reconstructTree",(function(){return fn})),n.d(o,"getComboBBox",(function(){return hn})),n.d(o,"shouldRefreshEdge",(function(){return dn})),n.d(o,"cloneBesidesImg",(function(){return pn}));var a={};n.r(a),n.d(a,"uniqueId",(function(){return mn})),n.d(a,"formatPadding",(function(){return bn})),n.d(a,"cloneEvent",(function(){return xn})),n.d(a,"isViewportChanged",(function(){return wn})),n.d(a,"isNaN",(function(){return _n})),n.d(a,"calculationItemsBBox",(function(){return Sn})),n.d(a,"processParallelEdges",(function(){return En}));var s={};n.r(s),n.d(s,"getSpline",(function(){return Kn})),n.d(s,"getControlPoint",(function(){return Zn})),n.d(s,"pointsToPolygon",(function(){return Qn})),n.d(s,"pathToPoints",(function(){return $n})),n.d(s,"getClosedSpline",(function(){return Jn})),n.d(s,"roundedHull",(function(){return rr})),n.d(s,"paddedHull",(function(){return ir}));var u={};n.r(u),n.d(u,"defaultSubjectColors",(function(){return Dr}));var c={};n.r(c),n.d(c,"leftTranslate",(function(){return Hr})),n.d(c,"leftRotate",(function(){return qr})),n.d(c,"leftScale",(function(){return Kr})),n.d(c,"transform",(function(){return Zr})),n.d(c,"direction",(function(){return Qr})),n.d(c,"angleTo",(function(){return $r})),n.d(c,"vertical",(function(){return Jr}));var l={};n.r(l),n.d(l,"mixColor",(function(){return vi})),n.d(l,"getColorsWithSubjectColor",(function(){return yi})),n.d(l,"getColorSetsBySubjectColors",(function(){return mi}));var f={};n.r(f),n.d(f,"proccessToFunc",(function(){return Gp})),n.d(f,"buildTextureData",(function(){return Fp})),n.d(f,"buildTextureDataWithOneEdgeAttr",(function(){return zp})),n.d(f,"buildTextureDataWithTwoEdgeAttr",(function(){return Up})),n.d(f,"attributesToTextureData",(function(){return Vp})),n.d(f,"arrayToTextureData",(function(){return Wp})),n.d(f,"radialLayout",(function(){return Xp}));var h={};n.r(h),n.d(h,"gpuDetector",(function(){return Yp}));var d={};n.r(d),n.d(d,"default",(function(){return wv})),n.d(d,"assign",(function(){return ev})),n.d(d,"format",(function(){return bv})),n.d(d,"parse",(function(){return xv})),n.d(d,"defaultI18n",(function(){return ov})),n.d(d,"setGlobalDateI18n",(function(){return sv})),n.d(d,"setGlobalDateMasks",(function(){return mv}));var p=n(0),g=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},v={}.toString,y=function(t,e){return v.call(t)==="[object "+e+"]"},m=function(t){return y(t,"Function")},b=function(t){return null==t},x=function(t){return Array.isArray?Array.isArray(t):y(t,"Array")};function w(t){return(w="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 _=function(t){var e=w(t);return null!==t&&"object"===e||"function"===e};var S=function(t,e){if(t)if(x(t))for(var n=0,r=t.length;ne?(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}),K={},Z=function(t){return K[t=t||"g"]?K[t]+=1:K[t]=1,t+K[t]};(function(t,e){if(!m(t))throw new TypeError("Expected a function");var n=function n(){for(var r=[],i=0;i-1})),f=function(i){var o=r[i];if(s[o]||0===s[o])a[o]&&(u[e.id]=Math.min(u[e.id],s[o]));else{var c=n.filter((function(t){return t.id===o}));c.length>0&&t(c[0]),u[e.id]=Math.min(u[e.id],u[o])}},h=0;h0;){var p=o.pop();if(a[p.id]=!1,d.push(p),p===e)break}d.length>0&&c.push(d)}},h=0,d=n;h0&&t(o[0])}},u=0;u0;)f.push(s.pop());o.push(f)}}return o}(t)}var dt=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},pt=dt,gt=function(t,e){return dt(t)[e]?dt(t)[e].inDegree:0},vt=function(t,e){return dt(t)[e]?dt(t)[e].outDegree:0};function yt(t,e,n){!function t(e,n,r,i){i.enter({current:n,previous:r});var o=e.edges;st(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 mt=function(t,e,n){var r,i;void 0===n&&(n=!0);for(var o=[],a=0,s=ht(t,!1);a0;)for(var p=f.pop(),g=p.id,v=st(g,t.edges),y=function(r){var i,a=v[r],s=t.nodes.find((function(t){return t.id===a}));if(a===g)o.push(((i={})[a]=p,i));else if(a in d){if(!d[g].has(s)){for(var u=!0,c=[s,p],l=h[g];d[a].size&&!d[a].has(l)&&(c.push(l),l!==h[l.id]);)l=h[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 y={},m=1;m-1)return f;r.push(u),i.add(u);for(var h=l[u.id],d=0;d0;){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-1}));v-1?p[g.id].push(u[m]):a.push(((i={})[g.id]=g,i))}}return{component:d,adjList:p,minIdx:s}},y=0;y=y})),b=ft({nodes:m,edges:t.edges}).filter((function(t){return t.length>1}));if(0===b.length)break;var x=v(b),w=x.minIdx,_=x.adjList,S=x.component;if(!(S.length>1))break;S.forEach((function(t){o[t.id]=new Set}));var E=s[w];if(e&&n&&-1===e.indexOf(E.id))return a;c(E,E,_),y=w+1}return a},xt=function(t,e,n,r){return void 0===r&&(r=!0),e?bt(t,n,r):mt(t,n,r)},wt=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;){yt(t,Object.keys(i)[0],s)}return e},_t=n(3),St=function(t,e,n,r){var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u=[],c={},l={},f={};o.forEach((function(t,n){var r=t.id;u.push(r),l[r]=1/0,r===e&&(l[r]=0)}));for(var h=o.length,d=function(t){var e=function(t,e,n){for(var r,i=1/0,o=0;ol[e.id]+s?(l[a]=l[e.id]+s,f[a]=[e.id]):l[a]===l[e.id]+s&&f[a].push(e.id)}))},p=0;p0&&c.length>0;){var h=c[c.length-1];if(h.length){var d=h.shift();if(d&&(s.push(d),u[d]=!0,f=r?st(d,a,"target"):st(d,a),c.push(f.filter((function(t){return!u[t]})))),s[s.length-1]===n){var p=s.map((function(t){return t}));l.push(p);g=s.pop();u[g]=!1,c.pop()}}else{var g=s.pop();u[g]=!1,c.pop()}}return l},kt=function(t,e){for(var n=nt(t,e),r=[],i=n.length,o=0;or[o][s]+r[s][a]&&(r[o][a]=r[o][s]+r[s][a]);return r},At=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===r&&(r=1e3);var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u={},c={};o.forEach((function(t,e){var n=ct();t.clusterId=n,u[n]={id:n,nodes:[t]},c[t.id]={node:t,idx:e}}));var l=nt(t,e),f=[],h={};l.forEach((function(t,e){var n=0,r=o[e].id;h[r]={},t.forEach((function(t,e){if(t){n+=t;var i=o[e].id;h[r][i]=t}})),f.push(n)}));for(var d=0,p=function(){var t=!1;if(o.forEach((function(e){var n={};Object.keys(h[e.id]).forEach((function(t){var r=h[e.id][t],i=c[t].node.clusterId;n[i]||(n[i]=0),n[i]+=r}));var r=-1/0,i=[];if(Object.keys(n).forEach((function(t){r=0&&i.splice(o,1),i&&i.length){t=!0;var a=u[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var l=Math.floor(Math.random()*i.length),f=u[i[l]];f.nodes.push(e),e.clusterId=f.id}}})),!t)return"break";d++};d100);)v=g,y++,Object.keys(c).forEach((function(t){var e=0;s.forEach((function(r){var i=r.source,o=r.target,a=l[i].node.clusterId,s=l[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=r[n]||1)})),c[t].sumTot=e})),o.forEach((function(t,e){var r,i=c[t.clusterId],o=0,a=h[e]/(2*p),u=0;i.nodes.forEach((function(t){var n=l[t.id].idx;u+=f[e][n]||0}));var g=u-i.sumTot*a,v=d[t.id];if(Object.keys(v).forEach((function(n){var i=l[n].node.clusterId;if(i!==t.clusterId){var s=c[i],u=s.nodes;if(u&&u.length){var h=0;u.forEach((function(t){var n=l[t.id].idx;h+=f[e][n]||0}));var d=h-s.sumTot*a-g;d>o&&(o=d,r=s)}}})),o>0){r.nodes.push(t);var y=t.clusterId;t.clusterId=r.id;var m=i.nodes.indexOf(t);i.nodes.splice(m,1);var b=0,x=0;s.forEach((function(t){var e=t.source,i=t.target,o=l[e].node.clusterId,a=l[i].node.clusterId;(o===r.id&&a!==r.id||a===r.id&&o!==r.id)&&(b+=t[n]||1),(o===y&&a!==y||a===y&&o!==y)&&(x+=t[n]||1)})),r.sumTot=b,i.sumTot=x}}));var m={},b=0;Object.keys(c).forEach((function(t){var e=c[t];if(e.nodes&&e.nodes.length){var n=String(b+1);n!==t&&(e.id=n,e.nodes=e.nodes.map((function(t){return{id:t.id,clusterId:n}})),c[n]=e,m[t]=n,delete c[t],b++)}else delete c[t]})),o.forEach((function(t){t.clusterId&&m[t.clusterId]&&(t.clusterId=m[t.clusterId])}));var x=[],w={};s.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=l[e].node.clusterId,a=l[r].node.clusterId,s=o+"---"+a;if(w[s])w[s].weight+=i,w[s].count++;else{var u={source:o,target:a,weight:i,count:1};w[s]=u,x.push(u)}}));var _=[];return Object.keys(c).forEach((function(t){_.push(c[t])})),{clusters:_,clusterEdges:x}},It=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e0&&(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&&r0?n=r:null!==i&&i0&&(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}(),Nt=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 c=new Dt((function(t,n){return e?t.weight-n.weight:0}));for(ut(s.id,a).forEach((function(t){c.insert(t)}));!c.isEmpty();){var l=c.delMin(),f=l.source,h=l.target;u.has(f)&&u.has(h)||(n.push(l),u.has(f)||(u.add(f),ut(f,a).forEach((function(t){c.insert(t)}))),u.has(h)||(u.add(h),ut(h,a).forEach((function(t){c.insert(t)}))))}return n},jt=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 It(i.map((function(t){return t.id})));s.length>0;){var c=s.shift(),l=c.source,f=c.target;u.connected(l,f)||(n.push(c),u.union(l,f))}return n},Rt=function(t,e,n){return n?{prim:Nt,kruskal:jt}[n](t,e):jt(t,e)},Lt=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,u=void 0===s?[]:s,c=t.edges,l=void 0===c?[]:c,f=u.length,h={},d={},p=0;p0&&i>e;){o=0;for(p=0;p0&&(r+=d[b]/x)}h[v]=n*r,o+=h[v]}}o=(1-o)/f,i=0;for(p=0;p=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,i=n.toNode;rf||r.hasNode(o[l.to])||(e.labelp;v--){if("break"===g(v))break}if(h){var y=t.findMinLabel(f);o.dfsEdgeList.push(new zt(l,d,"-1",y.edgeLabel,"-1"));var m=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[m]===o.dfsEdgeList[m]&&a(f[y.edgeLabel].projected)}var b={};h=!1;var x=0;s.forEach((function(e){var n=new Vt(e),o=t.findForwardPureEdges(r,n.edges[u[0]],c,n);o.length>0&&(h=!0,x=l,o.forEach((function(t){var n=t.label+"-"+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(h)return"break";var n=u[e];s.forEach((function(e){var a=new Vt(e),s=t.findForwardRmpathEdges(r,a.edges[n],c,a);s.length>0&&(h=!0,x=o.dfsEdgeList[n].fromNode,s.forEach((function(t){var n=t.label+"-"+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=0;f--){var h=e.findBackwardEdge(u,l.edges[r[f]],l.edges[r[0]],l);if(h){var d=e.dfsCode.dfsEdgeList[r[f]].fromNode+"-"+h.label;s[d]||(s[d]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[f]].fromNode,edgeLabel:h.label}),s[d].projected.push({graphId:t.graphId,edge:h,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(u,l.edges[r[0]],o,l).forEach((function(e){var n=i+"-"+e.label+"-"+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=e.dfsCode.dfsEdgeList[r[n]].fromNode+"-"+i.label+"-"+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(f=0;fi){var a=i;i=r,r=a}var l=t.label,f=n+"-"+r+"-"+l+"-"+i,h=r+"-"+l+"-"+i;if(!o[h]){var d=o[h]||0;d++,o[h]=d}s[f]={graphId:n,nodeLabel1:r,edgeLabel:l,nodeLabel2:i}}))}))})),Object.keys(i).forEach((function(t){if(!(i[t]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}},ee=function(t,e,n,r,i,o,a){if(void 0===n&&(n=!1),void 0===o&&(o="cluster"),void 0===a&&(a="cluster"),t&&t.nodes){var s=t.nodes.length;if(s){var u=kt(t,n),c=kt(e,n),l=$t(t.nodes,u,n),f=$t(e.nodes,c,n),h=Zt(t.nodes,o),d=h.nodeMap,g=h.nodeLabelMap,v=Zt(e.nodes,o),y=v.nodeMap,m=v.nodeLabelMap;Qt(t.edges,a,d);var b=Qt(e.edges,a,y).edgeLabelMap;i||(i=Math.max.apply(Math,Object(p.__spreadArray)(Object(p.__spreadArray)([],c[0]),[2]))),r||(r=i);var x=Yt(t,u,o,r),w=Yt(e,c,o,r),_=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,f=t.neighborNum-1;u2*e)););if(d<2*e&&(a[r+"-"+h]={start:r,end:h,distance:i[r][h]},u++,++s>=n))return a;if(++c>2*e)break}uL[r][f]){c=!0;break}if(c)return P.splice(e,1),"continue";var p={};i.neighbors.forEach((function(t){var e=l[n.id+"-"+t.id];p[n.id+"-"+t.id]={start:d[n.id].idx,end:d[t.id].idx,distance:e}})),S=qt(p,x,t,S);var g=[];Object.keys(p).forEach((function(t){if(C[t])g.push(C[t]);else{var e=S[t];C[t]=Kt(e,A,o,a),g.push(C[t])}})),g=g.sort((function(t,e){return e-t}));var v=!1;for(f=0;f=0;g--)p(g)}));var G=[];P.forEach((function(r){for(var s=d[r.id].idx,c=Ht(t.nodes,u[s],s,o,i).neighbors,f=!1,h=c.length-1;h>=0;h--){if(c.length+1L[g][w])c.splice(h,1);else{if(n){var _=p.id+"-"+r.id,E=l[_];if(w=B[g].length-1,E>B[g][w]){c.splice(h,1);continue}}var O=C[v]?C[v]:Jt(t,r,p,d,b,x,A,o,a,C,S),M=T.id+"-"+g;if(O=0;g--){if("break"===_(g))break}if(w)return G.splice(r,1),"continue";i.edges=l;var S=St(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]z[r][z[r].length-1]){e=c[t].node[o];if(u[e]--,u[e]=0;M--){var k=i.nodes[M],A=c[k.id].degree,C=c[k.id].inDegree,I=c[k.id].outDegree,P=k[o],N=te(D,P,y,m),j=N.minPatternNodeLabelDegree,R=N.minPatternNodeLabelInDegree,L=N.minPatternNodeLabelOutDegree;if(n?A=0;B--){var F=l[B];if(!c[F.source]||!c[F.target]){l.splice(B,1);var U=F[a];if(f[U]--,c[F.source]&&(c[F.source].degree--,c[F.source].outDegree--),c[F.target]&&(c[F.target].degree--,c[F.target].inDegree--),b[U]&&f[U]=0;V--){if("break"===U(V))break}var W=G.length,X=function(t){var e=G[t],n={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+t.label;n[e]?n[e]++:n[e]=1}));for(var r=function(t){var e=G[t],r={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+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&&G.splice(t,1)},i=W-1;i>t;i--)r(i);W=G.length};for(V=0;V<=W-1;V++)X(V);return G}}},ne=function(){function t(t){void 0===t&&(t=10),this.linkedList=new ot,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}(),re=wt,ie={getAdjMatrix:nt,breadthFirstSearch:lt,connectedComponent:ht,getDegree:pt,getInDegree:gt,getOutDegree:vt,detectCycle:wt,detectDirectedCycle:re,detectAllCycles:xt,detectAllDirectedCycle:bt,detectAllUndirectedCycle:mt,depthFirstSearch:yt,dijkstra:St,findAllPath:Mt,findShortestPath:Ot,floydWarshall:kt,labelPropagation:At,louvain:Tt,minimumSpanningTree:Rt,pageRank:Lt,getNeighbors:st,Stack:ne,GADDI:ee},oe=et.a.transform,ae=function(t){return function(e,n){return e[t]-n[t]}},se=function(t,e,n){return t>=e&&t<=n},ue=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,f=1/l;if(l*l>1e-4*(a*a+s*s)*(u*u+c*c)){var h=(i*c-o*u)*f,d=(i*s-o*a)*f;return se(h,0,1)&&se(d,0,1)?{x:t.x+h*a,y:t.y+h*s}:null}return null},ce=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;ce[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e},me=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},be=function(t,e){t.translate(e.x,e.y)},xe=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,f=0,h=0,d=0;t.animate((function(t){return i=oe(i,[["t",(h=u*t)-l,(d=c*t)-f]]),l=h,f=d,{matrix:i}}),r)}else{var p=oe(i,[["t",a,s]]);t.setMatrix(p)}},we=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=e;x(e)||(r=[e,e]),x(e)&&1===e.length&&(r=[e[0],e[0]]),n=oe(n,[["s",r[0],r[1]]]),t.setMatrix(n)},_e=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=oe(n,[["r",e]]),t.setMatrix(n)},Se=function(t,e,n){for(var r=[],i=0;i0!=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},Me=function(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY1){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(!Me(i,o))return!1;var a=!1;if(S(e,(function(e){if(Oe(t,e[0],e[1]))return a=!0,!1})),a)return!0;if(S(t,(function(t){if(Oe(e,t[0],t[1]))return a=!0,!1})),a)return!0;var s=r(t),u=r(e),c=!1;return S(u,(function(t){if(function(t,e){var n=!1;return S(t,(function(t){if(ue(t.from,t.to,e.from,e.to))return n=!0,!1})),n}(s,t))return c=!0,!1})),c},Ae=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}(),Ce=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]},Te=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},Ie=function(t,e){for(var n=["top","left","bottom","right"],r=t.getBBox(),i=0,o=[],a=0;a<4;a++){var s=Ce(r,n[a]),u=s[0],c=s[1],l=s[2],f=s[3];o[a]=ue({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:u,y:c},{x:l,y:f}),o[a]&&(i+=1)}return[o,i]},Pe=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=Ce(r,n[a]),u=s[0],c=s[1],l=s[2],f=s[3],h=Te(e,new Ae(u,c,l,f));(h=Math.abs(h-.5))>=0&&h<=1&&(o+=1,i=h0){for(var r=0,i=t;re.x+e.width,i=t.y>e.y+e.height,o=t.y":.604998779296875,"/":.5,"?":.53699951171875},Ze=Math.PI,Qe=Math.sin,$e=Math.cos,Je=Qe(Ze/8),tn=$e(Ze/8),en=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=he(r,o),i=he(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}},nn=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||qe.defaultLoopPosition,s=[n[6],n[7]],u=[t.startPoint.x,t.startPoint.y],c=[t.endPoint.x,t.endPoint.y],l=r.height/2,f=r.height/2,h=l*Je,d=l*tn,p=f*Je,g=f*tn;if(u[0]===c[0]&&u[1]===c[1]){switch(a){case"top":u=[s[0]-h,s[1]-d],c=[s[0]+p,s[1]-g];break;case"top-right":l=r.height/2,f=r.width/2,u=[s[0]+(h=l*Je),s[1]-(d=l*tn)],c=[s[0]+(g=f*tn),s[1]-(p=f*Je)];break;case"right":l=r.width/2,f=r.width/2,u=[s[0]+(d=l*tn),s[1]-(h=l*Je)],c=[s[0]+(g=f*tn),s[1]+(p=f*Je)];break;case"bottom-right":l=r.width/2,f=r.height/2,u=[s[0]+(d=l*tn),s[1]+(h=l*Je)],c=[s[0]+(p=f*Je),s[1]+(g=f*tn)];break;case"bottom":l=r.height/2,f=r.height/2,u=[s[0]+(h=l*Je),s[1]+(d=l*tn)],c=[s[0]-(p=f*Je),s[1]+(g=f*tn)];break;case"bottom-left":l=r.height/2,f=r.width/2,u=[s[0]-(h=l*Je),s[1]+(d=l*tn)],c=[s[0]-(g=f*tn),s[1]+(p=f*Je)];break;case"left":l=r.width/2,f=r.width/2,u=[s[0]-(d=l*tn),s[1]+(h=l*Je)],c=[s[0]-(g=f*tn),s[1]-(p=f*Je)];break;case"top-left":l=r.width/2,f=r.height/2,u=[s[0]-(d=l*tn),s[1]-(h=l*Je)],c=[s[0]-(p=f*Je),s[1]-(g=f*tn)];break;default:l=r.width/2,f=r.width/2,u=[s[0]-(h=l*Je),s[1]-(d=l*tn)],c=[s[0]+(p=f*Je),s[1]-(g=f*tn)]}if(!1===i.clockwise){var v=[u[0],u[1]];u=[c[0],c[1]],c=[v[0],v[1]]}}var y=[u[0]-s[0],u[1]-s[1]],m=(l+o)/l,b=(f+o)/f;!1===i.clockwise&&(m=(f+o)/f,b=(l+o)/l);var x=et.c.scale([0,0],y,m),w=[s[0]+x[0],s[1]+x[1]],_=[c[0]-s[0],c[1]-s[1]],S=et.c.scale([0,0],_,b),E=[s[0]+S[0],s[1]+S[1]];return t.startPoint={x:u[0],y:u[1]},t.endPoint={x:c[0],y:c[1]},t.controlPoints=[{x:w[0],y:w[1]},{x:E[0],y:E[1]}],t},rn=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*Ze),n&&(a.x+=$e(u)*n,a.y+=Qe(u)*n),r){var c=u-Ze/2;u>.5*Ze&&u<1.5*Ze&&(c-=Ze),a.x+=$e(c)*r,a.y+=Qe(c)*r}var l={x:a.x,y:a.y,angle:u};return i?(u>.5*Ze&&u<1.5*Ze&&(u-=Ze),Object(p.__assign)({rotate:u},l)):l},on=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},an=function(t,e){"function"==typeof e&&on(t,e)},sn=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)},un=function(t,e){return e*(Ke[t]||1)},cn=function(t,e){var n=0,r=new RegExp("[涓€-榫+");return t.split("").forEach((function(t){r.test(t)?n+=e:n+=un(t,e)})),[n,e]},ln=function(t,e){var n=[],r={},i={};t.forEach((function(t){i[t.id]=t})),t.forEach((function(t,e){var o=F(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 u={id:a.parentId,children:[a]};r[a.parentId]=u,r[o.id]=o}}else if(A(t.parentId)){var c=r[t.parentId];if(c)c.children?c.children.push(o):c.children=[o],r[o.id]=o;else{var l={id:t.parentId,children:[o]};r[l.id]=l,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,on(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-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||an(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 f=r.depth;an(r,(function(t){return"node"===t.itemType?f+=2:f+=1,t.depth=f,!0}))}return t},hn=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.maxXn&&(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}},En=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={},f=0;fl&&(f=l),t.zoom(f,a)||console.warn("zoom failed, ratio out of range, ratio: %f",f)}},t.prototype.getFormatPadding=function(){var t=this.graph.get("fitViewPadding");return bn(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,f=0,h=0;this.graph.get("canvas").animate((function(t){f=s*t,h=u*t,r.graph.translate(f-c,h-l),c=f,l=h}),Object(p.__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]),de({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]),he({x:t,y:e},n)},t.prototype.focus=function(t,e,n){if(A(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(!P(t)||!P(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 Mn(t){return(Mn="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 kn(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;er.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=cn(a.text,a.fontSize||12)[0],r=16,s.y+=r,s.height=r,s.width=i,t.attrs=Object(p.__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(p.__assign)(Object(p.__assign)({},t.attrs),t.bbox),t}function Cn(t){var e={},n=function(e){var n=function(t){return function(e){for(var n=t.length,r=[],i=0,o="";i0||(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),f=n.children||[],h=e.children||[],d=0;d-1)return;n.push(i)}else s>-1&&n.splice(s,1)}else if(A(e)){var u=n.filter((function(t){return t.includes(o)}));u.length>0&&this.clearStates(u),(a=a.filter((function(t){return!t.includes(o)}))).push(i),this.set("states",a)}if(r){var c=this.get("model").type;r.setState(c,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),A(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)B(a,t.stateStyles),delete t.stateStyles;Object.assign(n,t),o.x===t.x&&o.y===t.y||this.updatePosition(t),this.updateShape()}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(),be(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(),this.clearCache(),e.remove(),this._cfg=null,this.destroyed=!0}},t}(),Ln={source:"start",target:"end"},Bn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.__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=Ln[t]+"Point",r=t+"Node",i=this.get(r);i&&!i.destroyed&&i.removeEdge(this),M(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=Ln[t]+"Point",i=t+"Node",o=this.get(r);if(!o){var a=this.get(i),s=t+"Anchor",u=this.getPrePoint(t,n),c=e[s];b(c)||(o=a.getLinkPointByAnchor(c)),o=o||a.getLinkPoint(u),b(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=Ln[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=Ln[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="move"===n?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"),A(t.source)||M(t.source)||(t.source=t.source.getID()),A(t.target)||M(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");t.stateStyles&&(B(o,t.stateStyles),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}(Rn),Gn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.__extends)(e,t),e.prototype.getNearestPoint=function(t,e){for(var n=0,r=t[0],i=ge(t[0],e),o=0;o-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=!b(t.x),s=!b(t.y),u=Object.keys(t);return 1===u.length&&(a||s)||2===u.length&&a&&s?"move":P(t.x)||P(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":"style"}},e}(Rn),Fn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.__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||qe.defaultCombo.size[0]/2,width:n.width||qe.defaultCombo.size[0],height:n.height||qe.defaultCombo.size[1]};r.style=Object(p.__assign)(Object(p.__assign)(Object(p.__assign)({},e),t.style),i);var o=t.padding||qe.defaultCombo.padding;return P(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=en(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(),this.clearCache(),this.set("sizeCache",null),this.set("bbox",null),e.remove(),this._cfg=null,this.destroyed=!0}},e}(Gn),zn=function(){function t(t){var e=this;this.edgeToBeUpdateMap={},this.throttleRefresh=q((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=j(r),a=null,s=n.get(r+j("stateStyles"))||{},u=n.get("default"+o);e.stateStyles&&(s=e.stateStyles),u&&S(u,(function(t,n){_(t)&&!x(t)?e[n]=V({},t,e[n]):x(t)?e[n]=e[n]||F(u[n]):e[n]=e[n]||u[n]}));var c=n.get(r+"Mapper");if(c){var l=c(e);l.stateStyles&&(s=l.stateStyles,delete l.stateStyles),S(l,(function(t,n){_(t)&&!x(t)?e[n]=V({},e[n],t):e[n]=l[n]||e[n]}))}if(n.emit("beforeadditem",{type:t,model:e}),"edge"===t||"vedge"===t){var f=void 0,h=void 0;if(f=e.source,h=e.target,f&&A(f)&&(f=n.findById(f)),h&&A(h)&&(h=n.findById(h)),!f||!h)return void console.warn("The source or target node of edge "+e.id+" does not exist!");f.getType&&"combo"===f.getType()&&(e.isComboEdge=!0),h.getType&&"combo"===h.getType()&&(e.isComboEdge=!0),a=new Bn({model:e,source:f,target:h,styles:s,linkCenter:n.get("linkCenter"),group:i.addGroup()})}else if("node"===t)a=new Gn({model:e,styles:s,group:i.addGroup()});else if("combo"===t){var d=e.children,p=hn(d,n);isNaN(p.x)?isNaN(e.x)&&(e.x=100*Math.random()):e.x=p.x,isNaN(p.y)?isNaN(e.y)&&(e.y=100*Math.random()):e.y=p.y;var g=i.addGroup();g.setZIndex(e.depth);var v=(a=new Fn({model:e,styles:s,bbox:e.collapsed?hn([],n):p,group:g})).getModel();(d||[]).forEach((function(t){var e=n.findById(t.id);a.addChild(e),t.depth=v.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(A(t)&&(t=o.findById(t)),t&&!t.destroyed){var a="";t.getType&&(a=t.getType());var s=o.get(a+"Mapper"),u=t.getModel(),c=t.getUpdateType(e);if(s){var l=s(V({},u,e)),f=V({},u,l,e);l.stateStyles&&(t.set("styles",f.stateStyles),delete f.stateStyles),S(f,(function(t,n){e[n]=t}))}else S(e,(function(t,n){u[n]&&_(t)&&!x(t)&&(e[n]=Object(p.__assign)(Object(p.__assign)({},u[n]),e[n]))}));if(o.emit("beforeupdateitem",{item:t,cfg:e}),"edge"===a){if(e.source){var h=e.source;A(h)&&(h=o.findById(h)),t.setSource(h)}if(e.target){var d=e.target;A(d)&&(d=o.findById(d)),t.setTarget(d)}t.update(e)}if("node"===a||"combo"===a){t.update(e,c);var g=t.getEdges(),v="bbox"===c||"move"===c;if("node"===a)"move"===c?S(g,(function(t){i.edgeToBeUpdateMap[t.getID()]={edge:t,updateType:c},i.throttleRefresh()})):v&&S(g,(function(t){t.refresh()}));else if(v&&"combo"===a){var y=t.get("shapeFactory"),m=u.type||"circle";(void 0===u.animate||void 0===e.animate?null===(r=null===(n=y[m])||void 0===n?void 0:n.options)||void 0===r?void 0:r.animate:u.animate||e.animate)?setTimeout((function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&S(g,(function(t){t&&!t.destroyed&&t.refresh()}))}}),201):S(g,(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(A(t)&&(t=o.findById(t)),t&&!t.destroyed){var a=t.getModel(),s=hn(a.collapsed?[]:e,o),u=a.collapsed?hn(e,o):s,c=u.x,l=u.y;t.set("bbox",s),t.update({x:c,y:l});var f=t.get("shapeFactory"),h=a.type||"circle";(void 0===a.animate?null===(r=null===(n=f[h])||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-1&&o.splice(a,1),"edge"===i){var s=n.get("v"+i+"s"),u=s.indexOf(t);u>-1&&s.splice(u,1)}var c=t.get("id");delete n.get("itemMap")[c];var l=n.get("comboTrees"),f=t.get("id");if("node"===i){var h=t.getModel().comboId;if(l&&h){var d=l,p=!1;l.forEach((function(t){p||an(t,(function(t){if(t.id===f&&d){var e=d.indexOf(t);return d.splice(e,1),p=!0,!1}return d=t.children,!0}))}))}for(var g=(b=t.getEdges()).length-1;g>=0;g--)n.removeItem(b[g],!1);h&&n.updateCombo(h)}else if("combo"===i){var v,y=t.getModel().parentId,m=!1;(l||[]).forEach((function(t){m||an(t,(function(t){return t.id!==f||(v=t,m=!0,!1)}))})),v.removed=!0,v&&v.children&&v.children.forEach((function(t){e.removeItem(t.id)}));var b;for(g=(b=t.getEdges()).length;g>=0;g--)n.removeItem(b[g],!1);y&&n.updateCombo(y)}t.destroy(),n.emit("afterremoveitem",{item:r})}},t.prototype.setItemState=function(t,e,n){var r=this.graph,i=e;A(n)&&(i=e+":"+n),t.hasState(i)===n&&n||A(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;A(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;A(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;A(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){sn(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(A(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();S(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=[],u=!1;(o||[]).forEach((function(t){u||t.children&&0!==t.children.length&&an(t,(function(t){return t.id!==a||(s=t.children,u=!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();S(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}(),Un=null,Vn=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)),Un&&clearTimeout(Un),Un=setTimeout((function(){Un=null,i.updateGraphStates()}),16)}},t.prototype.updateStates=function(t,e,n){var r=this;A(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;S(e.disabled,(function(e,n){t[n]&&(t[n]=t[n].filter((function(t){return e.indexOf(t)<0&&!e.destroyed})))})),S(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,Un&&clearTimeout(Un),Un=null,this.destroyed=!0},t}();var Wn="\t\n\v\f\r 聽釟€釥庘€€鈥佲€傗€冣€勨€呪€嗏€団€堚€夆€娾€仧銆€\u2028\u2029",Xn=new RegExp("([a-z])["+Wn+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Wn+"]*,?["+Wn+"]*)+)","ig"),Yn=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+Wn+"]*,?["+Wn+"]*","ig");function Hn(t){if(!t)return null;if(x(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(Xn,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(Yn,(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}Math.PI;var qn=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},Kn=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;nr;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}(e);return s.unshift(["M",t[0].x,t[0].y]),s},Zn=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];et.c.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},Qn=function(t,e){var n=t.length;if(!n)return"";for(var r="",i=0;i0?s-1:o-1,c=et.c.normalize([0,0],et.c.add([0,0],a[u].v,et.c.scale([0,0],a[s].v,-1)));a[s].p=et.c.add([0,0],a[s].p,et.c.scale([0,0],c,e))}return a.map((function(t){var e=t.p;return{x:e[0],y:e[1]}}))}var or=function(t,e,n){return(t.y-n.y)*(e.x-n.x)-(t.x-n.x)*(e.y-n.y)},ar=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=2&&or(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&&or(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)},sr={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 ur(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-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;tn&&15!==o(t,s)&&(r=a(t,s));return r}}var cr=function(t,e){var n=Number.POSITIVE_INFINITY,r=null;return t.forEach((function(t){var i=Pe(t,e);i>=0&&i0?t+1:t}),0);s*Math.pow(c+1,2)0;){var r=t.pop();if(0===t.length){n.push(r);break}var i=t.pop(),o=new Ae(r.x1,r.y1,i.x2,i.y2);cr(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||(Re(t,{x:e.x1,y:e.y1})||Re(t,{x:e.x2,y:e.y2}))&&(n=!0)})),n},c=function(t,e){for(var n=0,r=e;n=1;)h=dr(n,l/=1.5,f,s),d=u(h,o)||u(h,i),p=c(h,e);!h||d||s&&p||(o.push(new Ae(t.x1,t.y1,h.x,h.y)),o.push(new Ae(h.x,h.y,t.x2,t.y2)),a=!0)};h(!0),a||h(!1)}}a||i.push(t),s+=1};!a&&o.length;)l()}for(;o.length;)i.push(o.pop());return i}(new Ae(t.getModel().x,t.getModel().y,o.getModel().x,o.getModel().y),e,r,i))}var fr=function(t,e,n){var r=Object.assign(sr,n),i=De(t.map((function(t){return{x:t.getModel().x,y:t.getModel().y}})));t=t.sort((function(t,e){return Ne({x:t.getModel().x,y:t.getModel().y},i)-Ne({x:e.getModel().x,y:e.getModel().y},i)}));var o=[],a=[];t.forEach((function(t){lr(t,e,o,r.maxRoutingIterations,r.morphBuffer).forEach((function(t){a.push(t)})),o.push(t)}));for(var s,u,c,l,f,h=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;or.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=h.width,u=h.height,c=r.pixelGroupSize,l=Math.ceil(s/c),f=Math.ceil(u/c),{cells:new Float32Array(Math.max(0,l*f)).fill(0),width:l,height:f}),p=[],g=[],v=0;v1)for(m=Math.floor(y.length/r.skip);m<3&&r.skip>1;)r.skip-=1,m=Math.floor(y.length/r.skip);for(var b=0,x=0;x0))break;r.nonMemberInfluenceFactor*=.8}}return g};function hr(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)]},f=function(t,e){for(var n=t.getBBox(),a=l(n,o.nodeR1),u=a[0],c=a[1],f=a[2],h=a[3],d=c;du.y?r?c.topLeft:c.bottomRight:r?c.topRight:c.bottomLeft:a.ys.x?r?c.topLeft:c.bottomRight:r?c.bottomLeft:c.topRight:o.x0?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":r=Hn(i=rr((n=ar(t)).map((function(t){return[t.x,t.y]})),this.padding));break;case"smooth-convex":2===(n=ar(t)).length?r=Hn(i=rr(n.map((function(t){return[t.x,t.y]})),this.padding)):n.length>2&&(i=ir(n.map((function(t){return[t.x,t.y]})),this.padding),r=Jn(i));break;case"bubble":r=(n=fr(t,e,this.cfg.bubbleCfg)).length>=2&&Jn(n)}return r},t.prototype.render=function(){this.group.addShape("path",{attrs:Object(p.__assign)({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id}),this.group.toBack()},t.prototype.addMember=function(t){if(t){A(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){A(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){A(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){A(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 A(t)?n.graph.findById(t):t}))),e&&(this.nonMembers=e.map((function(t){return A(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(p.__assign)({},t))},t.prototype.updateCfg=function(t){var e=this;this.cfg=V(this.cfg,t),this.id=this.cfg.id,this.group=this.cfg.group,t.members&&(this.members=this.cfg.members.map((function(t){return A(t)?e.graph.findById(t):t}))),t.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map((function(t){return A(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=A(t)?this.graph.findById(t):t).getKeyShape();if("path"===e.get("type"))n=$n(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]})),ke(n,$n(this.path))},t.prototype.destroy=function(){this.group.remove(),this.cfg=null},t}(),gr=et.a.transform,vr=function(t){function e(e){var n=t.call(this)||this;return n.cfg=V(n.getDefaultCfg(),e),n.init(),n.animating=!1,n.destroyed=!1,n.cfg.enabledStack&&(n.undoStack=new ne(n.cfg.maxStep),n.redoStack=new ne(n.cfg.maxStep)),n}return Object(p.__extends)(e,t),e.prototype.init=function(){this.initCanvas();var t=new On(this),e=new vn(this),n=new zn(this),r=new Vn(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"),e=(null==t?void 0:t.get("el")).id,n=t.addGroup({id:e+"-root",className:qe.rootContainerClassName});if(this.get("groupByTypes")){var r=n.addGroup({id:e+"-edge",className:qe.edgeContainerClassName}),i=n.addGroup({id:e+"-node",className:qe.nodeContainerClassName}),o=n.addGroup({id:e+"-combo",className:qe.comboContainerClassName});o.toBack(),this.set({nodeGroup:i,edgeGroup:r,comboGroup:o})}var a=n.addGroup({id:e+"-delegate",className:qe.delegateContainerClassName});this.set({delegateGroup:a}),this.set("group",n)},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 M(t)?this.cfg=Object(p.__assign)(Object(p.__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){A(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 S(r,(function(t,r){if(e(t,r))return n=t})),n},e.prototype.findAll=function(t,e){var n=[];return S(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=F(n.getMatrix());r||(r=[1,0,0,0,1,0,0,0,1]),r=gr(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");xe(i,{x:t,y:e},n,r||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:i.getMatrix()})},e.prototype.fitView=function(t){t&&this.set("fitViewPadding",t),this.get("viewController").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){var n=this.get("group"),r=F(n.getMatrix()),i=this.get("minZoom"),o=this.get("maxZoom");return r||(r=[1,0,0,0,1,0,0,0,1]),r=gr(r,e?[["t",-e.x,-e.y],["s",t,t],["t",e.x,e.y]]:[["s",t,t]]),!(i&&r[0]o)&&(n.setMatrix(r),this.emit("viewportchange",{action:"zoom",matrix:r}),this.autoPaint(),!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(A(t)&&(n=this.findById(t)),!n&&A(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(p.__assign)(Object(p.__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(p.__assign)(Object(p.__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 u=fn(this.get("comboTrees"));this.set("comboTrees",u)}}},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&&!A(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 u=this.get("itemMap"),c=!1;if(s.forEach((function(n){c||sn(n,(function(n){if(e.parentId===n.id){c=!0;var r=Object(p.__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=u[n.id];return c&&i&&i.getType&&"combo"===i.getType()&&o.updateCombo(i,n.children),!0}))})),!c){var l=Object(p.__assign)({id:e.id,depth:0},e);e.depth=l.depth,s.push(l),a=o.addItem(t,e)}this.set("comboTrees",s)}else if("node"===t&&A(e.comboId)&&s){var f;(f=this.findById(e.comboId))&&f.getType&&"combo"!==f.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 h=this.get("itemMap"),d=!1,g=!1;(s||[]).forEach((function(t){g||d||sn(t,(function(t){if(t.id===e.id)return g=!0,!1;if(e.comboId===t.id&&!g){d=!0;var n=F(e);n.itemType="node",t.children?t.children.push(n):t.children=[n],n.depth=t.depth+1}return d&&h[t.id].getType&&"combo"===h[t.id].getType()&&o.updateCombo(h[t.id],t.children),!0}))}))}else a=o.addItem(t,e);if("node"===t&&e.comboId||"combo"===t&&e.parentId)(f=this.findById(e.comboId||e.parentId))&&f.getType&&"combo"===f.getType()&&f.addChild(a);var v=this.get("combos");if(v&&v.length>0&&this.sortCombos(),this.autoPaint(),n&&this.get("enabledStack")){var y=Object(p.__assign)(Object(p.__assign)({},a.getModel()),{itemType:t}),m={};switch(t){case"node":m.nodes=[y];break;case"edge":m.edges=[y];break;case"combo":m.combos=[y]}this.pushStack("add",{before:{},after:m})}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=A(t)?this.findById(t):t;var a=F(i.getModel()),s="";i.getType&&(s=i.getType());var u=Object(p.__spreadArray)([],i.getStates());if("combo"===s&&S(u,(function(t){return r.setItemState(i,t,!1)})),o.updateItem(i,e),"combo"===s&&S(u,(function(t){return r.setItemState(i,t,!0)})),n&&this.get("enabledStack")){var c={nodes:[],edges:[],combos:[]},l={nodes:[],edges:[],combos:[]},f=Object(p.__assign)({id:a.id},e);switch(s){case"node":c.nodes.push(a),l.nodes.push(f);break;case"edge":c.edges.push(a),l.edges.push(f);break;case"combo":c.combos.push(a),l.combos.push(f)}"node"===s&&c.nodes.push(a),this.pushStack("update",{before:c,after:l})}},e.prototype.update=function(t,e,n){void 0===n&&(n=!0),this.updateItem(t,e,n)},e.prototype.setItemState=function(t,e,n){A(t)&&(t=this.findById(t)),this.get("itemController").setItemState(t,e,n);var r=this.get("stateController");A(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){gn(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"),S(r,(function(e){t.add("node",e,!1,!1)})),s&&0!==s.length){var u=ln(s,r);this.set("comboTrees",u),t.addCombos(s)}S(o,(function(e){t.add("edge",e,!1,!1)}));var c=t.get("animate");(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",!1);var l=t.get("layoutController");if(l){if(l.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",c)})),this.destroyed)return}else t.get("fitView")&&t.fitView(),t.get("fitCenter")&&t.fitCenter(),t.emit("afterrender"),t.set("animate",c);this.get("groupByTypes")||(s&&0!==s.length?this.sortCombos():e.nodes&&e.edges&&e.nodes.length=0;l--)c[l].destroyed&&c.splice(l,1);s&&(n.addCombos(s),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",a,t.edges),S(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(A(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){sn(t,(function(t){return t.id!==i||(t.itemType="combo",t.children=o,!1)}))})),a&&this.sortCombos()}},e.prototype.uncombo=function(t){var e=this,n=t;if(A(t)&&(n=this.findById(t)),!n||n.getType&&"combo"!==n.getType())console.warn("The item is not a combo!");else{var r=n.getModel().parentId,i=this.get("comboTrees");i||(i=[]);var o,a=this.get("itemMap"),s=n.get("id"),u=[],c=this.get("combos"),l=this.findById(r);if(i.forEach((function(t){o||sn(t,(function(t){if(t.id===s){o=t,n.getEdges().forEach((function(t){e.removeItem(t,!1)}));var i=c.indexOf(n);c.splice(i,1),delete a[s],n.destroy(),e.emit("afterremoveitem",{item:n})}return!r||!o||t.id!==r||(l.removeCombo(n),-1!==(i=(u=t.children).indexOf(o))&&u.splice(i,1),o.children.forEach((function(t){var n=e.findById(t.id),i=n.getModel();n.getType&&"combo"===n.getType()?(t.parentId=r,delete t.comboId,i.parentId=r,delete i.comboId):n.getType&&"node"===n.getType()&&(t.comboId=r,i.comboId=r),l.addChild(n),u.push(t)})),!1)}))})),!r&&o){var f=i.indexOf(o);i.splice(f,1),o.children.forEach((function(t){t.parentId=void 0;var n=e.findById(t.id).getModel();delete n.parentId,delete n.comboId,"node"!==t.itemType&&i.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){sn(e,(function(e){if(!e)return!0;var i=r[e.id];if(i&&i.getType&&"combo"===i.getType()){var o=Object(p.__spreadArray)([],i.getStates());S(o,(function(e){return t.setItemState(i,e,!1)})),n.updateCombo(i,e.children),S(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(A(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){sn(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(p.__spreadArray)([],r.getStates());S(i,(function(t){r.getStateStyle(t)&&n.setItemState(r,t,!1)})),o.updateCombo(r,t.children),S(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=A(t)?this.findById(t):t).getModel(),a=o.comboId||o.parentId,s="";if(r.getType&&(s=r.getType()),e&&"combo"===s){var u,c=this.get("comboTrees"),l=!0;if((c||[]).forEach((function(t){u||an(t,(function(t){if(!u)return t.id===r.getID()&&(u=t),!0}))})),an(u,(function(t){return t.id!==e||(l=!1,!1)})),!l)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={},h={};"combo"===s?(f.combos=[{id:o.id,parentId:o.parentId}],h.combos=[{id:o.id,parentId:e}]):"node"===s&&(f.nodes=[{id:o.id,parentId:o.comboId}],h.nodes=[{id:o.id,parentId:e}]),this.pushStack("updateComboTree",{before:f,after:h})}if(o.parentId||o.comboId){var d=this.findById(o.parentId||o.comboId);d&&d.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 p=fn(this.get("comboTrees"),o.id,e);this.set("comboTrees",p),this.updateCombos()},e.prototype.save=function(){var t=[],e=[],n=[];return S(this.get("nodes"),(function(e){t.push(e.getModel())})),S(this.get("edges"),(function(t){e.push(t.getModel())})),S(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");S(t,(function(t){t.refresh()})),S(e,(function(t){t.refresh()})),S(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(A(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){S(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(){S(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={};S(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(),S(n,(function(t){var e=t.getSource().getModel(),n=t.getTarget();if(!M(n)){var r=n.getModel();(o[e.id]||o[r.id]||t.getModel().isComboEdge)&&t.refresh()}})),S(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(A(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"),u={};Object.assign(u,s,t),this.set("layout",u),i.isLayoutTypeSame(u)&&u.gpuEnabled===s.gpuEnabled?i.updateLayoutCfg(u):i.changeLayout(u)},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(A(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||an(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 u={},c=[];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((h=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 l=s.id;if(u[n.id+"-"+l])return void(u[n.id+"-"+l]+=h.size||1);var f=e.addItem("vedge",{source:n.id,target:l,isVEdge:!0},!1);u[n.id+"-"+l]=h.size||1,c.push(f)}else if(!i.includes(r)&&!o.includes(r)&&(i.includes(a)||o.includes(a))||a.getModel().id===n.id){var h;if((h=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(u[p+"-"+n.id])return void(u[p+"-"+n.id]+=h.size||1);f=e.addItem("vedge",{target:n.id,source:p,isVEdge:!0},!1);u[p+"-"+n.id]=h.size||1,c.push(f)}}})),c.forEach((function(t){var n=t.getModel();e.updateItem(t,{size:u[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(A(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||an(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 u={},c={};r.forEach((function(t){if(!t.isVisible()||t.getModel().isVEdge){var r=t.getSource(),a=t.getTarget(),s=r.get("id"),l=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 f=a.getModel();!a.isVisible();){if(!(a=e.findById(f.comboId||f.parentId))||!f.parentId&&!f.comboId)return;f=a.getModel()}l=f.id;for(var h=r.getModel();!r.isVisible();){if(!(r=e.findById(h.comboId||h.parentId))||!h.parentId&&!h.comboId)return;if(h.comboId===n.id||h.parentId===n.id)break;h=r.getModel()}if(s=h.id,l){if(u[p=s+"-"+l])return u[p]+=t.getModel().size||1,void e.updateItem(c[p],{size:u[p]},!1);var d=e.addItem("vedge",{source:s,target:l,isVEdge:!0},!1);u[p]=t.getModel().size||1,c[p]=d}}else if(!i.includes(r)&&!o.includes(r)&&(i.includes(a)||o.includes(a))||l===n.id){if(t.getModel().isVEdge)return void e.removeItem(t,!1);for(h=r.getModel();!r.isVisible();){if(!(r=e.findById(h.comboId||h.parentId))||!h.parentId&&!h.comboId)return;h=r.getModel()}s=h.id;for(f=a.getModel();!a.isVisible();){if(!(a=e.findById(f.comboId||f.parentId))||!f.parentId&&!f.comboId)return;if(f.comboId===n.id||f.parentId===n.id)break;f=a.getModel()}if(l=f.id,s){var p;if(u[p=s+"-"+l])return u[p]+=t.getModel().size||1,void e.updateItem(c[p],{size:u[p]},!1);d=e.addItem("vedge",{target:l,source:s,isVEdge:!0},!1);u[p]=t.getModel().size||1,c[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(A(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){an(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 A(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;A(t)&&(r=this.findById(t));var i=this.get("degrees");i&&!n||(i=pt(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?F(e):{before:{},after:F(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=nt(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=nt(this.save(),e),this.set("adjMatrix",n)),r&&t||(r=kt(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 pr(this,Object(p.__assign)(Object(p.__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;e=A(t)?this.getHullById(t):t,delete this.get("hullMap")[e.id],e.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}(tt.a);function yr(t){return(yr="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 mr=et.a.transform,br=["startArrow","endArrow"],xr={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},wr={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:xr,combo:xr},_r={options:{},itemType:"",type:"",getCustomConfig:function(t){return{}},getOptions:function(t,e){return"move"===e||"bbox"===e?{}:V({labelCfg:{style:{fontFamily:"undefined"!=typeof window&&window.getComputedStyle&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"}},descriptionCfg:{style:{fontFamily:"undefined"!=typeof window&&window.getComputedStyle&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"}}},this.options,this.getCustomConfig(t)||{},t)},draw:function(t,e){var n=this.drawShape(t,e);(n.set("className",this.itemType+"-shape"),t.label)&&this.drawLabel(t,e).set("className",this.itemType+"-label");return n},afterDraw:function(t,e,n){},drawShape:function(t,e){return null},drawLabel:function(t,e){var n=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(!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=mr(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]]);break;case"lefttop":s=mr(s,[["t",-r.x,-r.y],["r",i],["t",r.x,r.y]]);break;case"leftcenter":s=mr(s,[["t",-r.x,-r.y-a.height/2],["r",i],["t",r.x,r.y+a.height/2]]);break;default:s=mr(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]])}else s=mr(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),o.toFront()}return o},drawLabelBg:function(t,e,n){var r=B({},this.options.labelCfg,t.labelCfg),i=this.getLabelBgStyleByPosition(n,t,r,e);return e.addShape("rect",{name:"text-bg-shape",attrs:i})},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=qe[i]?qe[i].style:null;return Object(p.__assign)(Object(p.__assign)(Object(p.__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=e.getContainer(),i=e.getKeyShape(),o=B({},i.attr(),t.style),a=function(t){var e,n=o[t];if(M(n)){var a=r.find((function(e){return e.get("name")===t}));a&&a.attr(n)}else i.attr(((e={})[t]=n,e))};for(var s in o)a(s)},updateLabel:function(t,e,n){var r=e.getContainer(),i=this.getOptions({},n).labelCfg,o=this.itemType+"-label",a=r.find((function(t){return t.get("className")===o})),s=this.itemType+"-label-bg",u=r.find((function(t){return t.get("classname")===s}));if(t.label||""===t.label)if(a){var c={};e.getModel&&(c=e.getModel().labelCfg);var l=V({},i,c,t.labelCfg),f=this.getLabelStyleByPosition(t,l,r),h=t.labelCfg?t.labelCfg.style:void 0,d=l.style&&l.style.background,g=Object(p.__assign)(Object(p.__assign)(Object(p.__assign)({},a.attr()),f),h),v=g.rotate;if(delete g.rotate,isNaN(v)||""===v)a.resetMatrix(),a.attr(g);else{var y=[1,0,0,0,1,0,0,0,1];y=mr(y,[["t",-g.x,-g.y],["r",v],["t",g.x,g.y]]),a.resetMatrix(),a.attr(Object(p.__assign)(Object(p.__assign)({},g),{matrix:y}))}if(u)if(g.background){var m=this.getLabelBgStyleByPosition(a,t,l,r),b=Object(p.__assign)(Object(p.__assign)({},m),d);if(u.resetMatrix(),!isNaN(v)&&""!==v){var x=[1,0,0,0,1,0,0,0,1];x=mr(x,[["t",-b.x,-b.y],["r",v],["t",b.x,b.y]]),b.matrix=x}u.attr(b)}else r.removeChild(u);else g.background&&((u=this.drawLabelBg(t,r,a)).set("classname",s),a.toFront())}else{this.drawLabel(t,r).set("className",o)}},afterUpdate:function(t,e){},setState:function(t,e,n){var r,i,o=n.get("keyShape");if(o&&!o.destroyed){var a=n.getType(),s=R(e)?t:t+":"+e,u=this.getStateStyle(s,n),c=n.getStateStyle(s);if(c||u){var l=B({},c||u),f=n.getContainer(),h={x:1,y:1,cx:1,cy:1};if("combo"===a&&(h.r=1,h.width=1,h.height=1),e){var d=function(t){var e,n=l[t];if(M(n)&&!br.includes(t)){var r=f.find((function(e){return e.get("name")===t}));r&&r.attr(n)}else o.attr(((e={})[t]=n,e))};for(var p in l)d(p)}else{var g=pn(n.getCurrentStatesStyle()),v=B({},n.getModel().style,pn(n.getOriginStyle())),y=o.get("name"),m=o.attr(),b={};Object.keys(m).forEach((function(t){if("img"!==t){var e=m[t];e&&"object"===yr(e)?b[t]=F(e):b[t]=e}}));var x={},w=function(t){var e=l[t];if(M(e)&&!br.includes(t)){var n=f.find((function(e){return e.get("name")===t}));if(n){var r=pn(n.attr());S(e,(function(e,i){if(t===y&&b[i]&&!h[i]){delete b[i];var s=v[t][i]||wr[a][i];o.attr(i,s)}else if(r[i]||0===r[i]){delete r[i];var u=v[t][i]||wr[a][i];n.attr(i,u)}})),x[t]=r}}else if(b[t]&&!h[t]){delete b[t];var i=v[t]||(v[y]?v[y][t]:void 0)||wr[a][t];o.attr(t,i)}};for(var _ in l)w(_);for(var p in y?x[y]=b:B(x,b),g)if(!h[p]){var E=g[p];M(E)&&!br.includes(p)||(y?(B(v[y],((i={})[p]=E,i)),delete v[p]):B(v,((r={})[p]=E,r)),delete g[p])}var O={};V(O,v,x,g);var k=!1,A=function(t){var e,n,r=O[t];if(M(r)&&!br.includes(t)){var i=f.find((function(e){return e.get("name")===t}));i&&("text"===i.get("type")&&(delete r.x,delete r.y,delete r.matrix),t===y&&("combo"===a&&(delete r.r,delete r.width,delete r.height),k=!0),i.attr(r))}else if(!k){var s=r||wr[a][t];"combo"===a?y||o.attr(((e={})[t]=s,e)):o.attr(((n={})[t]=s,n))}};for(var C in O)A(C)}}}},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,u=n.stateStyles?n.stateStyles[t]:o&&o[t];return"combo"===r?F(u):B({},s,u)},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)}},Sr={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:qe.nodeLabel.offset,getSize:function(t){var e=t.size||this.getOptions({}).size||qe.defaultNode.size;return x(e)&&1===e.length&&(e=[e[0],e[0]]),x(e)||(e=[e,e]),e},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;b(r)&&(r=this.offset);var i,o=this.getSize(t),a=o[0],s=o[1];switch(n){case"top":i={x:0,y:0-s/2-r,textBaseline:"bottom"};break;case"bottom":i={x:0,y:s/2+r,textBaseline:"top"};break;case"left":i={x:0-a/2-r,y:0,textAlign:"right"};break;default:i={x:a/2+r,y:0,textAlign:"left"}}return i.text=t.label,i},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=bn(o.padding),u=i.width+s[1]+s[3],c=i.height+s[0]+s[2],l=n.offset;return b(l)&&(l=this.offset),a={x:i.minX-s[3],y:i.minY-s[0]},a=Object(p.__assign)(Object(p.__assign)(Object(p.__assign)({},a),o),{width:u,height:c})},drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t);return e.addShape(n,{attrs:r,draggable:!0,name:"node-shape"})},updateLinkPoints:function(t,e){var n,r=this.getOptions(t).linkPoints,i=e.find((function(t){return"link-point-left"===t.get("className")})),o=e.find((function(t){return"link-point-right"===t.get("className")})),a=e.find((function(t){return"link-point-top"===t.get("className")})),s=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 u=B({},n,t.linkPoints),c=u.fill,l=u.stroke,f=u.lineWidth,h=u.size/2;h||(h=u.r);var d=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},g=d.left,v=d.right,y=d.top,m=d.bottom,b=this.getSize(t),x=b[0],w=b[1],_={r:h,fill:c,stroke:l,lineWidth:f};i?g||void 0===g?i.attr(Object(p.__assign)(Object(p.__assign)({},_),{x:-x/2,y:0})):i.remove():g&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},_),{x:-x/2,y:0}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),o?(v||void 0===v||o.remove(),o.attr(Object(p.__assign)(Object(p.__assign)({},_),{x:x/2,y:0}))):v&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},_),{x:x/2,y:0}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),a?(y||void 0===y||a.remove(),a.attr(Object(p.__assign)(Object(p.__assign)({},_),{x:0,y:-w/2}))):y&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},_),{x:0,y:-w/2}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s?m||void 0===m?s.attr(Object(p.__assign)(Object(p.__assign)({},_),{x:0,y:w/2})):s.remove():m&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},_),{x:0,y:w/2}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},updateShape:function(t,e,n,r){e.get("keyShape").attr(Object(p.__assign)({},n)),this.updateLabel(t,e),r&&this.updateIcon(t,e)},updateIcon:function(t,e){var n=this,r=e.getContainer(),i=this.getOptions(t).icon,o=(t.icon?t.icon:{show:void 0}).show,a=r.find((function(t){return t.get("className")===n.type+"-icon"}));if(a)if(o||void 0===o){var s=B({},a.attr(),i),u=s.width,c=void 0===u?20:u,l=s.height,f=void 0===l?20:l;a.attr(Object(p.__assign)(Object(p.__assign)({},s),{x:-c/2,y:-f/2}))}else a.remove();else if(o){c=i.width,f=i.height;r.addShape("image",{attrs:Object(p.__assign)(Object(p.__assign)({},i),{x:-c/2,y:-f/2}),className:this.type+"-icon",name:this.type+"-icon"});var h=r.find((function(t){return"node-label"===t.get("className")}));h&&h.toFront()}}},Er=Object(p.__assign)(Object(p.__assign)({},_r),Sr);jn.registerNode("single-node",Er);var Or={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:qe.defaultEdge.size,style:{x:0,y:0,stroke:qe.defaultEdge.style.stroke,lineAppendWidth:qe.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:qe.edgeLabel.style.fill,fontSize:qe.edgeLabel.style.fontSize}},stateStyles:Object(p.__assign)({},qe.edgeStateStyles)},getPath:function(t){var e=[];return S(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=B({},this.options.style,{stroke:t.color},t.style),n=t.size||qe.defaultEdge.size,r=(t=this.getPathPoints(t)).startPoint,i=t.endPoint,o=this.getControlPoints(t),a=[r];o&&(a=a.concat(o)),a.push(i);var s=this.getPath(a);return B({},qe.defaultEdge.style,{stroke:qe.defaultEdge.color,lineWidth:n,path:s},e)},updateShapeStyle:function(t,e,n){var r,i=e.getContainer(),o={stroke:t.color},a=(null===(r=e.getKeyShape)||void 0===r?void 0:r.call(e))||i.find((function(t){return"edge-shape"===t.get("className")})),s=t.size,u=(t=this.getPathPoints(t)).startPoint,c=t.endPoint,l=this.getControlPoints(t),f=[u];l&&(f=f.concat(l)),f.push(c);var h=a.attr(),d=B({},o,h,t.style),p=t.sourceNode,g=t.targetNode,v={radius:d.radius};l||(v={source:p,target:g,offset:d.offset,radius:d.radius});var y=this.getPath(f,v),m={};"move"===n?m={path:y}:(h.endArrow&&!1===d.endArrow&&(t.style.endArrow={path:""}),h.startArrow&&!1===d.startArrow&&(t.style.startArrow={path:""}),m=B(o,h,{lineWidth:s,path:y},t.style)),a&&a.attr(m)},getLabelStyleByPosition:function(t,e,n){var r,i=e.position||this.labelPosition,o={},a=n&&n.find((function(t){return"edge-shape"===t.get("className")}));r="start"===i?0:"end"===i?1:.5;var s,u=e.refX||this.refX,c=e.refY||this.refY;if(t.startPoint.x===t.endPoint.x&&t.startPoint.y===t.endPoint.y)return o.x=t.startPoint.x+u,o.y=t.startPoint.y+c,o.text=t.label,o;s=b(e.autoRotate)?this.labelAutoRotate:e.autoRotate;var l=rn(a,r,u,c,s);return o.x=l.x,o.y=l.y,o.rotate=l.rotate,o.textAlign=this._getTextAlign(i,l.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,u=i.width+s[1]+s[3],c=i.height+s[0]+s[2],l=n.position||this.labelPosition,f=Object(p.__assign)(Object(p.__assign)({},o),{width:u,height:c,x:i.minX-s[2],y:i.minY-s[0],rotate:0});a=b(n.autoRotate)?this.labelAutoRotate:n.autoRotate;var h,d=r&&r.find((function(t){return"edge-shape"===t.get("className")}));h="start"===l?0:"end"===l?1:.5;var g=n.refX||this.refX,v=n.refY||this.refY;if(e.startPoint.x===e.endPoint.x&&e.startPoint.y===e.endPoint.y)return f.x=e.startPoint.x+g-u/2,f.y=e.startPoint.y+v-c/2,f;var y=g-u/2;"start"===n.position?y=g-s[2]:"end"===n.position&&(y=g-u);var m=rn(d,h,y,v+c/2,a);return a&&(f.x=m.x,f.y=m.y),f.rotate=m.rotate,f},_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);return e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n})},drawLabel:function(t,e){var n,r=this.options.labelCfg;n="undefined"!=typeof window&&void 0!==window.getComputedStyle&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";var i=V({fontFamily:n},r,t.labelCfg),o=this.getLabelStyle(t,i,e),a=o.rotate;delete o.rotate;var s=e.addShape("text",{attrs:o,name:"text-shape"});if(isNaN(a)||""===a||s.rotateAtStart(a),o.background){var u=this.drawLabelBg(t,e,s,o,a),c=this.itemType+"-label-bg";u.set("classname",c),s.toFront()}return s},drawLabelBg:function(t,e,n,r,i){var o=this.options.labelCfg,a=V({},o,t.labelCfg),s=this.getLabelBgStyleByPosition(n,t,a,e);delete s.rotate;var u=e.addShape("rect",{name:"text-bg-shape",attrs:s});return isNaN(i)||u.rotateAtStart(i),u}},Mr=Object(p.__assign)(Object(p.__assign)({},_r),Or);jn.registerEdge("single-edge",Mr),jn.registerEdge("line",{getControlPoints:function(){}},"single-edge"),jn.registerEdge("spline",{getPath:function(t){return Kn(t)}},"single-edge"),jn.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=pe(r,n,i),r.x<=i.x&&r.y>i.y?this.clockwise=e.x>n.x?0:1:r.x<=i.x&&r.yn.x?1:0:r.x>i.x&&r.y<=i.y?this.clockwise=e.y=0;return n?i?2*Math.PI-r:r:i?r:2*Math.PI-r}function Jr(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}var ti=n(83),ei=n.n(ti),ni=n(93),ri=n.n(ni),ii=[{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 oi(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 ai(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 si(t,e,n){var r;return(r=n?t.v+.05*e:t.v-.15*e)>1&&(r=1),Number(r.toFixed(2))}function ui(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=ri()(t),i=5;i>0;i-=1){var o=r.toHsv(),a=ri()({h:oi(o,i,!0),s:ai(o,i,!0),v:si(o,i,!0)}).toHexString();n.push(a)}n.push(r.toHexString());for(var s=1;s<=4;s+=1){var u=r.toHsv(),c=ri()({h:oi(u,s),s:ai(u,s),v:si(u,s)}).toHexString();n.push(c)}return"dark"===e.theme?ii.map((function(t){var r=t.index,i=t.opacity;return ri.a.mix(e.backgroundColor||"#141414",n[r],100*i).toHexString()})):n}var ci={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"},li={},fi={};Object.keys(ci).forEach((function(t){li[t]=ui(ci[t]),li[t].primary=li[t][5],fi[t]=ui(ci[t],{theme:"dark",backgroundColor:"#141414"}),fi[t].primary=fi[t][5]}));li.red,li.volcano,li.gold,li.orange,li.yellow,li.lime,li.green,li.cyan,li.blue,li.geekblue,li.purple,li.magenta,li.grey;var hi,di,pi,gi,vi=function(t,e,n){var r=ei()(t),i=ei()(e);return ei()([(1-n)*r.red()+n*i.red(),(1-n)*r.green()+n*i.green(),(1-n)*r.blue()+n*i.blue()]).rgb()},yi=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=vi(e,t,.05).rgb().toString(),i=vi(e,t,.1).rgb().toString(),o=vi(e,t,.2).rgb().toString(),a=vi(e,t,.4).rgb().toString(),s=vi(e,n,.02).rgb().toString(),u=vi(e,n,.05).rgb().toString(),c=vi(e,n,.1).rgb().toString(),l=vi(e,n,.2).rgb().toString(),f=vi(e,n,.3).rgb().toString(),h=ui(t,{theme:"default",backgroundColor:e}),d=ei()(t).hex().toLowerCase(),p=h.indexOf(d),g=t;return-1!==p&&(g=h[p+1]),{mainStroke:t,mainFill:i,activeStroke:t,activeFill:r,inactiveStroke:a,inactiveFill:r,selectedStroke:t,selectedFill:e,highlightStroke:g,highlightFill:o,disableStroke:f,disableFill:u,edgeMainStroke:f,edgeActiveStroke:t,edgeInactiveStroke:l,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:c,comboMainStroke:f,comboMainFill:s,comboActiveStroke:t,comboActiveFill:r,comboInactiveStroke:f,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=vi(e,t,.2).rgb().toString(),i=vi(e,t,.3).rgb().toString(),o=vi(e,t,.6).rgb().toString(),a=vi(e,t,.8).rgb().toString(),s=vi(e,n,.2).rgb().toString(),u=vi(e,n,.25).rgb().toString(),c=vi(e,n,.3).rgb().toString(),l=vi(e,n,.4).rgb().toString(),f=vi(e,n,.5).rgb().toString(),h=ui(t,{theme:"dark",backgroundColor:e}),d=ei()(t).hex().toLowerCase(),p=h.indexOf(d),g=t;return-1!==p&&(g=h[p+1]),{mainStroke:a,mainFill:r,activeStroke:t,activeFill:i,inactiveStroke:a,inactiveFill:r,selectedStroke:t,selectedFill:r,highlightStroke:t,highlightFill:o,disableStroke:f,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")},mi=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(yi(t,e,n,r))})),i},bi=yi("rgb(95, 149, 255)","rgb(255, 255, 255)"),xi={version:"0.3.11",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:bi.mainStroke,fill:bi.mainFill},size:20,color:bi.mainStroke,linkPoints:{size:8,lineWidth:1,fill:bi.activeFill,stroke:bi.activeStroke}},nodeStateStyles:{active:{fill:bi.activeFill,stroke:bi.activeStroke,lineWidth:2,shadowColor:bi.mainStroke,shadowBlur:10},selected:{fill:bi.selectedFill,stroke:bi.selectedStroke,lineWidth:4,shadowColor:bi.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:bi.highlightFill,stroke:bi.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:bi.inactiveFill,stroke:bi.inactiveStroke,lineWidth:1},disable:{fill:bi.disableFill,stroke:bi.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:"rgb(0, 0, 0)",textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:bi.edgeMainStroke,lineAppendWidth:2},color:bi.edgeMainStroke},edgeStateStyles:{active:{stroke:bi.edgeActiveStroke,lineWidth:1},selected:{stroke:bi.edgeSelectedStroke,lineWidth:2,shadowColor:bi.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:bi.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:bi.edgeInactiveStroke,lineWidth:1},disable:{stroke:bi.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:"rgb(0, 0, 0)",textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:bi.comboMainFill,lineWidth:1,stroke:bi.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:bi.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:bi.comboActiveStroke,lineWidth:1,fill:bi.comboActiveFill},selected:{stroke:bi.comboSelectedStroke,lineWidth:2,fill:bi.comboSelectedFill,shadowColor:bi.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:bi.comboHighlightStroke,lineWidth:2,fill:bi.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:bi.comboInactiveStroke,fill:bi.comboInactiveFill,lineWidth:1},disable:{stroke:bi.comboDisableStroke,fill:bi.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 wi(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 _i(t){hi||(hi=document.createElement("table"),di=document.createElement("tr"),pi=/^\s*<(\w+|!)[^>]*>/,gi={tr:document.createElement("tbody"),tbody:hi,thead:hi,tfoot:hi,td:di,th:di,"*":document.createElement("div")});var e=pi.test(t)&&RegExp.$1;e&&e in gi||(e="*");var n=gi[e];t=t.replace(/(^\s*)|(\s*$)/g,""),n.innerHTML=""+t;var r=n.childNodes[0];return n.removeChild(r),r}function Si(t,e){if(t)for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t}var Ei=jr.cloneEvent,Oi=jr.isViewportChanged,Mi=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(p.__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=I(this,"onCanvasEvents"),a=I(this,"onExtendEvents"),s=I(this,"onWheelEvent");r.off("*").on("*",o),this.canvasHandler=o,n.push(wi(i,"DOMMouseScroll",s)),n.push(wi(i,"mousewheel",s)),"undefined"!=typeof window&&(n.push(wi(window,"keydown",a)),n.push(wi(window,"keyup",a)),n.push(wi(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]),Oi(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 f=n.getCanvasByPoint(t.x,t.y);t.canvasX=f.x,t.canvasY=f.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){b(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=Ei(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),S(n,(function(t){t.remove()})),this.dragging=!1,this.preItem=null,this.extendEvents.length=0,this.canvasHandler=null,this.destroyed=!0},e}(Lr);function ki(t,e){for(var n=0;ne[a][o]+e[o][s]&&(e[a][s]=e[a][o]+e[o][s]);return e},Ui=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=Gi(t,"source"),r=Gi(t,"target"),a=o[n],s=o[r];i[a][s]=1,e||(i[s][a]=1)})),i},Vi=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!!n(e)}(t,e)},Wi=function(t){return"function"==typeof t};function Xi(t){return(Xi="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 Yi(t,e){return(Yi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Hi(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Zi(t);if(e){var i=Zi(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return qi(this,n)}}function qi(t,e){if(e&&("object"===Xi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ki(t)}function Ki(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Zi(t){return(Zi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Qi=new Map,$i=function(t,e){if(Qi.get(t)&&console.warn("The layout with the name ".concat(t," exists already, it will be overridden")),Li(e)){var n=function(t){!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&&Yi(t,e)}(r,t);var n=Hi(r);function r(t){var i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r);var o=Ki(i=n.call(this)),a={},s=o.getDefaultCfg();return Object.assign(a,s,e,t),Object.keys(a).forEach((function(t){var e=a[t];o[t]=e})),i}return r}(Ti);Qi.set(t,n)}else Qi.set(t,e)},Ji=function(t){return Qi.has(t)?Qi.get(t):null};function to(t){return(to="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 eo(t,e){for(var n=0;nt.cells){var l=t.small(),f=t.large();(l-1)*f>=t.cells?t.small(l-1):(f-1)*l>=t.cells&&t.large(f-1)}else for(;t.cols*t.rows=t.cells?t.large(d+1):t.small(h+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((function(e){var n,r;e.x&&e.y||(e.x=0,e.y=0),Di(e.size)?(n=e.size[0],r=e.size[1]):Ni(e.size)?(n=e.size,r=e.size):Li(e.size)&&(n=e.size.width,r=e.size.height),void 0!==n&&void 0!==r||(Di(t.nodeSize)?(n=t.nodeSize[0],r=t.nodeSize[1]):Ni(t.nodeSize)?(n=t.nodeSize,r=t.nodeSize):(n=30,r=30));var 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(var p=0;p=t&&(this.col=0,this.row++)}},{key:"getPos",value:function(t){var e,n,r=this.begin,i=this.cellWidth,o=this.cellHeight,a=this.id2manPos[t.id];if(a)e=a.col*i+i/2+r[0],n=a.row*o+o/2+r[1];else{for(;this.used(this.row,this.col);)this.moveToNextCell();e=this.col*i+i/2+r[0],n=this.row*o+o/2+r[1],this.use(this.row,this.col),this.moveToNextCell()}t.x=e,t.y=n}},{key:"getType",value:function(){return"grid"}}])&&eo(e.prototype,n),r&&eo(e,r),o}(Ti);function so(t){return(so="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 uo(t,e){for(var n=0;na[1]?a[0]:a[1])+s(t)}:function(t){return a+s(t)}:function(t){return t.size?Di(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+s(t):Li(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+s(t):t.size+s(t):10+s(t)}}t.nodeSize=o;var c=t.edges;t.degrees=Fi(e.length,t.nodeIdxMap,c),t.getMass||(t.getMass=function(e){return t.degrees[t.nodeIdxMap[e.id]]||1}),t.run()}else t.onLayoutEnd&&t.onLayoutEnd()}},{key:"run",value:function(){var t=this,e=t.nodes,n=t.edges,r=t.maxIteration;if("undefined"!=typeof window){var i=0;this.timeInterval=window.setInterval((function(){var o=[],a=[];if(e){e.forEach((function(t,e){o[2*e]=0,o[2*e+1]=0,a[2*e]=0,a[2*e+1]=0})),t.calRepulsive(o,e),n&&t.calAttractive(o,n),t.calGravity(o,e);var s=Math.max(.02,t.interval-.002*i);t.updateVelocity(o,a,s,e);var u=[];e.forEach((function(t){u.push({x:t.x,y:t.y})})),t.updatePosition(a,s,e),t.tick&&t.tick();var c=0;e.forEach((function(t,e){var n=t.x-u[e].x,r=t.y-u[e].y;c+=Math.sqrt(n*n+r*r)})),(c/=e.length)=r&&(t.onLayoutEnd&&t.onLayoutEnd(),window.clearInterval(t.timeInterval))}}),0)}}},{key:"calRepulsive",value:function(t,e){var n=this.getMass,r=this.nodeStrength,i=this.factor,o=this.coulombDisScale,a=this.preventOverlap,s=this.nodeSize;e.forEach((function(u,c){var l=n?n(u):1;e.forEach((function(e,f){if(!(c>=f)){var h=u.x-e.x,d=u.y-e.y,p=Math.sqrt(h*h+d*d)+.01,g=(p+.1)*o,v=h/p,y=d/p,m=(r(u)+r(e))/2*i/(g*g),b=n?n(e):1;if(t[2*c]+=v*m,t[2*c+1]+=y*m,t[2*f]-=v*m,t[2*f+1]-=y*m,a&&p<(s(u)+s(e))/2){var x=(r(u)+r(e))/2/(p*p);t[2*c]+=v*x/l,t[2*c+1]+=y*x/l,t[2*f]-=v*x/b,t[2*f+1]-=y*x/b}}}))}))}},{key:"calAttractive",value:function(t,e){var n=this.nodeMap,r=this.nodeIdxMap,i=this.linkDistance,o=this.edgeStrength,a=this.getMass;e.forEach((function(e,s){var u=Gi(e,"source"),c=Gi(e,"target"),l=n[u],f=n[c],h=f.x-l.x,d=f.y-l.y,p=Math.sqrt(h*h+d*d)+.01,g=h/p,v=d/p,y=((i(e)||1)-p)*o(e),m=r[u],b=r[c],x=a?a(l):1,w=a?a(f):1;t[2*m]-=g*y/x,t[2*m+1]-=v*y/x,t[2*b]+=g*y/w,t[2*b+1]+=v*y/w}))}},{key:"calGravity",value:function(t,e){for(var n=this.center,r=this.gravity,i=this.degrees,o=e.length,a=0;ai.maxSpeed){var c=i.maxSpeed/u;a*=c,s*=c}e[2*r]=a,e[2*r+1]=s}))}},{key:"updatePosition",value:function(t,e,n){n.forEach((function(n,r){if(Ni(n.fx)&&Ni(n.fy))return n.x=n.fx,void(n.y=n.fy);var i=t[2*r]*e,o=t[2*r+1]*e;n.x+=i,n.y+=o}))}},{key:"stop",value:function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)}},{key:"destroy",value:function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0}},{key:"getType",value:function(){return"gForce"}}])&&vo(e.prototype,n),r&&vo(e,r),o}(Ti);function So(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,c,l,f,h,d=t._root,p={data:r},g=t._x0,v=t._y0,y=t._x1,m=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(o=(g+y)/2))?g=o:y=o,(l=n>=(a=(v+m)/2))?v=a:m=a,i=d,!(d=d[f=l<<1|c]))return i[f]=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[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(o=(g+y)/2))?g=o:y=o,(l=n>=(a=(v+m)/2))?v=a:m=a}while((f=l<<1|c)==(h=(u>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}var Eo=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function Oo(t){return t[0]}function Mo(t){return t[1]}function ko(t,e,n){var r=new Ao(null==e?Oo:e,null==n?Mo:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Ao(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 Co(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var To=ko.prototype=Ao.prototype;To.copy=function(){var t,e,n=new Ao(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=Co(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]=Co(e));return n},To.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return So(this.cover(e,n),e,n,t)},To.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,f=-1/0;for(n=0;nl&&(l=r),if&&(f=i));if(u>l||c>f)return this;for(this.cover(u,c).cover(l,f),n=0;nt||t>=i||r>e||e>=o;)switch(s=(eh||(o=u.y0)>d||(a=u.x1)=y)<<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 m=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=m*m+b*b;if(x=(s=(p+v)/2))?p=s:v=s,(l=a>=(u=(g+y)/2))?g=u:y=u,e=d,!(d=d[f=l<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}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[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},To.removeAll=function(t){for(var e=0,n=t.length;e=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 Lo(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),o=0;o=0&&e._call.call(null,t),e=e._next;--Vo}()}finally{Vo=0,function(){var t,e,n=zo,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:zo=e);Uo=t,ra(r)}(),Ho=0}}function na(){var t=Ko.now(),e=t-Yo;e>1e3&&(qo-=e,Yo=t)}function ra(t){Vo||(Wo&&(Wo=clearTimeout(Wo)),t-Ho>24?(t<1/0&&(Wo=setTimeout(ea,t-Ko.now()-qo)),Xo&&(Xo=clearInterval(Xo))):(Xo||(Yo=Ko.now(),Xo=setInterval(na,1e3)),Vo=1,Zo(ea)))}Jo.prototype=ta.prototype={constructor:Jo,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Qo():+n)+(null==e?0:+e),this._next||Uo===this||(Uo?Uo._next=this:zo=this,Uo=this),this._call=t,this._time=n,ra()},stop:function(){this._call&&(this._call=null,this._time=1/0,ra())}};function ia(t){return t.x}function oa(t){return t.y}var aa=Math.PI*(3-Math.sqrt(5)),sa=function(t){var e,n,r=1,i=.001,o=1-Math.pow(i,1/300),a=0,s=.6,u=new Map,c=ta(h),l=Go("tick","end"),f=(n=1,function(){return(n=(1664525*n+1013904223)%4294967296)/4294967296});function h(){d(),l.call("tick",e),r1?(null==n?u.delete(t):u.set(t,g(n)),e):u.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;c1?(l.on(t,n),e):l.on(t)}}},ua=function(){var t,e,n,r,i,o=Io(-30),a=1,s=1/0,u=.81;function c(n){var i,o=t.length,a=ko(t,ia,oa).visitAfter(f);for(r=n,i=0;i=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=Po(n))*f),0===h&&(p+=(h=Po(n))*h),pc+p||ol+p||au.index){var g=c-s.x-s.vx,v=l-s.y-s.vy,y=g*g+v*v;yt.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;rt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1||(e[r]=t[r])})),e})),this.ticking=!1}},{key:"execute",value:function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var i=e.forceSimulation,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){var u=ha().id((function(t){return t.id})).links(r);e.edgeStrength&&u.strength(e.edgeStrength),e.linkDistance&&u.distance(e.linkDistance),e.edgeForce=u,i.force("link",u)}e.preventOverlap&&e.overlapProcess(i),i.alpha(s).restart(),this.ticking=!0}else try{var c=ua();if(e.nodeStrength&&c.strength(e.nodeStrength),i=sa().nodes(n),e.clustering){var l=ma();l.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&l.links(r),n&&l.nodes(n),l.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=l,i.force("group",l)}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;ir[1]?r[0]:r[1])/2;e=function(t){return a+n(t)}}else if(Ni(r)){var s=r/2;e=function(t){return s+n(t)}}else e=function(){return 10};else e=function(t){return t.size?Di(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):Li(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",ga(e).strength(o))}},{key:"updateCfg",value:function(t){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.forceSimulation=null,Object.assign(this,t)}},{key:"destroy",value:function(){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.nodes=null,this.edges=null,this.destroyed=!0}}])&&_a(e.prototype,n),r&&_a(e,r),o}(Ti);function Aa(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}function Ca(t){return(Ca="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 Ta(t,e){for(var n=0;nr?1:0}var Ba=function(t){!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&&Ia(t,e)}(o,t);var e,n,r,i=Pa(o);function o(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this)).radius=null,e.startRadius=null,e.endRadius=null,e.startAngle=0,e.endAngle=2*Math.PI,e.clockwise=!0,e.divisions=1,e.ordering=null,e.angleRatio=1,e.nodes=[],e.edges=[],e.nodeMap={},e.degrees=[],e.width=300,e.height=300,e.updateCfg(t),e}return e=o,(n=[{key:"getDefaultCfg",value:function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}}},{key:"execute",value:function(){var t=this.nodes,e=this.edges,n=t.length;if(0!==n){this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight),this.center||(this.center=[this.width/2,this.height/2]);var r=this.center;if(1===n)return t[0].x=r[0],t[0].y=r[1],void(this.onLayoutEnd&&this.onLayoutEnd());var i=this.radius,o=this.startRadius,a=this.endRadius,s=this.divisions,u=this.startAngle,c=this.endAngle,l=(c-u)/n,f={};t.forEach((function(t,e){f[t.id]=e})),this.nodeMap=f;var h=Fi(t.length,f,e);this.degrees=h,i||o||a?!o&&a?o=a:o&&!a&&(a=o):i=this.height>this.width?this.width/2:this.height/2;var d=l*this.angleRatio,p=this.ordering,g=[];g="topology"===p?this.topologyOrdering():"topology-directed"===p?this.topologyOrdering(!0):"degree"===p?this.degreeOrdering():t;for(var v=this.clockwise,y=Math.ceil(n/s),m=0;m0&&void 0!==arguments[0]&&arguments[0],e=this,n=e.degrees,r=e.edges,i=e.nodes,o=Bi(i),a=e.nodeMap,s=[o[0]],u=[i[0]],c=[],l=i.length;c[0]=!0,ja(o,r,a,t);var f=0;return o.forEach((function(t,e){if(0!==e)if(e!==l-1&&n[e]===n[e+1]&&!Ra(s[f],t,r)||c[e]){for(var h=s[f].children,d=!1,p=0;p1&&void 0!==arguments[1]?arguments[1]:{};if(!Za(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;sa&&(a=t[s]);return a};var $a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Za(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;s1&&void 0!==arguments[1]?arguments[1]:{};if(!Za(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(!Za(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=$a(t),i=Qa(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;l1&&void 0!==arguments[1]?arguments[1]:{},n=e.maxRows,r=void 0===n?15:n,i=e.maxColumns,o=void 0===i?10:i,a=e.maxNumSize,s=void 0===a?8:a;return"".concat(t.constructor.name," {\n").concat(ts,"[\n").concat(es).concat(rs(t,r,o,s),"\n").concat(ts,"]\n").concat(ts,"rows: ").concat(t.rows,"\n").concat(ts,"columns: ").concat(t.columns,"\n}")}function rs(t,e,n,r){for(var i=t.rows,o=t.columns,a=Math.min(i,e),s=Math.min(o,n),u=[],c=0;cr)throw new RangeError("Row index out of range")}function ss(t,e,n){var r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function us(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 cs(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 ls(t,e){if("object"!==os(e))throw new TypeError("unexpected type for row indices");if(e.some((function(e){return e<0||e>=t.rows})))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function fs(t,e){if("object"!==os(e))throw new TypeError("unexpected type for column indices");if(e.some((function(e){return e<0||e>=t.columns})))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function hs(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(ps("startRow",e),ps("endRow",n),ps("startColumn",r),ps("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 ds(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=0;rn?(i=!0,n=e):(r=!1,i=!0);t++}return r}},{key:"isReducedEchelonForm",value:function(){for(var t=0,e=0,n=-1,r=!0,i=!1;tn?(i=!0,n=e):(r=!1,i=!0);for(var o=e+1;ot.get(r,n)&&(r=i);if(0===t.get(r,n))n++;else{t.swapRows(e,r);for(var o=t.get(e,n),a=n;a=0;)if(0===t.maxRow(r))r--;else{for(var i=0,o=!1;i0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==Ps(t))throw new TypeError("options must be an object");var e=t.rows,n=void 0===e?1:e,r=t.columns,i=void 0===r?1:r;if(!Number.isInteger(n)||n<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(i)||i<=0)throw new TypeError("columns must be a positive integer");for(var o=new Fs(this.rows*n,this.columns*i),a=0;at&&(t=this.get(e,n));return t}},{key:"maxIndex",value:function(){gs(this);for(var t=this.get(0,0),e=[0,0],n=0;nt&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}},{key:"min",value:function(){if(this.isEmpty())return NaN;for(var t=this.get(0,0),e=0;ee&&(e=this.get(t,n));return e}},{key:"maxRowIndex",value:function(t){as(this,t),gs(this);for(var e=this.get(t,0),n=[t,0],r=1;re&&(e=this.get(t,r),n[1]=r);return n}},{key:"minRow",value:function(t){if(as(this,t),this.isEmpty())return NaN;for(var e=this.get(t,0),n=1;ne&&(e=this.get(n,t));return e}},{key:"maxColumnIndex",value:function(t){ss(this,t),gs(this);for(var e=this.get(0,t),n=[0,t],r=1;re&&(e=this.get(r,t),n[0]=r);return n}},{key:"minColumn",value:function(t){if(ss(this,t),this.isEmpty())return NaN;for(var e=this.get(0,t),n=1;n0&&void 0!==arguments[0]?arguments[0]:"frobenius",e=0;if("max"===t)return this.max();if("frobenius"===t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==Ps(t))throw new TypeError("options must be an object");var e=t.min,n=void 0===e?0:e,r=t.max,i=void 0===r?1:r;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(n>=i)throw new RangeError("min must be smaller than max");for(var o=new Fs(this.rows,this.columns),a=0;a0&&Ja(s,{min:n,max:i,output:s}),o.setRow(a,s)}return o}},{key:"scaleColumns",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==Ps(t))throw new TypeError("options must be an object");var e=t.min,n=void 0===e?0:e,r=t.max,i=void 0===r?1:r;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(n>=i)throw new RangeError("min must be smaller than max");for(var o=new Fs(this.rows,this.columns),a=0;a0&&void 0!==arguments[0]?arguments[0]:Ls,e=0;e0&&void 0!==arguments[0]?arguments[0]:Ls,e=0;en||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");for(var r=new Fs(t.length,n-e+1),i=0;i=this.rows)throw new RangeError("Row index out of range: ".concat(t[i]));r.set(i,o-e,this.get(t[i],o))}return r}},{key:"subMatrixColumn",value:function(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");for(var r=new Fs(n-e+1,t.length),i=0;i=this.columns)throw new RangeError("Column index out of range: ".concat(t[i]));r.set(o-e,i,this.get(o,t[i]))}return r}},{key:"setSubMatrix",value:function(t,e,n){if((t=Fs.checkMatrix(t)).isEmpty())return this;hs(this,e,e+t.rows-1,n,n+t.columns-1);for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if("object"===Ps(t)&&(e=t,t=void 0),"object"!==Ps(e))throw new TypeError("options must be an object");var n=e,r=n.unbiased,i=void 0===r||r,o=n.mean,a=void 0===o?this.mean(t):o;if("boolean"!=typeof i)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(a))throw new TypeError("mean must be an array");return vs(this,i,a);case"column":if(!Array.isArray(a))throw new TypeError("mean must be an array");return ys(this,i,a);case void 0:if("number"!=typeof a)throw new TypeError("mean must be a number");return ms(this,i,a);default:throw new Error("invalid option: ".concat(t))}}},{key:"standardDeviation",value:function(t,e){"object"===Ps(t)&&(e=t,t=void 0);var n=this.variance(t,e);if(void 0===t)return Math.sqrt(n);for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if("object"===Ps(t)&&(e=t,t=void 0),"object"!==Ps(e))throw new TypeError("options must be an object");var n=e,r=n.center,i=void 0===r?this.mean(t):r;switch(t){case"row":if(!Array.isArray(i))throw new TypeError("center must be an array");return bs(this,i),this;case"column":if(!Array.isArray(i))throw new TypeError("center must be an array");return xs(this,i),this;case void 0:if("number"!=typeof i)throw new TypeError("center must be a number");return ws(this,i),this;default:throw new Error("invalid option: ".concat(t))}}},{key:"scale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===Ps(t)&&(e=t,t=void 0),"object"!==Ps(e))throw new TypeError("options must be an object");var n=e.scale;switch(t){case"row":if(void 0===n)n=_s(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return Ss(this,n),this;case"column":if(void 0===n)n=Es(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return Os(this,n),this;case void 0:if(void 0===n)n=Ms(this);else if("number"!=typeof n)throw new TypeError("scale must be a number");return ks(this,n),this;default:throw new Error("invalid option: ".concat(t))}}},{key:"toString",value:function(t){return ns(this,t)}}],[{key:"from1DArray",value:function(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");for(var r=new Fs(t,e),i=0;i2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==Ps(n))throw new TypeError("options must be an object");for(var r=n.random,i=void 0===r?Math.random:r,o=new Fs(t,e),a=0;a2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==Ps(n))throw new TypeError("options must be an object");var r=n.min,i=void 0===r?0:r,o=n.max,a=void 0===o?1e3:o,s=n.random,u=void 0===s?Math.random:s;if(!Number.isInteger(i))throw new TypeError("min must be an integer");if(!Number.isInteger(a))throw new TypeError("max must be an integer");if(i>=a)throw new RangeError("min must be smaller than max");for(var c=a-i,l=new Fs(t,e),f=0;f=0){if(i.data=[],!(Number.isInteger(r)&&r>=0))throw new TypeError("nColumns must be a positive integer");for(var o=0;o>t);return this},Bs.prototype.signPropagatingRightShiftM=function(t){if(t=Gs.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e>t.get(e,n));return this},Bs.signPropagatingRightShift=function(t,e){return new Gs(t).signPropagatingRightShift(e)},Bs.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},Bs.prototype.rightShiftS=function(t){for(var e=0;e>>t);return this},Bs.prototype.rightShiftM=function(t){if(t=Gs.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e>>t.get(e,n));return this},Bs.rightShift=function(t,e){return new Gs(t).rightShift(e)},Bs.prototype.zeroFillRightShift=Bs.prototype.rightShift,Bs.prototype.zeroFillRightShiftS=Bs.prototype.rightShiftS,Bs.prototype.zeroFillRightShiftM=Bs.prototype.rightShiftM,Bs.zeroFillRightShift=Bs.rightShift,Bs.prototype.not=function(){for(var t=0;tMath.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}function Ks(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zs(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(Ks(this,t),(e=Hs.checkMatrix(e)).isEmpty())throw new Error("Matrix must be non-empty");var r,i=e.rows,o=e.columns,a=n.computeLeftSingularVectors,s=void 0===a||a,u=n.computeRightSingularVectors,c=void 0===u||u,l=n.autoTranspose,f=void 0!==l&&l,h=Boolean(s),d=Boolean(c),p=!1;if(i=0;q--)if(0!==m[q]){for(var K=q+1;K=0;nt--){if(nt0;){var lt=void 0,ft=void 0;for(lt=X-2;lt>=-1&&-1!==lt;lt--){var ht=Number.MIN_VALUE+ct*Math.abs(m[lt]+Math.abs(m[lt+1]));if(Math.abs(w[lt])<=ht||Number.isNaN(w[lt])){w[lt]=0;break}}if(lt===X-2)ft=4;else{var dt=void 0;for(dt=X-1;dt>=lt&&dt!==lt;dt--){var pt=(dt!==X?Math.abs(w[dt]):0)+(dt!==lt+1?Math.abs(w[dt-1]):0);if(Math.abs(m[dt])<=ct*pt){m[dt]=0;break}}dt===lt?ft=3:dt===X-1?ft=1:(ft=2,lt=dt)}switch(lt++,ft){case 1:var gt=w[X-2];w[X-2]=0;for(var vt=X-2;vt>=lt;vt--){var yt=qs(m[vt],gt),mt=m[vt]/yt,bt=gt/yt;if(m[vt]=yt,vt!==lt&&(gt=-bt*w[vt-1],w[vt-1]=mt*w[vt-1]),d)for(var xt=0;xt=m[lt+1]);){var Xt=m[lt];if(m[lt]=m[lt+1],m[lt+1]=Xt,d&<e&&i.set(o,a,t.get(o,a)/this.s[a]);for(var s=this.U,u=s.rows,c=s.columns,l=new Fs(n,u),f=0;ft&&e++;return e}},{key:"diagonal",get:function(){return Array.from(this.s)}},{key:"threshold",get:function(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}},{key:"leftSingularVectors",get:function(){return this.U}},{key:"rightSingularVectors",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){return Fs.diag(this.s)}}])&&Zs(e.prototype,n),r&&Zs(e,r),t}();function $s(t,e){for(var n=0;nu?1:-1;c=.01*h,l=.01*h}if(fMath.PI/2&&(l-=Math.PI/2,s*=-1,u*=-1);var f=Math.cos(l)*c;e.x=s*f,e.y=u*f}));var a=this.radii;t.forEach((function(s,u){if(u!==i){var c=Math.sqrt(e[u].x*e[u].x+e[u].y*e[u].y);if(c>0&&u!==i){var l=Math.min(o*(n/800),c);if(s[0]+=e[u].x/c*l,s[1]+=e[u].y/c*l,r){var f=s[0]-t[i][0],h=s[1]-t[i][1],d=Math.sqrt(f*f+h*h);f=f/d*a[u],h=h/d*a[u],s[0]=t[i][0]+f,s[1]=t[i][1]+h}}}}))}}])&&tu(e.prototype,n),r&&tu(e,r),t}();function nu(t){return(nu="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 ru(t){return function(t){if(Array.isArray(t))return iu(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return iu(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 iu(t,e)}(t)||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.")}()}function iu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr[0]?r[0]:v-r[0],b=y-r[1]>r[1]?r[1]:y-r[1];0===m&&(m=v/2),0===b&&(b=y/2);var x=b>m?m:b,w=Math.max.apply(Math,ru(g)),_=[];g.forEach((function(e,n){t.unitRadius||(t.unitRadius=x/w),_[n]=e*t.unitRadius})),t.radii=_;var S=t.eIdealDisMatrix();t.eIdealDistances=S;var E=function(t){for(var e=t.length,n=t[0].length,r=[],i=0;iA[1]?A[0]:A[1])+T(t)}:function(t){return A+T(t)}:function(t){return t.size?Di(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+T(t):Li(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+T(t):t.size+T(t):10+T(t)};var P={nodes:e,nodeSizeFunc:M,adjMatrix:h,positions:O,radii:_,height:y,width:v,strictRadial:C,focusID:f,iterations:t.maxPreventOverlapIteration||200,k:O.length/4.5},D=new eu(P);O=D.layout()}return O.forEach((function(t,n){e[n].x=t[0]+r[0],e[n].y=t[1]+r[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n}}t.onLayoutEnd&&t.onLayoutEnd()}},{key:"run",value:function(){for(var t=this.maxIteration,e=this.positions||[],n=this.weights||[],r=this.eIdealDistances||[],i=this.radii||[],o=0;o<=t;o++){var a=o/t;this.oneIteration(a,e,i,r,n)}}},{key:"oneIteration",value:function(t,e,n,r,i){var o=1-t,a=this.focusIndex;e.forEach((function(s,u){var c=lu(s,[0,0]),l=0===c?0:1/c;if(u!==a){var f=0,h=0,d=0;e.forEach((function(t,e){if(u!==e){var n=lu(s,t),o=0===n?0:1/n,a=r[e][u];d+=i[u][e],f+=i[u][e]*(t[0]+a*(s[0]-t[0])*o),h+=i[u][e]*(t[1]+a*(s[1]-t[1])*o)}}));var p=0===n[u]?0:1/n[u];d*=o,d+=t*p*p,f*=o,f+=t*p*s[0]*l,s[0]=f/d,h*=o,h+=t*p*s[1]*l,s[1]=h/d}}))}},{key:"eIdealDisMatrix",value:function(){var t=this,e=t.nodes;if(!e)return[];var n=t.distances,r=t.linkDistance,i=t.radii||[],o=t.unitRadius||50,a=[];return n&&n.forEach((function(n,s){var u=[];n.forEach((function(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){var c=e[s][t.sortBy]||0,l=e[a][t.sortBy]||0;Ii(c)&&(c=c.charCodeAt(0)),Ii(l)&&(l=l.charCodeAt(0)),u.push(n*(Math.abs(c-l)*t.sortStrength)/(i[s]/o))}else u.push(n*r/(i[s]/o));else{var f=(r+o)/2;u.push(n*f)}})),a.push(u)})),a}},{key:"handleInfinity",value:function(t,e,n){for(var r=t.length,i=0;in?t[e][r]:n);return n}},{key:"getType",value:function(){return"radial"}}])&&ou(e.prototype,n),r&&ou(e,r),o}(Ti);function hu(t){return(hu="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 du(t,e){for(var n=0;n0){var n=Math.abs(f[0][t.sortBy]-e[t.sortBy]);t.maxLevelDiff&&n>=t.maxLevelDiff&&(f=[],l.push(f))}f.push(e)}));var h=o+t.minNodeSpacing;if(!t.preventOverlap){var d=l.length>0&&l[0].length>1,p=(Math.min(t.width,t.height)/2-h)/(l.length+(d?1:0));h=Math.min(h,p)}var g=0;if(l.forEach((function(e){var n=t.sweep;void 0===n&&(n=2*Math.PI-2*Math.PI/e.length);var r=e.dTheta=n/Math.max(1,e.length-1);if(e.length>1&&t.preventOverlap){var i=Math.cos(r)-Math.cos(0),o=Math.sin(r)-Math.sin(0),a=Math.sqrt(h*h/(i*i+o*o));g=Math.max(a,g)}e.r=g,g+=h})),t.equidistant){for(var v=0,y=0,m=0;m0){var r=Math.min(a*(l/800),n);t.x+=o[e].x/n*r,t.y+=o[e].y/n*r}}})),t.tick&&t.tick(),++p>=r&&(t.onLayoutEnd&&t.onLayoutEnd(),window.clearInterval(t.timeInterval))}}),0),{nodes:e,edges:n}}}}},{key:"applyCalculate",value:function(t,e,n,r,i){this.calRepulsive(t,n,i),e&&this.calAttractive(e,n,r)}},{key:"calRepulsive",value:function(t,e,n){t.forEach((function(r,i){e[i]={x:0,y:0},t.forEach((function(t,o){if(i!==o&&Ni(r.x)&&Ni(t.x)&&Ni(r.y)&&Ni(t.y)){var a=r.x-t.x,s=r.y-t.y,u=a*a+s*s;if(0===u){u=1;var c=i>o?1:-1;a=.01*c,s=.01*c}var l=n/u;e[i].x+=a*l,e[i].y+=s*l}}))}))}},{key:"calAttractive",value:function(t,e,n){var r=this;t.forEach((function(t){var i=Gi(t,"source"),o=Gi(t,"target");if(i&&o){var a=r.nodeIdxMap[i],s=r.nodeIdxMap[o];if(a!==s){var u=r.nodeMap[i],c=r.nodeMap[o];if(Ni(c.x)&&Ni(u.x)&&Ni(c.y)&&Ni(u.y)){var l=c.x-u.x,f=c.y-u.y,h=Math.sqrt(l*l+f*f),d=h*h/n;e[s].x-=l/h*d,e[s].y-=f/h*d,e[a].x+=l/h*d,e[a].y+=f/h*d}}}}))}},{key:"stop",value:function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)}},{key:"destroy",value:function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0}},{key:"getType",value:function(){return"fruchterman"}}])&&ku(e.prototype,n),r&&ku(e,r),o}(Ti),Du=n(10),Nu=n.n(Du),ju=n(6),Ru=n.n(ju),Lu=n(7),Bu=n.n(Lu),Gu=n(11),Fu=n.n(Gu),zu=(n(29),n(2)),Uu=n(5);function Vu(t){return"number"==typeof t}function Wu(t){return void 0===t?0:t>360||t<-360?t%360:t}function Xu(t,e,n){return Vu(t)?Yr.e.fromValues(t,e,n):3===t.length?Yr.e.clone(t):Yr.e.fromValues(t[0],t[1],t[2])}var Yu,Hu,qu,Ku,Zu,Qu,$u,Ju,tc,ec,nc=function(){function t(e,n){Ru()(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=Yr.b.clone(n.matrix),this.right=Yr.e.clone(n.right),this.up=Yr.e.clone(n.up),this.forward=Yr.e.clone(n.forward),this.position=Yr.e.clone(n.position),this.focalPoint=Yr.e.clone(n.focalPoint),this.distanceVector=Yr.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 Bu()(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=Yr.b.copy(t.matrix,this.matrix),t.right=Yr.e.copy(t.right,this.right),t.up=Yr.e.copy(t.up,this.up),t.forward=Yr.e.copy(t.forward,this.forward),t.position=Yr.e.copy(t.position,this.position),t.focalPoint=Yr.e.copy(t.focalPoint,this.focalPoint),t.distanceVector=Yr.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"}(Ju||(Ju={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(tc||(tc={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(ec||(ec={}));var rc,ic,oc,ac,sc,uc,cc,lc=Math.PI/180,fc=180/Math.PI,hc=(Yu=Object(Uu.injectable)(),Hu=Object(Uu.inject)(zu.IDENTIFIER.InteractorService),Yu(($u=Qu=function(){function t(){Ru()(this,t),this.matrix=Yr.b.create(),this.right=Yr.e.fromValues(1,0,0),this.up=Yr.e.fromValues(0,1,0),this.forward=Yr.e.fromValues(0,0,1),this.position=Yr.e.fromValues(0,0,1),this.focalPoint=Yr.e.fromValues(0,0,0),this.distanceVector=Yr.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,Nu()(this,"interactor",Zu,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=Yr.b.create(),this.view=void 0,this.following=void 0,this.type=Ju.EXPLORING,this.trackingMode=tc.DEFAULT,this.projectionMode=ec.PERSPECTIVE,this.frustum=new zu.Frustum,this.landmarks=[],this.landmarkAnimationID=void 0}return Bu()(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===Ju.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Ju.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!==Ju.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 Yr.b.invert(Yr.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===ec.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===ec.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=ec.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r,Yr.b.perspective(this.perspective,this.fov*lc,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){this.projectionMode=ec.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,f=u+a,h=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;f=(l+=p*this.view.offsetX)+p*this.view.width,d=(h-=g*this.view.offsetY)-g*this.view.height}return Yr.b.ortho(this.perspective,l,f,h,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=Yr.e.fromValues(0,1,0);if(this.focalPoint=Xu(t,e,n),this.trackingMode===tc.CINEMATIC){var i=Yr.e.subtract(Yr.e.create(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=Yr.e.length(i),a=Math.asin(e/o)*fc,s=90+Math.atan2(n,t)*fc,u=Yr.b.create();Yr.b.rotateY(u,u,s*lc),Yr.b.rotateX(u,u,a*lc),r=Yr.e.transformMat4(Yr.e.create(),[0,1,0],u)}return Yr.b.invert(this.matrix,Yr.b.lookAt(Yr.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=Yr.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=Wu(t),this.computeMatrix(),this._getAxes(),this.type===Ju.ORBITING||this.type===Ju.EXPLORING?this._getPosition():this.type===Ju.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=Wu(t),this.computeMatrix(),this._getAxes(),this.type===Ju.ORBITING||this.type===Ju.EXPLORING?this._getPosition():this.type===Ju.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=Wu(t),this.computeMatrix(),this._getAxes(),this.type===Ju.ORBITING||this.type===Ju.EXPLORING?this._getPosition():this.type===Ju.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,e,n){if(this.type===Ju.EXPLORING){t=Wu(t),e=Wu(e),n=Wu(n);var r=Yr.c.setAxisAngle(Yr.c.create(),[1,0,0],(this.rotateWorld?1:-1)*e*lc),i=Yr.c.setAxisAngle(Yr.c.create(),[0,1,0],(this.rotateWorld?1:-1)*t*lc),o=Yr.c.setAxisAngle(Yr.c.create(),[0,0,1],n*lc),a=Yr.c.multiply(Yr.c.create(),i,r);a=Yr.c.multiply(Yr.c.create(),a,o);var s=Yr.b.fromQuat(Yr.b.create(),a);Yr.b.translate(this.matrix,this.matrix,[0,0,-this.distance]),Yr.b.multiply(this.matrix,this.matrix,s),Yr.b.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+e)>90)return;this.relElevation=Wu(e),this.relAzimuth=Wu(t),this.relRoll=Wu(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===Ju.ORBITING||this.type===Ju.EXPLORING?this._getPosition():this.type===Ju.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=Xu(t,e,0),r=Yr.e.clone(this.position);return Yr.e.add(r,r,Yr.e.scale(Yr.e.create(),this.right,n[0])),Yr.e.add(r,r,Yr.e.scale(Yr.e.create(),this.up,n[1])),this._setPosition(r),this}},{key:"dolly",value:function(t){var e=this.forward,n=Yr.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===Ju.ORBITING||this.type===Ju.EXPLORING?this._getDistance():this.type===Ju.TRACKING&&Yr.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 nc(t,n);return this.landmarks.push(r),r}},{key:"setLandmark",value:function(t){var e=new nc(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,f=Yr.e.create(),h=Yr.e.create();if(Yr.e.lerp(f,e.focalPoint,a,l),Yr.e.lerp(h,e.position,o,l),u=e.roll*(1-l)+s*l,e.setFocalPoint(f),e.setPosition(h),e.setRoll(u),e.computeMatrix(),!(Yr.e.dist(f,a)+Yr.e.dist(h,o)>.01))return e.setFocalPoint(f),e.setPosition(h),e.setRoll(u),e.computeMatrix(),void e.interactor.connect();c-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Mc[kc.call(t)]};function Rc(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 Lc(t){for(var e=1;e0&&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-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Ul[Vl.call(t)]};function Xl(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 Yl(t){for(var e=1;e16)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 Bu()(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=yc()(gc.a.mark((function t(){var e,n,r,i,o,a,s,u,c=this;return gc.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;u0){var i=4-r;if(n>1&&n<=i)2===n&&(3===i&&(a+=4,s.push(0)),s.push.apply(s,zl()(t.data)),u.uniformGPUBufferLayout.push({name:t.name,offset:a}));else{for(var o=0;o2&&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),(zu.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=yc()(gc.a.mark((function t(e){var n;return gc.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:zu.isSafari}),entryPoint:"main"}});case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),xf=function(){function t(e,n){Ru()(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 ff(e,{data:i instanceof Array?new Uint16Array(i):i,usage:xc.BufferUsage.Index|xc.BufferUsage.CopyDst})}return Bu()(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}(),wf=function(){function t(e,n){Ru()(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 Bu()(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}(),_f=(hf={},bc()(hf,zu.gl.POINTS,xc.PrimitiveTopology.PointList),bc()(hf,zu.gl.LINES,xc.PrimitiveTopology.LineList),bc()(hf,zu.gl.LINE_LOOP,xc.PrimitiveTopology.LineList),bc()(hf,zu.gl.LINE_STRIP,xc.PrimitiveTopology.LineStrip),bc()(hf,zu.gl.TRIANGLES,xc.PrimitiveTopology.TriangleList),bc()(hf,zu.gl.TRIANGLE_FAN,xc.PrimitiveTopology.TriangleList),bc()(hf,zu.gl.TRIANGLE_STRIP,xc.PrimitiveTopology.TriangleStrip),hf),Sf=(df={},bc()(df,zu.gl.NEVER,xc.CompareFunction.Never),bc()(df,zu.gl.ALWAYS,xc.CompareFunction.Always),bc()(df,zu.gl.LESS,xc.CompareFunction.Less),bc()(df,zu.gl.LEQUAL,xc.CompareFunction.LessEqual),bc()(df,zu.gl.GREATER,xc.CompareFunction.Greater),bc()(df,zu.gl.GEQUAL,xc.CompareFunction.GreaterEqual),bc()(df,zu.gl.EQUAL,xc.CompareFunction.Equal),bc()(df,zu.gl.NOTEQUAL,xc.CompareFunction.NotEqual),df),Ef=(pf={},bc()(pf,zu.gl.FUNC_ADD,xc.BlendOperation.Add),bc()(pf,zu.gl.MIN_EXT,xc.BlendOperation.Min),bc()(pf,zu.gl.MAX_EXT,xc.BlendOperation.Max),bc()(pf,zu.gl.FUNC_SUBTRACT,xc.BlendOperation.Subtract),bc()(pf,zu.gl.FUNC_REVERSE_SUBTRACT,xc.BlendOperation.ReverseSubtract),pf),Of=(gf={},bc()(gf,zu.gl.ZERO,xc.BlendFactor.Zero),bc()(gf,zu.gl.ONE,xc.BlendFactor.One),bc()(gf,zu.gl.SRC_COLOR,xc.BlendFactor.SrcColor),bc()(gf,zu.gl.ONE_MINUS_SRC_COLOR,xc.BlendFactor.OneMinusSrcColor),bc()(gf,zu.gl.SRC_ALPHA,xc.BlendFactor.SrcAlpha),bc()(gf,zu.gl.ONE_MINUS_SRC_ALPHA,xc.BlendFactor.OneMinusSrcAlpha),bc()(gf,zu.gl.DST_COLOR,xc.BlendFactor.DstColor),bc()(gf,zu.gl.ONE_MINUS_DST_COLOR,xc.BlendFactor.OneMinusDstColor),bc()(gf,zu.gl.DST_ALPHA,xc.BlendFactor.DstAlpha),bc()(gf,zu.gl.ONE_MINUS_DST_ALPHA,xc.BlendFactor.OneMinusDstAlpha),bc()(gf,zu.gl.CONSTANT_COLOR,xc.BlendFactor.BlendColor),bc()(gf,zu.gl.ONE_MINUS_CONSTANT_COLOR,xc.BlendFactor.OneMinusBlendColor),bc()(gf,zu.gl.SRC_ALPHA_SATURATE,xc.BlendFactor.SrcAlphaSaturated),gf),Mf=(vf={},bc()(vf,zu.gl.ALPHA,"r8unorm"),bc()(vf,zu.gl.RGBA,"rgba8unorm"),bc()(vf,zu.gl.DEPTH_COMPONENT,"depth32float"),bc()(vf,zu.gl.DEPTH_STENCIL,"depth24plus-stencil8"),vf),kf=(yf={},bc()(yf,zu.gl.NEAREST,"nearest"),bc()(yf,zu.gl.LINEAR,"linear"),yf),Af=(mf={},bc()(mf,zu.gl.REPEAT,"repeat"),bc()(mf,zu.gl.CLAMP_TO_EDGE,"clamp-to-edge"),bc()(mf,zu.gl.MIRRORED_REPEAT,"mirror-repeat"),mf);function Cf(t){var e=t.cull;return e&&e.enable?e.face?e.face===zu.gl.FRONT?xc.CullMode.Front:xc.CullMode.Back:void 0:xc.CullMode.None}function Tf(t){var e=t.depth,n=(t.stencil,{compare:xc.CompareFunction.Always,depthFailOp:xc.StencilOperation.Keep,failOp:xc.StencilOperation.Keep,passOp:xc.StencilOperation.Keep});return{depthWriteEnabled:e&&e.enable,depthCompare:Sf[(null==e?void 0:e.func)||zu.gl.ALWAYS],format:xc.TextureFormat.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function If(t,e){var n=t.blend;return[{format:e,alphaBlend:{srcFactor:Of[n&&n.func&&n.func.srcAlpha||zu.gl.ONE],dstFactor:Of[n&&n.func&&n.func.dstAlpha||zu.gl.ZERO],operation:Ef[n&&n.equation&&n.equation.alpha||zu.gl.FUNC_ADD]},colorBlend:{srcFactor:Of[n&&n.func&&n.func.srcRGB||zu.gl.ONE],dstFactor:Of[n&&n.func&&n.func.dstRGB||zu.gl.ZERO],operation:Ef[n&&n.equation&&n.equation.rgb||zu.gl.FUNC_ADD]},writeMask:xc.ColorWrite.All}]}function Pf(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 Df(t){for(var e=1;e1?n-1:0),i=1;i3&&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:xc.LoadOp.Load,storeOp:xc.StoreOp.Store}],depthStencilAttachment:c&&u?{attachment:u,depthLoadValue:n?this.clearDepthValue:xc.LoadOp.Load,depthStoreOp:xc.StoreOp.Store,stencilLoadValue:a?this.clearStencilValue:xc.LoadOp.Load,stencilStoreOp:xc.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}())||jf,Ff=n(59),zf=n.n(Ff),Uf=n(23),Vf=n.n(Uf),Wf=n(24),Xf=n.n(Wf),Yf=n(18),Hf=n.n(Yf);function qf(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=Hf()(t);if(e){var i=Hf()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Xf()(this,n)}}var Kf,Zf=Object(Uu.injectable)()(Rf=function(t){Vf()(n,t);var e=qf(n);function n(){return Ru()(this,n),e.apply(this,arguments)}return Bu()(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?Yr.e.fromValues(.5,.5,.5):s,c=n,l=i,f=a,h=zf()(u,3),d=h[0],p=h[1],g=h[2],v=[Yr.e.fromValues(-d,-p,g),Yr.e.fromValues(d,-p,g),Yr.e.fromValues(d,p,g),Yr.e.fromValues(-d,p,g),Yr.e.fromValues(d,-p,-g),Yr.e.fromValues(-d,-p,-g),Yr.e.fromValues(-d,p,-g),Yr.e.fromValues(d,p,-g)],y=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],m=[[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=[],O=[],M=[],k=[],A=[],C=0,T=function(t,e,n){var r,i,o,a;for(o=0;o<=e;o++)for(a=0;a<=n;a++){var s=Yr.e.create(),u=Yr.e.create(),c=Yr.e.create(),l=Yr.e.create();Yr.e.lerp(s,v[y[t][0]],v[y[t][1]],o/e),Yr.e.lerp(u,v[y[t][0]],v[y[t][2]],a/n),Yr.e.sub(c,u,v[y[t][0]]),Yr.e.add(l,s,c),r=o/e,i=a/n,E.push(l[0],l[1],l[2]),O.push(m[t][0],m[t][1],m[t][2]),M.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,k.push(r,i),o 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:zu.gl.BACK}).setDepth({enable:!0,func:zu.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}(wl),Sh=Fu()(_h.prototype,"materialSystem",[vh,yh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Eh=Fu()(_h.prototype,"geometrySystem",[mh,bh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Oh=Fu()(_h.prototype,"shaderModuleService",[xh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wh=_h))||wh),Ch=n(94),Th=n(61);function Ih(t,e,n,r,i){Ph(e,r,-i),Ph(e,r,i),t.push(n),t.push(n)}function Ph(t,e,n){t.push([[e[0],e[1]],n])}var Dh,Nh,jh,Rh,Lh,Bh,Gh,Fh,zh,Uh,Vh;function Wh(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=Hf()(t);if(e){var i=Hf()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Xf()(this,n)}}var Xh,Yh,Hh,qh,Kh,Zh,Qh,$h,Jh,td,ed,nd=(Dh=Object(Uu.injectable)(),Nh=Object(Uu.inject)(zu.IDENTIFIER.Systems),jh=Object(Uu.named)(zu.IDENTIFIER.MaterialSystem),Rh=Object(Uu.inject)(zu.IDENTIFIER.Systems),Lh=Object(Uu.named)(zu.IDENTIFIER.GeometrySystem),Bh=Object(Uu.inject)(zu.IDENTIFIER.ShaderModuleService),Dh((Fh=function(t){Vf()(n,t);var e=Wh(n);function n(){var t;Ru()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o3;if(!isFinite(_)){Object(Th.normal)(c,r),Ih(d,h,x,c,1),p.push(1===s?[m,m+2,m+3]:[m+2,m+1,m+3]),f+=2,s=S;continue}E?(_=3,g.push(y/v),Ph(h,c,-S),d.push(x),Ph(h,a,_*S),d.push(x),p.push(s!==-S?[m,m+2,m+3]:[m+2,m+1,m+3]),p.push([m+2,m+3,m+4]),Object(Th.normal)(l,i),Object(Ch.copy)(c,l),Ph(h,c,-S),d.push(x),f+=3):(Ih(d,h,x,a,_),p.push(1===s?[m,m+2,m+3]:[m+2,m+1,m+3]),S=-1,Object(Ch.copy)(c,a),f+=2),s=S}else Object(Th.normal)(c,r),Ih(d,h,x,c,1),p.push(1===s?[m,m+2,m+3]:[m+2,m+1,m+3]),f+=2}return{normals:h,attrIndex:p,attrPos:d,attrCounters:g}}(this.config.points,!1),s=a.normals,u=a.attrIndex,c=a.attrPos,l=a.attrCounters,f=c.length;this.vertexCount=f;var h=this.geometrySystem.createBufferGeometry({vertexCount:f});this.setMaterial(o),this.setGeometry(h),o.setCull({enable:!1,face:zu.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)})),h.setIndex(u.reduce((function(t,e){return[].concat(zl()(t),zl()(e))}),[])),h.setAttribute("a_pos",Float32Array.from(c.reduce((function(t,e){return[].concat(zl()(t),zl()(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]});var g=new Array(f).fill(void 0).map((function(){return zl()(t.config.color)})).reduce((function(t,e){return[].concat(zl()(t),zl()(e))}),[]);h.setAttribute("a_color",Float32Array.from(g),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]}),h.setAttribute("a_line_miter",Float32Array.from(p),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float"}]}),h.setAttribute("a_line_normal",Float32Array.from(d.reduce((function(t,e){return[].concat(zl()(t),zl()(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:3,offset:0,format:"float2"}]}),h.setAttribute("a_counters",Float32Array.from(l),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:4,offset:0,format:"float"}]})}}]),n}(wl),zh=Fu()(Fh.prototype,"materialSystem",[Nh,jh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Uh=Fu()(Fh.prototype,"geometrySystem",[Rh,Lh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Vh=Fu()(Fh.prototype,"shaderModuleService",[Bh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gh=Fh))||Gh);function rd(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 id(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=Hf()(t);if(e){var i=Hf()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Xf()(this,n)}}var od,ad,sd,ud,cd,ld,fd,hd,dd,pd=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],gd=(Xh=Object(Uu.injectable)(),Yh=Object(Uu.inject)(zu.IDENTIFIER.Systems),Hh=Object(Uu.named)(zu.IDENTIFIER.MaterialSystem),qh=Object(Uu.inject)(zu.IDENTIFIER.Systems),Kh=Object(Uu.named)(zu.IDENTIFIER.GeometrySystem),Zh=Object(Uu.inject)(zu.IDENTIFIER.ShaderModuleService),Xh(($h=function(t){Vf()(n,t);var e=id(n);function n(){var t;Ru()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o>8&255,s+1>>8>>8&255])),e.instancedShapes.push(pd.indexOf(t.shape||"circle")),(i=e.instancedColors).push.apply(i,zl()(t.color||[1,0,0,1])),(o=e.instancedOffsets).push.apply(o,zl()(t.position||[0,0])),(a=e.instancedSizes).push.apply(a,zl()(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}(wl),Jh=Fu()($h.prototype,"materialSystem",[Yh,Hh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),td=Fu()($h.prototype,"geometrySystem",[qh,Kh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ed=Fu()($h.prototype,"shaderModuleService",[Zh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qh=$h))||Qh);function vd(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 yd(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 yd(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 yd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=Object(zu.createWorldContainer)(),r=navigator.gpu?Gf:of;n.isBound(zu.IDENTIFIER.RenderEngine)||n.bind(zu.IDENTIFIER.RenderEngine).to(r).inSingletonScope(),n.bind(kd).toSelf(),n.bind(bl).toSelf(),n.bind(wl).toSelf(),n.bind(Wd).toSelf(),n.bind(hc).toSelf(),n.bind(Ad).toSelf(),n.bind(t).toSelf(),n.bind(Cd).toSelf(),n.bind(Vd).toSelf(),n.bind(zu.IDENTIFIER.Geometry).to(Zf).whenTargetNamed(dc.BOX),n.bind(zu.IDENTIFIER.Geometry).to(fh).whenTargetNamed(dc.SPHERE),n.bind(zu.IDENTIFIER.Geometry).to(nh).whenTargetNamed(dc.PLANE),n.bind(zu.IDENTIFIER.Geometry).to(Jf).whenTargetNamed(dc.MERGED),n.bind(zu.IDENTIFIER.Material).to(Mh).whenTargetNamed(xl.BASIC),n.bind(zu.IDENTIFIER.Renderable).to(gd).whenTargetNamed(wl.POINT),n.bind(zu.IDENTIFIER.Renderable).to(nd).whenTargetNamed(wl.LINE),n.bind(zu.IDENTIFIER.Renderable).to(Ah).whenTargetNamed(wl.GRID);var i=n.get(t);return i.setContainer(n),i.setConfig(e),i}}]),t}(),Ud=Fu()(zd.prototype,"configService",[Gd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fd=zd))||Fd),qd=function(t,e){return t?Ni(t)?function(){return t}:t:function(){return e||1}},Kd=function(t,e){var n=[],r=[],i={},o=0;for(o=0;o = vec4(0.0);\\n\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\n# [[builtin work_group_id]] var workGroupID : vec3;\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\n[[builtin local_invocation_idx]] var 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;\\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 gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array>;\\n};\\n[[binding 1, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AttributeArray : [[stride 16]] array>;\\n};\\n[[binding 2, set 0]] var gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array>;\\n};\\n[[binding 3, set 0]] var 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) -> vec2 {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 = 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(dx, dy);}\\nfn calcGravity(currentNode : vec4, nodeAttributes : vec4) -> vec2 {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 = 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(dx, dy);}\\nfn calcAttractive(i : i32, currentNode : vec4) -> vec2 {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;\\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 = 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(dx, dy);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4 = 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 = 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 ;}\\nvar repulsive : vec2 = calcRepulsive(i, currentNode);\\ndx = dx + repulsive.x;\\ndy = dy + repulsive.y;\\nvar attractive : vec2 = calcAttractive(i, currentNode);\\ndx = dx + attractive.x;\\ndy = dy + attractive.y;\\nvar gravity : vec2 = 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(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[]","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","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[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([y,1,1]).setBinding({u_Data:x,u_K:f,u_K2:l,u_Gravity:r.gravity,u_ClusterGravity:r.clusterGravity||r.gravity||1,u_Speed:h,u_MaxDisplace:c,u_Clustering:d?1:0,u_Center:s,u_AttributeArray:g,u_ClusterCenters:E,MAX_EDGE_PER_VERTEX:b,VERTEX_COUNT:y}),d&&(k=_.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4 = vec4(0.0);\\n\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\n# [[builtin work_group_id]] var workGroupID : vec3;\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\n[[builtin local_invocation_idx]] var localInvocationIndex : u32;\\n\\n\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array>;\\n};\\n[[binding 0, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_NodeAttributes : [[stride 16]] array>;\\n};\\n[[binding 1, set 0]] var gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array>;\\n};\\n[[binding 2, set 0]] var gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar center : vec4 = 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 = gWebGPUBuffer1.u_NodeAttributes[j];\\nvar clusterIdx : i32 = i32(attributes.x);\\nvar vertex : vec4 = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx = sumx + vertex.x;\\nsumy = sumy + vertex.y;\\ncount = count + 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(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[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([v,1,1]).setBinding({u_Data:x,u_NodeAttributes:g,u_ClusterCenters:E,VERTEX_COUNT:y,CLUSTER_COUNT:v})),A=function(){return op(C,void 0,void 0,regeneratorRuntime.mark((function n(){var r,o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=0;case 1:if(!(r = vec4(0.0);\\n\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\n# [[builtin work_group_id]] var workGroupID : vec3;\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\n[[builtin local_invocation_idx]] var 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 gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array>;\\n};\\n[[binding 1, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array>;\\n};\\n[[binding 2, set 0]] var gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray1 : [[stride 16]] array>;\\n};\\n[[binding 3, set 0]] var gWebGPUBuffer2 : GWebGPUBuffer2;\\ntype GWebGPUBuffer3 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray2 : [[stride 16]] array>;\\n};\\n[[binding 4, set 0]] var 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 {var packedIntValue : i32 = i32(packedValue);\\nvar v0 : i32 = packedIntValue / 1048576;\\nreturn vec2(v0, packedIntValue - (v0 * 1048576));}\\nfn calcRepulsive(i : i32, currentNode : vec4) -> vec2 {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 = 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 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar attributesj : vec4 = 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(ax, ay);}\\nfn calcGravity(i : i32, currentNode : vec4, attributes2 : vec4) -> vec2 {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(ax, ay);}\\nfn calcAttractive(i : i32, currentNode : vec4, attributes1 : vec4) -> vec2 {var mass : f32 = attributes1.x;\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nvar compressed : vec2 = unpack_float(currentNode.z);\\nvar length : i32 = compressed.x;\\nvar arr_offset : i32 = compressed.y;\\nvar node_buffer : vec4;\\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 = 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(ax, ay);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4 = gWebGPUBuffer0.u_Data[i];\\nvar movement : vec4 = 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 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar nodeAttributes2 : vec4 = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvar repulsive : vec2 = calcRepulsive(i, currentNode);\\nax = ax + repulsive.x;\\nay = ay + repulsive.y;\\nvar attractive : vec2 = calcAttractive(i, currentNode, nodeAttributes1);\\nax = ax + attractive.x;\\nay = ay + attractive.y;\\nvar gravity : vec2 = 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(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4(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[]","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[]","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[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4[]","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([s,1,1]).setBinding({u_Data:l,u_damping:r.damping,u_maxSpeed:r.maxSpeed,u_minMovement:r.minMovement,u_coulombDisScale:r.coulombDisScale,u_factor:r.factor,u_NodeAttributeArray1:x,u_NodeAttributeArray2:w,MAX_EDGE_PER_VERTEX:c,VERTEX_COUNT:s,u_AveMovement:O,u_interval:r.interval}),A=S.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4 = vec4(0.0);\\n\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\n# [[builtin work_group_id]] var workGroupID : vec3;\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\n[[builtin local_invocation_idx]] var localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_iter : f32;\\n};\\n[[binding 0, set 0]] var gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array>;\\n};\\n[[binding 1, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array>;\\n};\\n[[binding 2, set 0]] var 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 = gWebGPUBuffer0.u_Data[j];\\nmovement = movement + vertex.w;}\\nmovement = movement / f32(__DefineValuePlaceholder__VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(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[]","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[]","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:l,VERTEX_COUNT:s,u_AveMovement:[0,0,0,0]}),C=function(){return dp(T,void 0,void 0,regeneratorRuntime.mark((function n(){var o,s,u;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=0;case 1:if(!(om[1]?m[0]:m[1])/2;v=function(t){return x}}else{var w=m/2;v=function(t){return w}}else v=function(t){return t.size?Di(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:Li(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=v;var _,S=this.comboSpacing;_=Ni(S)?function(){return S}:Wi(S)?S:function(){return 0},this.comboSpacing=_;var E,O=this.comboPadding;E=Ni(O)?function(){return O}:Di(O)?function(){return Math.max.apply(null,O)}:Wi(O)?O:function(){return 0},this.comboPadding=E;var M,k=this.linkDistance;k||(k=10),M=Ni(k)?function(t){return k}:k,this.linkDistance=M;var A,C=this.edgeStrength;C||(C=1),A=Ni(C)?function(t){return C}:C,this.edgeStrength=A;var T,I=this.nodeStrength;I||(I=30),T=Ni(I)?function(t){return I}:I,this.nodeStrength=T}},{key:"initPos",value:function(t){this.nodes.forEach((function(e,n){var 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))}))}},{key:"getComboMap",value:function(){var t=this,e=t.nodeMap,n=t.indexMap,r=t.comboTrees,i=t.oriComboMap,o={};return(r||[]).forEach((function(r){var a=[];Vi(r,(function(r){if("node"===r.itemType)return!0;if(!i[r.id])return!0;if(void 0===o[r.id]){var s={id:r.id,name:r.id,cx:0,cy:0,count:0,depth:t.oriComboMap[r.id].depth||0,children:[]};o[r.id]=s}var u=r.children;u&&u.forEach((function(t){if(!o[t.id]&&!e[t.id])return!0;a.push(t)}));var c=o[r.id];if(c.cx=0,c.cy=0,0===a.length){c.empty=!0;var l=i[r.id],f=Object.keys(e).length,h="".concat(r.id,"-visual-child-").concat(f),d={id:h,x:l.x,y:l.y,depth:c.depth+1,itemType:"node"};t.nodes.push(d),e[h]=d,n[h]=f,c.cx=l.x,c.cy=l.y,a.push(d)}return a.forEach((function(t){if(c.count++,"node"!==t.itemType){var n=o[t.id];return Ni(n.cx)&&(c.cx+=n.cx),void(Ni(n.cy)&&(c.cy+=n.cy))}var r=e[t.id];r&&(Ni(r.x)&&(c.cx+=r.x),Ni(r.y)&&(c.cy+=r.y))})),c.cx/=c.count,c.cy/=c.count,c.children=a,!0}))})),o}},{key:"applyComboCenterForce",value:function(t){var e=this.gravity,n=this.comboGravity||e,r=this.alpha,i=this.comboTrees,o=this.indexMap,a=this.nodeMap,s=this.comboMap;(i||[]).forEach((function(e){Vi(e,(function(e){if("node"===e.itemType)return!0;if(!s[e.id])return!0;var 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((function(e){if("node"!==e.itemType){var f=s[e.id];return f&&Ni(f.cx)&&(i.cx+=f.cx),void(f&&Ni(f.cy)&&(i.cy+=f.cy))}var h=a[e.id],d=h.x-c||.005,p=h.y-l||.005,g=Math.sqrt(d*d+p*p),v=o[h.id],y=n*r/g*u;t[v].x-=d*y,t[v].y-=p*y,Ni(h.x)&&(i.cx+=h.x),Ni(h.y)&&(i.cy+=h.y)})),i.cx/=i.count,i.cy/=i.count,!0}))}))}},{key:"applyCalculate",value:function(t){var e=this.comboMap,n=this.nodes,r={};n.forEach((function(t,e){n.forEach((function(n,i){if(!(eo&&(u.minX=o),u.minY>a&&(u.minY=a),u.maxX1&&a.forEach((function(n,s){if("node"===n.itemType)return!1;var u=e[n.id];u&&a.forEach((function(a,c){if(s<=c)return!1;if("node"===a.itemType)return!1;var l=e[a.id];if(!l)return!1;var f=u.cx-l.cx||.005,h=u.cy-l.cy||.005,d=f*f+h*h,p=u.r||1,g=l.r||1,v=p+g,y=g*g,m=p*p;if(di)){var y=e["".concat(d.id,"-").concat(n.id)],m=y.vx,b=y.vy,x=Math.log(Math.abs(n.depth-d.depth)/10)+1||1;x=x<1?1:x,n.comboId!==d.comboId&&(x+=1);var w=x?Math.pow(f,x):1,_=o(n)*a/g*w;if(t[p].x+=m*_,t[p].y+=b*_,p=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n}},{key:"NW",value:function(){var e=new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2});return e}},{key:"NE",value:function(){var e=new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2});return e}},{key:"SW",value:function(){var e=new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2});return e}},{key:"SE",value:function(){var e=new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2});return e}}])&&Ep(e.prototype,n),r&&Ep(e,r),t}();function Mp(t,e){for(var n=0;n250&&(this.barnesHut=!0),void 0===this.prune&&o>100&&(this.prune=!0),0!==this.maxIteration||this.prune?0===this.maxIteration&&n&&(r=100,o<=200&&o>100?r=500:o>200&&(r=950),this.maxIteration=r):(r=250,o<=200&&o>100?r=1e3:o>200&&(r=1200),this.maxIteration=r),this.kr||(this.kr=50,o>100&&o<=500?this.kr=20:o>500&&(this.kr=1)),this.kg||(this.kg=20,o>100&&o<=500?this.kg=10:o>500&&(this.kg=1)),this.nodes=this.updateNodesByForces(i),e()}},{key:"updateNodesByForces",value:function(t){for(var e=this.edges,n=this.maxIteration,r=this.nodes,i=e.filter((function(t){return Gi(t,"source")!==Gi(t,"target")})),o=r.length,a=i.length,s=[],u={},c={},l=[],f=0;f0;){for(var m=0;m50||!u)?this.getOptRepGraForces(d,g,i):this.getRepGraForces(h,50,d,100,o,i);var b=this.updatePos(d,p,f,i);a=b.nodes,f=b.sg,h--,this.tick&&this.tick()}return a}},{key:"getAttrForces",value:function(t,e,n,r,i,o,a,s){for(var u=this.nodes,c=this.preventOverlap,l=this.dissuadeHubs,f=this.mode,h=this.prune,d=0;d0&&(x=b,w=b),s[2*r[p.id]]+=x*m[0],s[2*r[v.id]]-=w*m[0],s[2*r[p.id]+1]+=x*m[1],s[2*r[v.id]+1]-=w*m[1]}}return s}},{key:"getRepGraForces",value:function(t,e,n,r,i,o){for(var a=this.nodes,s=this.preventOverlap,u=this.kr,c=this.kg,l=this.center,f=this.prune,h=a.length,d=0;d0&&(y=u*(o[d]+1)*(o[p]+1)/v),n[2*d]-=y*g[0],n[2*p]+=y*g[0],n[2*d+1]-=y*g[1],n[2*p+1]+=y*g[1]}var m=[a[d].x-l[0],a[d].y-l[1]],b=Math.hypot(m[0],m[1]);m[0]=m[0]/b,m[1]=m[1]/b;var x=c*(o[d]+1);n[2*d]-=x*m[0],n[2*d+1]-=x*m[1]}return n}},{key:"getOptRepGraForces",value:function(t,e,n){for(var r=this.nodes,i=this.kg,o=this.center,a=this.prune,s=r.length,u=9e10,c=-9e10,l=9e10,f=-9e10,h=0;h=c&&(c=r[h].x),r[h].x<=u&&(u=r[h].x),r[h].y>=f&&(f=r[h].y),r[h].y<=l&&(l=r[h].y));for(var d=Math.max(c-u,f-l),p=new Op({xmid:(c+u)/2,ymid:(f+l)/2,length:d,massCenter:o,mass:s}),g=new kp(p),v=0;v1.5*b?1.5*b:n);for(var x=0;xS?S:w)*t[2*x],O=w*t[2*x+1];i[x].x+=E,i[x].y+=O}return{nodes:i,sg:n}}}])&&Cp(e.prototype,n),r&&Cp(e,r),o}(Ti);var jp=new Proxy({},{get:function(t,e){return Ji(e)},set:function(t,e,n){return $i(e,n),!0}}),Rp=n(82),Lp=n.n(Rp),Bp=jr.traverseTree,Gp=function(t,e){return t?P(t)?function(e){return t}:t:function(t){return e||1}},Fp=function(t,e){var n=[],r=[],i={},o=0;for(o=0;o=0&&(o="x",i="y");var a=0;Bp(t,(function(t){return a++,t.x>r.x&&(r.x=t.x),t.xr.y&&(r.y=t.y),t.yWebGL.
','Find out how to get it here.'].join("\n"):['Your browser does not seem to support WebGL.
','Find out how to get it here.'].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)}}},Hp=Object(p.__assign)(Object(p.__assign)(Object(p.__assign)(Object(p.__assign)({},jr),l),f),h),qp=Hp.radialLayout,Kp=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=Lp.a[e.type](t,e.config);return qp(n),n}:this.layoutMethod=function(t){return Lp.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}();$i("grid",ao),$i("random",po),$i("force",ka),$i("circular",Ba),$i("dagre",Ha),$i("radial",fu),$i("concentric",mu),$i("mds",Ou),$i("fruchterman",Pu),$i("fruchterman-gpu",ap),$i("gForce",_o),$i("gForce-gpu",pp),$i("comboForce",wp),$i("forceAtlas2",Np);var Zp=function(t,e){e.isCustomLayout=!0,$i(t,e)},Qp=function(t,e){var n=t.toString(),r=new Blob(["importScripts('"+e+"');("+n+")()"],{type:"text/javascript"});return new Worker(URL.createObjectURL(r))},$p=function(t){return void 0===t&&(t="https://unpkg.com/@antv/layout@latest/dist/layout.min.js"),new Qp((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,f=(v=void 0===l?{}:l).type;if(!(h=layout.getLayoutByName(f))){this.postMessage({type:n,message:"layout "+f+" not found"});break}v.onLayoutEnd=function(){o.postMessage({type:e,nodes:u}),null==a||a.destroy()},(a=new h(v)).init({nodes:u,edges:c}),a.execute();break;case r:var h,d=i.data,p=d.nodes,g=(c=d.edges,d.layoutCfg),v=void 0===g?{}:g,y=d.canvas;f=v.type;if(!(h=layout.getLayoutByName(f))){this.postMessage({type:n,message:"layout "+f+" not found"});break}if("gpu"!==f.split("-")[1]){this.postMessage({type:n,message:"layout "+f+" does not support GPU"});break}var m=new h(v);m.init({nodes:p,edges:c}),m.executeWithWorker(y,this)}}(i)}}),t)},Jp="LAYOUT_RUN",tg="LAYOUT_END",eg="LAYOUT_ERROR",ng="LAYOUT_TICK",rg="GPU_LAYOUT_RUN",ig="GPU_LAYOUT_END";function og(t){return(og="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 ag=function(t){return setTimeout(t,16)},sg=function(t){return clearTimeout(t)},ug=function(t){return("undefined"!=typeof window&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||ag)(t)},cg=function(t){return("undefined"!=typeof window&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||sg)(t)},lg=["fruchterman","gForce"],fg=["force","grid","circular"],hg=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(p.__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=$p(this.layoutCfg.workerScriptURL)),this.worker},e.prototype.stopWorker=function(){var t=this.workerData;this.worker&&(this.worker.terminate(),this.worker=null,t.requestId&&(cg(t.requestId),t.requestId=null),t.requestId2&&(cg(t.requestId2),t.requestId2=null))},e.prototype.execLayoutMethod=function(t,e){var n=this;return new Promise((function(r,i){return Object(p.__awaiter)(n,void 0,void 0,(function(){var n,o,a,s,u,c,l;return Object(p.__generator)(this,(function(f){switch(f.label){case 0:if((n=this.graph).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,c=function(){a&&a(),n.refreshPositions()},t.tick=c):"comboForce"===t.type&&(t.comboTrees=n.get("comboTrees")),!1;try{s=new jp[o](t)}catch(t){console.warn("The layout method: '"+o+"' does not exist! Please specify it first."),i()}return s.enableTick&&(u=t.onTick,c=function(){u&&u(),n.refreshPositions()},s.tick=c),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}))}(l=this.filterLayoutData(this.data,t),e),s.init(l),n.emit("beforesublayout",{type:o}),[4,s.execute()];case 1:return f.sent(),s.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),this.layoutMethods[e]=s,[2]}}))}))}))},e.prototype.updateLayoutMethod=function(t,e){var n=this;return new Promise((function(r,i){return Object(p.__awaiter)(n,void 0,void 0,(function(){var n,i,o;return Object(p.__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"),s=n.get("height"),u={};Object.assign(u,{width:a,height:s,center:[a/2,s/2]},this.layoutCfg),this.layoutCfg=u,this.destoryLayoutMethods(),n.emit("beforelayout"),this.initPositions(u.center,i),this.initPositions(u.center,o);var c=u.type;c&&"gpu"===c.split("-")[1]&&(c=c.split("-")[0],u.gpuEnabled=!0);var l=!1;u.gpuEnabled&&(l=!0,Yp().webgl||(console.warn("Your browser does not support webGL or GPGPU. The layout will run in CPU."),l=!1)),this.isGPU=l;var f=u.onLayoutEnd,h=u.layoutEndFormatted,d=u.adjust;if(h||(u.layoutEndFormatted=!0,u.onAllLayoutEnd=function(){return Object(p.__awaiter)(e,void 0,void 0,(function(){return Object(p.__generator)(this,(function(t){switch(t.label){case 0:return f&&f(),this.refreshLayout(),d&&u.pipes?[4,this.adjustPipesBox(this.data,d)]:[3,2];case 1:t.sent(),this.refreshLayout(),t.label=2;case 2:return n.emit("afterlayout"),[2]}}))}))}),this.stopWorker(),u.workerEnabled&&this.layoutWithWorker(this.data))return!0;var g=Promise.resolve();return u.type?g=g.then((function(){return Object(p.__awaiter)(e,void 0,void 0,(function(){return Object(p.__generator)(this,(function(t){switch(t.label){case 0:return[4,this.execLayoutMethod(u,0)];case 1:return[2,t.sent()]}}))}))})):u.pipes&&u.pipes.forEach((function(t,n){g=g.then((function(){return Object(p.__awaiter)(e,void 0,void 0,(function(){return Object(p.__generator)(this,(function(e){switch(e.label){case 0:return[4,this.execLayoutMethod(t,n)];case 1:return[2,e.sent()]}}))}))}))})),g.then((function(){u.onAllLayoutEnd&&u.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'),u=n?n.backgroundColor:void 0,c=n?n.padding:void 0;c?P(c)&&(c=[c,c,c,c]):c=[0,0,0,0];var l=i+c[0]+c[2],f=o+c[1]+c[3],h={container:s,height:l,width:f,quickHit:!0},d="svg"===a?new Xr.Canvas(h):new Wr.Canvas(h),p=this.get("group").clone(),g=F(p.getMatrix());g||(g=[1,0,0,0,1,0,0,0,1]);var v=(r.maxX+r.minX)/2,y=(r.maxY+r.minY)/2;g=gg(g,[["t",-v,-y],["t",o/2+c[3],i/2+c[0]]]),p.resetMatrix(),p.setMatrix(g),d.add(p);var m=d.get("el"),b="";e||(e="image/png"),setTimeout((function(){if("svg"===a){var n=m.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);b="data:image/svg+xml;charset=utf8,"+encodeURIComponent(o)}else{var s=void 0,c=m.getContext("2d"),h=void 0;if(u){var d="undefined"!=typeof window?window.devicePixelRatio:1;try{s=c.getImageData(0,0,f*d,l*d),h=c.globalCompositeOperation,c.globalCompositeOperation="destination-over",c.fillStyle=u,c.fillRect(0,0,f,l)}catch(t){console.error("Download image failed. Out of memory at ImageData creation")}}b=m.toDataURL(e),u&&(c.clearRect(0,0,f,l),c.putImageData(s,0,0),c.globalCompositeOperation=h)}t&&t(b)}),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=_i(''),c=document.querySelector(".g6-graph-watermarker"),l=n?n.backgroundColor:void 0,f=n?n.padding:void 0;f?P(f)&&(f=[f,f,f,f]):f=[0,0,0,0];var h=o+f[0]+f[2],d=a+f[1]+f[3];if(c){var p=this.get("graphWaterMarker").cfg||{},g=p.width,v=p.height;h=Math.ceil(h/v)*v,d=Math.ceil(d/g)*g}var y={container:u,height:h,width:d},m="svg"===s?new Xr.Canvas(y):new Wr.Canvas(y),b=this.get("group").clone(),x=F(b.getMatrix());x||(x=[1,0,0,0,1,0,0,0,1]);var w=(i.maxX+i.minX)/2,_=(i.maxY+i.minY)/2;x=gg(x,[["t",-w,-_],["t",a/2+f[3],o/2+f[0]]]),b.resetMatrix(),b.setMatrix(x),m.add(b);var S=m.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)}),d,h,S)},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=xi.waterMarkerImage);var n=this.get("container");A(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=V({},xi.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 Wr.Canvas(c),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var f=r.get("context"),h=u.rotate,d=u.x,p=u.y;f.rotate(-h*Math.PI/180);var g=new Image;g.crossOrigin="anonymous",g.src=t,g.onload=function(){if(f.drawImage(g,d,p,u.width,u.height),f.rotate(h*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");A(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=V({},xi.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 Wr.Canvas(c),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var f=r.get("context"),h=u.rotate,d=u.fill,p=u.fontFamily,g=u.fontSize,v=u.baseline,y=u.x,m=u.y,b=u.lineHeight;f.rotate(-h*Math.PI/180),f.font=g+"px "+p,f.fillStyle=d,f.textBaseline=v;for(var x=t.length-1;x>=0;x--)f.fillText(t[x],y,m+x*b);if(f.rotate(h*Math.PI/180),s)n.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;";else{var w=document.querySelector(".g6-graph-watermarker");w||((w=document.createElement("div")).className="g6-graph-watermarker"),w.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(w)}},e.prototype.destroy=function(){var e,n,r,i;S(this.get("plugins"),(function(t){t.destroyPlugin()}));var o=this.get("tooltips");if(o)for(var a=0;a0)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 f=o.getModel();r&&o.set("originAttrs",{x:f.x,y:f.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(S(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}),A(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 S(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){mg(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})),S(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(){S(n.getNodes(),(function(t){t.set("originAttrs",null)})),S(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||!_(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}(vg),xg=function(){function t(t){this._cfgs=V(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={};S(n,(function(n,i){var o=I(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;S(e,(function(e,n){t.off(n,e)})),this._events=null,this._cfgs=null,this.destroyed=!0},t}(),wg=(pg=function(t,e){return(pg=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}pg(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),_g="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",Sg=function(t){function e(e){return t.call(this,e)||this}return wg(e,t),e.prototype.getDefaultCfgs=function(){return{img:_g,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")||_g,i=_i("
"),o=_i("");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");Si(this.get("container"),{width:n+"px",height:r+"px"});var i=80*n/e,o=80*r/e;Si(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");Si(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}(xg),Eg=n(80),Og=n.n(Eg),Mg=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&&Og()("\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 kg=function(t){function e(e){return t.call(this,e)||this}return Mg(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(t){return"\n
    \n
  • 鑿滃崟椤�1
  • \n
  • 鑿滃崟椤�2
  • \n
\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=_i("
");Si(t,{top:"0px",position:"absolute",visibility:"hidden"});var e=this.get("container");e||(e=this.get("graph").get("container")),A(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);A(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"),f=r.getBoundingClientRect(),h=this.get("offsetX")||0,d=this.get("offsetY")||0,p=o.getContainer().offsetTop,g=o.getContainer().offsetLeft,v=t.canvasX+g+h,y=t.canvasY+p+d;v+f.width>c&&(v=t.canvasX-f.width-h+g),y+f.height>l&&(y=t.canvasY-f.height-d+p),Si(r,{top:y+"px",left:v+"px",visibility:"visible"});var m="click"===this.get("trigger"),b=function(t){m?m=!1:e.onMenuHide()};document.body.addEventListener("click",b),this.set("handler",b)}},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&&Si(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")),A(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(xg),Ag=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)}}(),Cg=function(){return(Cg=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n "),a=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,s=0,u=0,c=!1,l=0,f=0,h=0,d=0,p=0,g=0;o.addEventListener("dragstart",(function(i){var a,v;if(i.dataTransfer){var y=new Image;y.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",null===(v=(a=i.dataTransfer).setDragImage)||void 0===v||v.call(a,y,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 m=o.style;l=parseInt(m.left,10),f=parseInt(m.top,10),h=parseInt(m.width,10),d=parseInt(m.height,10),h>n[0]||d>n[1]||(g=r.getZoom(),p=t.get("ratio"),c=!0,s=i.clientX,u=i.clientY)}}),!1),o.addEventListener(a?"dragover":"drag",(function(t){if(c&&!b(t.clientX)&&!b(t.clientY)){var e=s-t.clientX,i=u-t.clientY;(l-e<0||l-e+h>=n[0])&&(e=0),(f-i<0||f-i+d>=n[1])&&(i=0),Si(o,{left:(l-=e)+"px",top:(f-=i)+"px"}),r.translate(e*g/p,i*g/p),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,f=(u.y-s.y)*t,h=s.x*t+e,d=s.y*t+n,p=h+l,g=d+f;h<0&&(l+=h,h=0),p>i[0]&&(l-=p-i[0]),d<0&&(f+=d,d=0),g>i[1]&&(f-=g-i[1]),this.set("ratio",t),Si(c,{left:h+"px",top:d+"px",width:l+"px",height:f+"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();S(e.getEdges(),(function(e){t.updateOneEdgeKeyShape(e,r)})),S(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||(S(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();S(e.getEdges(),(function(e){t.updateOneEdgeKeyShape(e,r)})),S(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||(S(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:Cg({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=_i("
");A(r)&&(r=document.getElementById(r)),r?r.appendChild(i):t.get("container").appendChild(i),this.set("container",i);var o,a=_i('
');i.appendChild(a),a.addEventListener("dragenter",(function(t){t.preventDefault()})),a.addEventListener("dragover",(function(t){t.preventDefault()})),o="svg"===t.get("renderer")?new Xr.Canvas({container:a,width:e[0],height:e[1]}):new Wr.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=Tg(a.width,c),l=Tg(a.height,l)),c+=2*i,l+=2*i;var f=Math.min(e[0]/c,e[1]/l),h=[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)*f)/2,v=(e[1]-(l-2*i)*f)/2;h=Ig(h,[["t",d,p],["s",f,f],["t",g,v]]),o.setMatrix(h),this.set("ratio",f),this.set("totaldx",g+d*f),this.set("totaldy",v+p*f),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}(xg),Dg=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 Ng(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 jg(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 Rg=function(t){function e(e){return t.call(this,e)||this}return Dg(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"),f=e.get("iterations"),h=e.get("iterRate"),d=e.get("lambda"),p=0;pc;){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+=Ng(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=Ng({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),e.length=Ng({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+Ng({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 nn||Math.abs(o.y)>n){var s=1/Ng(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}(xg),Lg=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)}}(),Bg=function(){return(Bg=Object.assign||function(t){for(var e,n=1,r=arguments.length;n(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(ni){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(ro){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(),f=l.length,h=e?{x:e.x,y:e.y}:{x:t.x,y:t.y};!this.get("dragging")||"mousemove"!==this.get("trigger")&&"click"!==this.get("trigger")||(h=this.get("cacheCenter"));var d=this.get("delegateCenterDiff");d&&(h.x+=d.x,h.y+=d.y),this.updateDelegate(h,a);for(var p=0;p\n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n \n '},zoomSensitivity:2}},e.prototype.init=function(){var t=this,e=this.get("graph"),n=this.get("getContent")(e),r=n;A(n)&&(r=_i(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")),A(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&&Si(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,F(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,F(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")),A(e)&&(e=document.getElementById(e)),e.removeChild(t)}var n=this.get("handleClick");n&&t.removeEventListener("click",n)},e}(xg),Vg=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&&Og()("\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 Wg=function(t){function e(e){return t.call(this,e)||this}return Vg(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(t){return"\n

    绫诲瀷锛�"+t.item.getType()+"

    \n ID锛�"+t.item.getID()+"\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=_i("
    "),n=t.get("container");n||(n=t.get("graph").get("container")),A(n)&&(n=document.getElementById(n)),Si(e,{position:"absolute",visibility:"hidden",display:"none"}),n.appendChild(e),"click"!==t.get("trigger")&&(e.addEventListener("mouseenter",(function(t){Si(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);A(r)?n.innerHTML=r:n.innerHTML=r.outerHTML,this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&Si(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&&x(c)&&c.length>=2){var f=l.getBBox();u={x:f.minX+f.width*c[0],y:f.minY+f.height*c[1]}}var h=r.getCanvasByPoint(u.x,u.y),d=h.x,p=h.y,g=r.getContainer(),v={x:d+g.offsetLeft+a,y:p+g.offsetTop+s};Si(n,{visibility:"visible",display:"unset"});var y=n.getBoundingClientRect();d+y.width+a>i&&(v.x-=y.width+a),p+y.height+s>o&&(v.y-=y.height+s),Si(n,{left:v.x+"px",top:v.y+"px"})}else Si(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")),A(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(xg),Xg=n(55),Yg={};function Hg(t,e){Yg[t]=e}var qg=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(_t.assign)(this.__cfg__,t),this.init()},t.prototype.clone=function(){return this.constructor(this.__cfg__)},t.prototype.getTicks=function(){var t=this;return Object(_t.map)(this.ticks,(function(e,n){return Object(_t.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(_t.isNil)(r)||!Object(_t.isFunction)(r.toString)?"":r.toString()},t.prototype.getConfig=function(t){return this.__cfg__[t]},t.prototype.init=function(){Object(_t.assign)(this,this.__cfg__),this.setDomain(),Object(_t.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(_t.isString)(t)){var n=Yg[t];if(!n)throw new Error("There is no method to to calculate ticks!");e=n(this)}else Object(_t.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(_t.isNumber)(t)?(t-e)/(n-e):NaN},t.prototype.calcValue=function(t,e,n){return e+t*(n-e)},t}(),Kg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cat",e.isCategory=!0,e}return Object(p.__extends)(e,t),e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;tthis.max?NaN:this.values[r]},e.prototype.getText=function(e){for(var n=[],r=1;r1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(qg),Zg=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Qg="[^\\s]+",$g=/\[([^]*?)\]/gm;function Jg(t,e){for(var n=[],r=0,i=t.length;r-1?r:null}};function ev(t){for(var e=[],n=1;n3?0:(t-t%10!=10?1:0)*t%10]}},av=ev({},ov),sv=function(t){return av=ev(av,t)},uv=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},cv=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+cv(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+cv(Math.floor(Math.abs(e)/60),2)+":"+cv(Math.abs(e)%60,2)}},fv=function(t){return+t-1},hv=[null,"[1-9]\\d?"],dv=[null,Qg],pv=["isPm",Qg,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],gv=["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}],vv={D:["day","[1-9]\\d?"],DD:["day","\\d\\d"],Do:["day","[1-9]\\d?"+Qg,function(t){return parseInt(t,10)}],M:["month","[1-9]\\d?",fv],MM:["month","\\d\\d",fv],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:hv,dd:hv,ddd:dv,dddd:dv,MMM:["month",Qg,tv("monthNamesShort")],MMMM:["month",Qg,tv("monthNames")],a:pv,A:pv,ZZ:gv,Z:gv},yv={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"},mv=function(t){return ev(yv,t)},bv=function(t,e,n){if(void 0===e&&(e=yv.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=yv[e]||e).replace($g,(function(t,e){return r.push(e),"@@@"}));var i=ev(ev({},av),n);return(e=e.replace(Zg,(function(e){return lv[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))};function xv(t,e,n){if(void 0===n&&(n={}),"string"!=typeof e)throw new Error("Invalid format in fecha parse");if(e=yv[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($g,(function(t,e){return o.push(uv(e)),"@@@"})),s={},u={};a=uv(a).replace(Zg,(function(t){var e=vv[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=ev(ev({},av),n),f=1;f0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),Object(_t.isDate)(t)&&(t=t.getTime()),t}var Ev=36e5,Ov=24*Ev,Mv=31*Ov,kv=[["HH:mm:ss",1e3],["HH:mm:ss",1e4],["HH:mm:ss",3e4],["HH:mm",6e4],["HH:mm",6e5],["HH:mm",18e5],["HH",Ev],["HH",6*Ev],["HH",12*Ev],["YYYY-MM-DD",Ov],["YYYY-MM-DD",4*Ov],["YYYY-WW",7*Ov],["YYYY-MM",Mv],["YYYY-MM",4*Mv],["YYYY-MM",6*Mv],["YYYY",380*Ov]];function Av(t,e,n){var r,i=(r=function(t){return t[1]},function(t,e,n,i){for(var o=Object(_t.isNil)(n)?0:n,a=Object(_t.isNil)(i)?t.length:i;o>>1;r(t[s])>e?a=s:o=s+1}return o})(kv,(e-t)/n)-1,o=kv[i];return i<0?o=kv[0]:i>=kv.length&&(o=Object(_t.last)(kv)),o}var Cv=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return Object(p.__extends)(e,t),e.prototype.translate=function(t){t=Sv(t);var e=this.values.indexOf(t);return-1===e&&(e=Object(_t.isNumber)(t)&&t-1){var r=this.values[n],i=this.formatter;return r=i?i(r,e):_v(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(_t.each)(e,(function(t,n){e[n]=Sv(t)})),e.sort((function(t,e){return t-e})),t.prototype.setDomain.call(this)},e}(Kg),Tv=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return Object(p.__extends)(e,t),e.prototype.scale=function(t){if(Object(_t.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(_t.head)(e),r=Object(_t.last)(e);nthis.max&&(this.max=r),Object(_t.isNil)(this.minLimit)||(this.min=n),Object(_t.isNil)(this.maxLimit)||(this.max=r)},e.prototype.setDomain=function(){var t=Object(_t.getRange)(this.values),e=t.min,n=t.max;Object(_t.isNil)(this.min)&&(this.min=e),Object(_t.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(_t.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}(qg),Iv=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return Object(p.__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}(Tv);function Pv(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 Dv(t,e){return 1===t?1:Math.log(e)/Math.log(t)}function Nv(t,e,n){Object(_t.isNil)(n)&&(n=Math.max.apply(null,t));var r=n;return Object(_t.each)(t,(function(t){t>0&&t1&&(r=1),r}var jv=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return Object(p.__extends)(e,t),e.prototype.invert=function(t){var e,n=this.base,r=Dv(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=Dv(n,a/n)))*o;if(t=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(Pv(r,t)-Pv(r,n))/(Pv(r,e)-Pv(r,n))},e}(Tv),Lv=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return Object(p.__extends)(e,t),e.prototype.getText=function(t,e){var n=this.translate(t),r=this.formatter;return r?r(n,e):_v(n,this.mask)},e.prototype.scale=function(e){var n=e;return(Object(_t.isString)(n)||Object(_t.isDate)(n))&&(n=this.translate(n)),t.prototype.scale.call(this,n)},e.prototype.translate=function(t){return Sv(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(_t.isNil)(e)&&Object(_t.isNumber)(e)||(this.min=this.translate(this.min)),Object(_t.isNil)(n)&&Object(_t.isNumber)(n)||(this.max=this.translate(this.max)),t&&t.length){var r=[],i=1/0,o=i,a=0;Object(_t.each)(t,(function(t){var e=Sv(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t+" in time scale!");i>e?(o=i,i=e):o>e&&(o=e),a1&&(this.minTickInterval=o-i),Object(_t.isNil)(e)&&(this.min=i),Object(_t.isNil)(n)&&(this.max=a)}},e}(Iv),Bv=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return Object(p.__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(_t.last)(e);if(i<0)return Object(_t.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(_t.last)(e)!==this.max&&e.push(this.max),Object(_t.head)(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(tObject(_t.last)(e))return 1;var n=0;return Object(_t.each)(e,(function(e,r){if(!(t>=e))return!1;n=r})),n/(e.length-1)},e}(Tv),Gv=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return Object(p.__extends)(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(Bv),Fv={};function zv(t,e){if(function(t){return Fv[t]}(t))throw new Error("type '"+t+"' existed.");Fv[t]=e}var Uv=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return Object(p.__extends)(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&Object(_t.isNumber)(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return te[1]?NaN:this.values[0]},e}(qg),Vv=[1,5,2,2.5,4,3],Wv=100*Number.EPSILON;function Xv(t,e,n,r,i,o){var a=Object(_t.size)(e),s=Object(_t.indexOf)(e,t),u=0,c=function(t,e){return(t%e+e)%e}(r,o);return(c=0&&(u=1),1-s/(a-1)-n+u}function Yv(t,e,n){var r=Object(_t.size)(e);return 1-Object(_t.indexOf)(e,t)/(r-1)-n+1}function Hv(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 qv(t,e){return t>=e?2-(t-1)/(e-1):1}function Kv(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 Zv(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 Qv(t,e,n,r,i,o){if(void 0===n&&(n=5),void 0===r&&(r=!0),void 0===i&&(i=Vv),void 0===o&&(o=[.25,.2,.5,.05]),Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!n)return{min:0,max:0,ticks:[]};if(e-t<1e-15||1===n)return{min:t,max:e,ticks:[t]};for(var a={score:-2,lmin:0,lmax:0,lstep:0},s=1;s<1/0;){for(var u=0;ua.score&&(!r||w<=t&&_>=e)&&(a.lmin=w,a.lmax=_,a.lstep=S,a.score=k)}p+=1}f+=1}}s+=1}var A,C=a.lmax,T=a.lmin,I=a.lstep,P=Math.floor((C-T)/I)+1,D=new Array(P);for(u=0;u=o&&t<=a})).map((function(t){return e[t]}))}return e.slice(o,a+1)}var Jv=Math.sqrt(50),ty=Math.sqrt(10),ey=Math.sqrt(2),ny=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 u0?r=ry(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,t):r<0&&(r=ry(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=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s=0?(o>=Jv?10:o>=ty?5:o>=ey?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Jv?10:o>=ty?5:o>=ey?2:1)}function iy(t,e,n){return("ceil"===n?Math.ceil(t/e):"floor"===n?Math.floor(t/e):Math.round(t/e))*e}function oy(t,e,n){var r=iy(t,n,"floor"),i=iy(e,n,"ceil");r=Object(_t.fixedBase)(r,n),i=Object(_t.fixedBase)(i,n);for(var o=[],a=r;a<=i;a+=n){var s=Object(_t.fixedBase)(a,n);o.push(s)}return{min:r,max:i,ticks:o}}function ay(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(_t.isNil)(i)?Object(_t.isNil)(e)?a:e:i,f=Object(_t.isNil)(o)?Object(_t.isNil)(n)?s:n:o;if(l>f&&(f=(r=[l,f])[0],l=r[1]),c<=2)return[l,f];for(var h=(f-l)/(c-1),d=[],p=0;p1&&(i*=Math.ceil(a)),r&&i31536e6)for(var u=ly(n),c=Math.ceil(o/31536e6),l=s;l<=u+c;l+=c)a.push(fy(l));else if(o>Mv){var f=Math.ceil(o/Mv),h=hy(e),d=function(t,e){var n=ly(t),r=ly(e),i=hy(t);return 12*(r-n)+(hy(e)-i)%12}(e,n);for(l=0;l<=d+f;l+=f)a.push(dy(s,l+h))}else if(o>Ov){var p=(b=new Date(e)).getFullYear(),g=b.getMonth(),v=b.getDate(),y=Math.ceil(o/Ov),m=function(t,e){return Math.ceil((e-t)/Ov)}(e,n);for(l=0;lEv){p=(b=new Date(e)).getFullYear(),g=b.getMonth(),y=b.getDate();var b,x=b.getHours(),w=Math.ceil(o/Ev),_=function(t,e){return Math.ceil((e-t)/Ev)}(e,n);for(l=0;l<=_+w;l+=w)a.push(new Date(p,g,y,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 O=o;O<1e3&&(O=1e3);var M=1e3*Math.floor(e/1e3),k=Math.ceil((n-e)/1e3),A=Math.ceil(O/1e3);for(l=0;l=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})),Hg("log",(function(t){var e,n=t.base,r=t.tickCount,i=t.min,o=t.max,a=t.values,s=Dv(n,o);if(i>0)e=Math.floor(Dv(n,i));else{var u=Nv(a,n,o);e=Math.floor(Dv(n,u))}for(var c=s-e,l=Math.ceil(c/r),f=[],h=e;h=0?1:-1;return Math.pow(t,e)*n}))})),Hg("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;on&&(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=Iy(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}(),Gy=function(){return(Gy=Object.assign||function(t){for(var e,n=1,r=arguments.length;np?(o.show(),a.show(),p=s.minX+s.width+10):(o.hide(),a.hide()),o})),this.controllerBtnGroup=new By(Gy({group:this.group,x:this.x,y:this.y+r+25,width:n,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),a.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;e1&&(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=H(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),S(o,(function(e,n){return t.minTextShape.attr(n,e)})),this.maxHandlerShape.setX(n-r/2),S(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=H(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(),f=null,h=null;return"trend"===this.timeBarType?(f=a-c.widththis.x+this.width?{x:s-r/2-2,textAlign:"right"}:{x:s+r/2+2,textAlign:"left"}):"simple"===this.timeBarType&&(f=c.width>a-2?{x:a+r/2+2,textAlign:"center"}:{x:a-r/2-2,textAlign:"center"},h=l.width>this.width-s-2?{x:s-r/2-2,textAlign:"center"}:{x:s+r/2+2,textAlign:"center"}),u?[h,f]:[f,h]},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}(),qy=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,f=t.backgroundColor,h=void 0===f?"#000":f,d=t.textColor,p=void 0===d?"#fff":d,g=t.opacity,v=void 0===g?.8:g,y=t.fontSize,m=void 0===y?12:y;this.container=o,this.className=l,this.backgroundColor=h,this.textColor=p,this.x=n,this.y=i,this.text=a,this.padding=u,this.opacity=v,this.fontSize=m,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=_i("
    ');A(s)&&(s=document.getElementById(s)),s.appendChild(u),this.parentHeight=s.offsetHeight,this.parentWidth=s.offsetWidth,Si(u,{visibility:"hidden",top:0,left:0});var c=_i("\n
    ");c.innerHTML=r,u.appendChild(c),this.backgroundDOM=c;var l=_i("
    ");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;Si(this.container,{top:-i-a+"px",left:n+"px",visibility:"visible"}),Si(this.backgroundDOM,{marginLeft:-r/2+"px"}),Si(this.arrowDOM,{marginLeft:-o/2+"px",top:i+"px"});var s=n-r/2,u=n+r/2;s<0?Si(this.backgroundDOM,{marginLeft:-r/2-s+"px"}):u>this.parentWidth&&Si(this.backgroundDOM,{marginLeft:-r/2-u+this.parentWidth+12+"px"})},t.prototype.hide=function(){Si(this.container,{top:0,left:0,visibility:"hidden"})},t}(),Ky=function(){return(Ky=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=m&&r<=b?c:l,a=g.addShape("rect",{attrs:Ky({x:i+r*(p+2),y:i,width:p,height:h},o),draggable:!0,name:"tick-rect-"+r}),s=g.addShape("rect",{attrs:{x:i+r*p+2*(2*r-1)/2,y:i,width:0===r||r===d-1?p+1:p+2,height:h,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-"+r});s.toFront();var f,x=a.getBBox(),w=(x.minX+x.maxX)/2;if(v.push({rect:a,pickRect:s,value:e.date,x:w,y:x.minY}),u?(f=u(e),!A(f)&&f&&(f=e.date)):r%Math.round(d/10)==0&&(f=e.date),f){y.push(f);var _=x.maxY+2*i;g.addShape("line",{attrs:{stroke:"#BFBFBF",x1:w,y1:_,x2:w,y2:_+4}});var S=_+4+i,E=g.addShape("text",{attrs:{fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:w,y:S,textAlign:"center",text:f,textBaseline:"top",fontSize:10,fontFamily:t.fontFamily||"Arial, sans-serif"},capture:!1}),O=E.getBBox();O.maxX>n?E.attr("textAlign","right"):O.minX<0&&E.attr("textAlign","left")}})),this.tickRects=v;var x=this.group;this.currentSpeed=1,this.controllerBtnGroup=new By({group:x,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=r&&s<=n?o:a;i[s].rect.attr(u)}var c=i.length;t.endTickRectId=n;var l=r/c,f=n/c;t.graph.emit("valuechange",{value:[l,f]})}})),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(!(r0?this.endTickRectId++:(e[this.endTickRectId].rect.attr(r),this.endTickRectId--),o!==this.startTickRectId)this.endTickRectId"),{position:"relative"}),u.appendChild(t),this.set("timeBarContainer",t),e="SVG"===n.get("renderer")?new Xr.Canvas({container:t,width:i,height:o}):new Wr.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,f=t.backgroundStyle,h=t.foregroundStyle,d=a.data,p=em(a,["data"]),g=e-2*i,v="trend"===o?26:4,y=this.get("graph"),m=this.get("timeBarGroup"),b=this.get("canvas"),x=null;"trend"===o||"simple"===o?x=new Hy(tm(tm({graph:y,canvas:b,group:m,type:o,x:n+i,y:"trend"===o?r+i:r+i+15,width:g,height:v,padding:i,backgroundStyle:f,foregroundStyle:h,trendCfg:tm(tm({},p),{data:d.map((function(t){return t.value}))})},s),{tick:{ticks:d,tickLabelFormatter:l.tickLabelFormatter,tickLabelStyle:l.tickLabelStyle,tickLineStyle:l.tickLineStyle},handlerStyle:tm(tm({},s.handlerStyle),{height:s.height||v}),controllerCfg:u,textStyle:c})):"tick"===o&&(x=new $y(tm({graph:y,canvas:b,group:m,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,f=c?c(r[u]):r[u].date;if("tick"!==i)this.get("timebar").setText(l,f);if(o)o(a,l,f);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&0===this.cacheGraphData.nodes.length)&&(this.cacheGraphData=a.get("data"));var h=this.cacheGraphData.nodes.filter((function(t){return t.date>=r[s].date&&t.date<=r[u].date})),d=h.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:h,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",q((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")),A(r)&&(r=document.getElementById(r)),r.removeChild(n)}},e}(xg),rm=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)}}(),im=jr.applyMatrix;var om=function(t){function e(e){return t.call(this,e)||this}return rm(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");A(r)&&(r=document.getElementById(r));var i=_i("
    \n
    "),o=0,a=0,s=!1,u=0,c=0,l=0,f=0,h=0,d=0;r.addEventListener("mousedown",(function(r){if(e.refresh=!1,r.target===i){var u=i.style;l=parseInt(u.width,10),f=parseInt(u.height,10);var c=t.get("width"),p=t.get("height");l>c||f>p||(d=n.getZoom(),h=t.get("ratio"),s=!0,o=r.clientX,a=r.clientY)}}),!1),r.addEventListener("mousemove",(function(e){if(s&&!b(e.clientX)&&!b(e.clientY)){var r=t.get("width"),p=t.get("height"),g=i.style;u=parseInt(g.left,10),c=parseInt(g.top,10),l=parseInt(g.width,10),f=parseInt(g.height,10);var v=o-e.clientX,y=a-e.clientY;u-v<0?v=u:u-v+l>=r&&(v=0),c-y<0?y=c:c-y+f>=p&&(y=0),Si(i,{left:(u-=v)+"px",top:(c-=y)+"px"}),n.translate(v*d/h,y*d/h),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 f=a.getMatrix();f||(f=[1,0,0,0,1,0,0,0,1]);var h=Yr.a.invert([1,0,0,0,1,0,0,0,1],f),d=im({x:l.minX,y:l.minY},h),p=r.getCanvasByPoint(d.x,d.y),g=this.get("viewport");g||this.initViewport();var v=i/l.width,y=v*e,m=v*n,b=e*-p.x/l.width,x=n*-p.y/l.height,w=b+y,_=x+m;b<0&&(y+=b,b=0),w>e&&(y-=w-e),x<0&&(m+=x,x=0),_>n&&(m-=_-n),this.set("ratio",t),Si(g,{left:b+"px",top:x+"px",width:y+"px",height:m+"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=_i("
    ");A(i)&&(i=document.getElementById(i)),i?i.appendChild(s):t.get("container").appendChild(s),this.set("container",s);var u=_i('
    ');s.appendChild(u);var c=_i('');u.appendChild(c),this.set("containerDOM",u),this.set("containerSpan",c);var l=_i('');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=_i('');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}(xg),am=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)}}(),sm=function(){return(sm=Object.assign||function(t){for(var e,n=1,r=arguments.length;n(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;um({x:n,y:o},a)");r.appendChild(i),this.set("container",i);var o=this.render();Si(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";ym.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();Si(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(vm(vm({},n.get("oriAttrs")),i)),r.attr(vm(vm({},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(vm(vm({},n.get("oriAttrs")),a)),r.attr(vm(vm({},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")})),f=c.get("children").filter((function(t){return t.get("active")})),h=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?f:h).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 Wr.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,f=c.height,h=c.r,d=t.getStyle(e.substr(0,4),r);switch(r.type){case"circle":o={r:h,x:0,y:0};break;case"rect":o={width:l,height:f,x:-l/2,y:-f/2};break;case"ellipse":o={r1:l,r2:f,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:h,x:0,y:0}}var p=a.addShape(u,{attrs:vm(vm({},o),d),name:r.type+"-node-keyShape",oriAttrs:vm({opacity:1},d)});if(r.label){var g=p.getBBox(),v=(null===(i=r.labelCfg)||void 0===i?void 0:i.style)||{},y=vm({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},v);a.addShape("text",{attrs:vm({x:g.maxX+4,y:0,text:r.label},y),className:"legend-label",name:r.type+"-node-text",oriAttrs:y})}}))}));var u,c=this.get("padding"),l=r.find((function(t){return"title-container"===t.get("name")})),f={height:0,maxY:0,width:0};if(this.get("title")){l||(l=r.addGroup({name:"title-container"}));var h={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:c[0]},d=this.get("titleConfig")||{},p=Object.assign(h,d.style||{});u=l.addShape("text",{attrs:vm({text:this.get("title")},p)}),f=l.getCanvasBBox(),l.setMatrix([1,0,0,0,1,0,d.offsetX,d.offsetY,1])}this.layoutItems();var g=r.getCanvasBBox(),v=i.getCanvasBBox(),y=v.minX<0?Math.abs(v.minX)+c[3]:c[3],m=f.maxYc.max&&(c.max=o[0]),d>l&&(l=d),t.setMatrix([1,0,0,0,1,0,p,g,1])}));var f=c.max-c.min,h={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&&(h.min=o[0]);var a=t.get("children")[0],s=t.getCanvasBBox(),u=a.getBBox(),c=u.width,l=u.height,f=0,d=0;"vertical"===r?(f=o[1],d=o[0],o[0]=d+s.height+n,t.setMatrix([1,0,0,0,1,0,0,d+l/2,1])):(f=o[0],d=o[1],o[0]=f+s.width+e,t.setMatrix([1,0,0,0,1,0,f+c/2,0,1])),o[0]>h.max&&(h.max=o[0])}));var p=h.max-h.min;if(i&&""!==i&&"left"!==i){var g=f-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||Z(),type:t.type||"circle",style:vm({},t.style),order:t.order,label:t.label,itemType:"node",size:s,labelCfg:{position:"right",style:vm({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||Z(),type:i,size:a,style:vm({lineWidth:x(a)?a[1]:1},t.style),order:t.order,label:t.label,itemType:"edge",labelCfg:{position:"right",style:vm({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(P(e))this.set(t,[e,e,e,e]);else if(x(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&&(x(t.size)?(e=t.size[0],n=t.size[1]||t.size[0],r=t.size[0]/2):P(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 vm(vm({},"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}(xg)};Br("circle",{options:{size:Ur.defaultNode.size,style:{x:0,y:0,stroke:Ur.defaultNode.style.stroke,fill:Ur.defaultNode.style.fill,lineWidth:Ur.defaultNode.style.lineWidth},labelCfg:{style:{fill:Ur.nodeLabel.style.fill,fontSize:Ur.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Ur.defaultNode.linkPoints.size,lineWidth:Ur.defaultNode.linkPoints.lineWidth,fill:Ur.defaultNode.linkPoints.fill,stroke:Ur.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(p.__assign)({},Ur.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=this.getOptions(t).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=V({},r,t.icon),a=e.addShape("circle",{attrs:i,className:this.type+"-keyShape",draggable:!0}),s=o.width,u=o.height,c=o.show,l=o.text;return c&&(l?e.addShape("text",{attrs:Object(p.__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(p.__assign)({x:-s/2,y:-u/2},o),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})),this.drawLinkPoints(t,e),a},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,c=r.r,l=Object(p.__rest)(r,["top","left","right","bottom","size","r"]),f=this.getSize(t)[0]/2;o&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:-f,y:0,r:u/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:f,y:0,r:u/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),i&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:0,y:-f,r:u/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:0,y:f,r:u/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},r=V({},e,n),i=this.getSize(t)[0]/2;return Object(p.__assign)({x:0,y:0,r:i},r)},update:function(t,e){var n=e.getContainer(),r=this.getSize(t),i={stroke:t.color,r:r[0]/2},o=e.get("keyShape"),a=V({},o.attr(),i,t.style);this.updateShape(t,e,a,!0),this.updateLinkPoints(t,n)}},"single-node"),Br("rect",{options:{size:[100,30],style:{radius:0,stroke:Ur.defaultNode.style.stroke,fill:Ur.defaultNode.style.fill,lineWidth:Ur.defaultNode.style.lineWidth},labelCfg:{style:{fill:Ur.nodeLabel.style.fill,fontSize:Ur.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Ur.defaultNode.linkPoints.size,lineWidth:Ur.defaultNode.linkPoints.lineWidth,fill:Ur.defaultNode.linkPoints.fill,stroke:Ur.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(p.__assign)({},Ur.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 this.drawLinkPoints(t,e),r},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,c=r.r,l=Object(p.__rest)(r,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],d=f[1];o&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:-h/2,y:0,r:u/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:h/2,y:0,r:u/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),i&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:0,y:-d/2,r:u/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:0,y:d/2,r:u/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},getShapeStyle:function(t){var e=B({},this.getOptions(t).style,{stroke:t.color}),n=this.getSize(t),r=e.width||n[0],i=e.height||n[1];return Object(p.__assign)({x:-r/2,y:-i/2,width:r,height:i},e)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).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=B({},r,o.attr(),a);s=B(s,t.style),this.updateShape(t,e,s,!1),this.updateLinkPoints(t,n)}},"single-node"),Br("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:Ur.defaultNode.style.stroke,fill:Ur.defaultNode.style.fill,lineWidth:Ur.defaultNode.style.lineWidth},labelCfg:{style:{fill:Ur.nodeLabel.style.fill,fontSize:Ur.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Ur.defaultNode.linkPoints.size,lineWidth:Ur.defaultNode.linkPoints.lineWidth,fill:Ur.defaultNode.linkPoints.fill,stroke:Ur.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(p.__assign)({},Ur.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var n=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}),a=r.width,s=r.height,u=r.show,c=r.text;return u&&(c?e.addShape("text",{attrs:Object(p.__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(p.__assign)({x:-a/2,y:-s/2},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,c=r.r,l=Object(p.__rest)(r,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0]/2,d=f[1]/2;o&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:-h,y:0,r:u/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:h,y:0,r:u/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),i&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:0,y:-d,r:u/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:0,y:d,r:u/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},getShapeStyle:function(t){var e=B({},this.getOptions(t).style,{stroke:t.color}),n=this.getSize(t),r=n[0]/2,i=n[1]/2;return Object(p.__assign)({x:0,y:0,rx:r,ry:i},e)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getSize(t),o={stroke:t.color,rx:i[0]/2,ry:i[1]/2},a=B({},r,e.get("keyShape").attr(),o);a=B(a,t.style),this.updateShape(t,e,a,!0),this.updateLinkPoints(t,n)}},"single-node"),Br("diamond",{options:{size:[80,80],style:{stroke:Ur.defaultNode.style.stroke,fill:Ur.defaultNode.style.fill,lineWidth:Ur.defaultNode.style.lineWidth},labelCfg:{style:{fill:Ur.nodeLabel.style.fill,fontSize:Ur.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Ur.defaultNode.linkPoints.size,lineWidth:Ur.defaultNode.linkPoints.lineWidth,fill:Ur.defaultNode.linkPoints.fill,stroke:Ur.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(p.__assign)({},Ur.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var n=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}),a=r.width,s=r.height,u=r.show,c=r.text;return u&&(c?e.addShape("text",{attrs:Object(p.__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(p.__assign)({x:-a/2,y:-s/2},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,c=r.r,l=Object(p.__rest)(r,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],d=f[1];o&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:-h/2,y:0,r:u/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:h/2,y:0,r:u/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),i&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:0,y:-d/2,r:u/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:0,y:d/2,r:u/2||c||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=B({},this.getOptions(t).style,{stroke:t.color}),n=this.getPath(t);return Object(p.__assign)({path:n},e)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},a=B({},r,e.get("keyShape").attr(),o);a=B(a,t.style),this.updateShape(t,e,a,!0),this.updateLinkPoints(t,n)}},"single-node"),Br("triangle",{options:{size:40,direction:"up",style:{stroke:Ur.defaultNode.style.stroke,fill:Ur.defaultNode.style.fill,lineWidth:Ur.defaultNode.style.lineWidth},labelCfg:{style:{fill:Ur.nodeLabel.style.fill,fontSize:Ur.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Ur.defaultNode.linkPoints.size,lineWidth:Ur.defaultNode.linkPoints.lineWidth,fill:Ur.defaultNode.linkPoints.fill,stroke:Ur.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(p.__assign)({},Ur.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var n=this.getOptions(t),r=n.icon,i=void 0===r?{}:r,o=n.direction,a=this.getShapeStyle(t),s=t.direction||o,u=e.addShape("path",{attrs:a,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0}),c=i.width,l=i.height,f=i.show,h=i.offset,d=i.text;if(f)if(d)e.addShape("text",{attrs:Object(p.__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=-c/2,v=-l/2;"up"!==s&&"down"!==s||(v+=h),"left"!==s&&"right"!==s||(g+=h),e.addShape("image",{attrs:Object(p.__assign)({x:g,y:v},i),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})}return this.drawLinkPoints(t,e),u},drawLinkPoints:function(t,e){var n=this.getOptions(t),r=n.linkPoints,i=void 0===r?{}:r,o=n.direction,a=t.direction||o,s=i.top,u=i.left,c=i.right,l=i.bottom,f=i.size,h=i.r,d=Object(p.__rest)(i,["top","left","right","bottom","size","r"]),g=this.getSize(t)[0];if(u){var v=null,y=g*Math.sin(1/3*Math.PI),m=g*Math.sin(1/3*Math.PI);"up"===a?v=[-m,y]:"down"===a?v=[-m,-y]:"left"===a&&(v=[-m,m-y]),v&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},d),{x:v[0],y:v[1],r:f/2||h||5}),className:"link-point-left",name:"link-point-left"})}if(c){var b=null;y=g*Math.sin(1/3*Math.PI),m=g*Math.sin(1/3*Math.PI);"up"===a?b=[m,y]:"down"===a?b=[m,-y]:"right"===a&&(b=[m,m-y]),b&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},d),{x:b[0],y:b[1],r:f/2||h||5}),className:"link-point-right",name:"link-point-right"})}if(s){var x=null;y=g*Math.sin(1/3*Math.PI),m=g*Math.sin(1/3*Math.PI);"up"===a?x=[m-y,-y]:"left"===a?x=[m,-y]:"right"===a&&(x=[-m,-y]),x&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},d),{x:x[0],y:x[1],r:f/2||h||5}),className:"link-point-top",name:"link-point-top"})}if(l){var w=null;y=g*Math.sin(1/3*Math.PI),m=g*Math.sin(1/3*Math.PI);"down"===a?w=[-m+y,y]:"left"===a?w=[m,y]:"right"===a&&(w=[-m,y]),w&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},d),{x:w[0],y:w[1],r:f/2||h||5}),className:"link-point-bottom",name:"link-point-bottom"})}},getPath:function(t){var e=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=B({},this.getOptions(t).style,{stroke:t.color}),n=this.getPath(t);return Object(p.__assign)({path:n},e)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},a=B({},r,e.get("keyShape").attr(),o);a=B(a,t.style),this.updateShape(t,e,a,!0),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var n=this.getOptions({}),r=n.linkPoints,i=n.direction,o=t.direction||i,a=e.find((function(t){return"link-point-left"===t.get("className")})),s=e.find((function(t){return"link-point-right"===t.get("className")})),u=e.find((function(t){return"link-point-top"===t.get("className")})),c=e.find((function(t){return"link-point-bottom"===t.get("className")})),l=r,f=a||s||u||c;f&&(l=f.attr());var h=B({},l,t.linkPoints),d=h.fill,g=h.stroke,v=h.lineWidth,y=h.size/2;y||(y=h.r);var m=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},b=m.left,x=m.right,w=m.top,_=m.bottom,S=this.getSize(t)[0],E={r:y,fill:d,stroke:g,lineWidth:v},O=null,M=S*Math.sin(1/3*Math.PI),k=S*Math.sin(1/3*Math.PI);"up"===o?O=[-k,M]:"down"===o?O=[-k,-M]:"left"===o&&(O=[-k,k-M]),O&&(a?b||void 0===b?a.attr(Object(p.__assign)(Object(p.__assign)({},E),{x:O[0],y:O[1]})):a.remove():b&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},E),{x:O[0],y:O[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}));var A=null;"up"===o?A=[k,M]:"down"===o?A=[k,-M]:"right"===o&&(A=[k,k-M]),A&&(s?x||void 0===x?s.attr(Object(p.__assign)(Object(p.__assign)({},E),{x:A[0],y:A[1]})):s.remove():x&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},E),{x:A[0],y:A[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}));var C=null;"up"===o?C=[k-M,-M]:"left"===o?C=[k,-M]:"right"===o&&(C=[-k,-M]),C&&(u?w||void 0===w?u.attr(Object(p.__assign)(Object(p.__assign)({},E),{x:C[0],y:C[1]})):u.remove():w&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},E),{x:C[0],y:C[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}));var T=null;"down"===o?T=[-k+M,M]:"left"===o?T=[k,M]:"right"===o&&(T=[-k,M]),T&&(c?_||void 0===_?c.attr(Object(p.__assign)(Object(p.__assign)({},E),{x:T[0],y:T[1]})):c.remove():_&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},E),{x:T[0],y:T[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))}},"single-node"),Br("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:Ur.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf"},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.getOptions(t).preRect,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=this.getSize(t),a=o[0],s=o[1],u=e.addShape("rect",{attrs:i,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0}),c=r.show,l=Object(p.__rest)(r,["show"]);return c&&e.addShape("rect",{attrs:Object(p.__assign)({x:-a/2,y:-s/2,height:s},l),className:"pre-rect",name:"pre-rect",draggable:!0}),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),u},drawLogoIcon:function(t,e){var n=this.getOptions(t).logoIcon,r=void 0===n?{}:n,i=this.getSize(t)[0];if(r.show){var o=r.width,a=r.height,s=r.x,u=r.y,c=r.offset,l=r.text,f=Object(p.__rest)(r,["width","height","x","y","offset","text"]);l?e.addShape("text",{attrs:Object(p.__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(p.__assign)(Object(p.__assign)({},f),{x:s||-i/2+o+c,y:u||-a/2,width:o,height:a}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var n=this.getOptions(t).stateIcon,r=void 0===n?{}:n,i=this.getSize(t)[0];if(r.show){var o=r.width,a=r.height,s=r.x,u=r.y,c=r.offset,l=r.text,f=Object(p.__rest)(r,["width","height","x","y","offset","text"]);l?e.addShape("text",{attrs:Object(p.__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(p.__assign)(Object(p.__assign)({},f),{x:s||i/2-o+c,y:u||-a/2,width:o,height:a}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,c=r.r,l=Object(p.__rest)(r,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],d=f[1];o&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:-h/2,y:0,r:u/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:h/2,y:0,r:u/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),i&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:0,y:-d/2,r:u/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},l),{x:0,y:d/2,r:u/2||c||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,s=n.descriptionCfg,u=void 0===s?{}:s,c=this.getSize(t)[0],l=null,f=a.show,h=a.width,d=-c/2+i.offset;f&&(d=-c/2+h+i.offset);var g=i.style,v=u.style,y=u.paddingTop;return A(t.description)?(l=e.addShape("text",{attrs:Object(p.__assign)(Object(p.__assign)({},g),{x:d,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0}),e.addShape("text",{attrs:Object(p.__assign)(Object(p.__assign)({},v),{x:d,y:17+(y||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0})):l=e.addShape("text",{attrs:Object(p.__assign)(Object(p.__assign)({},g),{x:d,y:7,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0}),l},getShapeStyle:function(t){var e=B({},this.getOptions(t).style,{stroke:t.color}),n=this.getSize(t),r=e.width||n[0],i=e.height||n[1];return Object(p.__assign)({x:-r/2,y:-i/2,width:r,height:i},e)},update:function(t,e){var n=this.getOptions(t),r=n.style,i=void 0===r?{}:r,o=n.labelCfg,a=void 0===o?{}:o,s=n.descriptionCfg,u=void 0===s?{}:s,c=this.getSize(t),l=c[0],f=c[1];e.get("keyShape").attr(Object(p.__assign)(Object(p.__assign)({},i),{x:-l/2,y:-f/2,width:l,height:f}));var h=e.getContainer(),d=h.find((function(t){return"rect-logo-icon"===t.get("className")})),g=B({},d?d.attr():{},t.logoIcon),v=g.width;void 0===v&&(v=this.options.logoIcon.width);var y=t.logoIcon?t.logoIcon.show:void 0,m=a.offset,b=-l/2+v+m;y||void 0===y||(b=-l/2+m);var x=h.find((function(t){return"node-label"===t.get("className")})),w=h.find((function(t){return"rect-description"===t.get("className")}));if(t.label)if(x){var _=t.labelCfg?t.labelCfg.style:{},S=B({},x.attr(),_);t.label&&(S.text=t.label),S.x=b,A(t.description)&&(S.y=-5),w&&(w.resetMatrix(),w.attr({x:b})),x.resetMatrix(),x.attr(S)}else h.addShape("text",{attrs:Object(p.__assign)(Object(p.__assign)({},a.style),{x:b,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0});if(A(t.description)){var E=u.paddingTop;if(w){_=t.descriptionCfg?t.descriptionCfg.style:{};var O=B({},w.attr(),_);A(t.description)&&(O.text=t.description),O.x=b,w.resetMatrix(),w.attr(Object(p.__assign)(Object(p.__assign)({},O),{y:17+(E||0)}))}else h.addShape("text",{attrs:Object(p.__assign)(Object(p.__assign)({},u.style),{x:b,y:17+(E||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0})}var M=h.find((function(t){return"pre-rect"===t.get("className")}));if(M){var k=B({},M.attr(),t.preRect);M.attr(Object(p.__assign)(Object(p.__assign)({},k),{x:-l/2,y:-f/2,height:f}))}if(d)if(y||void 0===y){var C=g.width,T=g.height,I=g.x,P=g.y,D=g.offset,N=Object(p.__rest)(g,["width","height","x","y","offset"]);d.attr(Object(p.__assign)(Object(p.__assign)({},N),{x:I||-l/2+C+D,y:P||-T/2,width:C,height:T}))}else d.remove();else y&&this.drawLogoIcon(t,h);var j=h.find((function(t){return"rect-state-icon"===t.get("className")})),R=B({},j?j.attr():{},t.stateIcon);if(j){R.show||void 0===R.show||j.remove();var L=R.width,G=(T=R.height,I=R.x,P=R.y,R.offset),F=Object(p.__rest)(R,["width","height","x","y","offset"]);j.attr(Object(p.__assign)(Object(p.__assign)({},F),{x:I||l/2-L+G,y:P||-T/2,width:L,height:T}))}else R.show&&this.drawStateIcon(t,h);this.updateLinkPoints(t,h)}},"single-node"),Br("star",{options:{size:60,style:{stroke:Ur.defaultNode.style.stroke,fill:Ur.defaultNode.style.fill,lineWidth:Ur.defaultNode.style.lineWidth},labelCfg:{style:{fill:Ur.nodeLabel.style.fill,fontSize:Ur.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Ur.defaultNode.linkPoints.size,lineWidth:Ur.defaultNode.linkPoints.lineWidth,fill:Ur.defaultNode.linkPoints.fill,stroke:Ur.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(p.__assign)({},Ur.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var n=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}),a=r.width,s=r.height,u=r.show,c=r.text;return u&&(c?e.addShape("text",{attrs:Object(p.__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(p.__assign)({x:-a/2,y:-s/2},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.leftBottom,u=r.rightBottom,c=r.size,l=r.r,f=Object(p.__rest)(r,["top","left","right","leftBottom","rightBottom","size","r"]),h=this.getSize(t)[0];if(a){var d=Math.cos(.1*Math.PI)*h,g=Math.sin(.1*Math.PI)*h;e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},f),{x:d,y:-g,r:c/2||l||5}),className:"link-point-right",name:"link-point-right"})}if(i){d=Math.cos(.5*Math.PI)*h,g=Math.sin(.5*Math.PI)*h;e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},f),{x:d,y:-g,r:c/2||l||5}),className:"link-point-top",name:"link-point-top"})}if(o){d=Math.cos(.9*Math.PI)*h,g=Math.sin(.9*Math.PI)*h;e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},f),{x:d,y:-g,r:c/2||l||5}),className:"link-point-left",name:"link-point-left"})}if(s){d=Math.cos(1.3*Math.PI)*h,g=Math.sin(1.3*Math.PI)*h;e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},f),{x:d,y:-g,r:c/2||l||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(u){d=Math.cos(1.7*Math.PI)*h,g=Math.sin(1.7*Math.PI)*h;e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},f),{x:d,y:-g,r:c/2||l||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=B({},this.getOptions(t).style,{stroke:t.color}),n=this.getPath(t);return Object(p.__assign)({path:n},e)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},a=B({},r,e.get("keyShape").attr(),o);a=B(a,t.style),this.updateShape(t,e,a,!0),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var n=this.getOptions({}).linkPoints,r=e.find((function(t){return"link-point-left"===t.get("className")})),i=e.find((function(t){return"link-point-right"===t.get("className")})),o=e.find((function(t){return"link-point-top"===t.get("className")})),a=e.find((function(t){return"link-point-left-bottom"===t.get("className")})),s=e.find((function(t){return"link-point-right-bottom"===t.get("className")})),u=n,c=r||i||o||a||s;c&&(u=c.attr());var l=B({},u,t.linkPoints),f=l.fill,h=l.stroke,d=l.lineWidth,g=l.size/2;g||(g=l.r);var v=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},y=v.left,m=v.right,b=v.top,x=v.leftBottom,w=v.rightBottom,_=this.getSize(t)[0],S={r:g,fill:f,stroke:h,lineWidth:d},E=Math.cos(.1*Math.PI)*_,O=Math.sin(.1*Math.PI)*_;i?m||void 0===m?i.attr(Object(p.__assign)(Object(p.__assign)({},S),{x:E,y:-O})):i.remove():m&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},S),{x:E,y:-O}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),E=Math.cos(.5*Math.PI)*_,O=Math.sin(.5*Math.PI)*_,o?b||void 0===b?o.attr(Object(p.__assign)(Object(p.__assign)({},S),{x:E,y:-O})):o.remove():b&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},S),{x:E,y:-O}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),E=Math.cos(.9*Math.PI)*_,O=Math.sin(.9*Math.PI)*_,r?y||void 0===y?r.attr(Object(p.__assign)(Object(p.__assign)({},S),{x:E,y:-O})):r.remove():y&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},S),{x:E,y:-O}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),E=Math.cos(1.3*Math.PI)*_,O=Math.sin(1.3*Math.PI)*_,a?x||void 0===x?a.attr(Object(p.__assign)(Object(p.__assign)({},S),{x:E,y:-O})):a.remove():x&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},S),{x:E,y:-O}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0}),E=Math.cos(1.7*Math.PI)*_,O=Math.sin(1.7*Math.PI)*_,s?w||void 0===w?s.attr(Object(p.__assign)(Object(p.__assign)({},S),{x:E,y:-O})):a.remove():w&&e.addShape("circle",{attrs:Object(p.__assign)(Object(p.__assign)({},S),{x:E,y:-O}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0})}},"single-node");var bm=jr.defaultSubjectColors;Br("donut",{options:{size:Ur.defaultNode.size,style:{x:0,y:0,stroke:Ur.defaultNode.style.stroke,fill:Ur.defaultNode.style.fill,lineWidth:Ur.defaultNode.style.lineWidth},labelCfg:{style:{fill:Ur.nodeLabel.style.fill,fontSize:Ur.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Ur.defaultNode.linkPoints.size,lineWidth:Ur.defaultNode.linkPoints.lineWidth,fill:Ur.defaultNode.linkPoints.fill,stroke:Ur.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(p.__assign)({},Ur.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=this.getOptions(t).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=V({},r,t.icon),a=e.addShape("circle",{attrs:i,className:this.type+"-keyShape",draggable:!0,name:this.type+"-keyShape"}),s=o.width,u=o.height,c=o.show,l=o.text;c&&(l?e.addShape("text",{attrs:Object(p.__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(p.__assign)({x:-s/2,y:-u/2},o),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}));var f=a.attr("r"),h=.6*f,d=(f+h)/2,g=t,v=g.donutAttrs,y=void 0===v?{}:v,m=g.donutColorMap,b=void 0===m?{}:m,x=Object.keys(y).length;if(y&&x>1){var w=[],_=0;if(Object.keys(y).forEach((function(t){var e=y[t]||0;P(e)&&(w.push({key:t,value:e,color:b[t]}),_+=e)})),_){var S=f-h;if(1===x)return void e.addShape("circle",{attrs:{r:d,x:0,y:0,stroke:w[0].color||bm[0],lineWidth:S},name:"fan-shape-0"});var E=[d,0],O=0;w.forEach((function(t,n){var r=t.value/_;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=E,t.arcEnd=[d*Math.cos(t.endAngle),-d*Math.sin(t.endAngle)];var i=t.angle>Math.PI?1:0,o=[["M",t.arcBegin[0],t.arcBegin[1]],["A",d,d,0,i,0,t.arcEnd[0],t.arcEnd[1]],["L",t.arcEnd[0],t.arcEnd[1]]];e.addShape("path",{attrs:{path:o,lineWidth:S,stroke:t.color||bm[n%bm.length]},name:"fan-shape-"+n}),E=t.arcEnd}else e.addShape("circle",{attrs:{r:d,x:0,y:0,stroke:t.color||bm[n%bm.length],lineWidth:S},name:"fan-shape-"+n})}))}}return this.drawLinkPoints(t,e),a},update:void 0},"circle");var xm=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}},wm=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},_m=function(t){return wm(t)},Sm=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},Em=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.ye.x?i=t.maxX:n.xt.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},Om=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}},Mm=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}]},km=function(t,e){var n=t.x,r=t.y;return ne.maxX||re.maxY},Am=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},Cm=function(t,e,n,r,i){return Am(t,e)+Am(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])},Tm=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)},Im=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,f=r.y-e.y;return(i*s-o*a)*(u*f-c*l)<=0&&(i*c-o*u)*(a*f-s*l)<=0},Pm=function(t,e,n){if(n.width||n.height){var r=Mm(n),i=r[0],o=r[1],a=r[2],s=r[3];return Im(t,e,i,o)||Im(t,e,i,s)||Im(t,e,o,a)||Im(t,e,a,s)}return!1},Dm=function(t,e,n,r){var i=[];return t.forEach((function(t){if(t!==e&&(t.x===e.x||t.y===e.y)){if(Pm(t,e,n)||Pm(t,e,r))return;i.push(t)}})),wm(i)},Nm=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=Am(t,e),o=Am(n,e);return it.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x).concat(function(t,e){return et.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y))}(t,b).filter((function(t){return km(t,f)&&km(t,h)})))})),[{x:d.x,y:p.y},{x:p.x,y:d.y}].forEach((function(t){km(t,f)&&km(t,h)&&m.push(t)})),m.unshift(d),m.push(p);var x=function(t,e,n,r,i,o,a){var s=[],u=[e],c={},l={},f={};l[e.id]=0,f[e.id]=Cm(e,n,e);var h,d,p,g,v,y={};for(t.forEach((function(t){y[t.id]=t}));u.length;){if(h=void 0,d=1/0,u.forEach((function(t){f[t.id]<=d&&(d=f[t.id],h=t)})),h===n){var m=[];return Tm(m,y,c,n.id),m}g=h,v=void 0,(v=(p=u).indexOf(g))>-1&&p.splice(v,1),s.push(h),Dm(t,h,r,i).forEach((function(t){if(-1===s.indexOf(t)){-1===u.indexOf(t)&&u.push(t);var r=f[h.id]+Am(h,t);l[t.id]&&r>=l[t.id]||(c[t.id]=h.id,l[t.id]=r,f[t.id]=l[t.id]+Cm(t,n,e,o,a))}}))}return[e,n]}(m=wm(m),d,p,o,a,t,e);return x.unshift(t),x.push(e),_m(x)},Rm={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 _m(jm(t,e,n,r,i.offset))}},Lm=(Math.PI,function(t,e){var n=Math.round(Math.abs(t/e));return n<0?0:(t<0?-1:1)*n}),Bm=function(t,e){var n=e.x-t.x,r=e.y-t.y;return n||r?Math.atan2(r,n):0},Gm=function(t,e){var n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n},Fm=function(t,e,n){for(var r=1/0,i=0,o=e.length;iu.minX&&e.xu.minY&&e.y0&&M>0&&(b=void 0,x=1/0,Object.keys(h).forEach((function(t){var e=h[t].id;v[e]<=x&&(x=v[e],b=h[e])})),b);){if(f.findIndex((function(t){return t.x===b.x&&t.y===b.y}))>-1)return Vm(b,p,u,e,t,c,a);delete h[b.id],d[b.id]=!0;for(y=0;yo.maxAllowedDirectionChange||s[_.id]||(h[_.id]||(h[_.id]=_),S=o.distFunc(b,_)+(isNaN(k[O])?a:k[O]),E=g[b.id]+S,g[_.id]&&E>=g[_.id]||(p[_.id]=b,g[_.id]=E,v[_.id]=E+Fm(_,f,o.distFunc)));M-=1}return o.fallbackRoute(t,e,n,r,o)};Gr("polyline",{options:{color:Ur.defaultEdge.color,size:Ur.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:Ur.defaultEdge.style.stroke,lineAppendWidth:Ur.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:Ur.edgeLabel.style.fill,fontSize:Ur.edgeLabel.style.fontSize}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:Object(p.__assign)({},Ur.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);return 0===n.radius&&delete n.radius,e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n})},getShapeStyle:function(t){var e=B({},this.options.style,{stroke:t.color},t.style);t=this.getPathPoints(t),this.radius=e.radius,this.offset=e.offset;var n=t.startPoint,r=t.endPoint,i=this.getControlPoints(t),o=[n];i&&(o=o.concat(i)),o.push(r);var a=t.sourceNode,s=t.targetNode,u=e.radius,c=B({},this.options.routeCfg,t.routeCfg);c.offset=e.offset;var l=this.getPath(o,a,s,u,c);return(x(l)&&l.length<=1||A(l)&&-1===l.indexOf("L"))&&(l="M0 0, L0 0"),(isNaN(n.x)||isNaN(n.y)||isNaN(r.x)||isNaN(r.y))&&(l="M0 0, L0 0"),B({},Ur.defaultEdge.style,e,{lineWidth:t.size,path:l})},updateShapeStyle:function(t,e){var n=e.getContainer();if(e.isVisible()){var r={stroke:t.color},i=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(),f=B({},r,l,t.style),h=t.sourceNode,d=t.targetNode,p=f.radius,g=B({},this.options.routeCfg,t.routeCfg);g.offset=f.offset;var v=this.getPath(c,h,d,p,g);(x(v)&&v.length<=1||A(v)&&-1===v.indexOf("L"))&&(v="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(s.x)||isNaN(s.y))&&(v="M0 0, L0 0"),l.endArrow&&!1===f.endArrow&&(t.style.endArrow={path:""}),l.startArrow&&!1===f.startArrow&&(t.style.startArrow={path:""});var y=B(r,i.attr(),{lineWidth:o,path:v},t.style);i&&i.attr(y)}},getPath:function(t,e,n,r,i){var o=i.offset,a=i.simple;if(!o||t.length>2){if(r)return Nm(t,r);var s=[];return S(t,(function(t,e){0===e?s.push(["M",t.x,t.y]):s.push(["L",t.x,t.y])})),s}var u=a?jm(t[t.length-1],t[0],n,e,o):Wm(t[0],t[t.length-1],e,n,i);return u&&u.length?r?Nm(u,r):jr.pointsToPolygon(u):"M0 0, L0 0"}},"single-edge");var Xm=Hp.cloneEvent,Ym=Hp.isNaN,Hm=Math.abs,qm=["shift","ctrl","alt","control"],Km={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(!Ym(n)&&!Ym(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===Cr.TOUCHSTART||0===e.button)&&(t.name===Cr.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;as)for(var h=r.getNodes(),d=0,p=h.length;d-1?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1}},Zm={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(F(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(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",F(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:z((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=V({},xi.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(t),s=a.x,u=a.y,c=a.width,l=a.height,f=a.minX,h=a.minY;this.originPoint={x:s,y:u,width:c,height:l,minX:f,minY:h},this.delegateRect=i.addShape("rect",{attrs:Object(p.__assign)({width:c,height:l,x:s,y:u},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;ar&&(r=l),f>o&&(o=f)}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}}},Qm={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,f=s.length,h=u.length,d=0;d-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=$m(a.x,s.x),c=Jm(a.x,s.x),l=$m(a.y,s.y),f=Jm(a.y,s.y),h=[],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<=f&&i(t,"select")){h.push(t);var r=t.getModel();d.push(r.id),n.setItemState(t,o,!0)}}}));var p=[];this.includeEdges&&h.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=h,this.onSelect&&this.onSelect(h,p),n.emit("nodeselectchange",{selectedItems:{nodes:h,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:tb(t.canvasX-e.x),height:tb(t.canvasY-e.y),x:$m(t.canvasX,e.x),y:$m(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}},rb=["shift","ctrl","alt","control"],ib={getDefaultCfg:function(){return{multiple:!0,trigger:"shift",selectedState:"selected"}},getEvents:function(){return rb.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));S(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);S(n,(function(n){e.setItemState(n,t.selectedState,!1)}));var r=e.findAllByState("combo",this.selectedState);S(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}},ob=c.transform,ab={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(this.get("maxZoom")||n.get("maxZoom"))||in/2?u-=l.width:u+=this.offset,c>r/2?c-=l.height:c+=this.offset;var f=u+"px",h=c+"px";Si(this.container,{left:f,top:h,visibility:"visible"})}else Si(i,{visibility:"hidden"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var n=_i('
    ');return e.parentNode.appendChild(n),Si(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}},ub=Object(p.__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"}}},sb),cb=Object(p.__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"}}},sb),lb=["click","dblclick"],fb={getDefaultCfg:function(){return{trigger:"click",onChange:function(){}}},getEvents:function(){var t,e;return lb.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()))}}}}},hb=Hp.calculationItemsBBox,db={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(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;S(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,f=u-o,h=2*Math.sqrt(l*l+f*f);c+a-h>.8*c?n.setItemState(t,e.activeState,!0):n.setItemState(t,e.activeState,!1)}))}S(this.targets,(function(n){e.updateCombo(n,t)}))}},updatePositions:function(t,e){var n=this;(this.enableDelegate||e)&&S(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");S(r,(function(t){n.traverse(t,e)}));var i=t.get("nodes");S(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?hb(this.targets):this.targets[0].getBBox()).x,s=o.y,u=o.width,c=o.height,l=o.minX,f=o.minY;this.originPoint={x:a,y:s,width:u,height:c,minX:l,minY:f};var h=Object(p.__assign)(Object(p.__assign)({},xi.delegateStyle),this.delegateStyle);this.delegateShape=i.addShape("rect",{attrs:Object(p.__assign)({width:o.width,height:o.height,x:o.x,y:o.y},h),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}}},pb=["click","dblclick"],gb={getDefaultCfg:function(){return{trigger:"dblclick",relayout:!0}},getEvents:function(){var t,e;return pb.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())}}},vb=Hp.isPolygonsIntersect,yb=Hp.pathToPoints,mb=["drag","shift","ctrl","alt","control"],bb=["click","drag"],xb=["shift","ctrl","control","alt","meta",void 0],wb=["shift","ctrl","alt","control"],_b=["shift","ctrl","alt","control"];S({"drag-canvas":Km,"zoom-canvas":ab,"drag-node":Zm,"activate-relations":Qm,"brush-select":nb,"click-select":ib,"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 mb.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=yb(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 vb(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(p.__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:ub,"edge-tooltip":cb,"collapse-expand":fb,"drag-combo":db,"collapse-expand-combo":gb,"create-edge":{getDefaultCfg:function(){return{trigger:"click",key:void 0,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t;return bb.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="click",console.warn("Behavior create-edge 鐨� trigger 鍙傛暟涓嶅悎娉曪紝璇疯緭鍏� 'click'锛�'drag'")),this.key&&-1===xb.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&&m(i)?i({source:this.source,target:r.id}):this.edgeConfig;var a=Object(p.__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 s=Object(p.__assign)(Object(p.__assign)({},this.edge.getModel()),{itemType:"edge"}),u={};u.edges=[s],n.pushStack("add",{before:{},after:u})}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&&m(i)?i({source:r.id,target:r.id}):this.edgeConfig,this.edge=n.addItem("edge",Object(p.__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 wb.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!==_b.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(),f=this.scalableRange,h=this.scalableRange;f<1&&f>-1&&(f*=u,h*=c);var d=l.minX,p=l.maxX,g=l.minY,v=l.maxY;a>0?p<-f?a=0:p-a<-f&&(a=p+f):a<0&&(d>u+f?a=0:d-a>u+f&&(a=d-(u+f))),s>0?v<-h?s=0:v-s<-h&&(s=v+h):s<0&&(g>c+h?s=0:g-s>c+h&&(s=g-(c+h))),"x"===this.get("direction")?s=0:"y"===this.get("direction")&&(a=0),n.translate(-a,-s)}if(t.preventDefault(),this.get("enableOptimize")){var y=this.get("optimizeZoom"),m=this.get("optimized"),b=n.getNodes(),x=n.getEdges(),w=b.length,_=x.length;if(!m){for(var S=0;S