@gkd-kit/inspect 0.0.1734793860473 → 0.0.1735101017832

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-b0ZCYNBH.js → ActionCard.vue_vue_type_script_setup_true_lang-DynhTrXx.js} +2 -2
  2. package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-b0ZCYNBH.js.map → ActionCard.vue_vue_type_script_setup_true_lang-DynhTrXx.js.map} +1 -1
  3. package/dist/assets/{DevicePage-BDcVmU76.js → DevicePage-DTJIY7ic.js} +2 -2
  4. package/dist/assets/{DevicePage-BDcVmU76.js.map → DevicePage-DTJIY7ic.js.map} +1 -1
  5. package/dist/assets/{HomePage-BqsT3goJ.js → HomePage-9lnDYq9r.js} +2 -2
  6. package/dist/assets/{HomePage-BqsT3goJ.js.map → HomePage-9lnDYq9r.js.map} +1 -1
  7. package/dist/assets/{ImportPage-DSatpRU1.js → ImportPage-D3j6QfGo.js} +2 -2
  8. package/dist/assets/{ImportPage-DSatpRU1.js.map → ImportPage-D3j6QfGo.js.map} +1 -1
  9. package/dist/assets/{SelectorPage-B15WSmHh.js → SelectorPage-CCx1mGDr.js} +2 -2
  10. package/dist/assets/{SelectorPage-B15WSmHh.js.map → SelectorPage-CCx1mGDr.js.map} +1 -1
  11. package/dist/assets/{SnapshotPage-h7peY3S9.js → SnapshotPage-B1h5wIy7.js} +31 -31
  12. package/dist/assets/{SnapshotPage-h7peY3S9.js.map → SnapshotPage-B1h5wIy7.js.map} +1 -1
  13. package/dist/assets/{TrackGraph-DpD4rstl.js → TrackGraph-C3QBHeit.js} +2 -2
  14. package/dist/assets/{TrackGraph-DpD4rstl.js.map → TrackGraph-C3QBHeit.js.map} +1 -1
  15. package/dist/assets/{_404Page-47TXA9Ma.js → _404Page-BzIMjxih.js} +2 -2
  16. package/dist/assets/{_404Page-47TXA9Ma.js.map → _404Page-BzIMjxih.js.map} +1 -1
  17. package/dist/assets/chunk-C2qoS9Ga.js +3 -0
  18. package/dist/assets/{chunk-BR_VZk-b.js.map → chunk-C2qoS9Ga.js.map} +1 -1
  19. package/dist/assets/{dayjs.min-Bc9tXN5I.js → dayjs.min-BiJIqrUf.js} +2 -2
  20. package/dist/assets/{dayjs.min-Bc9tXN5I.js.map → dayjs.min-BiJIqrUf.js.map} +1 -1
  21. package/dist/assets/{error-DpEaP8W1.js → error-D-MYURXY.js} +2 -2
  22. package/dist/assets/{error-DpEaP8W1.js.map → error-D-MYURXY.js.map} +1 -1
  23. package/dist/assets/{import-nlZS8goj.js → import-B0oqXoKf.js} +2 -2
  24. package/dist/assets/{import-nlZS8goj.js.map → import-B0oqXoKf.js.map} +1 -1
  25. package/dist/assets/{index-D4mO3wpj.js → index-B9o0ntjg.js} +34 -36
  26. package/dist/assets/index-B9o0ntjg.js.map +1 -0
  27. package/dist/assets/index-CILewiSx.css +1 -0
  28. package/dist/assets/{jszip.min--7PMUu4r.js → jszip.min-ULenkMTW.js} +2 -2
  29. package/dist/assets/{jszip.min--7PMUu4r.js.map → jszip.min-ULenkMTW.js.map} +1 -1
  30. package/dist/assets/{snapshot-Ur5vjcGF.js → snapshot-CIqDi1BD.js} +2 -2
  31. package/dist/assets/{snapshot-Ur5vjcGF.js.map → snapshot-CIqDi1BD.js.map} +1 -1
  32. package/dist/assets/{table-CkbxQbRY.js → table-DzSAE3bL.js} +2 -2
  33. package/dist/assets/{table-CkbxQbRY.js.map → table-DzSAE3bL.js.map} +1 -1
  34. package/dist/index.html +3 -3
  35. package/package.json +1 -1
  36. package/dist/assets/chunk-BR_VZk-b.js +0 -3
  37. package/dist/assets/index-Bkz03J5r.css +0 -1
  38. package/dist/assets/index-D4mO3wpj.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{cs as da,cm as va,b0 as $c,h as d3,m as v3,A as p3,D as g3,ax as Nx,H as y3,I as m3}from"./index-D4mO3wpj.js";import{a0 as Ox}from"./dayjs.min-Bc9tXN5I.js";function b3(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(r,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const sm=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return zi},get Circle(){return G9},get Ellipse(){return z9},get Image(){return j9},get Line(){return U9},get Marker(){return X9},get Path(){return n1},get Polygon(){return K9},get Polyline(){return Q9},get Rect(){return t$},get Text(){return r$}},Symbol.toStringTag,{value:"Module"})),um=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return pi},get Circle(){return o$},get Dom(){return s$},get Ellipse(){return u$},get Image(){return f$},get Line(){return l$},get Marker(){return c$},get Path(){return h$},get Polygon(){return d$},get Polyline(){return v$},get Rect(){return g$},get Text(){return x$}},Symbol.toStringTag,{value:"Module"}));var R0=function(r,e){return R0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},R0(r,e)};function Rt(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");R0(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var z=function(){return z=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},z.apply(this,arguments)};function un(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function QC(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function JC(r,e){return function(t,n){e(t,n,r)}}function x3(r,e,t,n,i,a){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var s=n.kind,u=s==="getter"?"get":s==="setter"?"set":"value",f=!e&&r?n.static?r:r.prototype:null,l=e||(f?Object.getOwnPropertyDescriptor(f,n.name):{}),c,h=!1,d=t.length-1;d>=0;d--){var v={};for(var p in n)v[p]=p==="access"?{}:n[p];for(var p in n.access)v.access[p]=n.access[p];v.addInitializer=function(y){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(y||null))};var g=(0,t[d])(s==="accessor"?{get:l.get,set:l.set}:l[u],v);if(s==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(c=o(g.get))&&(l.get=c),(c=o(g.set))&&(l.set=c),(c=o(g.init))&&i.unshift(c)}else(c=o(g))&&(s==="field"?i.unshift(c):l[u]=c)}f&&Object.defineProperty(f,n.name,l),h=!0}function w3(r,e,t){for(var n=arguments.length>2,i=0;i<e.length;i++)t=n?e[i].call(r,t):e[i].call(r);return n?t:void 0}function E3(r){return typeof r=="symbol"?r:"".concat(r)}function _3(r,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function eA(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Vn(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(l){try{f(n.next(l))}catch(c){o(c)}}function u(l){try{f(n.throw(l))}catch(c){o(c)}}function f(l){l.done?a(l.value):i(l.value).then(s,u)}f((n=n.apply(r,e||[])).next())})}function Hn(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(f){return function(l){return u([f,l])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,f[0]&&(t=0)),t;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,i=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){t.label=f[1];break}if(f[0]===6&&t.label<a[1]){t.label=a[1],a=f;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(f);break}a[2]&&t.ops.pop(),t.trys.pop();continue}f=e.call(r,t)}catch(l){f=[6,l],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var vv=Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]};function tA(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&vv(e,r,t)}function Sd(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fm(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return a}function rA(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(fm(arguments[e]));return r}function pv(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}function Qn(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}function Gu(r){return this instanceof Gu?(this.v=r,this):new Gu(r)}function nA(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},s("next"),s("throw"),s("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(v){return Promise.resolve(v).then(d,c)}}function s(d,v){n[d]&&(i[d]=function(p){return new Promise(function(g,y){a.push([d,p,g,y])>1||u(d,p)})},v&&(i[d]=v(i[d])))}function u(d,v){try{f(n[d](v))}catch(p){h(a[0][3],p)}}function f(d){d.value instanceof Gu?Promise.resolve(d.value.v).then(l,c):h(a[0][2],d)}function l(d){u("next",d)}function c(d){u("throw",d)}function h(d,v){d(v),a.shift(),a.length&&u(a[0][0],a[0][1])}}function iA(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(o){return(t=!t)?{value:Gu(r[i](o)),done:!1}:a?a(o):o}:a}}function aA(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Sd=="function"?Sd(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(o){return new Promise(function(s,u){o=r[a](o),i(s,u,o.done,o.value)})}}function i(a,o,s,u){Promise.resolve(u).then(function(f){a({value:f,done:s})},o)}}function oA(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}var S3=Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e};function sA(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&vv(e,r,t);return S3(e,r),e}function uA(r){return r&&r.__esModule?r:{default:r}}function fA(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}function lA(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t}function cA(r,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?e===r:r.has(e)}function hA(r,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],t&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),r.stack.push({value:e,dispose:n,async:t})}else t&&r.stack.push({async:!0});return e}var M3=typeof SuppressedError=="function"?SuppressedError:function(r,e,t){var n=new Error(t);return n.name="SuppressedError",n.error=r,n.suppressed=e,n};function dA(r){function e(n){r.error=r.hasError?new M3(n,r.error,"An error was suppressed during disposal."):n,r.hasError=!0}function t(){for(;r.stack.length;){var n=r.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(t,function(a){return e(a),t()})}catch(a){e(a)}}if(r.hasError)throw r.error}return t()}const C3={__extends:Rt,__assign:z,__rest:un,__decorate:QC,__param:JC,__metadata:eA,__awaiter:Vn,__generator:Hn,__createBinding:vv,__exportStar:tA,__values:Sd,__read:fm,__spread:rA,__spreadArrays:pv,__spreadArray:Qn,__await:Gu,__asyncGenerator:nA,__asyncDelegator:iA,__asyncValues:aA,__makeTemplateObject:oA,__importStar:sA,__importDefault:uA,__classPrivateFieldGet:fA,__classPrivateFieldSet:lA,__classPrivateFieldIn:cA,__addDisposableResource:hA,__disposeResources:dA},A3=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:hA,get __assign(){return z},__asyncDelegator:iA,__asyncGenerator:nA,__asyncValues:aA,__await:Gu,__awaiter:Vn,__classPrivateFieldGet:fA,__classPrivateFieldIn:cA,__classPrivateFieldSet:lA,__createBinding:vv,__decorate:QC,__disposeResources:dA,__esDecorate:x3,__exportStar:tA,__extends:Rt,__generator:Hn,__importDefault:uA,__importStar:sA,__makeTemplateObject:oA,__metadata:eA,__param:JC,__propKey:E3,__read:fm,__rest:un,__runInitializers:w3,__setFunctionName:_3,__spread:rA,__spreadArray:Qn,__spreadArrays:pv,__values:Sd,default:C3},Symbol.toStringTag,{value:"Module"}));var zn=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},Md=function(r,e){return zn(r)?r.indexOf(e)>-1:!1},gv=function(r,e){if(!zn(r))return r;for(var t=[],n=0;n<r.length;n++){var i=r[n];e(i,n)&&t.push(i)}return t},T3=function(r,e){return e===void 0&&(e=[]),gv(r,function(t){return!Md(e,t)})},I3={}.toString,Fi=function(r,e){return I3.call(r)==="[object "+e+"]"};const Pr=function(r){return Fi(r,"Function")};var ht=function(r){return r==null};const mt=function(r){return Array.isArray?Array.isArray(r):Fi(r,"Array")},wn=function(r){var e=typeof r;return r!==null&&e==="object"||e==="function"};function _e(r,e){if(r){var t;if(mt(r))for(var n=0,i=r.length;n<i&&(t=e(r[n],n),t!==!1);n++);else if(wn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(t=e(r[a],a),t===!1))break}}}var vA=Object.keys?function(r){return Object.keys(r)}:function(r){var e=[];return _e(r,function(t,n){Pr(r)&&n==="prototype"||e.push(n)}),e};function pA(r,e){var t=vA(e),n=t.length;if(ht(r))return!n;for(var i=0;i<n;i+=1){var a=t[i];if(e[a]!==r[a]||!(a in r))return!1}return!0}var Cd=function(r){return typeof r=="object"&&r!==null},bn=function(r){if(!Cd(r)||!Fi(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e};function k3(r,e){if(!mt(r))return null;var t;if(Pr(e)&&(t=e),bn(e)&&(t=function(i){return pA(i,e)}),t){for(var n=0;n<r.length;n+=1)if(t(r[n]))return r[n]}return null}function L3(r,e,t){t===void 0&&(t=0);for(var n=t;n<r.length;n++)if(e(r[n],n))return n;return-1}var N3=function(r,e){for(var t=null,n=0;n<r.length;n++){var i=r[n],a=i[e];if(!ht(a)){mt(a)?t=a[0]:t=a;break}}return t},O3=function(r){if(!mt(r))return[];for(var e=[],t=0;t<r.length;t++)e=e.concat(r[t]);return e},gA=function(r,e){if(e===void 0&&(e=[]),!mt(r))e.push(r);else for(var t=0;t<r.length;t+=1)gA(r[t],e);return e};const la=function(r){if(mt(r))return r.reduce(function(e,t){return Math.max(e,t)},r[0])},ca=function(r){if(mt(r))return r.reduce(function(e,t){return Math.min(e,t)},r[0])};var yA=function(r){var e=r.filter(function(o){return!isNaN(o)});if(!e.length)return{min:0,max:0};if(mt(r[0])){for(var t=[],n=0;n<r.length;n++)t=t.concat(r[n]);e=t}var i=la(e),a=ca(e);return{min:a,max:i}},mA=Array.prototype,D3=mA.splice,P3=mA.indexOf,R3=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=0;n<e.length;n++)for(var i=e[n],a=-1;(a=P3.call(r,i))>-1;)D3.call(r,a,1);return r},B3=Array.prototype.splice,bA=function(e,t){if(!zn(e))return[];for(var n=e?t.length:0,i=n-1;n--;){var a=void 0,o=t[n];(n===i||o!==a)&&(a=o,B3.call(e,o,1))}return e},xA=function(r,e,t){if(!mt(r)&&!bn(r))return r;var n=t;return _e(r,function(i,a){n=e(n,i,a)}),n},F3=function(r,e){var t=[];if(!zn(r))return t;for(var n=-1,i=[],a=r.length;++n<a;){var o=r[n];e(o,n,r)&&(t.push(o),i.push(n))}return bA(r,i),t};const Fe=function(r){return Fi(r,"String")};function G3(r,e){var t;if(Pr(e))t=function(i,a){return e(i)-e(a)};else{var n=[];Fe(e)?n.push(e):mt(e)&&(n=e),t=function(i,a){for(var o=0;o<n.length;o+=1){var s=n[o];if(i[s]>a[s])return 1;if(i[s]<a[s])return-1}return 0}}return r.sort(t),r}function Al(r,e){e===void 0&&(e=new Map);var t=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];e.has(a)||(t.push(a),e.set(a,!0))}return t}var z3=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Al([].concat.apply([],r))};const j3=function(r,e){for(var t=[],n={},i=0;i<r.length;i++){var a=r[i],o=a[e];if(!ht(o)){mt(o)||(o=[o]);for(var s=0;s<o.length;s++){var u=o[s];n[u]||(t.push(u),n[u]=!0)}}}return t};function ua(r){if(zn(r))return r[0]}function ci(r){if(zn(r)){var e=r;return e[e.length-1]}}function U3(r,e){return mt(r)||Fe(r)?r[0]===e:!1}function $3(r,e){return mt(r)||Fe(r)?r[r.length-1]===e:!1}var X3=function(r,e){for(var t=0;t<r.length;t++)if(!e(r[t],t))return!1;return!0},Y3=function(r,e){for(var t=0;t<r.length;t++)if(e(r[t],t))return!0;return!1},W3=Object.prototype.hasOwnProperty;function Ad(r,e){if(!e||!mt(r))return{};for(var t={},n=Pr(e)?e:function(s){return s[e]},i,a=0;a<r.length;a++){var o=r[a];i=n(o),W3.call(t,i)?t[i].push(o):t[i]=[o]}return t}function wA(r,e){if(!e)return{0:r};if(!Pr(e)){var t=mt(e)?e:e.replace(/\s+/g,"").split("*");e=function(n){for(var i="_",a=0,o=t.length;a<o;a++)i+=n[t[a]]&&n[t[a]].toString();return i}}return Ad(r,e)}const q3=function(r,e){if(!e)return[r];var t=wA(r,e),n=[];for(var i in t)n.push(t[i]);return n};function V3(r,e){return r["_wrap_"+e]}function gs(r,e){if(r["_wrap_"+e])return r["_wrap_"+e];var t=function(n){r[e](n)};return r["_wrap_"+e]=t,t}var Dx={};function H3(r){var e=Dx[r];if(!e){for(var t=r.toString(16),n=t.length;n<6;n++)t="0"+t;e="#"+t,Dx[r]=e}return e}function Z3(r){var e=0,t=0,n=0,i=0;return mt(r)?r.length===1?e=t=n=i=r[0]:r.length===2?(e=n=r[0],t=i=r[1]):r.length===3?(e=r[0],t=i=r[1],n=r[2]):(e=r[0],t=r[1],n=r[2],i=r[3]):e=t=n=i=r,{r1:e,r2:t,r3:n,r4:i}}var K3=function(r,e,t){return r<e?e:r>t?t:r},rd=function(r,e){var t=e.toString(),n=t.indexOf(".");if(n===-1)return Math.round(r);var i=t.substr(n+1).length;return i>20&&(i=20),parseFloat(r.toFixed(i))},dt=function(r){return Fi(r,"Number")},Q3=function(r){return dt(r)&&r%1!==0},J3=function(r){return dt(r)&&r%2===0},e5=Number.isInteger?Number.isInteger:function(r){return dt(r)&&r%1===0},t5=function(r){return dt(r)&&r<0},r5=1e-5;function EA(r,e,t){return t===void 0&&(t=r5),Math.abs(r-e)<t}var n5=function(r){return dt(r)&&r%2!==0},i5=function(r){return dt(r)&&r>0};const a5=function(r,e){if(mt(r)){for(var t,n=-1/0,i=0;i<r.length;i++){var a=r[i],o=Pr(e)?e(a):a[e];o>n&&(t=a,n=o)}return t}},o5=function(r,e){if(mt(r)){for(var t,n=1/0,i=0;i<r.length;i++){var a=r[i],o=Pr(e)?e(a):a[e];o<n&&(t=a,n=o)}return t}};var yv=function(r,e){return(r%e+e)%e},s5=180/Math.PI,u5=function(r){return s5*r};const f5=parseInt;var l5=Math.PI/180,mv=function(r){return l5*r};const Px=function(r,e){return r.hasOwnProperty(e)};var lm=Object.values?function(r){return Object.values(r)}:function(r){var e=[];return _e(r,function(t,n){Pr(r)&&n==="prototype"||e.push(t)}),e};const c5=function(r,e){return Md(lm(r),e)},ef=function(r){return ht(r)?"":r.toString()};var h5=function(r){return ef(r).toLowerCase()},d5=function(r){var e=ef(r);return e.charAt(0).toLowerCase()+e.substring(1)};function v5(r,e){return!r||!e?r:r.replace(/\\?\{([^{}]+)\}/g,function(t,n){return t.charAt(0)==="\\"?t.slice(1):e[n]===void 0?"":e[n]})}var p5=function(r){return ef(r).toUpperCase()},zu=function(r){var e=ef(r);return e.charAt(0).toUpperCase()+e.substring(1)},g5={}.toString,_A=function(r){return g5.call(r).replace(/^\[object /,"").replace(/]$/,"")},y5=function(r){return Fi(r,"Arguments")},Zl=function(r){return Fi(r,"Boolean")},cm=function(r){return Fi(r,"Date")},m5=function(r){return Fi(r,"Error")};function b5(r){return dt(r)&&isFinite(r)}var x5=function(r){return r===null},w5=Object.prototype,SA=function(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||w5;return r===t},E5=function(r){return Fi(r,"RegExp")},_5=function(r){return r===void 0},S5=function(r){return r instanceof Element||r instanceof HTMLDocument};function MA(r){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)};return e(r)}function CA(r){var e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;e(r)}function Jp(r,e){for(var t in e)e.hasOwnProperty(t)&&t!=="constructor"&&e[t]!==void 0&&(r[t]=e[t])}function bt(r,e,t,n){return e&&Jp(r,e),t&&Jp(r,t),n&&Jp(r,n),r}var M5=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];for(var t=r[0],n=1;n<r.length;n++){var i=r[n];Pr(i)&&(i=i.prototype),bt(t.prototype,i)}},Jt=function(r){if(typeof r!="object"||r===null)return r;var e;if(mt(r)){e=[];for(var t=0,n=r.length;t<n;t++)typeof r[t]=="object"&&r[t]!=null?e[t]=Jt(r[t]):e[t]=r[t]}else{e={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?e[i]=Jt(r[i]):e[i]=r[i]}return e};function Kl(r,e,t){var n;return function(){var i=this,a=arguments,o=function(){n=null,t||r.apply(i,a)},s=t&&!n;clearTimeout(n),n=setTimeout(o,e),s&&r.apply(i,a)}}const AA=function(r,e){if(!Pr(r))throw new TypeError("Expected a function");var t=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=e?e.apply(this,n):n[0],o=t.cache;if(o.has(a))return o.get(a);var s=r.apply(this,n);return o.set(a,s),s};return t.cache=new Map,t};var C5=5;function TA(r,e,t,n){t=t||0,n=n||C5;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];a!==null&&bn(a)?(bn(r[i])||(r[i]={}),t<n?TA(r[i],a,t+1,n):r[i]=e[i]):mt(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var Tr=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=0;n<e.length;n+=1)TA(r,e[n]);return r},A5=function(r,e,t,n){Pr(e)||(t=e,e=r,r=function(){});var i=Object.create?function(o,s){return Object.create(o,{constructor:{value:s}})}:function(o,s){function u(){}u.prototype=o;var f=new u;return f.constructor=s,f},a=i(e.prototype,r);return r.prototype=bt(a,r.prototype),r.superclass=i(e.prototype,e),bt(a,t),bt(r,n),r},hm=function(r,e){if(!zn(r))return-1;var t=Array.prototype.indexOf;if(t)return t.call(r,e);for(var n=-1,i=0;i<r.length;i++)if(r[i]===e){n=i;break}return n},T5=Object.prototype.hasOwnProperty;function IA(r){if(ht(r))return!0;if(zn(r))return!r.length;var e=_A(r);if(e==="Map"||e==="Set")return!r.size;if(SA(r))return!Object.keys(r).length;for(var t in r)if(T5.call(r,t))return!1;return!0}var So=function(r,e){if(r===e)return!0;if(!r||!e||Fe(r)||Fe(e))return!1;if(zn(r)||zn(e)){if(r.length!==e.length)return!1;for(var t=!0,n=0;n<r.length&&(t=So(r[n],e[n]),!!t);n++);return t}if(Cd(r)||Cd(e)){var i=Object.keys(r),a=Object.keys(e);if(i.length!==a.length)return!1;for(var t=!0,n=0;n<i.length&&(t=So(r[i[n]],e[i[n]]),!!t);n++);return t}return!1};const I5=function(r,e,t){return Pr(t)?!!t(r,e):So(r,e)};var As=function(r,e){if(!zn(r))return r;for(var t=[],n=0;n<r.length;n++){var i=r[n];t.push(e(i,n))}return t},k5=function(r){return r};const L5=function(r,e){e===void 0&&(e=k5);var t={};return wn(r)&&!ht(r)&&Object.keys(r).forEach(function(n){t[n]=e(r[n],n)}),t},Pa=function(r,e,t){for(var n=0,i=Fe(e)?e.split("."):e;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?t:r},N5=function(r,e,t){var n=r,i=Fe(e)?e.split("."):e;return i.forEach(function(a,o){o<i.length-1?(wn(n[a])||(n[a]=dt(i[o+1])?[]:{}),n=n[a]):n[a]=t}),r};var O5=Object.prototype.hasOwnProperty;const D5=function(r,e){if(r===null||!bn(r))return{};var t={};return _e(e,function(n){O5.call(r,n)&&(t[n]=r[n])}),t},P5=function(r,e){return xA(r,function(t,n,i){return e.includes(i)||(t[i]=n),t},{})},Tl=function(r,e,t){var n,i,a,o,s=0;t||(t={});var u=function(){s=t.leading===!1?0:Date.now(),n=null,o=r.apply(i,a),n||(i=a=null)},f=function(){var l=Date.now();!s&&t.leading===!1&&(s=l);var c=e-(l-s);return i=this,a=arguments,c<=0||c>e?(n&&(clearTimeout(n),n=null),s=l,o=r.apply(i,a),n||(i=a=null)):!n&&t.trailing!==!1&&(n=setTimeout(u,c)),o};return f.cancel=function(){clearTimeout(n),s=0,n=i=a=null},f},kA=function(r){return zn(r)?Array.prototype.slice.call(r):[]};var Xc={};const ha=function(r){return r=r||"g",Xc[r]?Xc[r]+=1:Xc[r]=1,r+Xc[r]},nl=function(){},R5=function(r){return r};function bv(r){return ht(r)?0:zn(r)?r.length:Object.keys(r).length}var Yc;const il=AA(function(r,e){e===void 0&&(e={});var t=e.fontSize,n=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return Yc||(Yc=document.createElement("canvas").getContext("2d")),Yc.font=[a,o,i,t+"px",n].join(" "),Yc.measureText(Fe(r)?r:"").width},function(r,e){return e===void 0&&(e={}),pv([r],lm(e)).join("")}),B5=function(r,e,t,n){n===void 0&&(n="...");var i=16,a=il(n,t),o=Fe(r)?r:ef(r),s=e,u=[],f,l;if(il(r,t)<=e)return r;for(;f=o.substr(0,i),l=il(f,t),!(l+a>s&&l>s);)if(u.push(f),s-=l,o=o.substr(i),!o)return u.join("");for(;f=o.substr(0,1),l=il(f,t),!(l+a>s);)if(u.push(f),s-=l,o=o.substr(1),!o)return u.join("");return""+u.join("")+n};var F5=function(){function r(){this.map={}}return r.prototype.has=function(e){return this.map[e]!==void 0},r.prototype.get=function(e,t){var n=this.map[e];return n===void 0?t:n},r.prototype.set=function(e,t){this.map[e]=t},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(e){delete this.map[e]},r.prototype.size=function(){return Object.keys(this.map).length},r}();const G5=Object.freeze(Object.defineProperty({__proto__:null,Cache:F5,assign:bt,augment:M5,clamp:K3,clearAnimationFrame:CA,clone:Jt,contains:Md,debounce:Kl,deepMix:Tr,difference:T3,each:_e,endsWith:$3,every:X3,extend:A5,filter:gv,find:k3,findIndex:L3,firstValue:N3,fixedBase:rd,flatten:O3,flattenDeep:gA,forIn:_e,get:Pa,getEllipsisText:B5,getRange:yA,getType:_A,getWrapBehavior:V3,group:q3,groupBy:Ad,groupToMap:wA,has:Px,hasKey:Px,hasValue:c5,head:ua,identity:R5,includes:Md,indexOf:hm,isArguments:y5,isArray:mt,isArrayLike:zn,isBoolean:Zl,isDate:cm,isDecimal:Q3,isElement:S5,isEmpty:IA,isEqual:So,isEqualWith:I5,isError:m5,isEven:J3,isFinite:b5,isFunction:Pr,isInteger:e5,isMatch:pA,isNegative:t5,isNil:ht,isNull:x5,isNumber:dt,isNumberEqual:EA,isObject:wn,isObjectLike:Cd,isOdd:n5,isPlainObject:bn,isPositive:i5,isPrototype:SA,isRegExp:E5,isString:Fe,isType:Fi,isUndefined:_5,keys:vA,last:ci,lowerCase:h5,lowerFirst:d5,map:As,mapValues:L5,max:la,maxBy:a5,measureTextWidth:il,memoize:AA,min:ca,minBy:o5,mix:bt,mod:yv,noop:nl,number2color:H3,omit:P5,parseRadius:Z3,pick:D5,pull:R3,pullAt:bA,reduce:xA,remove:F3,requestAnimationFrame:MA,set:N5,size:bv,some:Y3,sortBy:G3,startsWith:U3,substitute:v5,throttle:Tl,toArray:kA,toDegree:u5,toInteger:f5,toRadian:mv,toString:ef,union:z3,uniq:Al,uniqueId:ha,upperCase:p5,upperFirst:zu,values:lm,valuesOfKey:j3,wrapBehavior:gs},Symbol.toStringTag,{value:"Module"})),z5={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(e){return Object.assign(this,e),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(e){var t=this,n=this.events;this.graph=e,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!0),_e(n,function(i,a){e.on(a,i)}),document.addEventListener("visibilitychange",function(){t.keydown=!1})},unbind:function(e){var t=this.events,n=e.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!1),_e(t,function(i,a){e.off(a,i)}),e.get("canvas").set("draggable",n)},get:function(e){return this[e]},set:function(e,t){return this[e]=t,this}};var dm=function(){function r(){}return r.registerBehavior=function(e,t){if(!t)throw new Error("please specify handler for this behavior: ".concat(e));var n=Jt(z5);Object.assign(n,t);var i=function(o){var s=this;Object.assign(this,this.getDefaultCfg(),o);var u=this.getEvents();this.events=null;var f={};u&&(_e(u,function(l,c){f[c]=gs(s,l)}),this.events=f)};i.prototype=n,r.types[e]=i},r.hasBehavior=function(e){return!!r.types[e]},r.getBehavior=function(e){return r.types[e]},r.types={},r}(),j5="*",LA=function(){function r(){this._events={}}return r.prototype.on=function(e,t,n){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!n}),this},r.prototype.once=function(e,t){return this.on(e,t,!0)},r.prototype.emit=function(e){for(var t=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this._events[e]||[],o=this._events[j5]||[],s=function(u){for(var f=u.length,l=0;l<f;l++)if(u[l]){var c=u[l],h=c.callback,d=c.once;d&&(u.splice(l,1),u.length===0&&delete t._events[e],f--,l--),h.apply(t,n)}};s(a),s(o)},r.prototype.off=function(e,t){if(!e)this._events={};else if(!t)delete this._events[e];else{for(var n=this._events[e]||[],i=n.length,a=0;a<i;a++)n[a].callback===t&&(n.splice(a,1),i--,a--);n.length===0&&delete this._events[e]}return this},r.prototype.getEvents=function(){return this._events},r}(),Mt=1e-6,or=typeof Float32Array<"u"?Float32Array:Array,Pi=Math.random;function U5(r){or=r}var $5=Math.PI/180;function X5(r){return r*$5}function Y5(r,e){return Math.abs(r-e)<=Mt*Math.max(1,Math.abs(r),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});const W5=Object.freeze(Object.defineProperty({__proto__:null,get ARRAY_TYPE(){return or},EPSILON:Mt,RANDOM:Pi,equals:Y5,setMatrixArrayType:U5,toRadian:X5},Symbol.toStringTag,{value:"Module"}));function q5(){var r=new or(4);return or!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r}function V5(r){var e=new or(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function H5(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function Z5(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r}function K5(r,e,t,n){var i=new or(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}function Q5(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function J5(r,e){if(r===e){var t=e[1];r[1]=e[2],r[2]=t}else r[0]=e[0],r[1]=e[2],r[2]=e[1],r[3]=e[3];return r}function eB(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t*a-i*n;return o?(o=1/o,r[0]=a*o,r[1]=-n*o,r[2]=-i*o,r[3]=t*o,r):null}function tB(r,e){var t=e[0];return r[0]=e[3],r[1]=-e[1],r[2]=-e[2],r[3]=t,r}function rB(r){return r[0]*r[3]-r[2]*r[1]}function NA(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],f=t[2],l=t[3];return r[0]=n*s+a*u,r[1]=i*s+o*u,r[2]=n*f+a*l,r[3]=i*f+o*l,r}function nB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),u=Math.cos(t);return r[0]=n*u+a*s,r[1]=i*u+o*s,r[2]=n*-s+a*u,r[3]=i*-s+o*u,r}function iB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1];return r[0]=n*s,r[1]=i*s,r[2]=a*u,r[3]=o*u,r}function aB(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=-t,r[3]=n,r}function oB(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=e[1],r}function sB(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function uB(r){return Math.hypot(r[0],r[1],r[2],r[3])}function fB(r,e,t,n){return r[2]=n[2]/n[0],t[0]=n[0],t[1]=n[1],t[3]=n[3]-r[2]*t[1],[r,e,t]}function lB(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r}function OA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r}function cB(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}function hB(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=e[0],s=e[1],u=e[2],f=e[3];return Math.abs(t-o)<=Mt*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(n-s)<=Mt*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=Mt*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=Mt*Math.max(1,Math.abs(a),Math.abs(f))}function dB(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r}function vB(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r}var pB=NA,gB=OA;const yB=Object.freeze(Object.defineProperty({__proto__:null,LDU:fB,add:lB,adjoint:tB,clone:V5,copy:H5,create:q5,determinant:rB,equals:hB,exactEquals:cB,frob:uB,fromRotation:aB,fromScaling:oB,fromValues:K5,identity:Z5,invert:eB,mul:pB,multiply:NA,multiplyScalar:dB,multiplyScalarAndAdd:vB,rotate:nB,scale:iB,set:Q5,str:sB,sub:gB,subtract:OA,transpose:J5},Symbol.toStringTag,{value:"Module"}));function mB(){var r=new or(6);return or!=Float32Array&&(r[1]=0,r[2]=0,r[4]=0,r[5]=0),r[0]=1,r[3]=1,r}function bB(r){var e=new or(6);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e}function xB(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r}function wB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function EB(r,e,t,n,i,a){var o=new or(6);return o[0]=r,o[1]=e,o[2]=t,o[3]=n,o[4]=i,o[5]=a,o}function _B(r,e,t,n,i,a,o){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r}function SB(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=t*a-n*i;return u?(u=1/u,r[0]=a*u,r[1]=-n*u,r[2]=-i*u,r[3]=t*u,r[4]=(i*s-a*o)*u,r[5]=(n*o-t*s)*u,r):null}function MB(r){return r[0]*r[3]-r[1]*r[2]}function DA(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=t[0],l=t[1],c=t[2],h=t[3],d=t[4],v=t[5];return r[0]=n*f+a*l,r[1]=i*f+o*l,r[2]=n*c+a*h,r[3]=i*c+o*h,r[4]=n*d+a*v+s,r[5]=i*d+o*v+u,r}function CB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=Math.sin(t),l=Math.cos(t);return r[0]=n*l+a*f,r[1]=i*l+o*f,r[2]=n*-f+a*l,r[3]=i*-f+o*l,r[4]=s,r[5]=u,r}function AB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=t[0],l=t[1];return r[0]=n*f,r[1]=i*f,r[2]=a*l,r[3]=o*l,r[4]=s,r[5]=u,r}function TB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=t[0],l=t[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=n*f+a*l+s,r[5]=i*f+o*l+u,r}function IB(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=-t,r[3]=n,r[4]=0,r[5]=0,r}function kB(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=e[1],r[4]=0,r[5]=0,r}function LB(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=e[0],r[5]=e[1],r}function NB(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")"}function OB(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],1)}function DB(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r}function PA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r}function PB(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r}function RB(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r[4]=e[4]+t[4]*n,r[5]=e[5]+t[5]*n,r}function BB(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]}function FB(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=e[0],f=e[1],l=e[2],c=e[3],h=e[4],d=e[5];return Math.abs(t-u)<=Mt*Math.max(1,Math.abs(t),Math.abs(u))&&Math.abs(n-f)<=Mt*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-l)<=Mt*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-c)<=Mt*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-h)<=Mt*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-d)<=Mt*Math.max(1,Math.abs(s),Math.abs(d))}var GB=DA,zB=PA;const jB=Object.freeze(Object.defineProperty({__proto__:null,add:DB,clone:bB,copy:xB,create:mB,determinant:MB,equals:FB,exactEquals:BB,frob:OB,fromRotation:IB,fromScaling:kB,fromTranslation:LB,fromValues:EB,identity:wB,invert:SB,mul:GB,multiply:DA,multiplyScalar:PB,multiplyScalarAndAdd:RB,rotate:CB,scale:AB,set:_B,str:NB,sub:zB,subtract:PA,translate:TB},Symbol.toStringTag,{value:"Module"}));function RA(){var r=new or(9);return or!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function UB(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[4],r[4]=e[5],r[5]=e[6],r[6]=e[8],r[7]=e[9],r[8]=e[10],r}function $B(r){var e=new or(9);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function XB(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function YB(r,e,t,n,i,a,o,s,u){var f=new or(9);return f[0]=r,f[1]=e,f[2]=t,f[3]=n,f[4]=i,f[5]=a,f[6]=o,f[7]=s,f[8]=u,f}function WB(r,e,t,n,i,a,o,s,u,f){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=f,r}function qB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function VB(r,e){if(r===e){var t=e[1],n=e[2],i=e[5];r[1]=e[3],r[2]=e[6],r[3]=t,r[5]=e[7],r[6]=n,r[7]=i}else r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8];return r}function vm(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8],c=l*o-s*f,h=-l*a+s*u,d=f*a-o*u,v=t*c+n*h+i*d;return v?(v=1/v,r[0]=c*v,r[1]=(-l*n+i*f)*v,r[2]=(s*n-i*o)*v,r[3]=h*v,r[4]=(l*t-i*u)*v,r[5]=(-s*t+i*a)*v,r[6]=d*v,r[7]=(-f*t+n*u)*v,r[8]=(o*t-n*a)*v,r):null}function HB(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8];return r[0]=o*l-s*f,r[1]=i*f-n*l,r[2]=n*s-i*o,r[3]=s*u-a*l,r[4]=t*l-i*u,r[5]=i*a-t*s,r[6]=a*f-o*u,r[7]=n*u-t*f,r[8]=t*o-n*a,r}function ZB(r){var e=r[0],t=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],f=r[8];return e*(f*a-o*u)+t*(-f*i+o*s)+n*(u*i-a*s)}function pa(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=e[8],h=t[0],d=t[1],v=t[2],p=t[3],g=t[4],y=t[5],m=t[6],x=t[7],b=t[8];return r[0]=h*n+d*o+v*f,r[1]=h*i+d*s+v*l,r[2]=h*a+d*u+v*c,r[3]=p*n+g*o+y*f,r[4]=p*i+g*s+y*l,r[5]=p*a+g*u+y*c,r[6]=m*n+x*o+b*f,r[7]=m*i+x*s+b*l,r[8]=m*a+x*u+b*c,r}function KB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=e[8],h=t[0],d=t[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=u,r[6]=h*n+d*o+f,r[7]=h*i+d*s+l,r[8]=h*a+d*u+c,r}function QB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=e[8],h=Math.sin(t),d=Math.cos(t);return r[0]=d*n+h*o,r[1]=d*i+h*s,r[2]=d*a+h*u,r[3]=d*o-h*n,r[4]=d*s-h*i,r[5]=d*u-h*a,r[6]=f,r[7]=l,r[8]=c,r}function JB(r,e,t){var n=t[0],i=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=i*e[3],r[4]=i*e[4],r[5]=i*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function pm(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=e[0],r[7]=e[1],r[8]=1,r}function gm(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=0,r[3]=-t,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function ym(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=e[1],r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function eF(r,e){return r[0]=e[0],r[1]=e[1],r[2]=0,r[3]=e[2],r[4]=e[3],r[5]=0,r[6]=e[4],r[7]=e[5],r[8]=1,r}function tF(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t+t,s=n+n,u=i+i,f=t*o,l=n*o,c=n*s,h=i*o,d=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[3]=l-y,r[6]=h+g,r[1]=l+y,r[4]=1-f-v,r[7]=d-p,r[2]=h-g,r[5]=d+p,r[8]=1-f-c,r}function rF(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8],c=e[9],h=e[10],d=e[11],v=e[12],p=e[13],g=e[14],y=e[15],m=t*s-n*o,x=t*u-i*o,b=t*f-a*o,w=n*u-i*s,E=n*f-a*s,S=i*f-a*u,_=l*p-c*v,C=l*g-h*v,M=l*y-d*v,A=c*g-h*p,T=c*y-d*p,I=h*y-d*g,L=m*I-x*T+b*A+w*M-E*C+S*_;return L?(L=1/L,r[0]=(s*I-u*T+f*A)*L,r[1]=(u*M-o*I-f*C)*L,r[2]=(o*T-s*M+f*_)*L,r[3]=(i*T-n*I-a*A)*L,r[4]=(t*I-i*M+a*C)*L,r[5]=(n*M-t*T-a*_)*L,r[6]=(p*S-g*E+y*w)*L,r[7]=(g*b-v*S-y*x)*L,r[8]=(v*E-p*b+y*m)*L,r):null}function nF(r,e,t){return r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}function iF(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function aF(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function oF(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r}function BA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r}function sF(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r}function uF(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r[4]=e[4]+t[4]*n,r[5]=e[5]+t[5]*n,r[6]=e[6]+t[6]*n,r[7]=e[7]+t[7]*n,r[8]=e[8]+t[8]*n,r}function fF(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]}function lF(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],c=e[0],h=e[1],d=e[2],v=e[3],p=e[4],g=e[5],y=e[6],m=e[7],x=e[8];return Math.abs(t-c)<=Mt*Math.max(1,Math.abs(t),Math.abs(c))&&Math.abs(n-h)<=Mt*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=Mt*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-v)<=Mt*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-p)<=Mt*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=Mt*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=Mt*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(f-m)<=Mt*Math.max(1,Math.abs(f),Math.abs(m))&&Math.abs(l-x)<=Mt*Math.max(1,Math.abs(l),Math.abs(x))}var cF=pa,hF=BA;const FA=Object.freeze(Object.defineProperty({__proto__:null,add:oF,adjoint:HB,clone:$B,copy:XB,create:RA,determinant:ZB,equals:lF,exactEquals:fF,frob:aF,fromMat2d:eF,fromMat4:UB,fromQuat:tF,fromRotation:gm,fromScaling:ym,fromTranslation:pm,fromValues:YB,identity:qB,invert:vm,mul:cF,multiply:pa,multiplyScalar:sF,multiplyScalarAndAdd:uF,normalFromMat4:rF,projection:nF,rotate:QB,scale:JB,set:WB,str:iF,sub:hF,subtract:BA,translate:KB,transpose:VB},Symbol.toStringTag,{value:"Module"}));function dF(){var r=new or(16);return or!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}function vF(r){var e=new or(16);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function pF(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function gF(r,e,t,n,i,a,o,s,u,f,l,c,h,d,v,p){var g=new or(16);return g[0]=r,g[1]=e,g[2]=t,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=f,g[10]=l,g[11]=c,g[12]=h,g[13]=d,g[14]=v,g[15]=p,g}function yF(r,e,t,n,i,a,o,s,u,f,l,c,h,d,v,p,g){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=f,r[9]=l,r[10]=c,r[11]=h,r[12]=d,r[13]=v,r[14]=p,r[15]=g,r}function GA(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function mF(r,e){if(r===e){var t=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=t,r[6]=e[9],r[7]=e[13],r[8]=n,r[9]=a,r[11]=e[14],r[12]=i,r[13]=o,r[14]=s}else r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15];return r}function bF(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8],c=e[9],h=e[10],d=e[11],v=e[12],p=e[13],g=e[14],y=e[15],m=t*s-n*o,x=t*u-i*o,b=t*f-a*o,w=n*u-i*s,E=n*f-a*s,S=i*f-a*u,_=l*p-c*v,C=l*g-h*v,M=l*y-d*v,A=c*g-h*p,T=c*y-d*p,I=h*y-d*g,L=m*I-x*T+b*A+w*M-E*C+S*_;return L?(L=1/L,r[0]=(s*I-u*T+f*A)*L,r[1]=(i*T-n*I-a*A)*L,r[2]=(p*S-g*E+y*w)*L,r[3]=(h*E-c*S-d*w)*L,r[4]=(u*M-o*I-f*C)*L,r[5]=(t*I-i*M+a*C)*L,r[6]=(g*b-v*S-y*x)*L,r[7]=(l*S-h*b+d*x)*L,r[8]=(o*T-s*M+f*_)*L,r[9]=(n*M-t*T-a*_)*L,r[10]=(v*E-p*b+y*m)*L,r[11]=(c*b-l*E-d*m)*L,r[12]=(s*C-o*A-u*_)*L,r[13]=(t*A-n*C+i*_)*L,r[14]=(p*x-v*w-g*m)*L,r[15]=(l*w-c*x+h*m)*L,r):null}function xF(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8],c=e[9],h=e[10],d=e[11],v=e[12],p=e[13],g=e[14],y=e[15];return r[0]=s*(h*y-d*g)-c*(u*y-f*g)+p*(u*d-f*h),r[1]=-(n*(h*y-d*g)-c*(i*y-a*g)+p*(i*d-a*h)),r[2]=n*(u*y-f*g)-s*(i*y-a*g)+p*(i*f-a*u),r[3]=-(n*(u*d-f*h)-s*(i*d-a*h)+c*(i*f-a*u)),r[4]=-(o*(h*y-d*g)-l*(u*y-f*g)+v*(u*d-f*h)),r[5]=t*(h*y-d*g)-l*(i*y-a*g)+v*(i*d-a*h),r[6]=-(t*(u*y-f*g)-o*(i*y-a*g)+v*(i*f-a*u)),r[7]=t*(u*d-f*h)-o*(i*d-a*h)+l*(i*f-a*u),r[8]=o*(c*y-d*p)-l*(s*y-f*p)+v*(s*d-f*c),r[9]=-(t*(c*y-d*p)-l*(n*y-a*p)+v*(n*d-a*c)),r[10]=t*(s*y-f*p)-o*(n*y-a*p)+v*(n*f-a*s),r[11]=-(t*(s*d-f*c)-o*(n*d-a*c)+l*(n*f-a*s)),r[12]=-(o*(c*g-h*p)-l*(s*g-u*p)+v*(s*h-u*c)),r[13]=t*(c*g-h*p)-l*(n*g-i*p)+v*(n*h-i*c),r[14]=-(t*(s*g-u*p)-o*(n*g-i*p)+v*(n*u-i*s)),r[15]=t*(s*h-u*c)-o*(n*h-i*c)+l*(n*u-i*s),r}function wF(r){var e=r[0],t=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],f=r[8],l=r[9],c=r[10],h=r[11],d=r[12],v=r[13],p=r[14],g=r[15],y=e*o-t*a,m=e*s-n*a,x=e*u-i*a,b=t*s-n*o,w=t*u-i*o,E=n*u-i*s,S=f*v-l*d,_=f*p-c*d,C=f*g-h*d,M=l*p-c*v,A=l*g-h*v,T=c*g-h*p;return y*T-m*A+x*M+b*C-w*_+E*S}function zA(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=e[8],h=e[9],d=e[10],v=e[11],p=e[12],g=e[13],y=e[14],m=e[15],x=t[0],b=t[1],w=t[2],E=t[3];return r[0]=x*n+b*s+w*c+E*p,r[1]=x*i+b*u+w*h+E*g,r[2]=x*a+b*f+w*d+E*y,r[3]=x*o+b*l+w*v+E*m,x=t[4],b=t[5],w=t[6],E=t[7],r[4]=x*n+b*s+w*c+E*p,r[5]=x*i+b*u+w*h+E*g,r[6]=x*a+b*f+w*d+E*y,r[7]=x*o+b*l+w*v+E*m,x=t[8],b=t[9],w=t[10],E=t[11],r[8]=x*n+b*s+w*c+E*p,r[9]=x*i+b*u+w*h+E*g,r[10]=x*a+b*f+w*d+E*y,r[11]=x*o+b*l+w*v+E*m,x=t[12],b=t[13],w=t[14],E=t[15],r[12]=x*n+b*s+w*c+E*p,r[13]=x*i+b*u+w*h+E*g,r[14]=x*a+b*f+w*d+E*y,r[15]=x*o+b*l+w*v+E*m,r}function EF(r,e,t){var n=t[0],i=t[1],a=t[2],o,s,u,f,l,c,h,d,v,p,g,y;return e===r?(r[12]=e[0]*n+e[4]*i+e[8]*a+e[12],r[13]=e[1]*n+e[5]*i+e[9]*a+e[13],r[14]=e[2]*n+e[6]*i+e[10]*a+e[14],r[15]=e[3]*n+e[7]*i+e[11]*a+e[15]):(o=e[0],s=e[1],u=e[2],f=e[3],l=e[4],c=e[5],h=e[6],d=e[7],v=e[8],p=e[9],g=e[10],y=e[11],r[0]=o,r[1]=s,r[2]=u,r[3]=f,r[4]=l,r[5]=c,r[6]=h,r[7]=d,r[8]=v,r[9]=p,r[10]=g,r[11]=y,r[12]=o*n+l*i+v*a+e[12],r[13]=s*n+c*i+p*a+e[13],r[14]=u*n+h*i+g*a+e[14],r[15]=f*n+d*i+y*a+e[15]),r}function _F(r,e,t){var n=t[0],i=t[1],a=t[2];return r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*i,r[5]=e[5]*i,r[6]=e[6]*i,r[7]=e[7]*i,r[8]=e[8]*a,r[9]=e[9]*a,r[10]=e[10]*a,r[11]=e[11]*a,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function SF(r,e,t,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),u,f,l,c,h,d,v,p,g,y,m,x,b,w,E,S,_,C,M,A,T,I,L,N;return s<Mt?null:(s=1/s,i*=s,a*=s,o*=s,u=Math.sin(t),f=Math.cos(t),l=1-f,c=e[0],h=e[1],d=e[2],v=e[3],p=e[4],g=e[5],y=e[6],m=e[7],x=e[8],b=e[9],w=e[10],E=e[11],S=i*i*l+f,_=a*i*l+o*u,C=o*i*l-a*u,M=i*a*l-o*u,A=a*a*l+f,T=o*a*l+i*u,I=i*o*l+a*u,L=a*o*l-i*u,N=o*o*l+f,r[0]=c*S+p*_+x*C,r[1]=h*S+g*_+b*C,r[2]=d*S+y*_+w*C,r[3]=v*S+m*_+E*C,r[4]=c*M+p*A+x*T,r[5]=h*M+g*A+b*T,r[6]=d*M+y*A+w*T,r[7]=v*M+m*A+E*T,r[8]=c*I+p*L+x*N,r[9]=h*I+g*L+b*N,r[10]=d*I+y*L+w*N,r[11]=v*I+m*L+E*N,e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r)}function MF(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[4],o=e[5],s=e[6],u=e[7],f=e[8],l=e[9],c=e[10],h=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=a*i+f*n,r[5]=o*i+l*n,r[6]=s*i+c*n,r[7]=u*i+h*n,r[8]=f*i-a*n,r[9]=l*i-o*n,r[10]=c*i-s*n,r[11]=h*i-u*n,r}function CF(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[0],o=e[1],s=e[2],u=e[3],f=e[8],l=e[9],c=e[10],h=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*i-f*n,r[1]=o*i-l*n,r[2]=s*i-c*n,r[3]=u*i-h*n,r[8]=a*n+f*i,r[9]=o*n+l*i,r[10]=s*n+c*i,r[11]=u*n+h*i,r}function AF(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[0],o=e[1],s=e[2],u=e[3],f=e[4],l=e[5],c=e[6],h=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*i+f*n,r[1]=o*i+l*n,r[2]=s*i+c*n,r[3]=u*i+h*n,r[4]=f*i-a*n,r[5]=l*i-o*n,r[6]=c*i-s*n,r[7]=h*i-u*n,r}function TF(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function IF(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function kF(r,e,t){var n=t[0],i=t[1],a=t[2],o=Math.hypot(n,i,a),s,u,f;return o<Mt?null:(o=1/o,n*=o,i*=o,a*=o,s=Math.sin(e),u=Math.cos(e),f=1-u,r[0]=n*n*f+u,r[1]=i*n*f+a*s,r[2]=a*n*f-i*s,r[3]=0,r[4]=n*i*f-a*s,r[5]=i*i*f+u,r[6]=a*i*f+n*s,r[7]=0,r[8]=n*a*f+i*s,r[9]=i*a*f-n*s,r[10]=a*a*f+u,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r)}function LF(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=n,r[6]=t,r[7]=0,r[8]=0,r[9]=-t,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function NF(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=0,r[2]=-t,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=t,r[9]=0,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function OF(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=0,r[3]=0,r[4]=-t,r[5]=n,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function jA(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,u=i+i,f=a+a,l=n*s,c=n*u,h=n*f,d=i*u,v=i*f,p=a*f,g=o*s,y=o*u,m=o*f;return r[0]=1-(d+p),r[1]=c+m,r[2]=h-y,r[3]=0,r[4]=c-m,r[5]=1-(l+p),r[6]=v+g,r[7]=0,r[8]=h+y,r[9]=v-g,r[10]=1-(l+d),r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function DF(r,e){var t=new or(3),n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=n*n+i*i+a*a+o*o;return c>0?(t[0]=(s*o+l*n+u*a-f*i)*2/c,t[1]=(u*o+l*i+f*n-s*a)*2/c,t[2]=(f*o+l*a+s*i-u*n)*2/c):(t[0]=(s*o+l*n+u*a-f*i)*2,t[1]=(u*o+l*i+f*n-s*a)*2,t[2]=(f*o+l*a+s*i-u*n)*2),jA(r,e,t),r}function UA(r,e){return r[0]=e[12],r[1]=e[13],r[2]=e[14],r}function $A(r,e){var t=e[0],n=e[1],i=e[2],a=e[4],o=e[5],s=e[6],u=e[8],f=e[9],l=e[10];return r[0]=Math.hypot(t,n,i),r[1]=Math.hypot(a,o,s),r[2]=Math.hypot(u,f,l),r}function XA(r,e){var t=new or(3);$A(t,e);var n=1/t[0],i=1/t[1],a=1/t[2],o=e[0]*n,s=e[1]*i,u=e[2]*a,f=e[4]*n,l=e[5]*i,c=e[6]*a,h=e[8]*n,d=e[9]*i,v=e[10]*a,p=o+l+v,g=0;return p>0?(g=Math.sqrt(p+1)*2,r[3]=.25*g,r[0]=(c-d)/g,r[1]=(h-u)/g,r[2]=(s-f)/g):o>l&&o>v?(g=Math.sqrt(1+o-l-v)*2,r[3]=(c-d)/g,r[0]=.25*g,r[1]=(s+f)/g,r[2]=(h+u)/g):l>v?(g=Math.sqrt(1+l-o-v)*2,r[3]=(h-u)/g,r[0]=(s+f)/g,r[1]=.25*g,r[2]=(c+d)/g):(g=Math.sqrt(1+v-o-l)*2,r[3]=(s-f)/g,r[0]=(h+u)/g,r[1]=(c+d)/g,r[2]=.25*g),r}function PF(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3],u=i+i,f=a+a,l=o+o,c=i*u,h=i*f,d=i*l,v=a*f,p=a*l,g=o*l,y=s*u,m=s*f,x=s*l,b=n[0],w=n[1],E=n[2];return r[0]=(1-(v+g))*b,r[1]=(h+x)*b,r[2]=(d-m)*b,r[3]=0,r[4]=(h-x)*w,r[5]=(1-(c+g))*w,r[6]=(p+y)*w,r[7]=0,r[8]=(d+m)*E,r[9]=(p-y)*E,r[10]=(1-(c+v))*E,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function RF(r,e,t,n,i){var a=e[0],o=e[1],s=e[2],u=e[3],f=a+a,l=o+o,c=s+s,h=a*f,d=a*l,v=a*c,p=o*l,g=o*c,y=s*c,m=u*f,x=u*l,b=u*c,w=n[0],E=n[1],S=n[2],_=i[0],C=i[1],M=i[2],A=(1-(p+y))*w,T=(d+b)*w,I=(v-x)*w,L=(d-b)*E,N=(1-(h+y))*E,O=(g+m)*E,B=(v+x)*S,W=(g-m)*S,D=(1-(h+p))*S;return r[0]=A,r[1]=T,r[2]=I,r[3]=0,r[4]=L,r[5]=N,r[6]=O,r[7]=0,r[8]=B,r[9]=W,r[10]=D,r[11]=0,r[12]=t[0]+_-(A*_+L*C+B*M),r[13]=t[1]+C-(T*_+N*C+W*M),r[14]=t[2]+M-(I*_+O*C+D*M),r[15]=1,r}function BF(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t+t,s=n+n,u=i+i,f=t*o,l=n*o,c=n*s,h=i*o,d=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[1]=l+y,r[2]=h-g,r[3]=0,r[4]=l-y,r[5]=1-f-v,r[6]=d+p,r[7]=0,r[8]=h+g,r[9]=d-p,r[10]=1-f-c,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function FF(r,e,t,n,i,a,o){var s=1/(t-e),u=1/(i-n),f=1/(a-o);return r[0]=a*2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*u,r[6]=0,r[7]=0,r[8]=(t+e)*s,r[9]=(i+n)*u,r[10]=(o+a)*f,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*a*2*f,r[15]=0,r}function YA(r,e,t,n,i){var a=1/Math.tan(e/2),o;return r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=(i+n)*o,r[14]=2*i*n*o):(r[10]=-1,r[14]=-2*n),r}var GF=YA;function zF(r,e,t,n,i){var a=1/Math.tan(e/2),o;return r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=i*o,r[14]=i*n*o):(r[10]=-1,r[14]=-n),r}function jF(r,e,t,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+s),f=2/(i+a);return r[0]=u,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=f,r[6]=0,r[7]=0,r[8]=-((o-s)*u*.5),r[9]=(i-a)*f*.5,r[10]=n/(t-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=n*t/(t-n),r[15]=0,r}function WA(r,e,t,n,i,a,o){var s=1/(e-t),u=1/(n-i),f=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*f,r[11]=0,r[12]=(e+t)*s,r[13]=(i+n)*u,r[14]=(o+a)*f,r[15]=1,r}var UF=WA;function $F(r,e,t,n,i,a,o){var s=1/(e-t),u=1/(n-i),f=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=f,r[11]=0,r[12]=(e+t)*s,r[13]=(i+n)*u,r[14]=a*f,r[15]=1,r}function XF(r,e,t,n){var i,a,o,s,u,f,l,c,h,d,v=e[0],p=e[1],g=e[2],y=n[0],m=n[1],x=n[2],b=t[0],w=t[1],E=t[2];return Math.abs(v-b)<Mt&&Math.abs(p-w)<Mt&&Math.abs(g-E)<Mt?GA(r):(l=v-b,c=p-w,h=g-E,d=1/Math.hypot(l,c,h),l*=d,c*=d,h*=d,i=m*h-x*c,a=x*l-y*h,o=y*c-m*l,d=Math.hypot(i,a,o),d?(d=1/d,i*=d,a*=d,o*=d):(i=0,a=0,o=0),s=c*o-h*a,u=h*i-l*o,f=l*a-c*i,d=Math.hypot(s,u,f),d?(d=1/d,s*=d,u*=d,f*=d):(s=0,u=0,f=0),r[0]=i,r[1]=s,r[2]=l,r[3]=0,r[4]=a,r[5]=u,r[6]=c,r[7]=0,r[8]=o,r[9]=f,r[10]=h,r[11]=0,r[12]=-(i*v+a*p+o*g),r[13]=-(s*v+u*p+f*g),r[14]=-(l*v+c*p+h*g),r[15]=1,r)}function YF(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=n[0],u=n[1],f=n[2],l=i-t[0],c=a-t[1],h=o-t[2],d=l*l+c*c+h*h;d>0&&(d=1/Math.sqrt(d),l*=d,c*=d,h*=d);var v=u*h-f*c,p=f*l-s*h,g=s*c-u*l;return d=v*v+p*p+g*g,d>0&&(d=1/Math.sqrt(d),v*=d,p*=d,g*=d),r[0]=v,r[1]=p,r[2]=g,r[3]=0,r[4]=c*g-h*p,r[5]=h*v-l*g,r[6]=l*p-c*v,r[7]=0,r[8]=l,r[9]=c,r[10]=h,r[11]=0,r[12]=i,r[13]=a,r[14]=o,r[15]=1,r}function WF(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}function qF(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}function VF(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r}function qA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r}function HF(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r}function ZF(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r[4]=e[4]+t[4]*n,r[5]=e[5]+t[5]*n,r[6]=e[6]+t[6]*n,r[7]=e[7]+t[7]*n,r[8]=e[8]+t[8]*n,r[9]=e[9]+t[9]*n,r[10]=e[10]+t[10]*n,r[11]=e[11]+t[11]*n,r[12]=e[12]+t[12]*n,r[13]=e[13]+t[13]*n,r[14]=e[14]+t[14]*n,r[15]=e[15]+t[15]*n,r}function KF(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]&&r[9]===e[9]&&r[10]===e[10]&&r[11]===e[11]&&r[12]===e[12]&&r[13]===e[13]&&r[14]===e[14]&&r[15]===e[15]}function QF(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],c=r[9],h=r[10],d=r[11],v=r[12],p=r[13],g=r[14],y=r[15],m=e[0],x=e[1],b=e[2],w=e[3],E=e[4],S=e[5],_=e[6],C=e[7],M=e[8],A=e[9],T=e[10],I=e[11],L=e[12],N=e[13],O=e[14],B=e[15];return Math.abs(t-m)<=Mt*Math.max(1,Math.abs(t),Math.abs(m))&&Math.abs(n-x)<=Mt*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-b)<=Mt*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-w)<=Mt*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-E)<=Mt*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(s-S)<=Mt*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(u-_)<=Mt*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(f-C)<=Mt*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(l-M)<=Mt*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(c-A)<=Mt*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(h-T)<=Mt*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-I)<=Mt*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(v-L)<=Mt*Math.max(1,Math.abs(v),Math.abs(L))&&Math.abs(p-N)<=Mt*Math.max(1,Math.abs(p),Math.abs(N))&&Math.abs(g-O)<=Mt*Math.max(1,Math.abs(g),Math.abs(O))&&Math.abs(y-B)<=Mt*Math.max(1,Math.abs(y),Math.abs(B))}var JF=zA,e4=qA;const t4=Object.freeze(Object.defineProperty({__proto__:null,add:VF,adjoint:xF,clone:vF,copy:pF,create:dF,determinant:wF,equals:QF,exactEquals:KF,frob:qF,fromQuat:BF,fromQuat2:DF,fromRotation:kF,fromRotationTranslation:jA,fromRotationTranslationScale:PF,fromRotationTranslationScaleOrigin:RF,fromScaling:IF,fromTranslation:TF,fromValues:gF,fromXRotation:LF,fromYRotation:NF,fromZRotation:OF,frustum:FF,getRotation:XA,getScaling:$A,getTranslation:UA,identity:GA,invert:bF,lookAt:XF,mul:JF,multiply:zA,multiplyScalar:HF,multiplyScalarAndAdd:ZF,ortho:UF,orthoNO:WA,orthoZO:$F,perspective:GF,perspectiveFromFieldOfView:jF,perspectiveNO:YA,perspectiveZO:zF,rotate:SF,rotateX:MF,rotateY:CF,rotateZ:AF,scale:_F,set:yF,str:WF,sub:e4,subtract:qA,targetTo:YF,translate:EF,transpose:mF},Symbol.toStringTag,{value:"Module"}));function mm(){var r=new or(3);return or!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function r4(r){var e=new or(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function VA(r){var e=r[0],t=r[1],n=r[2];return Math.hypot(e,t,n)}function B0(r,e,t){var n=new or(3);return n[0]=r,n[1]=e,n[2]=t,n}function n4(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function i4(r,e,t,n){return r[0]=e,r[1]=t,r[2]=n,r}function a4(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r}function HA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r}function ZA(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r}function KA(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r}function o4(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r}function s4(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r}function u4(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.min(e[2],t[2]),r}function f4(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r}function l4(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r}function c4(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r}function h4(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r}function QA(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2];return Math.hypot(t,n,i)}function JA(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2];return t*t+n*n+i*i}function eT(r){var e=r[0],t=r[1],n=r[2];return e*e+t*t+n*n}function d4(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r}function v4(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r}function tT(r,e){var t=e[0],n=e[1],i=e[2],a=t*t+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),r[0]=e[0]*a,r[1]=e[1]*a,r[2]=e[2]*a,r}function bm(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function nd(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[0],s=t[1],u=t[2];return r[0]=i*u-a*s,r[1]=a*o-n*u,r[2]=n*s-i*o,r}function p4(r,e,t,n){var i=e[0],a=e[1],o=e[2];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r[2]=o+n*(t[2]-o),r}function g4(r,e,t,n,i,a){var o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,f=o*(a-1),l=o*(3-2*a);return r[0]=e[0]*s+t[0]*u+n[0]*f+i[0]*l,r[1]=e[1]*s+t[1]*u+n[1]*f+i[1]*l,r[2]=e[2]*s+t[2]*u+n[2]*f+i[2]*l,r}function y4(r,e,t,n,i,a){var o=1-a,s=o*o,u=a*a,f=s*o,l=3*a*s,c=3*u*o,h=u*a;return r[0]=e[0]*f+t[0]*l+n[0]*c+i[0]*h,r[1]=e[1]*f+t[1]*l+n[1]*c+i[1]*h,r[2]=e[2]*f+t[2]*l+n[2]*c+i[2]*h,r}function m4(r,e){e=e||1;var t=Pi()*2*Math.PI,n=Pi()*2-1,i=Math.sqrt(1-n*n)*e;return r[0]=Math.cos(t)*i,r[1]=Math.sin(t)*i,r[2]=n*e,r}function b4(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[3]*n+t[7]*i+t[11]*a+t[15];return o=o||1,r[0]=(t[0]*n+t[4]*i+t[8]*a+t[12])/o,r[1]=(t[1]*n+t[5]*i+t[9]*a+t[13])/o,r[2]=(t[2]*n+t[6]*i+t[10]*a+t[14])/o,r}function xv(r,e,t){var n=e[0],i=e[1],a=e[2];return r[0]=n*t[0]+i*t[3]+a*t[6],r[1]=n*t[1]+i*t[4]+a*t[7],r[2]=n*t[2]+i*t[5]+a*t[8],r}function x4(r,e,t){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],f=e[2],l=i*f-a*u,c=a*s-n*f,h=n*u-i*s,d=i*h-a*c,v=a*l-n*h,p=n*c-i*l,g=o*2;return l*=g,c*=g,h*=g,d*=2,v*=2,p*=2,r[0]=s+l+d,r[1]=u+c+v,r[2]=f+h+p,r}function w4(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function E4(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function _4(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function S4(r,e){var t=r[0],n=r[1],i=r[2],a=e[0],o=e[1],s=e[2],u=Math.sqrt(t*t+n*n+i*i),f=Math.sqrt(a*a+o*o+s*s),l=u*f,c=l&&bm(r,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function M4(r){return r[0]=0,r[1]=0,r[2]=0,r}function C4(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function A4(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]}function T4(r,e){var t=r[0],n=r[1],i=r[2],a=e[0],o=e[1],s=e[2];return Math.abs(t-a)<=Mt*Math.max(1,Math.abs(t),Math.abs(a))&&Math.abs(n-o)<=Mt*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=Mt*Math.max(1,Math.abs(i),Math.abs(s))}var I4=HA,k4=ZA,L4=KA,N4=QA,O4=JA,rT=VA,D4=eT,P4=function(){var r=mm();return function(e,t,n,i,a,o){var s,u;for(t||(t=3),n||(n=0),i?u=Math.min(i*t+n,e.length):u=e.length,s=n;s<u;s+=t)r[0]=e[s],r[1]=e[s+1],r[2]=e[s+2],a(r,r,o),e[s]=r[0],e[s+1]=r[1],e[s+2]=r[2];return e}}();const R4=Object.freeze(Object.defineProperty({__proto__:null,add:a4,angle:S4,bezier:y4,ceil:o4,clone:r4,copy:n4,create:mm,cross:nd,dist:N4,distance:QA,div:L4,divide:KA,dot:bm,equals:T4,exactEquals:A4,floor:s4,forEach:P4,fromValues:B0,hermite:g4,inverse:v4,len:rT,length:VA,lerp:p4,max:f4,min:u4,mul:k4,multiply:ZA,negate:d4,normalize:tT,random:m4,rotateX:w4,rotateY:E4,rotateZ:_4,round:l4,scale:c4,scaleAndAdd:h4,set:i4,sqrDist:O4,sqrLen:D4,squaredDistance:JA,squaredLength:eT,str:C4,sub:I4,subtract:HA,transformMat3:xv,transformMat4:b4,transformQuat:x4,zero:M4},Symbol.toStringTag,{value:"Module"}));function nT(){var r=new or(4);return or!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function iT(r){var e=new or(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function aT(r,e,t,n){var i=new or(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}function oT(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function sT(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function uT(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r}function fT(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r}function lT(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r[3]=e[3]*t[3],r}function cT(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r[3]=e[3]/t[3],r}function B4(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r[3]=Math.ceil(e[3]),r}function F4(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r[3]=Math.floor(e[3]),r}function G4(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.min(e[2],t[2]),r[3]=Math.min(e[3],t[3]),r}function z4(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r[3]=Math.max(e[3],t[3]),r}function j4(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r[3]=Math.round(e[3]),r}function hT(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r}function U4(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r}function dT(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2],a=e[3]-r[3];return Math.hypot(t,n,i,a)}function vT(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2],a=e[3]-r[3];return t*t+n*n+i*i+a*a}function xm(r){var e=r[0],t=r[1],n=r[2],i=r[3];return Math.hypot(e,t,n,i)}function wm(r){var e=r[0],t=r[1],n=r[2],i=r[3];return e*e+t*t+n*n+i*i}function $4(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r}function X4(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r[3]=1/e[3],r}function pT(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t*t+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),r[0]=t*o,r[1]=n*o,r[2]=i*o,r[3]=a*o,r}function gT(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}function Y4(r,e,t,n){var i=t[0]*n[1]-t[1]*n[0],a=t[0]*n[2]-t[2]*n[0],o=t[0]*n[3]-t[3]*n[0],s=t[1]*n[2]-t[2]*n[1],u=t[1]*n[3]-t[3]*n[1],f=t[2]*n[3]-t[3]*n[2],l=e[0],c=e[1],h=e[2],d=e[3];return r[0]=c*f-h*u+d*s,r[1]=-(l*f)+h*o-d*a,r[2]=l*u-c*o+d*i,r[3]=-(l*s)+c*a-h*i,r}function yT(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r[2]=o+n*(t[2]-o),r[3]=s+n*(t[3]-s),r}function W4(r,e){e=e||1;var t,n,i,a,o,s;do t=Pi()*2-1,n=Pi()*2-1,o=t*t+n*n;while(o>=1);do i=Pi()*2-1,a=Pi()*2-1,s=i*i+a*a;while(s>=1);var u=Math.sqrt((1-o)/s);return r[0]=e*t,r[1]=e*n,r[2]=e*i*u,r[3]=e*a*u,r}function q4(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3];return r[0]=t[0]*n+t[4]*i+t[8]*a+t[12]*o,r[1]=t[1]*n+t[5]*i+t[9]*a+t[13]*o,r[2]=t[2]*n+t[6]*i+t[10]*a+t[14]*o,r[3]=t[3]*n+t[7]*i+t[11]*a+t[15]*o,r}function V4(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[0],s=t[1],u=t[2],f=t[3],l=f*n+s*a-u*i,c=f*i+u*n-o*a,h=f*a+o*i-s*n,d=-o*n-s*i-u*a;return r[0]=l*f+d*-o+c*-u-h*-s,r[1]=c*f+d*-s+h*-o-l*-u,r[2]=h*f+d*-u+l*-s-c*-o,r[3]=e[3],r}function H4(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function Z4(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function mT(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}function bT(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=e[0],s=e[1],u=e[2],f=e[3];return Math.abs(t-o)<=Mt*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(n-s)<=Mt*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=Mt*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=Mt*Math.max(1,Math.abs(a),Math.abs(f))}var K4=fT,Q4=lT,J4=cT,eG=dT,tG=vT,rG=xm,nG=wm,iG=function(){var r=nT();return function(e,t,n,i,a,o){var s,u;for(t||(t=4),n||(n=0),i?u=Math.min(i*t+n,e.length):u=e.length,s=n;s<u;s+=t)r[0]=e[s],r[1]=e[s+1],r[2]=e[s+2],r[3]=e[s+3],a(r,r,o),e[s]=r[0],e[s+1]=r[1],e[s+2]=r[2],e[s+3]=r[3];return e}}();const aG=Object.freeze(Object.defineProperty({__proto__:null,add:uT,ceil:B4,clone:iT,copy:oT,create:nT,cross:Y4,dist:eG,distance:dT,div:J4,divide:cT,dot:gT,equals:bT,exactEquals:mT,floor:F4,forEach:iG,fromValues:aT,inverse:X4,len:rG,length:xm,lerp:yT,max:z4,min:G4,mul:Q4,multiply:lT,negate:$4,normalize:pT,random:W4,round:j4,scale:hT,scaleAndAdd:U4,set:sT,sqrDist:tG,sqrLen:nG,squaredDistance:vT,squaredLength:wm,str:Z4,sub:K4,subtract:fT,transformMat4:q4,transformQuat:V4,zero:H4},Symbol.toStringTag,{value:"Module"}));function Td(){var r=new or(4);return or!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function oG(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function xT(r,e,t){t=t*.5;var n=Math.sin(t);return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=Math.cos(t),r}function sG(r,e){var t=Math.acos(e[3])*2,n=Math.sin(t/2);return n>Mt?(r[0]=e[0]/n,r[1]=e[1]/n,r[2]=e[2]/n):(r[0]=1,r[1]=0,r[2]=0),t}function uG(r,e){var t=_m(r,e);return Math.acos(2*t*t-1)}function wT(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],f=t[2],l=t[3];return r[0]=n*l+o*s+i*f-a*u,r[1]=i*l+o*u+a*s-n*f,r[2]=a*l+o*f+n*u-i*s,r[3]=o*l-n*s-i*u-a*f,r}function ET(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),u=Math.cos(t);return r[0]=n*u+o*s,r[1]=i*u+a*s,r[2]=a*u-i*s,r[3]=o*u-n*s,r}function _T(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),u=Math.cos(t);return r[0]=n*u-a*s,r[1]=i*u+o*s,r[2]=a*u+n*s,r[3]=o*u-i*s,r}function ST(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),u=Math.cos(t);return r[0]=n*u+i*s,r[1]=i*u-n*s,r[2]=a*u+o*s,r[3]=o*u-a*s,r}function fG(r,e){var t=e[0],n=e[1],i=e[2];return r[0]=t,r[1]=n,r[2]=i,r[3]=Math.sqrt(Math.abs(1-t*t-n*n-i*i)),r}function MT(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+n*n+i*i),s=Math.exp(a),u=o>0?s*Math.sin(o)/o:0;return r[0]=t*u,r[1]=n*u,r[2]=i*u,r[3]=s*Math.cos(o),r}function CT(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return r[0]=t*s,r[1]=n*s,r[2]=i*s,r[3]=.5*Math.log(t*t+n*n+i*i+a*a),r}function lG(r,e,t){return CT(r,e),TT(r,r,t),MT(r,r),r}function id(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3],u=t[0],f=t[1],l=t[2],c=t[3],h,d,v,p,g;return d=i*u+a*f+o*l+s*c,d<0&&(d=-d,u=-u,f=-f,l=-l,c=-c),1-d>Mt?(h=Math.acos(d),v=Math.sin(h),p=Math.sin((1-n)*h)/v,g=Math.sin(n*h)/v):(p=1-n,g=n),r[0]=p*i+g*u,r[1]=p*a+g*f,r[2]=p*o+g*l,r[3]=p*s+g*c,r}function cG(r){var e=Pi(),t=Pi(),n=Pi(),i=Math.sqrt(1-e),a=Math.sqrt(e);return r[0]=i*Math.sin(2*Math.PI*t),r[1]=i*Math.cos(2*Math.PI*t),r[2]=a*Math.sin(2*Math.PI*n),r[3]=a*Math.cos(2*Math.PI*n),r}function hG(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t*t+n*n+i*i+a*a,s=o?1/o:0;return r[0]=-t*s,r[1]=-n*s,r[2]=-i*s,r[3]=a*s,r}function dG(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r}function AT(r,e){var t=e[0]+e[4]+e[8],n;if(t>0)n=Math.sqrt(t+1),r[3]=.5*n,n=.5/n,r[0]=(e[5]-e[7])*n,r[1]=(e[6]-e[2])*n,r[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[a*3+a]-e[o*3+o]+1),r[i]=.5*n,n=.5/n,r[3]=(e[a*3+o]-e[o*3+a])*n,r[a]=(e[a*3+i]+e[i*3+a])*n,r[o]=(e[o*3+i]+e[i*3+o])*n}return r}function vG(r,e,t,n){var i=.5*Math.PI/180;e*=i,t*=i,n*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(t),u=Math.cos(t),f=Math.sin(n),l=Math.cos(n);return r[0]=a*u*l-o*s*f,r[1]=o*s*l+a*u*f,r[2]=o*u*f-a*s*l,r[3]=o*u*l+a*s*f,r}function pG(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var gG=iT,yG=aT,Em=oT,mG=sT,bG=uT,xG=wT,TT=hT,_m=gT,wG=yT,Sm=xm,EG=Sm,Mm=wm,_G=Mm,Cm=pT,SG=mT,MG=bT,CG=function(){var r=mm(),e=B0(1,0,0),t=B0(0,1,0);return function(n,i,a){var o=bm(i,a);return o<-.999999?(nd(r,e,i),rT(r)<1e-6&&nd(r,t,i),tT(r,r),xT(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(nd(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,Cm(n,n))}}(),AG=function(){var r=Td(),e=Td();return function(t,n,i,a,o,s){return id(r,n,o,s),id(e,i,a,s),id(t,r,e,2*s*(1-s)),t}}(),TG=function(){var r=RA();return function(e,t,n,i){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-t[0],r[5]=-t[1],r[8]=-t[2],Cm(e,AT(e,r))}}();const IG=Object.freeze(Object.defineProperty({__proto__:null,add:bG,calculateW:fG,clone:gG,conjugate:dG,copy:Em,create:Td,dot:_m,equals:MG,exactEquals:SG,exp:MT,fromEuler:vG,fromMat3:AT,fromValues:yG,getAngle:uG,getAxisAngle:sG,identity:oG,invert:hG,len:EG,length:Sm,lerp:wG,ln:CT,mul:xG,multiply:wT,normalize:Cm,pow:lG,random:cG,rotateX:ET,rotateY:_T,rotateZ:ST,rotationTo:CG,scale:TT,set:mG,setAxes:TG,setAxisAngle:xT,slerp:id,sqlerp:AG,sqrLen:_G,squaredLength:Mm,str:pG},Symbol.toStringTag,{value:"Module"}));function kG(){var r=new or(8);return or!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0),r[3]=1,r}function LG(r){var e=new or(8);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e}function NG(r,e,t,n,i,a,o,s){var u=new or(8);return u[0]=r,u[1]=e,u[2]=t,u[3]=n,u[4]=i,u[5]=a,u[6]=o,u[7]=s,u}function OG(r,e,t,n,i,a,o){var s=new or(8);s[0]=r,s[1]=e,s[2]=t,s[3]=n;var u=i*.5,f=a*.5,l=o*.5;return s[4]=u*n+f*t-l*e,s[5]=f*n+l*r-u*t,s[6]=l*n+u*e-f*r,s[7]=-u*r-f*e-l*t,s}function IT(r,e,t){var n=t[0]*.5,i=t[1]*.5,a=t[2]*.5,o=e[0],s=e[1],u=e[2],f=e[3];return r[0]=o,r[1]=s,r[2]=u,r[3]=f,r[4]=n*f+i*u-a*s,r[5]=i*f+a*o-n*u,r[6]=a*f+n*s-i*o,r[7]=-n*o-i*s-a*u,r}function DG(r,e){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=e[0]*.5,r[5]=e[1]*.5,r[6]=e[2]*.5,r[7]=0,r}function PG(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function RG(r,e){var t=Td();XA(t,e);var n=new or(3);return UA(n,e),IT(r,t,n),r}function kT(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r}function BG(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function FG(r,e,t,n,i,a,o,s,u){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r}var GG=Em;function zG(r,e){return r[0]=e[4],r[1]=e[5],r[2]=e[6],r[3]=e[7],r}var jG=Em;function UG(r,e){return r[4]=e[0],r[5]=e[1],r[6]=e[2],r[7]=e[3],r}function $G(r,e){var t=e[4],n=e[5],i=e[6],a=e[7],o=-e[0],s=-e[1],u=-e[2],f=e[3];return r[0]=(t*f+a*o+n*u-i*s)*2,r[1]=(n*f+a*s+i*o-t*u)*2,r[2]=(i*f+a*u+t*s-n*o)*2,r}function XG(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0]*.5,u=t[1]*.5,f=t[2]*.5,l=e[4],c=e[5],h=e[6],d=e[7];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=o*s+i*f-a*u+l,r[5]=o*u+a*s-n*f+c,r[6]=o*f+n*u-i*s+h,r[7]=-n*s-i*u-a*f+d,r}function YG(r,e,t){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return ET(r,e,t),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function WG(r,e,t){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return _T(r,e,t),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function qG(r,e,t){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return ST(r,e,t),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function VG(r,e,t){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],f=e[2],l=e[3];return r[0]=s*o+l*n+u*a-f*i,r[1]=u*o+l*i+f*n-s*a,r[2]=f*o+l*a+s*i-u*n,r[3]=l*o-s*n-u*i-f*a,s=e[4],u=e[5],f=e[6],l=e[7],r[4]=s*o+l*n+u*a-f*i,r[5]=u*o+l*i+f*n-s*a,r[6]=f*o+l*a+s*i-u*n,r[7]=l*o-s*n-u*i-f*a,r}function HG(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],f=t[2],l=t[3];return r[0]=n*l+o*s+i*f-a*u,r[1]=i*l+o*u+a*s-n*f,r[2]=a*l+o*f+n*u-i*s,r[3]=o*l-n*s-i*u-a*f,s=t[4],u=t[5],f=t[6],l=t[7],r[4]=n*l+o*s+i*f-a*u,r[5]=i*l+o*u+a*s-n*f,r[6]=a*l+o*f+n*u-i*s,r[7]=o*l-n*s-i*u-a*f,r}function ZG(r,e,t,n){if(Math.abs(n)<Mt)return kT(r,e);var i=Math.hypot(t[0],t[1],t[2]);n=n*.5;var a=Math.sin(n),o=a*t[0]/i,s=a*t[1]/i,u=a*t[2]/i,f=Math.cos(n),l=e[0],c=e[1],h=e[2],d=e[3];r[0]=l*f+d*o+c*u-h*s,r[1]=c*f+d*s+h*o-l*u,r[2]=h*f+d*u+l*s-c*o,r[3]=d*f-l*o-c*s-h*u;var v=e[4],p=e[5],g=e[6],y=e[7];return r[4]=v*f+y*o+p*u-g*s,r[5]=p*f+y*s+g*o-v*u,r[6]=g*f+y*u+v*s-p*o,r[7]=y*f-v*o-p*s-g*u,r}function KG(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r}function LT(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[4],u=t[5],f=t[6],l=t[7],c=e[4],h=e[5],d=e[6],v=e[7],p=t[0],g=t[1],y=t[2],m=t[3];return r[0]=n*m+o*p+i*y-a*g,r[1]=i*m+o*g+a*p-n*y,r[2]=a*m+o*y+n*g-i*p,r[3]=o*m-n*p-i*g-a*y,r[4]=n*l+o*s+i*f-a*u+c*m+v*p+h*y-d*g,r[5]=i*l+o*u+a*s-n*f+h*m+v*g+d*p-c*y,r[6]=a*l+o*f+n*u-i*s+d*m+v*y+c*g-h*p,r[7]=o*l-n*s-i*u-a*f+v*m-c*p-h*g-d*y,r}var QG=LT;function JG(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r}var NT=_m;function e6(r,e,t,n){var i=1-n;return NT(e,t)<0&&(n=-n),r[0]=e[0]*i+t[0]*n,r[1]=e[1]*i+t[1]*n,r[2]=e[2]*i+t[2]*n,r[3]=e[3]*i+t[3]*n,r[4]=e[4]*i+t[4]*n,r[5]=e[5]*i+t[5]*n,r[6]=e[6]*i+t[6]*n,r[7]=e[7]*i+t[7]*n,r}function t6(r,e){var t=wv(e);return r[0]=-e[0]/t,r[1]=-e[1]/t,r[2]=-e[2]/t,r[3]=e[3]/t,r[4]=-e[4]/t,r[5]=-e[5]/t,r[6]=-e[6]/t,r[7]=e[7]/t,r}function r6(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r[4]=-e[4],r[5]=-e[5],r[6]=-e[6],r[7]=e[7],r}var OT=Sm,n6=OT,wv=Mm,i6=wv;function a6(r,e){var t=wv(e);if(t>0){t=Math.sqrt(t);var n=e[0]/t,i=e[1]/t,a=e[2]/t,o=e[3]/t,s=e[4],u=e[5],f=e[6],l=e[7],c=n*s+i*u+a*f+o*l;r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=(s-n*c)/t,r[5]=(u-i*c)/t,r[6]=(f-a*c)/t,r[7]=(l-o*c)/t}return r}function o6(r){return"quat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+")"}function s6(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]}function u6(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=e[0],c=e[1],h=e[2],d=e[3],v=e[4],p=e[5],g=e[6],y=e[7];return Math.abs(t-l)<=Mt*Math.max(1,Math.abs(t),Math.abs(l))&&Math.abs(n-c)<=Mt*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-h)<=Mt*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-d)<=Mt*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-v)<=Mt*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=Mt*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(u-g)<=Mt*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(f-y)<=Mt*Math.max(1,Math.abs(f),Math.abs(y))}const f6=Object.freeze(Object.defineProperty({__proto__:null,add:KG,clone:LG,conjugate:r6,copy:kT,create:kG,dot:NT,equals:u6,exactEquals:s6,fromMat4:RG,fromRotation:PG,fromRotationTranslation:IT,fromRotationTranslationValues:OG,fromTranslation:DG,fromValues:NG,getDual:zG,getReal:GG,getTranslation:$G,identity:BG,invert:t6,len:n6,length:OT,lerp:e6,mul:QG,multiply:LT,normalize:a6,rotateAroundAxis:ZG,rotateByQuatAppend:VG,rotateByQuatPrepend:HG,rotateX:YG,rotateY:WG,rotateZ:qG,scale:JG,set:FG,setDual:UG,setReal:jG,sqrLen:i6,squaredLength:wv,str:o6,translate:XG},Symbol.toStringTag,{value:"Module"}));function DT(){var r=new or(2);return or!=Float32Array&&(r[0]=0,r[1]=0),r}function l6(r){var e=new or(2);return e[0]=r[0],e[1]=r[1],e}function c6(r,e){var t=new or(2);return t[0]=r,t[1]=e,t}function h6(r,e){return r[0]=e[0],r[1]=e[1],r}function d6(r,e,t){return r[0]=e,r[1]=t,r}function mn(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}function PT(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}function RT(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r}function BT(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r}function v6(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r}function p6(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r}function co(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}function ho(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}function g6(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r}function An(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r}function y6(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r}function Id(r,e){var t=e[0]-r[0],n=e[1]-r[1];return Math.hypot(t,n)}function FT(r,e){var t=e[0]-r[0],n=e[1]-r[1];return t*t+n*n}function GT(r){var e=r[0],t=r[1];return Math.hypot(e,t)}function zT(r){var e=r[0],t=r[1];return e*e+t*t}function m6(r,e){return r[0]=-e[0],r[1]=-e[1],r}function b6(r,e){return r[0]=1/e[0],r[1]=1/e[1],r}function _o(r,e){var t=e[0],n=e[1],i=t*t+n*n;return i>0&&(i=1/Math.sqrt(i)),r[0]=e[0]*i,r[1]=e[1]*i,r}function Am(r,e){return r[0]*e[0]+r[1]*e[1]}function x6(r,e,t){var n=e[0]*t[1]-e[1]*t[0];return r[0]=r[1]=0,r[2]=n,r}function w6(r,e,t,n){var i=e[0],a=e[1];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r}function E6(r,e){e=e||1;var t=Pi()*2*Math.PI;return r[0]=Math.cos(t)*e,r[1]=Math.sin(t)*e,r}function _6(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i,r[1]=t[1]*n+t[3]*i,r}function S6(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i+t[4],r[1]=t[1]*n+t[3]*i+t[5],r}function M6(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[3]*i+t[6],r[1]=t[1]*n+t[4]*i+t[7],r}function C6(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[4]*i+t[12],r[1]=t[1]*n+t[5]*i+t[13],r}function A6(r,e,t,n){var i=e[0]-t[0],a=e[1]-t[1],o=Math.sin(n),s=Math.cos(n);return r[0]=i*s-a*o+t[0],r[1]=i*o+a*s+t[1],r}function jT(r,e){var t=r[0],n=r[1],i=e[0],a=e[1],o=Math.sqrt(t*t+n*n)*Math.sqrt(i*i+a*a),s=o&&(t*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function T6(r){return r[0]=0,r[1]=0,r}function I6(r){return"vec2("+r[0]+", "+r[1]+")"}function Tm(r,e){return r[0]===e[0]&&r[1]===e[1]}function k6(r,e){var t=r[0],n=r[1],i=e[0],a=e[1];return Math.abs(t-i)<=Mt*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(n-a)<=Mt*Math.max(1,Math.abs(n),Math.abs(a))}var L6=GT,ad=PT,N6=RT,O6=BT,D6=Id,P6=FT,R6=zT,B6=function(){var r=DT();return function(e,t,n,i,a,o){var s,u;for(t||(t=2),n||(n=0),i?u=Math.min(i*t+n,e.length):u=e.length,s=n;s<u;s+=t)r[0]=e[s],r[1]=e[s+1],a(r,r,o),e[s]=r[0],e[s+1]=r[1];return e}}();const F6=Object.freeze(Object.defineProperty({__proto__:null,add:mn,angle:jT,ceil:v6,clone:l6,copy:h6,create:DT,cross:x6,dist:D6,distance:Id,div:O6,divide:BT,dot:Am,equals:k6,exactEquals:Tm,floor:p6,forEach:B6,fromValues:c6,inverse:b6,len:L6,length:GT,lerp:w6,max:ho,min:co,mul:N6,multiply:RT,negate:m6,normalize:_o,random:E6,rotate:A6,round:g6,scale:An,scaleAndAdd:y6,set:d6,sqrDist:P6,sqrLen:R6,squaredDistance:FT,squaredLength:zT,str:I6,sub:ad,subtract:PT,transformMat2:_6,transformMat2d:S6,transformMat3:M6,transformMat4:C6,zero:T6},Symbol.toStringTag,{value:"Module"})),G6=Object.freeze(Object.defineProperty({__proto__:null,glMatrix:W5,mat2:yB,mat2d:jB,mat3:FA,mat4:t4,quat:IG,quat2:f6,vec2:F6,vec3:R4,vec4:aG},Symbol.toStringTag,{value:"Module"}));function z6(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return pm(n,t),pa(r,n,e)}function j6(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return gm(n,t),pa(r,n,e)}function U6(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return ym(n,t),pa(r,n,e)}function $6(r,e,t){return pa(r,t,e)}function vi(r,e){for(var t=r?[].concat(r):[1,0,0,0,1,0,0,0,1],n=0,i=e.length;n<i;n++){var a=e[n];switch(a[0]){case"t":z6(t,t,[a[1],a[2]]);break;case"s":U6(t,t,[a[1],a[2]]);break;case"r":j6(t,t,a[1]);break;case"m":$6(t,t,a[1]);break}}return t}var Ts=function(e,t){var n=e.nodes,i=e.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var f=[];a.push(f)}),i&&i.forEach(function(s){var u=s.source,f=s.target,l=o[u],c=o[f];!l&&l!==0||!c&&c!==0||(a[l][c]=1,t||(a[c][l]=1))}),a},X6=function(e,t){return e===t},Rx=function(){function r(e,t){t===void 0&&(t=null),this.value=e,this.next=t}return r.prototype.toString=function(e){return e?e(this.value):"".concat(this.value)},r}(),UT=function(){function r(e){e===void 0&&(e=X6),this.head=null,this.tail=null,this.compare=e}return r.prototype.prepend=function(e){var t=new Rx(e,this.head);return this.head=t,this.tail||(this.tail=t),this},r.prototype.append=function(e){var t=new Rx(e);return this.head?(this.tail.next=t,this.tail=t,this):(this.head=t,this.tail=t,this)},r.prototype.delete=function(e){if(!this.head)return null;for(var t=null;this.head&&this.compare(this.head.value,e);)t=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,e)?(t=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,e)&&(this.tail=n),t},r.prototype.find=function(e){var t=e.value,n=t===void 0?void 0:t,i=e.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||n!==void 0&&this.compare(o.value,n))return o;o=o.next}return null},r.prototype.deleteTail=function(){var e=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,e;for(var t=this.head;t.next;)t.next.next?t=t.next:t.next=null;return this.tail=t,e},r.prototype.deleteHead=function(){if(!this.head)return null;var e=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),e},r.prototype.fromArray=function(e){var t=this;return e.forEach(function(n){return t.append(n)}),this},r.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},r.prototype.reverse=function(){for(var e=this.head,t=null,n=null;e;)n=e.next,e.next=t,t=e,e=n;this.tail=this.head,this.head=t},r.prototype.toString=function(e){return e===void 0&&(e=void 0),this.toArray().map(function(t){return t.toString(e)}).toString()},r}(),Y6=function(){function r(){this.linkedList=new UT}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(e){this.linkedList.append(e)},r.prototype.dequeue=function(){var e=this.linkedList.deleteHead();return e?e.value:null},r.prototype.toString=function(e){return this.linkedList.toString(e)},r}(),Kn=function(e,t,n){t===void 0&&(t=[]);var i=t.filter(function(u){return u.source===e||u.target===e});if(n==="target"){var a=function(f){return f.source===e};return i.filter(a).map(function(u){return u.target})}if(n==="source"){var o=function(f){return f.target===e};return i.filter(o).map(function(u){return u.source})}var s=function(f){return f.source===e?f.target:f.source};return i.map(s)},W6=function(e,t){return t.filter(function(n){return n.source===e})},od=function(e,t){return t.filter(function(n){return n.source===e||n.target===e})},$T=function(e){e===void 0&&(e=0);var t="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(e,"-").concat(t).concat(n)};function q6(r){r===void 0&&(r={});var e=r,t=function(){},n=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return e.allowTraversal=r.allowTraversal||n,e.enter=r.enter||t,e.leave=r.leave||t,e}var XT=function(e,t,n,i){i===void 0&&(i=!0);var a=q6(n),o=new Y6,s=e.edges,u=s===void 0?[]:s;o.enqueue(t);for(var f="",l=function(){var h=o.dequeue();a.enter({current:h,previous:f}),Kn(h,u,i?"target":void 0).forEach(function(d){a.allowTraversal({previous:f,current:h,next:d})&&o.enqueue(d)}),a.leave({current:h,previous:f}),f=h};!o.isEmpty();)l()},V6=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},u=[],f=function d(v){u.push(v),s[v.id]=!0;for(var p=Kn(v.id,a),g=function(x){var b=p[x];if(!s[b]){var w=n.filter(function(E){return E.id===b});w.length>0&&d(w[0])}},y=0;y<p.length;++y)g(y)},l=0;l<n.length;l++){var c=n[l];if(!s[c.id]){f(c);for(var h=[];u.length>0;)h.push(u.pop());o.push(h)}}return o},YT=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},u={},f={},l=[],c=0,h=function g(y){u[y.id]=c,f[y.id]=c,c+=1,o.push(y),s[y.id]=!0;for(var m=Kn(y.id,a,"target").filter(function(S){return n.map(function(_){return _.id}).indexOf(S)>-1}),x=function(_){var C=m[_];if(!u[C]&&u[C]!==0){var M=n.filter(function(A){return A.id===C});M.length>0&&g(M[0]),f[y.id]=Math.min(f[y.id],f[C])}else s[C]&&(f[y.id]=Math.min(f[y.id],u[C]))},b=0;b<m.length;b++)x(b);if(f[y.id]===u[y.id]){for(var w=[];o.length>0;){var E=o.pop();if(s[E.id]=!1,w.push(E),E===y)break}w.length>0&&l.push(w)}},d=0,v=n;d<v.length;d++){var p=v[d];!u[p.id]&&u[p.id]!==0&&h(p)}return l};function Im(r,e){return e?YT(r):V6(r)}var Ua=function(e){var t={},n=e.nodes,i=n===void 0?[]:n,a=e.edges,o=a===void 0?[]:a;return i.forEach(function(s){t[s.id]={degree:0,inDegree:0,outDegree:0}}),o.forEach(function(s){t[s.source].degree++,t[s.source].outDegree++,t[s.target].degree++,t[s.target].inDegree++}),t},WT=function(e,t){var n=Ua(e);return n[t]?Ua(e)[t].inDegree:0},qT=function(e,t){var n=Ua(e);return n[t]?Ua(e)[t].outDegree:0};function H6(r){r===void 0&&(r={});var e=r,t=function(){},n=function(){var i={};return function(a){var o=a.next;return i[o]?!1:(i[o]=!0,!0)}}();return e.allowTraversal=r.allowTraversal||n,e.enter=r.enter||t,e.leave=r.leave||t,e}function VT(r,e,t,n,i){i===void 0&&(i=!0),n.enter({current:e,previous:t});var a=r.edges,o=a===void 0?[]:a;Kn(e,o,i?"target":void 0).forEach(function(s){n.allowTraversal({previous:t,current:e,next:s})&&VT(r,s,e,n,i)}),n.leave({current:e,previous:t})}function km(r,e,t,n){n===void 0&&(n=!0),VT(r,e,"",H6(t),n)}var Lm=function(e){var t=null,n=e.nodes,i=n===void 0?[]:n,a={},o={},s={},u={};i.forEach(function(c){o[c.id]=c});for(var f={enter:function(h){var d=h.current,v=h.previous;if(s[d]){t={};for(var p=d,g=v;g!==d;)t[p]=g,p=g,g=a[g];t[p]=g}else s[d]=d,delete o[d],a[d]=v},leave:function(h){var d=h.current;u[d]=d,delete s[d]},allowTraversal:function(h){var d=h.next;return t?!1:!u[d]}};Object.keys(o).length;){var l=Object.keys(o)[0];km(e,l,f)}return t},Nm=function(e,t,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=Im(e,!1),u=0,f=s;u<f.length;u++){var l=f[u];if(l.length)for(var c=l[0],h=c.id,d=[c],v=(i={},i[h]=c,i),p=(a={},a[h]=new Set,a);d.length>0;)for(var g=d.pop(),y=g.id,m=Kn(y,e.edges),x=function(E){var S,_=m[E],C=e.nodes.find(function(N){return N.id===_});if(_===y)o.push((S={},S[_]=g,S));else if(!(_ in p))v[_]=g,d.push(C),p[_]=new Set([g]);else if(!p[y].has(C)){for(var M=!0,A=[C,g],T=v[y];p[_].size&&!p[_].has(T)&&(A.push(T),T!==v[T.id]);)T=v[T.id];if(A.push(T),t&&n?(M=!1,A.findIndex(function(N){return t.indexOf(N.id)>-1})>-1&&(M=!0)):t&&!n&&A.findIndex(function(N){return t.indexOf(N.id)>-1})>-1&&(M=!1),M){for(var I={},L=1;L<A.length;L+=1)I[A[L-1].id]=A[L];A.length&&(I[A[A.length-1].id]=A[0]),o.push(I)}p[_].add(g)}},b=0;b<m.length;b+=1)x(b)}return o},Om=function(e,t,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],u={},f={},l=function(T){for(var I=[T];I.length>0;){var L=I.pop();a.has(L)&&(a.delete(L),o[L.id].forEach(function(N){I.push(N)}),o[L.id].clear())}},c=function A(T,I,L){var N=!1;if(t&&n===!1&&t.indexOf(T.id)>-1)return N;i.push(T),a.add(T);for(var O=L[T.id],B=0;B<O.length;B+=1){var W=u[O[B]];if(W===I){for(var D={},P=1;P<i.length;P+=1)D[i[P-1].id]=i[P];i.length&&(D[i[i.length-1].id]=i[0]),s.push(D),N=!0}else a.has(W)||A(W,I,L)&&(N=!0)}if(N)l(T);else for(var B=0;B<O.length;B+=1){var W=u[O[B]];o[W.id].has(T)||o[W.id].add(T)}return i.pop(),N},h=e.nodes,d=h===void 0?[]:h,v=0;v<d.length;v+=1){var p=d[v],g=p.id;f[g]=v,u[v]=p}if(t&&n)for(var y=function(T){var I=t[T];f[d[T].id]=f[I],f[I]=0,u[0]=d.find(function(L){return L.id===I}),u[f[d[T].id]]=d[T]},v=0;v<t.length;v++)y(v);for(var m=function(T){for(var I,L,N=1/0,O=0;O<T.length;O+=1)for(var B=T[O],W=0;W<B.length;W++){var D=f[B[W].id];D<N&&(N=D,L=O)}for(var P=T[L],R=[],O=0;O<P.length;O+=1){var X=P[O];R[X.id]=[];for(var Y=0,ee=Kn(X.id,e.edges,"target").filter(function(K){return P.map(function(se){return se.id}).indexOf(K)>-1});Y<ee.length;Y++){var U=ee[Y];U===X.id&&!(n===!1&&t.indexOf(X.id)>-1)?s.push((I={},I[X.id]=X,I)):R[X.id].push(f[U])}}return{component:P,adjList:R,minIdx:N}},x=0;x<d.length;){var b=d.filter(function(A){return f[A.id]>=x}),w=YT({nodes:b,edges:e.edges}).filter(function(A){return A.length>1});if(w.length===0)break;var E=m(w),S=E.minIdx,_=E.adjList,C=E.component;if(C.length>1){C.forEach(function(A){o[A.id]=new Set});var M=u[S];if(t&&n&&t.indexOf(M.id)===-1)return s;c(M,M,_),x=S+1}else break}return s},HT=function(e,t,n,i){return i===void 0&&(i=!0),t?Om(e,n,i):Nm(e,n,i)},Z6=function(e,t,n){for(var i=1/0,a,o=0;o<t.length;o++){var s=t[o].id;!n[s]&&e[s]<=i&&(i=e[s],a=t[o])}return a},Il=function(e,t,n,i){var a=e.nodes,o=a===void 0?[]:a,s=e.edges,u=s===void 0?[]:s,f={},l={},c={};o.forEach(function(m,x){var b=m.id;l[b]=1/0,b===t&&(l[b]=0)});for(var h=o.length,d=function(x){var b=Z6(l,o,f),w=b.id;if(f[w]=!0,l[w]===1/0)return"continue";var E=[];n?E=W6(w,u):E=od(w,u),E.forEach(function(S){var _=S.target,C=S.source,M=_===w?C:_,A=i&&S[i]?S[i]:1;l[M]>l[b.id]+A?(l[M]=l[b.id]+A,c[M]=[b.id]):l[M]===l[b.id]+A&&c[M].push(b.id)})},v=0;v<h;v++)d();c[t]=[t];var p={};for(var g in l)l[g]!==1/0&&ZT(t,g,c,p);var y={};for(var g in p)y[g]=p[g][0];return{length:l,path:y,allPath:p}};function ZT(r,e,t,n){if(r===e)return[r];if(n[e])return n[e];for(var i=[],a=0,o=t[e];a<o.length;a++){var s=o[a],u=ZT(r,s,t,n);if(!u)return;for(var f=0,l=u;f<l.length;f++){var c=l[f];mt(c)?i.push(Qn(Qn([],c,!0),[e],!1)):i.push([c,e])}}return n[e]=i,n[e]}var KT=function(e,t,n,i,a){var o=Il(e,t,i,a),s=o.length,u=o.path,f=o.allPath;return{length:s[n],path:u[n],allPath:f[n]}},QT=function(e,t,n,i){var a;if(t===n)return[[t]];var o=e.edges,s=o===void 0?[]:o,u=[t],f=(a={},a[t]=!0,a),l=[],c=[],h=i?Kn(t,s,"target"):Kn(t,s);for(l.push(h);u.length>0&&l.length>0;){var d=l[l.length-1];if(d.length){var v=d.shift();v&&(u.push(v),f[v]=!0,h=i?Kn(v,s,"target"):Kn(v,s),l.push(h.filter(function(y){return!f[y]})))}else{var p=u.pop();f[p]=!1,l.pop();continue}if(u[u.length-1]===n){var g=u.map(function(m){return m});c.push(g);var p=u.pop();f[p]=!1,l.pop()}}return c},kl=function(e,t){for(var n=Ts(e,t),i=[],a=n.length,o=0;o<a;o+=1){i[o]=[];for(var s=0;s<a;s+=1)o===s?i[o][s]=0:n[o][s]===0||!n[o][s]?i[o][s]=1/0:i[o][s]=n[o][s]}for(var u=0;u<a;u+=1)for(var o=0;o<a;o+=1)for(var s=0;s<a;s+=1)i[o][s]>i[o][u]+i[u][s]&&(i[o][s]=i[o][u]+i[u][s]);return i},JT=function(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=e.nodes,o=a===void 0?[]:a,s=e.edges,u=s===void 0?[]:s,f={},l={};o.forEach(function(x,b){var w=$T();x.clusterId=w,f[w]={id:w,nodes:[x]},l[x.id]={node:x,idx:b}});var c=Ts(e,t),h={};c.forEach(function(x,b){var w=o[b].id;h[w]={},x.forEach(function(E,S){if(E){var _=o[S].id;h[w][_]=E}})});for(var d=0,v=function(){var b=!1;if(o.forEach(function(w){var E={};Object.keys(h[w.id]).forEach(function(L){var N=h[w.id][L],O=l[L].node,B=O.clusterId;E[B]||(E[B]=0),E[B]+=N});var S=-1/0,_=[];if(Object.keys(E).forEach(function(L){S<E[L]?(S=E[L],_=[L]):S===E[L]&&_.push(L)}),!(_.length===1&&_[0]===w.clusterId)){var C=_.indexOf(w.clusterId);if(C>=0&&_.splice(C,1),_&&_.length){b=!0;var M=f[w.clusterId],A=M.nodes.indexOf(w);M.nodes.splice(A,1);var T=Math.floor(Math.random()*_.length),I=f[_[T]];I.nodes.push(w),w.clusterId=I.id}}}),!b)return"break";d++};d<i;){var p=v();if(p==="break")break}Object.keys(f).forEach(function(x){var b=f[x];(!b.nodes||!b.nodes.length)&&delete f[x]});var g=[],y={};u.forEach(function(x){var b=x.source,w=x.target,E=x[n]||1,S=l[b].node.clusterId,_=l[w].node.clusterId,C="".concat(S,"---").concat(_);if(y[C])y[C].weight+=E,y[C].count++;else{var M={source:S,target:_,weight:E,count:1};y[C]=M,g.push(M)}});var m=[];return Object.keys(f).forEach(function(x){m.push(f[x])}),{clusters:m,clusterEdges:g}},li=function(){function r(e){this.arr=e}return r.prototype.getArr=function(){return this.arr||[]},r.prototype.add=function(e){var t,n=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+n[a];return new r(i)}},r.prototype.subtract=function(e){var t,n=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-n[a];return new r(i)}},r.prototype.avg=function(e){var t=[];if(e!==0)for(var n in this.arr)t[n]=this.arr[n]/e;return new r(t)},r.prototype.negate=function(){var e=[];for(var t in this.arr)e[t]=-this.arr[t];return new r(e)},r.prototype.squareEuclideanDistance=function(e){var t,n=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return i}},r.prototype.euclideanDistance=function(e){var t,n=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},r.prototype.normalize=function(){var e=[],t=Jt(this.arr);t.sort(function(o,s){return o-s});var n=t[t.length-1],i=t[0];for(var a in this.arr)e[a]=(this.arr[a]-i)/(n-i);return new r(e)},r.prototype.norm2=function(){var e;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return 0;var t=0;for(var n in this.arr)t+=Math.pow(this.arr[n],2);return Math.sqrt(t)},r.prototype.dot=function(e){var t,n=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=this.arr[a]*e.arr[a];return i}else console.error("The two vectors are unequal in length.")},r.prototype.equal=function(e){var t,n=e.arr;if(((t=this.arr)===null||t===void 0?void 0:t.length)!==(n==null?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0},r}(),Dm=function(e,t){t===void 0&&(t=void 0);var n=[];return e.forEach(function(i){t===void 0&&n.push(i),i[t]!==void 0&&n.push(i[t])}),n},Oi;(function(r){r.EuclideanDistance="euclideanDistance"})(Oi||(Oi={}));var K6=function(e,t,n){var i=[];t!=null&&t.length?i=t:(e.forEach(function(o){i=i.concat(Object.keys(o))}),i=Al(i));var a={};return i.forEach(function(o){var s=[];e.forEach(function(u){u[o]!==void 0&&u[o]!==""&&s.push(u[o])}),s.length&&!(n!=null&&n.includes(o))&&(a[o]=Al(s))}),a},Pm=function(e,t,n){var i=K6(e,t,n),a=[];if(!Object.keys(i).length)return a;var o=Object.values(i),s=o.every(function(u){return u.every(function(f){return typeof f=="number"})});return e.forEach(function(u,f){var l=[];Object.keys(i).forEach(function(c){var h=u[c],d=i[c],v=d.findIndex(function(y){return h===y}),p=[];if(s)p.push(h);else for(var g=0;g<d.length;g++)g===v?p.push(1):p.push(0);l=l.concat(p)}),a[f]=l}),a},Bx=function(e,t,n,i){n===void 0&&(n=Oi.EuclideanDistance);var a=0;switch(n){case Oi.EuclideanDistance:a=new li(e).euclideanDistance(new li(t));break}return a},Fx=function(e,t,n,i){for(var a=t.length,o=2*i,s=0,u=0;u<a;u++)for(var f=e[u].clusterId,l=0;l<a;l++){var c=e[l].clusterId;if(f===c){var h=t[u][l]||0,d=n[u]||0,v=n[l]||0;s+=h-d*v/o}}return s*=1/o,s},eg=function(e,t){e===void 0&&(e=[]);for(var n=e.length,i=new li([]),a=0;a<n;a++)i=i.add(new li(t[a]));var o=i.avg(n);o.normalize();for(var s=0,a=0;a<n;a++){var u=new li(t[a]),f=u.squareEuclideanDistance(o);s+=f}var l=[];e.forEach(function(){l.push([])});for(var a=0;a<n;a++){var u=new li(t[a]);e[a].clusterInertial=0;for(var c=0;c<n;c++){if(a===c){l[a][c]=0;continue}var h=new li(t[c]);l[a][c]=u.squareEuclideanDistance(h),e[a].clusterInertial+=l[a][c]}}for(var d=0,v=2*n*s,a=0;a<n;a++)for(var p=e[a].clusterId,c=0;c<n;c++){var g=e[c].clusterId;if(!(a===c||p!==g)){var y=e[a].clusterInertial*e[c].clusterInertial/Math.pow(v,2)-l[a][c]/v;d+=y}}return Number(d.toFixed(4))},Rm=function(e,t,n,i,a,o,s,u,f){t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),o===void 0&&(o=void 0),s===void 0&&(s=[]),u===void 0&&(u=["id"]),f===void 0&&(f=1);var l=e.nodes,c=l===void 0?[]:l,h=e.edges,d=h===void 0?[]:h,v=[];if(a){c.forEach(function(D,P){D.properties=D.properties||{},D.originIndex=P});var p=[];c.every(function(D){return D.hasOwnProperty("nodeType")})&&(p=Array.from(new Set(c.map(function(D){return D.nodeType}))),c.forEach(function(D){D.properties.nodeType=p.findIndex(function(P){return P===D.nodeType})}));var g=Dm(c,o);v=Pm(g,s,u)}var y=1,m={},x={};c.forEach(function(D,P){var R=String(y++);D.clusterId=R,m[R]={id:R,nodes:[D]},x[D.id]={node:D,idx:P}});var b=Ts(e,t),w=[],E={},S=0;b.forEach(function(D,P){var R=0,X=c[P].id;E[X]={},D.forEach(function(Y,ee){if(Y){R+=Y;var U=c[ee].id;E[X][U]=Y,S+=Y}}),w.push(R)}),S/=2;for(var _=1/0,C=1/0,M=0,A=[],T={};;){a&&c.every(function(D){return D.hasOwnProperty("properties")})?_=Fx(c,b,w,S)+eg(c,v)*f:_=Fx(c,b,w,S),M===0&&(C=_,A=c,T=m);var I=_>0&&_>C&&_-C<i;if(_>C&&(A=c.map(function(D){return{node:D,clusterId:D.clusterId}}),T=Jt(m),C=_),I||M>100)break;M++,Object.keys(m).forEach(function(D){var P=0;d.forEach(function(R){var X=R.source,Y=R.target,ee=x[X].node.clusterId,U=x[Y].node.clusterId;(ee===D&&U!==D||U===D&&ee!==D)&&(P=P+(R[n]||1))}),m[D].sumTot=P}),c.forEach(function(D,P){var R=m[D.clusterId],X=0,Y,ee=w[P]/(2*S),U=0,Z=R.nodes;Z.forEach(function(Ke){var xt=x[Ke.id].idx;U+=b[P][xt]||0});var K=U-R.sumTot*ee,se=Z.filter(function(Ke){return Ke.id!==D.id});se.forEach(function(Ke,xt){v[Ke.originIndex]});var re=eg(se,v)*f,J=E[D.id];if(Object.keys(J).forEach(function(Ke){var xt=x[Ke].node,kt=xt.clusterId;if(kt!==D.clusterId){var Lt=m[kt],vr=Lt.nodes;if(!(!vr||!vr.length)){var xr=0;vr.forEach(function(Ot){var ut=x[Ot.id].idx;xr+=b[P][ut]||0});var pt=xr-Lt.sumTot*ee,Nt=vr.concat([D]);Nt.forEach(function(Ot,ut){v[Ot.originIndex]});var F=eg(Nt,v)*f,zt=pt-K;a&&(zt=pt+F-(K+re)),zt>X&&(X=zt,Y=Lt)}}}),X>0){Y.nodes.push(D);var me=D.clusterId;D.clusterId=Y.id;var Ae=R.nodes.indexOf(D);R.nodes.splice(Ae,1);var Ye=0,Ve=0;d.forEach(function(Ke){var xt=Ke.source,kt=Ke.target,Lt=x[xt].node.clusterId,vr=x[kt].node.clusterId;(Lt===Y.id&&vr!==Y.id||vr===Y.id&&Lt!==Y.id)&&(Ye=Ye+(Ke[n]||1)),(Lt===me&&vr!==me||vr===me&&Lt!==me)&&(Ve=Ve+(Ke[n]||1))}),Y.sumTot=Ye,R.sumTot=Ve}})}var L={},N=0;Object.keys(T).forEach(function(D){var P=T[D];if(!P.nodes||!P.nodes.length){delete T[D];return}var R=String(N+1);R!==D&&(P.id=R,P.nodes=P.nodes.map(function(X){return{id:X.id,clusterId:R}}),T[R]=P,L[D]=R,delete T[D],N++)}),A.forEach(function(D){var P=D.node,R=D.clusterId;P&&(P.clusterId=R,P.clusterId&&L[P.clusterId]&&(P.clusterId=L[P.clusterId]))});var O=[],B={};d.forEach(function(D){var P=D.source,R=D.target,X=D[n]||1,Y=x[P].node.clusterId,ee=x[R].node.clusterId;if(!(!Y||!ee)){var U="".concat(Y,"---").concat(ee);if(B[U])B[U].weight+=X,B[U].count++;else{var Z={source:Y,target:ee,weight:X,count:1};B[U]=Z,O.push(Z)}}});var W=[];return Object.keys(T).forEach(function(D){W.push(T[D])}),{clusters:W,clusterEdges:O}},eI=function(e,t,n,i,a,o,s,u){return t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=void 0),o===void 0&&(o=[]),s===void 0&&(s=["id"]),u===void 0&&(u=1),Rm(e,t,n,i,!0,a,o,s,u)},tI=function(e,t){var n;t===void 0&&(t=1);for(var i=Jt(e),a=i.nodes,o=a===void 0?[]:a,s=i.edges,u=s===void 0?[]:s,f=function(){var h=Ua({nodes:o,edges:u}),d=Object.keys(h);d.sort(function(g,y){var m,x;return((m=h[g])===null||m===void 0?void 0:m.degree)-((x=h[y])===null||x===void 0?void 0:x.degree)});var v=d[0];if(!o.length||((n=h[v])===null||n===void 0?void 0:n.degree)>=t)return"break";var p=o.findIndex(function(g){return g.id===v});o.splice(p,1),u=u.filter(function(g){return!(g.source===v||g.target===v)})};;){var l=f();if(l==="break")break}return{nodes:o,edges:u}},Gx=function(e,t,n){var i=[];switch(e){case Oi.EuclideanDistance:i=t[n];break;default:i=[];break}return i},rI=function(e,t,n,i,a,o){t===void 0&&(t=3),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=["id"]),o===void 0&&(o=Oi.EuclideanDistance);var s=e.nodes,u=s===void 0?[]:s,f=e.edges,l=f===void 0?[]:f,c={clusters:[{id:"0",nodes:u}],clusterEdges:[]};if(o===Oi.EuclideanDistance&&!u.every(function(R){return R.hasOwnProperty(n)}))return c;var h=[],d=[];if(o===Oi.EuclideanDistance&&(h=Dm(u,n),d=Pm(h,i,a)),!d.length)return c;for(var v=Al(d.map(function(R){return R.join("")})),p=Math.min(t,u.length,v.length),g=0;g<u.length;g++)u[g].originIndex=g;for(var y=[],m=[],x=[],g=0;g<p;g++)if(g===0){var b=Math.floor(Math.random()*u.length);switch(o){case Oi.EuclideanDistance:y[g]=d[b];break;default:y[g]=[];break}m.push(b),x[g]=[u[b]],u[b].clusterId=String(g)}else{for(var w=-1/0,E=0,S=function(Y){if(!m.includes(Y)){for(var ee=0,U=0;U<y.length;U++){var Z=0;switch(o){case Oi.EuclideanDistance:Z=Bx(d[u[Y].originIndex],y[U],o);break}ee+=Z}var K=ee/y.length;K>w&&!y.find(function(se){return So(se,Gx(o,d,u[Y].originIndex))})&&(w=K,E=Y)}},_=0;_<u.length;_++)S(_);y[g]=Gx(o,d,E),m.push(E),x[g]=[u[E]],u[E].clusterId=String(g)}for(var C=0;;){for(var g=0;g<u.length;g++){var M=0,A=1/0;if(!(C===0&&m.includes(g))){for(var T=0;T<y.length;T++){var I=0;switch(o){case Oi.EuclideanDistance:I=Bx(d[g],y[T],o);break}I<A&&(A=I,M=T)}if(u[g].clusterId!==void 0)for(var L=x[Number(u[g].clusterId)].length-1;L>=0;L--)x[Number(u[g].clusterId)][L].id===u[g].id&&x[Number(u[g].clusterId)].splice(L,1);u[g].clusterId=String(M),x[M].push(u[g])}}for(var N=!1,g=0;g<x.length;g++){for(var O=x[g],B=new li([]),T=0;T<O.length;T++)B=B.add(new li(d[O[T].originIndex]));var W=B.avg(O.length);W.equal(new li(y[g]))||(N=!0,y[g]=W.getArr())}if(C++,u.every(function(R){return R.clusterId!==void 0})&&N||C>=1e3)break}var D=[],P={};return l.forEach(function(R){var X,Y,ee=R.source,U=R.target,Z=(X=u.find(function(J){return J.id===ee}))===null||X===void 0?void 0:X.clusterId,K=(Y=u.find(function(J){return J.id===U}))===null||Y===void 0?void 0:Y.clusterId,se="".concat(Z,"---").concat(K);if(P[se])P[se].count++;else{var re={source:Z,target:K,count:1};P[se]=re,D.push(re)}}),{clusters:x,clusterEdges:D}},Bm=function(e,t){var n=new li(t),i=n.norm2(),a=new li(e),o=a.norm2(),s=n.dot(a),u=i*o,f=u?s/u:0;return f},nI=function(e,t,n,i,a){e===void 0&&(e=[]),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=[]);var o=Jt(e.filter(function(h){return h.id!==t.id})),s=e.findIndex(function(h){return h.id===t.id}),u=Dm(e,n),f=Pm(u,i,a),l=f[s],c=[];return o.forEach(function(h,d){if(h.id!==t.id){var v=f[d],p=Bm(v,l);c.push(p),h.cosineSimilarity=p}}),o.sort(function(h,d){return d.cosineSimilarity-h.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},Q6=function(){function r(e){this.count=e.length,this.parent={};for(var t=0,n=e;t<n.length;t++){var i=n[t];this.parent[i]=i}}return r.prototype.find=function(e){for(;this.parent[e]!==e;)e=this.parent[e];return e},r.prototype.union=function(e,t){var n=this.find(e),i=this.find(t);n!==i&&(n<i?(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]):(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]))},r.prototype.connected=function(e,t){return this.find(e)===this.find(t)},r}(),J6=function(e,t){return e-t},ez=function(){function r(e){e===void 0&&(e=J6),this.compareFn=e,this.list=[]}return r.prototype.getLeft=function(e){return 2*e+1},r.prototype.getRight=function(e){return 2*e+2},r.prototype.getParent=function(e){return e===0?null:Math.floor((e-1)/2)},r.prototype.isEmpty=function(){return this.list.length<=0},r.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},r.prototype.delMin=function(){var e=this.top(),t=this.list.pop();return this.list.length>0&&(this.list[0]=t,this.moveDown(0)),e},r.prototype.insert=function(e){if(e!==null){this.list.push(e);var t=this.list.length-1;return this.moveUp(t),!0}return!1},r.prototype.moveUp=function(e){for(var t=this.getParent(e);e&&e>0&&this.compareFn(this.list[t],this.list[e])>0;){var n=this.list[t];this.list[t]=this.list[e],this.list[e]=n,e=t,t=this.getParent(e)}},r.prototype.moveDown=function(e){var t,n=e,i=this.getLeft(e),a=this.getRight(e),o=this.list.length;i!==null&&i<o&&this.compareFn(this.list[n],this.list[i])>0?n=i:a!==null&&a<o&&this.compareFn(this.list[n],this.list[a])>0&&(n=a),e!==n&&(t=[this.list[n],this.list[e]],this.list[e]=t[0],this.list[n]=t[1],this.moveDown(n))},r}(),tz=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=a[0],f=new Set;f.add(u);var l=function(g,y){return t?g.weight-y.weight:0},c=new ez(l);for(od(u.id,s).forEach(function(p){c.insert(p)});!c.isEmpty();){var h=c.delMin(),d=h.source,v=h.target;f.has(d)&&f.has(v)||(n.push(h),f.has(d)||(f.add(d),od(d,s).forEach(function(p){c.insert(p)})),f.has(v)||(f.add(v),od(v,s).forEach(function(p){c.insert(p)})))}return n},zx=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=s.map(function(d){return d});t&&u.sort(function(d,v){return d.weight-v.weight});for(var f=new Q6(a.map(function(d){return d.id}));u.length>0;){var l=u.shift(),c=l.source,h=l.target;f.connected(c,h)||(n.push(l),f.union(c,h))}return n},iI=function(e,t,n){var i={prim:tz,kruskal:zx};return n?i[n](e,t):zx(e,t)},aI=function(e,t,n){typeof t!="number"&&(t=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,o=1e3,s=e.nodes,u=s===void 0?[]:s,f=e.edges,l=f===void 0?[]:f,c=u.length,h,d={},v={},p=0;p<c;++p){var g=u[p],y=g.id;d[y]=1/c,v[y]=1/c}for(var m=Ua(e);o>0&&i>t;){a=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;if(h=0,m[g.id].inDegree===0)d[y]=0;else{for(var x=Kn(y,l,"source"),b=0;b<x.length;++b){var w=x[b],E=m[w].outDegree;E>0&&(h+=v[w]/E)}d[y]=n*h,a+=d[y]}}a=(1-a)/c,i=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;h=d[y]+a,i+=Math.abs(h-v[y]),v[y]=h}o-=1}return v},rz=-1,kd=-1,oI="-1",sa="-1",sI=-1,jx=function(){function r(e,t,n,i){e===void 0&&(e=rz),t===void 0&&(t=kd),n===void 0&&(n=kd),i===void 0&&(i=oI),this.id=e,this.from=t,this.to=n,this.label=i}return r}(),nz=function(){function r(e,t){e===void 0&&(e=kd),t===void 0&&(t=sa),this.id=e,this.label=t,this.edges=[],this.edgeMap={}}return r.prototype.addEdge=function(e){this.edges.push(e),this.edgeMap[e.id]=e},r}(),uI=function(){function r(e,t,n){e===void 0&&(e=kd),t===void 0&&(t=!0),n===void 0&&(n=!1),this.id=e,this.edgeIdAutoIncrease=t,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return r.prototype.getNodeNum=function(){return this.nodes.length},r.prototype.addNode=function(e,t){if(!this.nodeMap[e]){var n=new nz(e,t);this.nodes.push(n),this.nodeMap[e]=n,this.nodeLabelMap[t]||(this.nodeLabelMap[t]=[]),this.nodeLabelMap[t].push(e)}},r.prototype.addEdge=function(e,t,n,i){if((this.edgeIdAutoIncrease||e===void 0)&&(e=this.counter++),!(this.nodeMap[t]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[e])){var a=new jx(e,t,n,i);if(this.edges.push(a),this.edgeMap[e]=a,this.nodeMap[t].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var o=new jx(e,n,t,i);this.nodeMap[n].addEdge(o),this.edgeLabelMap[i].push(o)}}},r}(),hs=function(){function r(e,t,n,i,a){this.fromNode=e,this.toNode=t,this.nodeEdgeNodeLabel={nodeLabel1:n||sa,edgeLabel:i||oI,nodeLabel2:a||sa}}return r.prototype.equalTo=function(e){return this.fromNode===e.formNode&&this.toNode===e.toNode&&this.nodeEdgeNodeLabel===e.nodeEdgeNodeLabel},r.prototype.notEqualTo=function(e){return!this.equalTo(e)},r}(),Ux=function(){function r(){this.rmpath=[],this.dfsEdgeList=[]}return r.prototype.equalTo=function(e){var t=this.dfsEdgeList.length,n=e.length;if(t!==n)return!1;for(var i=0;i<t;i++)if(this.dfsEdgeList[i]!==e[i])return!1;return!0},r.prototype.notEqualTo=function(e){return!this.equalTo(e)},r.prototype.pushBack=function(e,t,n,i,a){return this.dfsEdgeList.push(new hs(e,t,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(e,t){e===void 0&&(e=sI),t===void 0&&(t=!1);var n=new uI(e,!0,t);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,o=i.toNode,s=i.nodeEdgeNodeLabel,u=s.nodeLabel1,f=s.edgeLabel,l=s.nodeLabel2;u!==sa&&n.addNode(a,u),l!==sa&&n.addNode(o,l),u!==sa&&l!==u&&n.addEdge(void 0,a,o,f)}),n},r.prototype.buildRmpath=function(){this.rmpath=[];for(var e=void 0,t=this.dfsEdgeList.length,n=t-1;n>=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,o=i.toNode;a<o&&(e===void 0||o===e)&&(this.rmpath.push(n),e=a)}return this.rmpath},r.prototype.getNodeNum=function(){var e={};return this.dfsEdgeList.forEach(function(t){e[t.fromNode]||(e[t.fromNode]=!0),e[t.toNode]||(e[t.toNode]=!0)}),Object.keys(e).length},r}(),Wc=function(){function r(e){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!e){for(;e;){var t=e.edge;this.edges.push(t),this.nodesUsed[t.from]=1,this.nodesUsed[t.to]=1,this.edgesUsed[t.id]=1,e=e.preNode}this.edges=this.edges.reverse()}}return r.prototype.hasNode=function(e){return this.nodesUsed[e.id]===1},r.prototype.hasEdge=function(e){return this.edgesUsed[e.id]===1},r}(),iz=function(){function r(e){var t=e.graphs,n=e.minSupport,i=n===void 0?2:n,a=e.minNodeNum,o=a===void 0?1:a,s=e.maxNodeNum,u=s===void 0?4:s,f=e.top,l=f===void 0?10:f,c=e.directed,h=c===void 0?!1:c,d=e.verbose,v=d===void 0?!1:d;this.graphs=t,this.dfsCode=new Ux,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=l,this.directed=h,this.counter=0,this.maxNodeNum=u,this.minNodeNum=o,this.verbose=v,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return r.prototype.findForwardRootEdges=function(e,t){var n=this,i=[],a=e.nodeMap;return t.edges.forEach(function(o){(n.directed||t.label<=a[o.to].label)&&i.push(o)}),i},r.prototype.findBackwardEdge=function(e,t,n,i){if(!this.directed&&t===n)return null;for(var a=e.nodeMap,o=a[n.to],s=o.edges,u=s.length,f=0;f<u;f++){var l=s[f];if(!(i.hasEdge(l)||l.to!==t.from)){if(this.directed){if(a[t.from].label<a[n.to].label||a[t.from].label===a[n.to].label&&t.label<=l.label)return l}else if(t.label<l.label||t.label===l.label&&a[t.to].label<=a[n.to].label)return l}}return null},r.prototype.findForwardPureEdges=function(e,t,n,i){for(var a=[],o=t.to,s=e.nodeMap[o].edges,u=s.length,f=0;f<u;f++){var l=s[f],c=e.nodeMap[l.to];n<=c.label&&!i.hasNode(c)&&a.push(l)}return a},r.prototype.findForwardRmpathEdges=function(e,t,n,i){for(var a=[],o=e.nodeMap,s=o[t.to].label,u=o[t.from],f=u.edges,l=f.length,c=0;c<l;c++){var h=f[c],d=o[h.to].label;t.to===h.to||n>d||i.hasNode(o[h.to])||(t.label<h.label||t.label===h.label&&s<=d)&&a.push(h)}return a},r.prototype.getSupport=function(e){var t={};return e.forEach(function(n){t[n.graphId]||(t[n.graphId]=!0)}),Object.keys(t).length},r.prototype.findMinLabel=function(e){var t=void 0;return Object.keys(e).forEach(function(n){var i=e[n],a=i.nodeLabel1,o=i.edgeLabel,s=i.nodeLabel2;if(!t){t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s};return}(a<t.nodeLabel1||a===t.nodeLabel1&&o<t.edgeLabel||a===t.nodeLabel1&&o===t.edgeLabel&&s<t.nodeLabel2)&&(t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s})}),t},r.prototype.isMin=function(){var e=this,t=this.dfsCode;if(this.verbose&&console.log("isMin checking",t),t.dfsEdgeList.length===1)return!0;var n=this.directed,i=t.toGraph(sI,n),a=i.nodeMap,o=new Ux,s={};i.nodes.forEach(function(c){var h=e.findForwardRootEdges(i,c);h.forEach(function(d){var v=a[d.to],p="".concat(c.label,"-").concat(d.label,"-").concat(v.label);s[p]||(s[p]={projected:[],nodeLabel1:c.label,edgeLabel:d.label,nodeLabel2:v.label});var g={graphId:i.id,edge:d,preNode:null};s[p].projected.push(g)})});var u=this.findMinLabel(s);if(u){o.dfsEdgeList.push(new hs(0,1,u.nodeLabel1,u.edgeLabel,u.nodeLabel2));var f=function c(h){for(var d=o.buildRmpath(),v=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,p=o.dfsEdgeList[d[0]].toNode,g={},y=!1,m=0,x=n?-1:0,b=function(B){if(y)return"break";h.forEach(function(W){var D=new Wc(W),P=e.findBackwardEdge(i,D.edges[d[B]],D.edges[d[0]],D);P&&(g[P.label]||(g[P.label]={projected:[],edgeLabel:P.label}),g[P.label].projected.push({graphId:i.id,edge:g,preNode:W}),m=o.dfsEdgeList[d[B]].fromNode,y=!0)})},w=d.length-1;w>x;w--){var E=b(w);if(E==="break")break}if(y){var S=e.findMinLabel(g);o.dfsEdgeList.push(new hs(p,m,sa,S.edgeLabel,sa));var _=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[_]!==o.dfsEdgeList[_]?!1:c(g[S.edgeLabel].projected)}var C={};y=!1;var M=0;h.forEach(function(O){var B=new Wc(O),W=e.findForwardPureEdges(i,B.edges[d[0]],v,B);W.length>0&&(y=!0,M=p,W.forEach(function(D){var P="".concat(D.label,"-").concat(a[D.to].label);C[P]||(C[P]={projected:[],edgeLabel:D.label,nodeLabel2:a[D.to].label}),C[P].projected.push({graphId:i.id,edge:D,preNode:O})}))});for(var A=d.length,T=function(B){if(y)return"break";var W=d[B];h.forEach(function(D){var P=new Wc(D),R=e.findForwardRmpathEdges(i,P.edges[W],v,P);R.length>0&&(y=!0,M=o.dfsEdgeList[W].fromNode,R.forEach(function(X){var Y="".concat(X.label,"-").concat(a[X.to].label);C[Y]||(C[Y]={projected:[],edgeLabel:X.label,nodeLabel2:a[X.to].label}),C[Y].projected.push({graphId:i.id,edge:X,preNode:D})}))})},w=0;w<A;w++){var I=T(w);if(I==="break")break}if(!y)return!0;var L=e.findMinLabel(C);o.dfsEdgeList.push(new hs(M,p+1,sa,L.edgeLabel,L.nodeLabel2));var N=o.dfsEdgeList.length-1;return t.dfsEdgeList[N]!==o.dfsEdgeList[N]?!1:c(C["".concat(L.edgeLabel,"-").concat(L.nodeLabel2)].projected)},l="".concat(u.nodeLabel1,"-").concat(u.edgeLabel,"-").concat(u.nodeLabel2);return f(s[l].projected)}},r.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var e=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(Jt(e))}},r.prototype.subGraphMining=function(e){var t=this,n=this.getSupport(e);if(!(n<this.minSupport)&&this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),o=this.dfsCode.dfsEdgeList[a[0]].toNode,s=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,u={},f={};e.forEach(function(l){for(var c=t.graphs[l.graphId],h=c.nodeMap,d=new Wc(l),v=a.length-1;v>=0;v--){var p=t.findBackwardEdge(c,d.edges[a[v]],d.edges[a[0]],d);if(p){var g="".concat(t.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(p.label);f[g]||(f[g]={projected:[],toNodeId:t.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:p.label}),f[g].projected.push({graphId:l.graphId,edge:p,preNode:l})}}if(!(i>=t.maxNodeNum)){var y=t.findForwardPureEdges(c,d.edges[a[0]],s,d);y.forEach(function(x){var b="".concat(o,"-").concat(x.label,"-").concat(h[x.to].label);u[b]||(u[b]={projected:[],fromNodeId:o,edgeLabel:x.label,nodeLabel2:h[x.to].label}),u[b].projected.push({graphId:l.graphId,edge:x,preNode:l})});for(var m=function(b){var w=t.findForwardRmpathEdges(c,d.edges[a[b]],s,d);w.forEach(function(E){var S="".concat(t.dfsCode.dfsEdgeList[a[b]].fromNode,"-").concat(E.label,"-").concat(h[E.to].label);u[S]||(u[S]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[b]].fromNode,edgeLabel:E.label,nodeLabel2:h[E.to].label}),u[S].projected.push({graphId:l.graphId,edge:E,preNode:l})})},v=0;v<a.length;v++)m(v)}}),Object.keys(f).forEach(function(l){var c=f[l],h=c.toNodeId,d=c.edgeLabel;t.dfsCode.dfsEdgeList.push(new hs(o,h,"-1",d,"-1")),t.subGraphMining(f[l].projected),t.dfsCode.dfsEdgeList.pop()}),Object.keys(u).forEach(function(l){var c=u[l],h=c.fromNodeId,d=c.edgeLabel,v=c.nodeLabel2;t.dfsCode.dfsEdgeList.push(new hs(h,o+1,sa,d,v)),t.subGraphMining(u[l].projected),t.dfsCode.dfsEdgeList.pop()})}},r.prototype.generate1EdgeFrequentSubGraphs=function(){var e=this.graphs,t=this.directed,n=this.minSupport,i=this.frequentSize1Subgraphs,a={},o={},s={};return Object.keys(e).forEach(function(u){var f=e[u],l=f.nodeMap;f.nodes.forEach(function(c,h){var d=c.label,v="".concat(u,"-").concat(d);if(!s[v]){var p=a[d]||0;p++,a[d]=p}s[v]={graphKey:u,label:d},c.edges.forEach(function(g){var y=d,m=l[g.to].label;if(!t&&y>m){var x=m;m=y,y=x}var b=g.label,w="".concat(y,"-").concat(b,"-").concat(m);if(!o[w]){var E=o[w]||0;E++,o[w]=E}})})}),Object.keys(a).forEach(function(u){var f=a[u];if(!(f<n)){var l={nodes:[],edges:[]};l.nodes.push({id:"0",label:u}),i.push(l)}}),i},r.prototype.run=function(){var e=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var t=this.graphs;this.directed;var n={};Object.keys(t).forEach(function(i){var a=t[i],o=a.nodeMap;a.nodes.forEach(function(s){var u=e.findForwardRootEdges(a,s);u.forEach(function(f){var l=o[f.to],c="".concat(s.label,"-").concat(f.label,"-").concat(l.label);n[c]||(n[c]={projected:[],nodeLabel1:s.label,edgeLabel:f.label,nodeLabel2:l.label});var h={graphId:i,edge:f,preNode:null};n[c].projected.push(h)})})}),Object.keys(n).forEach(function(i){var a=n[i],o=a.projected,s=a.nodeLabel1,u=a.edgeLabel,f=a.nodeLabel2;e.dfsCode.dfsEdgeList.push(new hs(0,1,s,u,f)),e.subGraphMining(o),e.dfsCode.dfsEdgeList.pop()})}},r}(),az=function(e,t,n,i){var a={};return Object.keys(e).forEach(function(o,s){var u=e[o],f=new uI(s,!0,t),l={};u.nodes.forEach(function(c,h){f.addNode(h,c[n]),l[c.id]=h}),u.edges.forEach(function(c,h){var d=l[c.source],v=l[c.target];f.addEdge(-1,d,v,c[i])}),f&&f.getNodeNum()&&(a[f.id]=f)}),a},oz=function(e,t,n){var i=[];return e.forEach(function(a){var o={nodes:[],edges:[]};a.nodes.forEach(function(s){var u;o.nodes.push((u={id:"".concat(s.id)},u[t]=s.label,u))}),a.edges.forEach(function(s){var u;o.edges.push((u={source:"".concat(s.from),target:"".concat(s.to)},u[n]=s.label,u))}),i.push(o)}),i},$x="cluster",sz=function(e){var t=e.graphs,n=e.directed,i=n===void 0?!1:n,a=e.nodeLabelProp,o=a===void 0?$x:a,s=e.edgeLabelProp,u=s===void 0?$x:s,f=az(t,i,o,u),l=e.minSupport,c=e.maxNodeNum,h=e.minNodeNum,d=e.verbose,v=e.top,p={graphs:f,minSupport:l,maxNodeNum:c,minNodeNum:h,top:v,verbose:d,directed:i},g=new iz(p);g.run();var y=oz(g.frequentSubgraphs,o,u);return y},Xx=function(e,t,n,i){n===void 0&&(n="cluster"),i===void 0&&(i=2);var a=[],o=e.nodes;return t.forEach(function(s,u){a.push(fI(o,s,u,n,i))}),a},fI=function(e,t,n,i,a){var o=[n],s=[],u={};return t.forEach(function(f,l){if(f<=a&&n!==l){o.push(l),s.push(e[l]);var c=e[l][i];u[c]?(u[c].count++,u[c].dists.push(f)):u[c]={count:1,dists:[f]}}}),Object.keys(u).forEach(function(f){u[f].dists=u[f].dists.sort(function(l,c){return l-c})}),{nodeIdx:n,nodeId:e[n].id,nodeIdxs:o,neighbors:s,neighborNum:o.length-1,nodeLabelCountMap:u}},uz=function(e,t,n,i,a){var o=Math.ceil(n/t),s={},u=0;return i.forEach(function(f,l){for(var c=0,h=0,d=f.nodeIdxs,v=f.neighborNum-1;c<o;){for(var p=d[1+Math.floor(Math.random()*v)],g=0;(s["".concat(l,"-").concat(p)]||s["".concat(p,"-").concat(l)])&&(p=Math.floor(Math.random()*t),g++,!(g>2*t)););if(g<2*t&&(s["".concat(l,"-").concat(p)]={start:l,end:p,distance:a[l][p]},c++,u++,u>=n))return s;if(h++,h>2*t)break}if(c<o){var y=o-c;o=(o+y)/(t-l-1)}}),s},sd=function(e,t,n,i){var a=n.nodes;return i||(i={}),Object.keys(e).forEach(function(o){var s,u;if(!(i&&i[o])){i[o]={nodes:[],edges:[]};var f=e[o],l=(s=t[f.start])===null||s===void 0?void 0:s.nodeIdxs,c=(u=t[f.end])===null||u===void 0?void 0:u.nodeIdxs;if(!(!l||!c)){var h=new Set(c),d=l.filter(function(m){return h.has(m)});if(!(!d||!d.length)){for(var v={},p=d.length,g=0;g<p;g++){var y=a[d[g]];i[o].nodes.push(y),v[y.id]=!0}n.edges.forEach(function(m){v[m.source]&&v[m.target]&&i[o].edges.push(m)})}}}}),i},ud=function(e,t,n,i){var a,o,s={};e.nodes.forEach(function(f){s[f.id]=f});var u=0;return!(!((a=t==null?void 0:t.edges)===null||a===void 0)&&a.length)||((o=t==null?void 0:t.nodes)===null||o===void 0?void 0:o.length)<2?0:(e.edges.forEach(function(f){var l=s[f.source][n],c=s[f.target][n],h=t==null?void 0:t.nodes[0][n],d=t==null?void 0:t.nodes[1][n],v=t==null?void 0:t.edges[0][i];f[i]===v&&(l===h&&c===d||l===d&&c===h)&&u++}),u)},fz=function(e,t,n){for(var i=1/0,a=0,o=function(f){var l=e[f],c=Object.keys(l).sort(function(m,x){return l[m]-l[x]}),h=10,d=[];c.forEach(function(m,x){d[x%h]||(d[x%h]={graphs:[],totalCount:0,aveCount:0}),d[x%h].graphs.push(m),d[x%h].totalCount+=l[m]});var v=0,p=[];d.forEach(function(m){var x=m.totalCount/m.graphs.length;m.aveCount=x,p.push(x);var b=0,w=m.length;m.graphs.forEach(function(E,S){var _=l[E];m.graphs.forEach(function(C,M){S!==M&&(b+=Math.abs(_-l[C]))})}),b/=w*(w-1)/2,v+=b}),v/=d.length;var g=0;p.forEach(function(m,x){p.forEach(function(b,w){x!==w&&(g+=Math.abs(m-b))}),g/=p.length*(p.length-1)/2});var y=g-v;i<y&&(i=y,a=f)},s=0;s<t;s++)o(s);return{structure:n[a],structureCountMap:e[a]}},Yx=function(e,t){var n={},i={};return e.forEach(function(a,o){n[a.id]={idx:o,node:a,degree:0,inDegree:0,outDegree:0};var s=a[t];i[s]||(i[s]=[]),i[s].push(a)}),{nodeMap:n,nodeLabelMap:i}},Wx=function(e,t,n){var i={},a={};return e.forEach(function(o,s){i["".concat($T)]={idx:s,edge:o};var u=o[t];a[u]||(a[u]=[]),a[u].push(o);var f=n[o.source];f&&(f.degree++,f.outDegree++);var l=n[o.target];l&&(l.degree++,l.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},qx=function(e,t,n){var i=t.length,a={};return t.forEach(function(o,s){for(var u=n?0:s+1,f=e[s].id,l=u;l<i;l++)if(s!==l){var c=e[l].id,h=o[l];a["".concat(f,"-").concat(c)]=h,n||(a["".concat(c,"-").concat(f)]=h)}}),a},lz=function(e,t,n,i,a,o,s,u,f,l,c){var h,d="".concat(t.id,"-").concat(n.id);if(l&&l[d])return l[d];var v=c?c[d]:void 0;if(!v){var p=(h={},h[d]={start:i[t.id].idx,end:i[n.id].idx,distance:a},h);c=sd(p,o,e,c),v=c[d]}return ud(v,s,u,f)},Vx=function(e,t,n,i){var a,o,s,u=(a=e[t])===null||a===void 0?void 0:a.degree,f=(o=e[t])===null||o===void 0?void 0:o.inDegree,l=(s=e[t])===null||s===void 0?void 0:s.outDegree;return e[t]===void 0&&(u=1/0,f=1/0,l=1/0,i[t].forEach(function(c){var h=n[c.id].degree;u>h&&(u=h);var d=n[c.id].inDegree;f>d&&(f=d);var v=n[c.id].outDegree;l>v&&(l=v)}),e[t]={degree:u,inDegree:f,outDegree:l}),{minPatternNodeLabelDegree:u,minPatternNodeLabelInDegree:f,minPatternNodeLabelOutDegree:l}},lI=function(e,t,n,i,a,o,s){var u;if(n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!e||!e.nodes)){var f=e.nodes.length;if(f){var l=kl(e,n),c=kl(t,n),h=qx(e.nodes,l,n),d=qx(t.nodes,c,n),v=Yx(e.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,y=Yx(t.nodes,o),m=y.nodeMap,x=y.nodeLabelMap;Wx(e.edges,s,p);var b=Wx(t.edges,s,m).edgeLabelMap,w=[];c==null||c.forEach(function(pt){w=w.concat(pt)}),a||(a=Math.max.apply(Math,Qn(Qn([],w,!1),[2],!1))),i||(i=a);var E=Xx(e,l,o,i),S=Xx(t,c,o,i),_=Math.min(100,f*(f-1)/2),C=uz(i,f,_,E,l),M=sd(C,E,e),A=10,T=1,I=1,L=4,N={graphs:M,nodeLabelProp:o,edgeLabelProp:s,minSupport:T,minNodeNum:I,maxNodeNum:L,directed:n},O=sz(N).slice(0,A),B=O.length,W=[];O.forEach(function(pt,Nt){W[Nt]={},Object.keys(M).forEach(function(F){var zt=M[F],Ot=ud(zt,pt,o,s);W[Nt][F]=Ot})});var D=fz(W,B,O),P=D.structure,R=D.structureCountMap,X=t.nodes[0],Y=[],ee=(u=t.nodes[0])===null||u===void 0?void 0:u[o],U=-1/0;t.nodes.forEach(function(pt){var Nt=pt[o],F=g[Nt];(F==null?void 0:F.length)>U&&(U=F.length,Y=F,ee=Nt,X=pt)});var Z={},K={},se={},re={},J={},me={};Object.keys(x).forEach(function(pt,Nt){J[pt]=[],n&&(me[pt]=[]);var F=x[pt],zt={};F.forEach(function(ct){var ve=d["".concat(X.id,"-").concat(ct.id)];if(ve&&J[pt].push(ve),zt["".concat(X.id,"-").concat(ct.id)]={start:0,end:m[ct.id].idx,distance:ve},n){var Te=d["".concat(ct.id,"-").concat(X.id)];Te&&me[pt].push(Te)}}),J[pt]=J[pt].sort(function(ct,ve){return ct-ve}),n&&(me[pt]=me[pt].sort(function(ct,ve){return ct-ve})),K=sd(zt,S,t,K);var Ot=[];if(Object.keys(zt).forEach(function(ct){if(se[ct]){Ot.push(se[ct]);return}var ve=K[ct];se[ct]=ud(ve,P,o,s),Ot.push(se[ct])}),Ot=Ot.sort(function(ct,ve){return ve-ct}),re["".concat(X.id,"-").concat(pt)]=Ot,pt!==ee)for(var ut=(Y==null?void 0:Y.length)||0,Gt=function(ve){var Te=Y[ve],nt=E[p[Te.id].idx],st=nt.nodeLabelCountMap[pt],gt=x[pt].length;if(!st||st.count<gt)return Y.splice(ve,1),"continue";for(var Ct=!1,Bt=0;Bt<gt;Bt++)if(st.dists[Bt]>J[pt][Bt]){Ct=!0;break}if(Ct)return Y.splice(ve,1),"continue";var Sr={};nt.neighbors.forEach(function(wt){var er=h["".concat(Te.id,"-").concat(wt.id)];Sr["".concat(Te.id,"-").concat(wt.id)]={start:p[Te.id].idx,end:p[wt.id].idx,distance:er}}),M=sd(Sr,E,e,M);var yr=[];Object.keys(Sr).forEach(function(wt){if(R[wt]){yr.push(R[wt]);return}var er=M[wt];R[wt]=ud(er,P,o,s),yr.push(R[wt])}),yr=yr.sort(function(wt,er){return er-wt});for(var Rr=!1,Bt=0;Bt<gt;Bt++)if(yr[Bt]<Ot[Bt]){Rr=!0;break}if(Rr)return Y.splice(ve,1),"continue"},_t=ut-1;_t>=0;_t--)Gt(_t)});var Ae=[];Y==null||Y.forEach(function(pt){for(var Nt=p[pt.id].idx,F=fI(e.nodes,l[Nt],Nt,o,a),zt=F.neighbors,Ot=zt.length,ut=!1,Gt=Ot-1;Gt>=0;Gt--){if(zt.length+1<t.nodes.length){ut=!0;return}var _t=zt[Gt],ct=_t[o];if(!x[ct]||!x[ct].length){zt.splice(Gt,1);continue}if(!J[ct]||!J[ct].length){zt.splice(Gt,1);continue}var ve="".concat(pt.id,"-").concat(_t.id),Te=h[ve],nt=J[ct].length-1,st=J[ct][nt];if(Te>st){zt.splice(Gt,1);continue}if(n){var gt="".concat(_t.id,"-").concat(pt.id),Ct=h[gt];nt=me[ct].length-1;var Bt=me[ct][nt];if(Ct>Bt){zt.splice(Gt,1);continue}}var Sr=R[ve]?R[ve]:lz(e,pt,_t,p,Te,E,P,o,s,R,M),yr="".concat(X.id,"-").concat(ct),Rr=re[yr][re[yr].length-1];if(Sr<Rr){zt.splice(Gt,1);continue}var wt=Vx(Z,ct,m,x),er=wt.minPatternNodeLabelDegree;if(wt.minPatternNodeLabelInDegree,wt.minPatternNodeLabelOutDegree,p[_t.id].degree<er){zt.splice(Gt,1);continue}}ut||Ae.push({nodes:[pt].concat(zt)})});var Ye=Il(t,X.id,!1).length,Ve={};n?(Object.keys(Ye).forEach(function(pt){var Nt=m[pt].node[o];Ve[Nt]?Ve[Nt].push(Ye[pt]):Ve[Nt]=[Ye[pt]]}),Object.keys(Ve).forEach(function(pt){Ve[pt].sort(function(Nt,F){return Nt-F})})):Ve=J;for(var Ke=Ae.length,xt=function(Nt){var F=Ae[Nt],zt=F.nodes[0],Ot={},ut={};F.nodes.forEach(function(sr,Er){ut[sr.id]={idx:Er,node:sr,degree:0,inDegree:0,outDegree:0};var jt=sr[o];Ot[jt]?Ot[jt]++:Ot[jt]=1});var Gt=[],_t={};e.edges.forEach(function(sr){ut[sr.source]&&ut[sr.target]&&(Gt.push(sr),_t[sr[s]]?_t[sr[s]]++:_t[sr[s]]=1,ut[sr.source].degree++,ut[sr.target].degree++,ut[sr.source].outDegree++,ut[sr.target].inDegree++)});for(var ct=Object.keys(b).length,ve=!1,Te=0;Te<ct;Te++){var nt=Object.keys(b)[Te];if(!_t[nt]||_t[nt]<b[nt].length){ve=!0;break}}if(ve)return Ae.splice(Nt,1),"continue";var st=Gt.length;if(st<t.edges.length)return Ae.splice(Nt,1),"break";for(var gt=!1,Ct=function(Er){var jt=Gt[Er],_r=jt[s],an=b[_r];if(!an||!an.length)return _t[_r]--,an&&_t[_r]<an.length?(gt=!0,"break"):(Gt.splice(Er,1),ut[jt.source].degree--,ut[jt.target].degree--,ut[jt.source].outDegree--,ut[jt.target].inDegree--,"continue");var xa=ut[jt.source].node[o],Xn=ut[jt.target].node[o],Ha=!1;if(an.forEach(function(js){var Us=m[js.source].node,$s=m[js.target].node;Us[o]===xa&&$s[o]===Xn&&(Ha=!0),!n&&Us[o]===Xn&&$s[o]===xa&&(Ha=!0)}),!Ha)return _t[_r]--,an&&_t[_r]<an.length?(gt=!0,"break"):(Gt.splice(Er,1),ut[jt.source].degree--,ut[jt.target].degree--,ut[jt.source].outDegree--,ut[jt.target].inDegree--,"continue")},Te=st-1;Te>=0;Te--){var Bt=Ct(Te);if(Bt==="break")break}if(gt)return Ae.splice(Nt,1),"continue";F.edges=Gt;var Sr=Il(F,F.nodes[0].id,!1).length;if(Object.keys(Sr).reverse().forEach(function(sr){if(!(sr===F.nodes[0].id||gt)){if(Sr[sr]===1/0){var Er=ut[sr].node[o];if(Ot[Er]--,Ot[Er]<x[Er].length){gt=!0;return}var jt=F.nodes.indexOf(ut[sr].node);F.nodes.splice(jt,1),ut[sr]=void 0;return}var _r=p[sr].node[o];if(!Ve[_r]||!Ve[_r].length||Sr[sr]>Ve[_r][Ve[_r].length-1]){var Er=ut[sr].node[o];if(Ot[Er]--,Ot[Er]<x[Er].length){gt=!0;return}var jt=F.nodes.indexOf(ut[sr].node);F.nodes.splice(jt,1),ut[sr]=void 0}}}),gt)return Ae.splice(Nt,1),"continue";for(var yr=!0,Rr=0;yr&&!gt;){yr=!1;var wt=n?ut[zt.id].degree<m[X.id].degree||ut[zt.id].inDegree<m[X.id].inDegree||ut[zt.id].outDegree<m[X.id].outDegree:ut[zt.id].degree<m[X.id].degree;if(wt){gt=!0;break}if(Ot[zt[o]]<x[zt[o]].length){gt=!0;break}for(var er=F.nodes.length,ir=er-1;ir>=0;ir--){var Yt=F.nodes[ir],br=ut[Yt.id].degree,It=ut[Yt.id].inDegree,wr=ut[Yt.id].outDegree,Ht=Yt[o],fr=Vx(Z,Ht,m,x),mr=fr.minPatternNodeLabelDegree,Lr=fr.minPatternNodeLabelInDegree,Vr=fr.minPatternNodeLabelOutDegree,cn=n?br<mr||It<Lr||wr<Vr:br<mr;if(cn){if(Ot[Yt[o]]--,Ot[Yt[o]]<x[Yt[o]].length){gt=!0;break}F.nodes.splice(ir,1),ut[Yt.id]=void 0,yr=!0}}if(gt||!yr&&Rr!==0)break;st=Gt.length;for(var Mr=st-1;Mr>=0;Mr--){var hn=Gt[Mr];if(!ut[hn.source]||!ut[hn.target]){Gt.splice(Mr,1);var rn=hn[s];if(_t[rn]--,ut[hn.source]&&(ut[hn.source].degree--,ut[hn.source].outDegree--),ut[hn.target]&&(ut[hn.target].degree--,ut[hn.target].inDegree--),b[rn]&&_t[rn]<b[rn].length){gt=!0;break}yr=!0}}Rr++}if(gt||gt||F.nodes.length<t.nodes.length||Gt.length<t.edges.length)return Ae.splice(Nt,1),"continue"},kt=Ke-1;kt>=0;kt--){var Lt=xt(kt);if(Lt==="break")break}for(var vr=Ae.length,xr=function(Nt){var F=Ae[Nt],zt={};F.edges.forEach(function(Gt){var _t="".concat(Gt.source,"-").concat(Gt.target,"-").concat(Gt.label);zt[_t]?zt[_t]++:zt[_t]=1});for(var Ot=function(_t){var ct=Ae[_t],ve={};ct.edges.forEach(function(nt){var st="".concat(nt.source,"-").concat(nt.target,"-").concat(nt.label);ve[st]?ve[st]++:ve[st]=1});var Te=!0;Object.keys(ve).length!==Object.keys(zt).length?Te=!1:Object.keys(zt).forEach(function(nt){ve[nt]!==zt[nt]&&(Te=!1)}),Te&&Ae.splice(_t,1)},ut=vr-1;ut>Nt;ut--)Ot(ut);vr=Ae.length},kt=0;kt<=vr-1;kt++)xr(kt);return Ae}}},Iu=function(){function r(e){e===void 0&&(e=10),this.linkedList=new UT,this.maxStep=e}return Object.defineProperty(r.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},r.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},r.prototype.push=function(e){this.linkedList.prepend(e),this.length>this.maxStep&&this.linkedList.deleteTail()},r.prototype.pop=function(){var e=this.linkedList.deleteHead();return e?e.value:null},r.prototype.toArray=function(){return this.linkedList.toArray().map(function(e){return e.value})},r.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},r}(),cI=Lm;const cz={getAdjMatrix:Ts,breadthFirstSearch:XT,connectedComponent:Im,getDegree:Ua,getInDegree:WT,getOutDegree:qT,detectCycle:Lm,detectDirectedCycle:cI,detectAllCycles:HT,detectAllDirectedCycle:Om,detectAllUndirectedCycle:Nm,depthFirstSearch:km,dijkstra:Il,findAllPath:QT,findShortestPath:KT,floydWarshall:kl,labelPropagation:JT,louvain:Rm,iLouvain:eI,kCore:tI,kMeans:rI,cosineSimilarity:Bm,nodesCosineSimilarity:nI,minimumSpanningTree:iI,pageRank:aI,getNeighbors:Kn,Stack:Iu,GADDI:lI},hz=Object.freeze(Object.defineProperty({__proto__:null,GADDI:lI,Stack:Iu,breadthFirstSearch:XT,connectedComponent:Im,cosineSimilarity:Bm,default:cz,depthFirstSearch:km,detectAllCycles:HT,detectAllDirectedCycle:Om,detectAllUndirectedCycle:Nm,detectCycle:Lm,detectDirectedCycle:cI,dijkstra:Il,findAllPath:QT,findShortestPath:KT,floydWarshall:kl,getAdjMatrix:Ts,getDegree:Ua,getInDegree:WT,getNeighbors:Kn,getOutDegree:qT,iLouvain:eI,kCore:tI,kMeans:rI,labelPropagation:JT,louvain:Rm,minimumSpanningTree:iI,nodesCosineSimilarity:nI,pageRank:aI},Symbol.toStringTag,{value:"Module"}));var Ld=vi,dz=function(e){return function(t,n){return t[e]-n[e]}},Hx=function(e,t,n){return e>=t&&e<=n},Ev=function(e,t,n,i){var a=1e-4,o={x:n.x-e.x,y:n.y-e.y},s={x:t.x-e.x,y:t.y-e.y},u={x:i.x-n.x,y:i.y-n.y},f=s.x*u.y-s.y*u.x,l=f*f,c=1/f,h=s.x*s.x+s.y*s.y,d=u.x*u.x+u.y*u.y;if(l>a*h*d){var v=(o.x*u.y-o.y*u.x)*c,p=(o.x*s.y-o.y*s.x)*c;return!Hx(v,0,1)||!Hx(p,0,1)?null:{x:e.x+v*s.x,y:e.y+v*s.y}}return null},hI=function(e,t){var n=e.x,i=e.y,a=e.width,o=e.height,s=n+a/2,u=i+o/2,f=[],l={x:s,y:u};f.push({x:n,y:i}),f.push({x:n+a,y:i}),f.push({x:n+a,y:i+o}),f.push({x:n,y:i+o}),f.push({x:n,y:i});for(var c=null,h=1;h<f.length&&(c=Ev(f[h-1],f[h],l,t),!c);h++);return c},dI=function(e,t){var n=e.x,i=e.y,a=e.r,o=t.x,s=t.y,u=o-n,f=s-i;if(u*u+f*f<a*a)return null;var l=Math.atan(f/u);return{x:n+Math.abs(a*Math.cos(l))*Math.sign(u),y:i+Math.abs(a*Math.sin(l))*Math.sign(f)}},vI=function(e,t){var n=e.rx,i=e.ry,a=e.x,o=e.y,s=t.x-a,u=t.y-o,f=Math.atan2(u/i,s/n);return f<0&&(f+=2*Math.PI),{x:a+n*Math.cos(f),y:o+i*Math.sin(f)}},Nu=function(e,t,n){n===void 0&&(n=1);var i=[e.x,e.y,n];return(!t||isNaN(t[0]))&&(t=[1,0,0,0,1,0,0,0,1]),xv(i,i,t),{x:i[0],y:i[1]}},pI=function(e,t,n){n===void 0&&(n=1),(!t||isNaN(t[0]))&&(t=[1,0,0,0,1,0,0,0,1]);var i=vm([1,0,0,0,1,0,0,0,1],t);i||(i=[1,0,0,0,1,0,0,0,1]);var a=[e.x,e.y,n];return xv(a,a,i),{x:a[0],y:a[1]}},F0=function(e,t,n){var i=e.x-t.x,a=e.y-t.y,o=e.x-n.x,s=e.y-n.y,u=(e.x*e.x-t.x*t.x-t.y*t.y+e.y*e.y)/2,f=(e.x*e.x-n.x*n.x-n.y*n.y+e.y*e.y)/2,l=a*o-i*s;return{x:-(s*u-a*f)/l,y:-(i*f-o*u)/l}},Nd=function(e,t){var n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)},vz=function(e,t){var n=[];return e.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*t)}),n.push(a)}),n},pz=function(e){for(var t=[],n=e.length,i=0;i<n;i+=1){t[i]=[];for(var a=0;a<n;a+=1)i===a?t[i][a]=0:e[i][a]===0||!e[i][a]?t[i][a]=1/0:t[i][a]=e[i][a]}for(var o=0;o<n;o+=1)for(var i=0;i<n;i+=1)for(var a=0;a<n;a+=1)t[i][a]>t[i][o]+t[o][a]&&(t[i][a]=t[i][o]+t[o][a]);return t},gz=function(e,t){var n=e.nodes,i=e.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var f=[];a.push(f)}),i&&i.forEach(function(s){var u=s.source,f=s.target,l=o[u],c=o[f];a[l][c]=1,t||(a[c][l]=1)}),a},gI=function(e,t){e.translate(t.x,t.y)},G0=function(e,t,n,i){i===void 0&&(i={duration:500});var a=e.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var o=e.getCanvasBBox(),s=t.x-o.minX,u=t.y-o.minY;if(n){var f=s*a[0],l=u*a[4],c=0,h=0,d=0,v=0;e.animate(function(g){return d=f*g,v=l*g,a=Ld(a,[["t",d-c,v-h]]),c=d,h=v,{matrix:a}},i)}else{var p=Ld(a,[["t",s,u]]);e.setMatrix(p)}},yz=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var i=t;mt(t)||(i=[t,t]),mt(t)&&t.length===1&&(i=[t[0],t[0]]),n=Ld(n,[["s",i[0],i[1]]]),e.setMatrix(n)},mz=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=Ld(n,[["r",t]]),e.setMatrix(n)},bz=function(e,t,n){for(var i=[],a=0;a<e;a++)i[a]=0;return n.forEach(function(o){o.source&&(i[t[o.source]]+=1),o.target&&(i[t[o.target]]+=1)}),i};function xz(r,e,t){return(t[0]-r[0])*(e[1]-r[1])===(e[0]-r[0])*(t[1]-r[1])&&Math.min(r[0],e[0])<=t[0]&&t[0]<=Math.max(r[0],e[0])&&Math.min(r[1],e[1])<=t[1]&&t[1]<=Math.max(r[1],e[1])}var Ll=function(e,t,n){var i=!1,a=e.length,o=1e-6;function s(c){return Math.abs(c)<o?0:c<0?-1:1}if(a<=2)return!1;for(var u=0;u<a;u++){var f=e[u],l=e[(u+1)%a];if(xz(f,l,[t,n]))return!0;s(f[1]-n)>0!=s(l[1]-n)>0&&s(t-(n-f[1])*(f[0]-l[0])/(f[1]-l[1])-f[0])<0&&(i=!i)}return i},yI=function(e,t){return!(t.minX>e.maxX||t.maxX<e.minX||t.minY>e.maxY||t.maxY<e.minY)},wz=function(e,t){var n=!1;return _e(e,function(i){if(Ev(i.from,i.to,t.from,t.to))return n=!0,!1}),n},mI=function(e,t){var n=function(h){var d=h.map(function(p){return p[0]}),v=h.map(function(p){return p[1]});return{minX:Math.min.apply(null,d),maxX:Math.max.apply(null,d),minY:Math.min.apply(null,v),maxY:Math.max.apply(null,v)}},i=function(h){for(var d=[],v=h.length,p=0;p<v-1;p++){var g=h[p],y=h[p+1];d.push({from:{x:g[0],y:g[1]},to:{x:y[0],y:y[1]}})}if(d.length>1){var m=h[0],x=h[v-1];d.push({from:{x:x[0],y:x[1]},to:{x:m[0],y:m[1]}})}return d};if(e.length<2||t.length<2)return!1;var a=n(e),o=n(t);if(!yI(a,o))return!1;var s=!1;if(_e(t,function(c){if(Ll(e,c[0],c[1]))return s=!0,!1}),s||(_e(e,function(c){if(Ll(t,c[0],c[1]))return s=!0,!1}),s))return!0;var u=i(e),f=i(t),l=!1;return _e(f,function(c){if(wz(u,c))return l=!0,!1}),l},Is=function(){function r(e,t,n,i){this.x1=e,this.y1=t,this.x2=n,this.y2=i}return r.prototype.getBBox=function(){var e=Math.min(this.x1,this.x2),t=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),i=Math.max(this.y1,this.y2),a={x:e,y:t,minX:e,minY:t,maxX:n,maxY:i,width:n-e,height:i-t};return a},r}(),Fm=function(e,t){var n={top:[e.minX,e.minY,e.maxX,e.minY],left:[e.minX,e.minY,e.minX,e.maxY],bottom:[e.minX,e.maxY,e.maxX,e.maxY],right:[e.maxX,e.minY,e.maxX,e.maxY]};return n[t]},Ez=function(e,t){var n=(t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1),i=(e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1),a=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(a){var o=n/a,s=i/a;if(o>=0&&o<=1&&s>=0&&s<=1)return o}return Number.POSITIVE_INFINITY},bI=function(e,t){for(var n=["top","left","bottom","right"],i=e.getBBox(),a=0,o=[],s=0;s<4;s++){var u=Fm(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3];o[s]=Ev({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},{x:f,y:l},{x:c,y:h}),o[s]&&(a+=1)}return[o,a]},Gm=function(e,t){for(var n=["top","left","bottom","right"],i=e.getBBox(),a=Number.POSITIVE_INFINITY,o=0,s=0;s<4;s++){var u=Fm(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3],d=Ez(t,new Is(f,l,c,h));d=Math.abs(d-.5),d>=0&&d<=1&&(o+=1,a=d<a?d:a)}return o===0?-1:a},xI=function(e){var t=0,n=0;if(e.length>0){for(var i=0,a=e;i<a.length;i++){var o=a[i];t+=o.x,n+=o.y}t/=e.length,n/=e.length}return{x:t,y:n}},Od=function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)},wI=function(e,t){var n=t.x1,i=t.y1,a=t.x2-n,o=t.y2-i,s=e.x-n,u=e.y-i,f=s*a+u*o,l;f<=0?l=0:(s=a-s,u=o-u,f=s*a+u*o,f<=0?l=0:l=f*f/(a*a+o*o));var c=s*s+u*u-l;return c<0&&(c=0),c},z0=function(e,t,n){return n===void 0&&(n=.001),Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<Math.pow(n,2)},EI=function(e,t){var n=e.x<t.x,i=e.x>t.x+t.width,a=e.y>t.y+t.height,o=e.y<t.y,s=n||i||a||o;if(!s)return 0;if(a&&!n&&!i)return Math.pow(t.y+t.height-e.y,2);if(o&&!n&&!i)return Math.pow(e.y-t.y,2);if(n&&!a&&!o)return Math.pow(t.x-e.x,2);if(i&&!a&&!o)return Math.pow(t.x+t.width-e.x,2);var u=Math.min(Math.abs(t.x-e.x),Math.abs(t.x+t.width-e.x)),f=Math.min(Math.abs(t.y-e.y),Math.abs(t.y+t.height-e.y));return u*u+f*f},_z=function(e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t.x,u=t.y,f=[a-n,o-i];if(Tm(f,[0,0]))return NaN;var l=[-f[1],f[0]];_o(l,l);var c=[s-n,u-i];return Math.abs(Am(c,l))},zm=function(e,t,n){return e+(t-e)*n},j0=function(e,t,n){for(var i=Math.min(e.length,t.length),a=new Array(i),o=0;o<i;o++)a[o]=zm(e[o],t[o],n);return a};const Sz=Object.freeze(Object.defineProperty({__proto__:null,Line:Is,applyMatrix:Nu,compare:dz,distance:Nd,floydWarshall:pz,fractionToLine:Gm,getAdjMatrix:gz,getBBoxBoundLine:Fm,getCircleCenterByPoints:F0,getCircleIntersectByPoint:dI,getDegree:bz,getEllipseIntersectByPoint:vI,getLineIntersect:Ev,getPointsCenter:xI,getRectIntersectByPoint:hI,intersectBBox:yI,invertMatrix:pI,isPointInPolygon:Ll,isPointsOverlap:z0,isPolygonsIntersect:mI,itemIntersectByLine:bI,lerp:zm,lerpArray:j0,move:G0,pointLineDistance:_z,pointLineSquareDist:wI,pointRectSquareDist:EI,rotate:mz,scale:yz,scaleMatrix:vz,squareDist:Od,translate:gI},Symbol.toStringTag,{value:"Module"}));var to="rgb(95, 149, 255)",Mz="rgb(255, 255, 255)",Zx="rgb(0, 0, 0)",tg="rgb(247, 250, 255)",_I="rgb(239, 244, 255)",qc="rgb(253, 253, 253)",Kx="rgb(250, 250, 250)",Vc="rgb(224, 224, 224)",Qx="rgb(234, 234, 234)",Cz="rgb(245, 245, 245)",Az="rgb(191, 213, 255)",Jx="#4572d9",Tz="rgb(223, 234, 255)",hr={mainStroke:to,mainFill:_I,activeStroke:to,activeFill:tg,inactiveStroke:Az,inactiveFill:tg,selectedStroke:to,selectedFill:Mz,highlightStroke:Jx,highlightFill:Tz,disableStroke:Vc,disableFill:Kx,edgeMainStroke:Vc,edgeActiveStroke:to,edgeInactiveStroke:Qx,edgeSelectedStroke:to,edgeHighlightStroke:to,edgeDisableStroke:Cz,comboMainStroke:Vc,comboMainFill:qc,comboActiveStroke:to,comboActiveFill:tg,comboInactiveStroke:Vc,comboInactiveFill:qc,comboSelectedStroke:to,comboSelectedFill:qc,comboHighlightStroke:Jx,comboHighlightFill:qc,comboDisableStroke:Qx,comboDisableFill:Kx};const lt={version:"0.8.23",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:hr.mainStroke,fill:_I},size:20,color:hr.mainStroke,linkPoints:{size:8,lineWidth:1,fill:hr.activeFill,stroke:hr.activeStroke}},nodeStateStyles:{active:{fill:hr.activeFill,stroke:hr.activeStroke,lineWidth:2,shadowColor:hr.mainStroke,shadowBlur:10},selected:{fill:hr.selectedFill,stroke:hr.selectedStroke,lineWidth:4,shadowColor:hr.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:hr.highlightFill,stroke:hr.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:hr.inactiveFill,stroke:hr.inactiveStroke,lineWidth:1},disable:{fill:hr.disableFill,stroke:hr.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:Zx,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:hr.edgeMainStroke,lineAppendWidth:2},color:hr.edgeMainStroke},edgeStateStyles:{active:{stroke:hr.edgeActiveStroke,lineWidth:1},selected:{stroke:hr.edgeSelectedStroke,lineWidth:2,shadowColor:hr.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:hr.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:hr.edgeInactiveStroke,lineWidth:1},disable:{stroke:hr.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:Zx,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:hr.comboMainFill,lineWidth:1,stroke:hr.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:hr.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:hr.comboActiveStroke,lineWidth:1,fill:hr.comboActiveFill},selected:{stroke:hr.comboSelectedStroke,lineWidth:2,fill:hr.comboSelectedFill,shadowColor:hr.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:hr.comboHighlightStroke,lineWidth:2,fill:hr.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:hr.comboInactiveStroke,fill:hr.comboInactiveFill,lineWidth:1},disable:{stroke:hr.comboDisableStroke,fill:hr.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:typeof window<"u"&&window.getComputedStyle&&document.body&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},Iz={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,0:.6,1:.40099945068359377,2:.6,3:.6,4:.6,5:.6,6:.6,7:.5469985961914062,8:.6,9:.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875};var ra=Math.PI,U0=Math.sin,$0=Math.cos,gn=U0(ra/8),yn=$0(ra/8),Dd=function(e,t){var n=e.getBBox(),i={x:n.minX,y:n.minY},a={x:n.maxX,y:n.maxY};if(t){var o=t.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),i=Nu(i,o),a=Nu(a,o)}var s=i.x,u=i.y,f=a.x,l=a.y;return{x:s,y:u,minX:s,minY:u,maxX:f,maxY:l,width:f-s,height:l-u}},SI=function(e){var t=e.sourceNode||e.targetNode,n=t.get("group"),i=n.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var a=t.getKeyShape(),o=a.getBBox(),s=e.loopCfg||{},u=s.dist||Math.max(o.width,o.height)*2,f=s.position||lt.defaultLoopPosition,l=[(o.minX+o.maxX)/2+i[6],(o.minY+o.maxY)/2+i[7]],c=[e.startPoint.x,e.startPoint.y],h=[e.endPoint.x,e.endPoint.y],d=o.height/2,v=o.width/2,p=d,g=d,y=p*gn,m=p*yn,x=g*gn,b=g*yn,w=a.get("type"),E=Math.min(d/2,v/2),S=Math.min(d,v),_=s!=null&&s.pointPadding?Math.min(S,s==null?void 0:s.pointPadding):E;if(c[0]===h[0]&&c[1]===h[1]){switch(f){case"top":w==="circle"?(c=[l[0]-y,l[1]-m],h=[l[0]+x,l[1]-b]):(c=[l[0]-_,l[1]-d],h=[l[0]+_,l[1]-d]);break;case"top-right":p=d,g=v,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]+y,l[1]-m],h=[l[0]+b,l[1]-x]):(c=[l[0]+v-_,l[1]-d],h=[l[0]+v,l[1]-d+_]);break;case"right":p=v,g=v,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]+m,l[1]-y],h=[l[0]+b,l[1]+x]):(c=[l[0]+v,l[1]-_],h=[l[0]+v,l[1]+_]);break;case"bottom-right":p=v,g=d,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]+m,l[1]+y],h=[l[0]+x,l[1]+b]):(c=[l[0]+v,l[1]+d-_],h=[l[0]+v-_,l[1]+d]);break;case"bottom":p=d,g=d,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]+y,l[1]+m],h=[l[0]-x,l[1]+b]):(c=[l[0]-_,l[1]+d],h=[l[0]+_,l[1]+d]);break;case"bottom-left":p=d,g=v,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]-y,l[1]+m],h=[l[0]-b,l[1]+x]):(c=[l[0]-v,l[1]+d-_],h=[l[0]-v+_,l[1]+d]);break;case"left":p=v,g=v,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]-m,l[1]+y],h=[l[0]-b,l[1]-x]):(c=[l[0]-v,l[1]-_],h=[l[0]-v,l[1]+_]);break;case"top-left":p=v,g=d,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]-m,l[1]-y],h=[l[0]-x,l[1]-b]):(c=[l[0]-v+_,l[1]-d],h=[l[0]-v,l[1]-d+_]);break;default:p=v,g=v,y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]-y,l[1]-m],h=[l[0]+x,l[1]-b]}if(s.clockwise===!1){var C=[c[0],c[1]];c=[h[0],h[1]],h=[C[0],C[1]]}}var M=[c[0]-l[0],c[1]-l[1]],A=(p+u)/p,T=(g+u)/g;s.clockwise===!1&&(A=(g+u)/g,T=(p+u)/p);var I=An([0,0],M,A),L=[l[0]+I[0],l[1]+I[1]],N=[h[0]-l[0],h[1]-l[1]],O=An([0,0],N,T),B=[l[0]+O[0],l[1]+O[1]];return e.startPoint={x:c[0],y:c[1]},e.endPoint={x:h[0],y:h[1]},e.controlPoints=[{x:L[0],y:L[1]},{x:B[0],y:B[1]}],e},MI=function(e,t,n,i,a){var o=1e-4,s=[],u=e==null?void 0:e.getPoint(t);if(!u)return{x:0,y:0,angle:0};if(t<o)s=e.getStartTangent().reverse();else if(t>1-o)s=e.getEndTangent();else{var f=e==null?void 0:e.getPoint(t+o);s.push([u.x,u.y]),s.push([f.x,f.y])}var l=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(l<0&&(l+=ra*2),n&&(u.x+=$0(l)*n,u.y+=U0(l)*n),i){var c=l-ra/2;l>1/2*ra&&l<3*1/2*ra&&(c-=ra),u.x+=$0(c)*i,u.y+=U0(c)*i}var h={x:u.x,y:u.y,angle:l};return a?(l>.5*ra&&l<1.5*ra&&(l-=ra),z({rotate:l},h)):h},kz=function r(e,t,n,i){if(i(e,t,n)===!1)return!1;if(e&&e.children){for(var a=e.children.length-1;a>=0;a--)if(!r(e.children[a],e,a,i))return!1}return!0},Lz=function r(e,t,n,i){if(e&&e.children){for(var a=e.children.length-1;a>=0;a--)if(!r(e.children[a],e,a,i))return}return i(e,t,n)!==!1},Cn=function(e,t){typeof t=="function"&&kz(e,null,-1,t)},na=function(e,t){typeof t=="function"&&Lz(e,null,-1,t)},CI=function(e,t){return t*(Iz[e]||1)},AI=function(e,t){var n=0,i=new RegExp("[一-龥]+");return e.split("").forEach(function(a){i.test(a)?n+=t:n+=CI(a,t)}),[n,t]},TI=function(e,t){return typeof t!="number"||t<=0||t>=e.length?e:e.substring(0,t)+"..."},X0=function(e,t){var n=[],i={},a={};e.forEach(function(u){a[u.id]=u}),e.forEach(function(u,f){var l=Jt(u);l.itemType="combo",l.children=void 0,l.parentId===l.id?(console.warn("The parentId for combo ".concat(l.id," can not be the same as the combo's id")),delete l.parentId):l.parentId&&!a[l.parentId]&&(console.warn("The parent combo for combo ".concat(l.id," does not exist!")),delete l.parentId);var c=i[l.id];if(c){if(l.children=c.children,i[l.id]=l,c=l,!c.parentId){n.push(c);return}var h=i[c.parentId];if(h)h.children?h.children.push(l):h.children=[l];else{var d={id:c.parentId,children:[c]};i[c.parentId]=d,i[l.id]=l}return}if(Fe(u.parentId)){var v=i[u.parentId];if(v)v.children?v.children.push(l):v.children=[l],i[l.id]=l;else{var p={id:u.parentId,children:[l]};i[p.id]=p,i[l.id]=l}}else n.push(l),i[l.id]=l});var o={};(t||[]).forEach(function(u){o[u.id]=u;var f=i[u.comboId];if(f){var l={id:u.id,comboId:u.comboId};f.children?f.children.push(l):f.children=[l],l.itemType="node",i[u.id]=l}});var s=0;return n.forEach(function(u){u.depth=s+10,Cn(u,function(f){var l,c=i[f.id].itemType;c==="node"?l=i[f.comboId]:l=i[f.parentId],l&&c==="node"?f.depth=s+1:f.depth=s+10,s<f.depth&&(s=f.depth);var h=o[f.id];return h&&(h.depth=f.depth),!0})}),n},Y0=function(e,t,n){var i,a=e,o,s={root:{children:e}},u=!1,f="root";(e||[]).forEach(function(v){if(!u){if(v.id===t){o=v,v.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0;return}Cn(v,function(p){var g;return s[p.id]={children:(p==null?void 0:p.children)||[]},a=(g=s[p.parentId||p.comboId||"root"])===null||g===void 0?void 0:g.children,p&&(p.removed||t===p.id)&&a?(f=p.parentId||p.comboId||"root",o=p,p.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0,!1):!0})}}),a=(i=s[f])===null||i===void 0?void 0:i.children;var l=a?a.indexOf(o):-1;if(l>-1&&a.splice(l,1),u||(o={id:t,itemType:"node",comboId:n},s[t]={children:void 0}),t){var c=!1;if(n){var h=0;(e||[]).forEach(function(v){c||Cn(v,function(p){return n===p.id?(c=!0,p.children?p.children.push(o):p.children=[o],h=p.depth,o.itemType==="node"?o.depth=h+2:o.depth=h+1,!1):!0})})}else(!n||!c)&&o.itemType!=="node"&&e.push(o);var d=o.depth;Cn(o,function(v){return v.itemType==="node"?d+=2:d+=1,v.depth=d,!0})}return e},fd=function(e,t,n){var i={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};if(!e||e.length===0){var a=n==null?void 0:n.getModel(),o=a||{},s=o.x,u=o.y,f=o.fixSize,l=o.collapsed,c=o.fixCollapseSize,h=l?c:f,d=mt(h)?h:[h,h],v=d[0],p=d[1],g=[v/2,p/2];return{minX:s-g[0],minY:u-g[1],maxX:s+g[0],maxY:u+g[1],x:s,y:u,width:v,height:p}}return e.forEach(function(y){var m=t.findById(y.id);if(!(!m||!m.isVisible())){m.set("bboxCanvasCache",void 0);var x=m.getCanvasBBox();x.x&&i.minX>x.minX&&(i.minX=x.minX),x.y&&i.minY>x.minY&&(i.minY=x.minY),x.x&&i.maxX<x.maxX&&(i.maxX=x.maxX),x.y&&i.maxY<x.maxY&&(i.maxY=x.maxY)}}),i.x=(i.minX+i.maxX)/2,i.y=(i.minY+i.maxY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY,i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2,(n==null?void 0:n.getKeyShape().get("type"))==="circle"&&(i.width=Math.hypot(i.height,i.width),i.height=i.width),Object.keys(i).forEach(function(y){(i[y]===1/0||i[y]===-1/0)&&(i[y]=void 0)}),i},Nz=function(e){var t=dt(e.x)||dt(e.y)||e.type||e.anchorPoints||e.size;return e.style&&(t=t||dt(e.style.r)||dt(e.style.width)||dt(e.style.height)||dt(e.style.rx)||dt(e.style.ry)),t},ld=function(e){var t={};return Object.keys(e).forEach(function(n){var i=e[n];if(!(n==="img"&&!Fe(i)))if(wn(i)&&!mt(i)){var a={};Object.keys(i).forEach(function(o){var s=i[o];o==="img"&&!Fe(s)||(a[o]=Jt(s))}),t[n]=a}else t[n]=Jt(i)}),t},Nl=function(e){var t=e.animateCfg,n=e.callback,i;if(!t)i={duration:500,callback:n};else if(i=Jt(t),t.callback){var a=t.callback;i.callback=function(){n(),a()}}else i.callback=n;return i};const Oz=Object.freeze(Object.defineProperty({__proto__:null,cloneBesidesImg:ld,getAnimateCfgWithCallback:Nl,getBBox:Dd,getComboBBox:fd,getLabelPosition:MI,getLetterWidth:CI,getLoopCfgs:SI,getTextSize:AI,plainCombosToTrees:X0,reconstructTree:Y0,shouldRefreshEdge:Nz,traverseTree:Cn,traverseTreeUp:na,truncateLabelByLength:TI},Symbol.toStringTag,{value:"Module"}));var ew=function(e){if(!e)return console.error("G6 Error Tips: the data must be defined"),!1;var t=e.nodes,n=e.edges,i=e.combos,a=i===void 0?[]:i;if(!t&&!n){var o=!0;return Cn(e,function(h){return Fe(h.id)?!0:(o=!1,!1)}),o}var s=(t||[]).find(function(h){return!Fe(h.id)});if(s)return console.warn("G6 Warning Tips: missing 'id' property, or %c".concat(s.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1;var u=(t||[]).map(function(h){return h.id}),f=a==null?void 0:a.map(function(h){return h.id}),l=Qn(Qn([],u,!0),f,!0),c=(n||[]).find(function(h){return!l.includes(h.source)||!l.includes(h.target)});return c?(console.warn("G6 Warning Tips: The source %c".concat(c.source,"%c or the target %c").concat(c.target,"%c of the edge do not exist in the nodes or combos."),"font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1):!0},Dz=function(e,t){if(e==="node"||e==="combo"){if(t.id&&!Fe(t.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(t.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(e==="edge"&&(!t.source||!t.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0},Pz=function(){function r(e){this.graph=e,this.destroyed=!1,this.modes=e.get("modes")||{default:[]},this.formatModes(),this.mode=e.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return r.prototype.formatModes=function(){var e=this.modes;_e(e,function(t){_e(t,function(n,i){Fe(n)&&(t[i]={type:n})})})},r.prototype.setBehaviors=function(e){var t=this.graph,n=this.modes[e],i=[],a;_e(n||[],function(o){var s=dm.getBehavior(o.type||o);s&&(a=new s(o),a&&(a.bind(t),i.push(a)))}),this.currentBehaves=i},r.mergeBehaviors=function(e,t){return _e(t,function(n){e.indexOf(n)<0&&(Fe(n)&&(n={type:n}),e.push(n))}),e},r.filterBehaviors=function(e,t){var n=[];return e.forEach(function(i){var a="";Fe(i)?a=i:a=i.type,t.indexOf(a)<0&&n.push(i)}),n},r.prototype.setMode=function(e){var t=this,n=t.modes,i=t.graph,a=e,o=n[a];o&&(i.emit("beforemodechange",{mode:e}),_e(this.currentBehaves,function(s){s.delegate&&s.delegate.remove(),s.unbind(i)}),this.setBehaviors(a),i.emit("aftermodechange",{mode:e}),this.mode=e)},r.prototype.getMode=function(){return this.mode},r.prototype.manipulateBehaviors=function(e,t,n){var i=this,a;if(mt(e)?a=e:a=[e],mt(t))return _e(t,function(s){i.modes[s]?n?i.modes[s]=r.mergeBehaviors(i.modes[s]||[],a):i.modes[s]=r.filterBehaviors(i.modes[s]||[],a):n&&(i.modes[s]=a)}),this;var o=t;return t||(o=this.mode),this.modes[o]||n&&(this.modes[o]=a),n?this.modes[o]=r.mergeBehaviors(this.modes[o]||[],a):this.modes[o]=r.filterBehaviors(this.modes[o]||[],a),this.formatModes(),this.setMode(this.mode),this},r.prototype.updateBehavior=function(e,t,n){Fe(e)&&(e={type:e});var i=[];if(!n||n===this.mode||n==="default"){if(i=this.currentBehaves,!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var a=i.length,o=0;o<a;o++){var s=i[o];if(s.type===e.type)return s.updateCfg(t),this;o===a-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(i=this.modes[n],!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var u=i.length,o=0;o<u;o++){var s=i[o];if(s.type===e.type||s===e.type)return s===e.type&&(s={type:s}),Object.assign(s,t),i[o]=s,this;o===u-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},r.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},r}(),vl=`
1
+ import{cs as da,cm as va,b0 as $c,h as d3,m as v3,A as p3,D as g3,ax as Nx,H as y3,I as m3}from"./index-B9o0ntjg.js";import{a0 as Ox}from"./dayjs.min-BiJIqrUf.js";function b3(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(r,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const sm=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return zi},get Circle(){return G9},get Ellipse(){return z9},get Image(){return j9},get Line(){return U9},get Marker(){return X9},get Path(){return n1},get Polygon(){return K9},get Polyline(){return Q9},get Rect(){return t$},get Text(){return r$}},Symbol.toStringTag,{value:"Module"})),um=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return pi},get Circle(){return o$},get Dom(){return s$},get Ellipse(){return u$},get Image(){return f$},get Line(){return l$},get Marker(){return c$},get Path(){return h$},get Polygon(){return d$},get Polyline(){return v$},get Rect(){return g$},get Text(){return x$}},Symbol.toStringTag,{value:"Module"}));var R0=function(r,e){return R0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},R0(r,e)};function Rt(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");R0(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var z=function(){return z=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},z.apply(this,arguments)};function un(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function QC(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function JC(r,e){return function(t,n){e(t,n,r)}}function x3(r,e,t,n,i,a){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var s=n.kind,u=s==="getter"?"get":s==="setter"?"set":"value",f=!e&&r?n.static?r:r.prototype:null,l=e||(f?Object.getOwnPropertyDescriptor(f,n.name):{}),c,h=!1,d=t.length-1;d>=0;d--){var v={};for(var p in n)v[p]=p==="access"?{}:n[p];for(var p in n.access)v.access[p]=n.access[p];v.addInitializer=function(y){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(y||null))};var g=(0,t[d])(s==="accessor"?{get:l.get,set:l.set}:l[u],v);if(s==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(c=o(g.get))&&(l.get=c),(c=o(g.set))&&(l.set=c),(c=o(g.init))&&i.unshift(c)}else(c=o(g))&&(s==="field"?i.unshift(c):l[u]=c)}f&&Object.defineProperty(f,n.name,l),h=!0}function w3(r,e,t){for(var n=arguments.length>2,i=0;i<e.length;i++)t=n?e[i].call(r,t):e[i].call(r);return n?t:void 0}function E3(r){return typeof r=="symbol"?r:"".concat(r)}function _3(r,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function eA(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Vn(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(l){try{f(n.next(l))}catch(c){o(c)}}function u(l){try{f(n.throw(l))}catch(c){o(c)}}function f(l){l.done?a(l.value):i(l.value).then(s,u)}f((n=n.apply(r,e||[])).next())})}function Hn(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(f){return function(l){return u([f,l])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,f[0]&&(t=0)),t;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,i=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){t.label=f[1];break}if(f[0]===6&&t.label<a[1]){t.label=a[1],a=f;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(f);break}a[2]&&t.ops.pop(),t.trys.pop();continue}f=e.call(r,t)}catch(l){f=[6,l],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var vv=Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]};function tA(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&vv(e,r,t)}function Sd(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fm(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return a}function rA(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(fm(arguments[e]));return r}function pv(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}function Qn(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}function Gu(r){return this instanceof Gu?(this.v=r,this):new Gu(r)}function nA(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},s("next"),s("throw"),s("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(v){return Promise.resolve(v).then(d,c)}}function s(d,v){n[d]&&(i[d]=function(p){return new Promise(function(g,y){a.push([d,p,g,y])>1||u(d,p)})},v&&(i[d]=v(i[d])))}function u(d,v){try{f(n[d](v))}catch(p){h(a[0][3],p)}}function f(d){d.value instanceof Gu?Promise.resolve(d.value.v).then(l,c):h(a[0][2],d)}function l(d){u("next",d)}function c(d){u("throw",d)}function h(d,v){d(v),a.shift(),a.length&&u(a[0][0],a[0][1])}}function iA(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(o){return(t=!t)?{value:Gu(r[i](o)),done:!1}:a?a(o):o}:a}}function aA(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Sd=="function"?Sd(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(o){return new Promise(function(s,u){o=r[a](o),i(s,u,o.done,o.value)})}}function i(a,o,s,u){Promise.resolve(u).then(function(f){a({value:f,done:s})},o)}}function oA(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}var S3=Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e};function sA(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&vv(e,r,t);return S3(e,r),e}function uA(r){return r&&r.__esModule?r:{default:r}}function fA(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}function lA(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t}function cA(r,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?e===r:r.has(e)}function hA(r,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],t&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),r.stack.push({value:e,dispose:n,async:t})}else t&&r.stack.push({async:!0});return e}var M3=typeof SuppressedError=="function"?SuppressedError:function(r,e,t){var n=new Error(t);return n.name="SuppressedError",n.error=r,n.suppressed=e,n};function dA(r){function e(n){r.error=r.hasError?new M3(n,r.error,"An error was suppressed during disposal."):n,r.hasError=!0}function t(){for(;r.stack.length;){var n=r.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(t,function(a){return e(a),t()})}catch(a){e(a)}}if(r.hasError)throw r.error}return t()}const C3={__extends:Rt,__assign:z,__rest:un,__decorate:QC,__param:JC,__metadata:eA,__awaiter:Vn,__generator:Hn,__createBinding:vv,__exportStar:tA,__values:Sd,__read:fm,__spread:rA,__spreadArrays:pv,__spreadArray:Qn,__await:Gu,__asyncGenerator:nA,__asyncDelegator:iA,__asyncValues:aA,__makeTemplateObject:oA,__importStar:sA,__importDefault:uA,__classPrivateFieldGet:fA,__classPrivateFieldSet:lA,__classPrivateFieldIn:cA,__addDisposableResource:hA,__disposeResources:dA},A3=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:hA,get __assign(){return z},__asyncDelegator:iA,__asyncGenerator:nA,__asyncValues:aA,__await:Gu,__awaiter:Vn,__classPrivateFieldGet:fA,__classPrivateFieldIn:cA,__classPrivateFieldSet:lA,__createBinding:vv,__decorate:QC,__disposeResources:dA,__esDecorate:x3,__exportStar:tA,__extends:Rt,__generator:Hn,__importDefault:uA,__importStar:sA,__makeTemplateObject:oA,__metadata:eA,__param:JC,__propKey:E3,__read:fm,__rest:un,__runInitializers:w3,__setFunctionName:_3,__spread:rA,__spreadArray:Qn,__spreadArrays:pv,__values:Sd,default:C3},Symbol.toStringTag,{value:"Module"}));var zn=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},Md=function(r,e){return zn(r)?r.indexOf(e)>-1:!1},gv=function(r,e){if(!zn(r))return r;for(var t=[],n=0;n<r.length;n++){var i=r[n];e(i,n)&&t.push(i)}return t},T3=function(r,e){return e===void 0&&(e=[]),gv(r,function(t){return!Md(e,t)})},I3={}.toString,Fi=function(r,e){return I3.call(r)==="[object "+e+"]"};const Pr=function(r){return Fi(r,"Function")};var ht=function(r){return r==null};const mt=function(r){return Array.isArray?Array.isArray(r):Fi(r,"Array")},wn=function(r){var e=typeof r;return r!==null&&e==="object"||e==="function"};function _e(r,e){if(r){var t;if(mt(r))for(var n=0,i=r.length;n<i&&(t=e(r[n],n),t!==!1);n++);else if(wn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(t=e(r[a],a),t===!1))break}}}var vA=Object.keys?function(r){return Object.keys(r)}:function(r){var e=[];return _e(r,function(t,n){Pr(r)&&n==="prototype"||e.push(n)}),e};function pA(r,e){var t=vA(e),n=t.length;if(ht(r))return!n;for(var i=0;i<n;i+=1){var a=t[i];if(e[a]!==r[a]||!(a in r))return!1}return!0}var Cd=function(r){return typeof r=="object"&&r!==null},bn=function(r){if(!Cd(r)||!Fi(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e};function k3(r,e){if(!mt(r))return null;var t;if(Pr(e)&&(t=e),bn(e)&&(t=function(i){return pA(i,e)}),t){for(var n=0;n<r.length;n+=1)if(t(r[n]))return r[n]}return null}function L3(r,e,t){t===void 0&&(t=0);for(var n=t;n<r.length;n++)if(e(r[n],n))return n;return-1}var N3=function(r,e){for(var t=null,n=0;n<r.length;n++){var i=r[n],a=i[e];if(!ht(a)){mt(a)?t=a[0]:t=a;break}}return t},O3=function(r){if(!mt(r))return[];for(var e=[],t=0;t<r.length;t++)e=e.concat(r[t]);return e},gA=function(r,e){if(e===void 0&&(e=[]),!mt(r))e.push(r);else for(var t=0;t<r.length;t+=1)gA(r[t],e);return e};const la=function(r){if(mt(r))return r.reduce(function(e,t){return Math.max(e,t)},r[0])},ca=function(r){if(mt(r))return r.reduce(function(e,t){return Math.min(e,t)},r[0])};var yA=function(r){var e=r.filter(function(o){return!isNaN(o)});if(!e.length)return{min:0,max:0};if(mt(r[0])){for(var t=[],n=0;n<r.length;n++)t=t.concat(r[n]);e=t}var i=la(e),a=ca(e);return{min:a,max:i}},mA=Array.prototype,D3=mA.splice,P3=mA.indexOf,R3=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=0;n<e.length;n++)for(var i=e[n],a=-1;(a=P3.call(r,i))>-1;)D3.call(r,a,1);return r},B3=Array.prototype.splice,bA=function(e,t){if(!zn(e))return[];for(var n=e?t.length:0,i=n-1;n--;){var a=void 0,o=t[n];(n===i||o!==a)&&(a=o,B3.call(e,o,1))}return e},xA=function(r,e,t){if(!mt(r)&&!bn(r))return r;var n=t;return _e(r,function(i,a){n=e(n,i,a)}),n},F3=function(r,e){var t=[];if(!zn(r))return t;for(var n=-1,i=[],a=r.length;++n<a;){var o=r[n];e(o,n,r)&&(t.push(o),i.push(n))}return bA(r,i),t};const Fe=function(r){return Fi(r,"String")};function G3(r,e){var t;if(Pr(e))t=function(i,a){return e(i)-e(a)};else{var n=[];Fe(e)?n.push(e):mt(e)&&(n=e),t=function(i,a){for(var o=0;o<n.length;o+=1){var s=n[o];if(i[s]>a[s])return 1;if(i[s]<a[s])return-1}return 0}}return r.sort(t),r}function Al(r,e){e===void 0&&(e=new Map);var t=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];e.has(a)||(t.push(a),e.set(a,!0))}return t}var z3=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Al([].concat.apply([],r))};const j3=function(r,e){for(var t=[],n={},i=0;i<r.length;i++){var a=r[i],o=a[e];if(!ht(o)){mt(o)||(o=[o]);for(var s=0;s<o.length;s++){var u=o[s];n[u]||(t.push(u),n[u]=!0)}}}return t};function ua(r){if(zn(r))return r[0]}function ci(r){if(zn(r)){var e=r;return e[e.length-1]}}function U3(r,e){return mt(r)||Fe(r)?r[0]===e:!1}function $3(r,e){return mt(r)||Fe(r)?r[r.length-1]===e:!1}var X3=function(r,e){for(var t=0;t<r.length;t++)if(!e(r[t],t))return!1;return!0},Y3=function(r,e){for(var t=0;t<r.length;t++)if(e(r[t],t))return!0;return!1},W3=Object.prototype.hasOwnProperty;function Ad(r,e){if(!e||!mt(r))return{};for(var t={},n=Pr(e)?e:function(s){return s[e]},i,a=0;a<r.length;a++){var o=r[a];i=n(o),W3.call(t,i)?t[i].push(o):t[i]=[o]}return t}function wA(r,e){if(!e)return{0:r};if(!Pr(e)){var t=mt(e)?e:e.replace(/\s+/g,"").split("*");e=function(n){for(var i="_",a=0,o=t.length;a<o;a++)i+=n[t[a]]&&n[t[a]].toString();return i}}return Ad(r,e)}const q3=function(r,e){if(!e)return[r];var t=wA(r,e),n=[];for(var i in t)n.push(t[i]);return n};function V3(r,e){return r["_wrap_"+e]}function gs(r,e){if(r["_wrap_"+e])return r["_wrap_"+e];var t=function(n){r[e](n)};return r["_wrap_"+e]=t,t}var Dx={};function H3(r){var e=Dx[r];if(!e){for(var t=r.toString(16),n=t.length;n<6;n++)t="0"+t;e="#"+t,Dx[r]=e}return e}function Z3(r){var e=0,t=0,n=0,i=0;return mt(r)?r.length===1?e=t=n=i=r[0]:r.length===2?(e=n=r[0],t=i=r[1]):r.length===3?(e=r[0],t=i=r[1],n=r[2]):(e=r[0],t=r[1],n=r[2],i=r[3]):e=t=n=i=r,{r1:e,r2:t,r3:n,r4:i}}var K3=function(r,e,t){return r<e?e:r>t?t:r},rd=function(r,e){var t=e.toString(),n=t.indexOf(".");if(n===-1)return Math.round(r);var i=t.substr(n+1).length;return i>20&&(i=20),parseFloat(r.toFixed(i))},dt=function(r){return Fi(r,"Number")},Q3=function(r){return dt(r)&&r%1!==0},J3=function(r){return dt(r)&&r%2===0},e5=Number.isInteger?Number.isInteger:function(r){return dt(r)&&r%1===0},t5=function(r){return dt(r)&&r<0},r5=1e-5;function EA(r,e,t){return t===void 0&&(t=r5),Math.abs(r-e)<t}var n5=function(r){return dt(r)&&r%2!==0},i5=function(r){return dt(r)&&r>0};const a5=function(r,e){if(mt(r)){for(var t,n=-1/0,i=0;i<r.length;i++){var a=r[i],o=Pr(e)?e(a):a[e];o>n&&(t=a,n=o)}return t}},o5=function(r,e){if(mt(r)){for(var t,n=1/0,i=0;i<r.length;i++){var a=r[i],o=Pr(e)?e(a):a[e];o<n&&(t=a,n=o)}return t}};var yv=function(r,e){return(r%e+e)%e},s5=180/Math.PI,u5=function(r){return s5*r};const f5=parseInt;var l5=Math.PI/180,mv=function(r){return l5*r};const Px=function(r,e){return r.hasOwnProperty(e)};var lm=Object.values?function(r){return Object.values(r)}:function(r){var e=[];return _e(r,function(t,n){Pr(r)&&n==="prototype"||e.push(t)}),e};const c5=function(r,e){return Md(lm(r),e)},ef=function(r){return ht(r)?"":r.toString()};var h5=function(r){return ef(r).toLowerCase()},d5=function(r){var e=ef(r);return e.charAt(0).toLowerCase()+e.substring(1)};function v5(r,e){return!r||!e?r:r.replace(/\\?\{([^{}]+)\}/g,function(t,n){return t.charAt(0)==="\\"?t.slice(1):e[n]===void 0?"":e[n]})}var p5=function(r){return ef(r).toUpperCase()},zu=function(r){var e=ef(r);return e.charAt(0).toUpperCase()+e.substring(1)},g5={}.toString,_A=function(r){return g5.call(r).replace(/^\[object /,"").replace(/]$/,"")},y5=function(r){return Fi(r,"Arguments")},Zl=function(r){return Fi(r,"Boolean")},cm=function(r){return Fi(r,"Date")},m5=function(r){return Fi(r,"Error")};function b5(r){return dt(r)&&isFinite(r)}var x5=function(r){return r===null},w5=Object.prototype,SA=function(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||w5;return r===t},E5=function(r){return Fi(r,"RegExp")},_5=function(r){return r===void 0},S5=function(r){return r instanceof Element||r instanceof HTMLDocument};function MA(r){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)};return e(r)}function CA(r){var e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;e(r)}function Jp(r,e){for(var t in e)e.hasOwnProperty(t)&&t!=="constructor"&&e[t]!==void 0&&(r[t]=e[t])}function bt(r,e,t,n){return e&&Jp(r,e),t&&Jp(r,t),n&&Jp(r,n),r}var M5=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];for(var t=r[0],n=1;n<r.length;n++){var i=r[n];Pr(i)&&(i=i.prototype),bt(t.prototype,i)}},Jt=function(r){if(typeof r!="object"||r===null)return r;var e;if(mt(r)){e=[];for(var t=0,n=r.length;t<n;t++)typeof r[t]=="object"&&r[t]!=null?e[t]=Jt(r[t]):e[t]=r[t]}else{e={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?e[i]=Jt(r[i]):e[i]=r[i]}return e};function Kl(r,e,t){var n;return function(){var i=this,a=arguments,o=function(){n=null,t||r.apply(i,a)},s=t&&!n;clearTimeout(n),n=setTimeout(o,e),s&&r.apply(i,a)}}const AA=function(r,e){if(!Pr(r))throw new TypeError("Expected a function");var t=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=e?e.apply(this,n):n[0],o=t.cache;if(o.has(a))return o.get(a);var s=r.apply(this,n);return o.set(a,s),s};return t.cache=new Map,t};var C5=5;function TA(r,e,t,n){t=t||0,n=n||C5;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];a!==null&&bn(a)?(bn(r[i])||(r[i]={}),t<n?TA(r[i],a,t+1,n):r[i]=e[i]):mt(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var Tr=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=0;n<e.length;n+=1)TA(r,e[n]);return r},A5=function(r,e,t,n){Pr(e)||(t=e,e=r,r=function(){});var i=Object.create?function(o,s){return Object.create(o,{constructor:{value:s}})}:function(o,s){function u(){}u.prototype=o;var f=new u;return f.constructor=s,f},a=i(e.prototype,r);return r.prototype=bt(a,r.prototype),r.superclass=i(e.prototype,e),bt(a,t),bt(r,n),r},hm=function(r,e){if(!zn(r))return-1;var t=Array.prototype.indexOf;if(t)return t.call(r,e);for(var n=-1,i=0;i<r.length;i++)if(r[i]===e){n=i;break}return n},T5=Object.prototype.hasOwnProperty;function IA(r){if(ht(r))return!0;if(zn(r))return!r.length;var e=_A(r);if(e==="Map"||e==="Set")return!r.size;if(SA(r))return!Object.keys(r).length;for(var t in r)if(T5.call(r,t))return!1;return!0}var So=function(r,e){if(r===e)return!0;if(!r||!e||Fe(r)||Fe(e))return!1;if(zn(r)||zn(e)){if(r.length!==e.length)return!1;for(var t=!0,n=0;n<r.length&&(t=So(r[n],e[n]),!!t);n++);return t}if(Cd(r)||Cd(e)){var i=Object.keys(r),a=Object.keys(e);if(i.length!==a.length)return!1;for(var t=!0,n=0;n<i.length&&(t=So(r[i[n]],e[i[n]]),!!t);n++);return t}return!1};const I5=function(r,e,t){return Pr(t)?!!t(r,e):So(r,e)};var As=function(r,e){if(!zn(r))return r;for(var t=[],n=0;n<r.length;n++){var i=r[n];t.push(e(i,n))}return t},k5=function(r){return r};const L5=function(r,e){e===void 0&&(e=k5);var t={};return wn(r)&&!ht(r)&&Object.keys(r).forEach(function(n){t[n]=e(r[n],n)}),t},Pa=function(r,e,t){for(var n=0,i=Fe(e)?e.split("."):e;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?t:r},N5=function(r,e,t){var n=r,i=Fe(e)?e.split("."):e;return i.forEach(function(a,o){o<i.length-1?(wn(n[a])||(n[a]=dt(i[o+1])?[]:{}),n=n[a]):n[a]=t}),r};var O5=Object.prototype.hasOwnProperty;const D5=function(r,e){if(r===null||!bn(r))return{};var t={};return _e(e,function(n){O5.call(r,n)&&(t[n]=r[n])}),t},P5=function(r,e){return xA(r,function(t,n,i){return e.includes(i)||(t[i]=n),t},{})},Tl=function(r,e,t){var n,i,a,o,s=0;t||(t={});var u=function(){s=t.leading===!1?0:Date.now(),n=null,o=r.apply(i,a),n||(i=a=null)},f=function(){var l=Date.now();!s&&t.leading===!1&&(s=l);var c=e-(l-s);return i=this,a=arguments,c<=0||c>e?(n&&(clearTimeout(n),n=null),s=l,o=r.apply(i,a),n||(i=a=null)):!n&&t.trailing!==!1&&(n=setTimeout(u,c)),o};return f.cancel=function(){clearTimeout(n),s=0,n=i=a=null},f},kA=function(r){return zn(r)?Array.prototype.slice.call(r):[]};var Xc={};const ha=function(r){return r=r||"g",Xc[r]?Xc[r]+=1:Xc[r]=1,r+Xc[r]},nl=function(){},R5=function(r){return r};function bv(r){return ht(r)?0:zn(r)?r.length:Object.keys(r).length}var Yc;const il=AA(function(r,e){e===void 0&&(e={});var t=e.fontSize,n=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return Yc||(Yc=document.createElement("canvas").getContext("2d")),Yc.font=[a,o,i,t+"px",n].join(" "),Yc.measureText(Fe(r)?r:"").width},function(r,e){return e===void 0&&(e={}),pv([r],lm(e)).join("")}),B5=function(r,e,t,n){n===void 0&&(n="...");var i=16,a=il(n,t),o=Fe(r)?r:ef(r),s=e,u=[],f,l;if(il(r,t)<=e)return r;for(;f=o.substr(0,i),l=il(f,t),!(l+a>s&&l>s);)if(u.push(f),s-=l,o=o.substr(i),!o)return u.join("");for(;f=o.substr(0,1),l=il(f,t),!(l+a>s);)if(u.push(f),s-=l,o=o.substr(1),!o)return u.join("");return""+u.join("")+n};var F5=function(){function r(){this.map={}}return r.prototype.has=function(e){return this.map[e]!==void 0},r.prototype.get=function(e,t){var n=this.map[e];return n===void 0?t:n},r.prototype.set=function(e,t){this.map[e]=t},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(e){delete this.map[e]},r.prototype.size=function(){return Object.keys(this.map).length},r}();const G5=Object.freeze(Object.defineProperty({__proto__:null,Cache:F5,assign:bt,augment:M5,clamp:K3,clearAnimationFrame:CA,clone:Jt,contains:Md,debounce:Kl,deepMix:Tr,difference:T3,each:_e,endsWith:$3,every:X3,extend:A5,filter:gv,find:k3,findIndex:L3,firstValue:N3,fixedBase:rd,flatten:O3,flattenDeep:gA,forIn:_e,get:Pa,getEllipsisText:B5,getRange:yA,getType:_A,getWrapBehavior:V3,group:q3,groupBy:Ad,groupToMap:wA,has:Px,hasKey:Px,hasValue:c5,head:ua,identity:R5,includes:Md,indexOf:hm,isArguments:y5,isArray:mt,isArrayLike:zn,isBoolean:Zl,isDate:cm,isDecimal:Q3,isElement:S5,isEmpty:IA,isEqual:So,isEqualWith:I5,isError:m5,isEven:J3,isFinite:b5,isFunction:Pr,isInteger:e5,isMatch:pA,isNegative:t5,isNil:ht,isNull:x5,isNumber:dt,isNumberEqual:EA,isObject:wn,isObjectLike:Cd,isOdd:n5,isPlainObject:bn,isPositive:i5,isPrototype:SA,isRegExp:E5,isString:Fe,isType:Fi,isUndefined:_5,keys:vA,last:ci,lowerCase:h5,lowerFirst:d5,map:As,mapValues:L5,max:la,maxBy:a5,measureTextWidth:il,memoize:AA,min:ca,minBy:o5,mix:bt,mod:yv,noop:nl,number2color:H3,omit:P5,parseRadius:Z3,pick:D5,pull:R3,pullAt:bA,reduce:xA,remove:F3,requestAnimationFrame:MA,set:N5,size:bv,some:Y3,sortBy:G3,startsWith:U3,substitute:v5,throttle:Tl,toArray:kA,toDegree:u5,toInteger:f5,toRadian:mv,toString:ef,union:z3,uniq:Al,uniqueId:ha,upperCase:p5,upperFirst:zu,values:lm,valuesOfKey:j3,wrapBehavior:gs},Symbol.toStringTag,{value:"Module"})),z5={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(e){return Object.assign(this,e),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(e){var t=this,n=this.events;this.graph=e,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!0),_e(n,function(i,a){e.on(a,i)}),document.addEventListener("visibilitychange",function(){t.keydown=!1})},unbind:function(e){var t=this.events,n=e.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!1),_e(t,function(i,a){e.off(a,i)}),e.get("canvas").set("draggable",n)},get:function(e){return this[e]},set:function(e,t){return this[e]=t,this}};var dm=function(){function r(){}return r.registerBehavior=function(e,t){if(!t)throw new Error("please specify handler for this behavior: ".concat(e));var n=Jt(z5);Object.assign(n,t);var i=function(o){var s=this;Object.assign(this,this.getDefaultCfg(),o);var u=this.getEvents();this.events=null;var f={};u&&(_e(u,function(l,c){f[c]=gs(s,l)}),this.events=f)};i.prototype=n,r.types[e]=i},r.hasBehavior=function(e){return!!r.types[e]},r.getBehavior=function(e){return r.types[e]},r.types={},r}(),j5="*",LA=function(){function r(){this._events={}}return r.prototype.on=function(e,t,n){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!n}),this},r.prototype.once=function(e,t){return this.on(e,t,!0)},r.prototype.emit=function(e){for(var t=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this._events[e]||[],o=this._events[j5]||[],s=function(u){for(var f=u.length,l=0;l<f;l++)if(u[l]){var c=u[l],h=c.callback,d=c.once;d&&(u.splice(l,1),u.length===0&&delete t._events[e],f--,l--),h.apply(t,n)}};s(a),s(o)},r.prototype.off=function(e,t){if(!e)this._events={};else if(!t)delete this._events[e];else{for(var n=this._events[e]||[],i=n.length,a=0;a<i;a++)n[a].callback===t&&(n.splice(a,1),i--,a--);n.length===0&&delete this._events[e]}return this},r.prototype.getEvents=function(){return this._events},r}(),Mt=1e-6,or=typeof Float32Array<"u"?Float32Array:Array,Pi=Math.random;function U5(r){or=r}var $5=Math.PI/180;function X5(r){return r*$5}function Y5(r,e){return Math.abs(r-e)<=Mt*Math.max(1,Math.abs(r),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});const W5=Object.freeze(Object.defineProperty({__proto__:null,get ARRAY_TYPE(){return or},EPSILON:Mt,RANDOM:Pi,equals:Y5,setMatrixArrayType:U5,toRadian:X5},Symbol.toStringTag,{value:"Module"}));function q5(){var r=new or(4);return or!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r}function V5(r){var e=new or(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function H5(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function Z5(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r}function K5(r,e,t,n){var i=new or(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}function Q5(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function J5(r,e){if(r===e){var t=e[1];r[1]=e[2],r[2]=t}else r[0]=e[0],r[1]=e[2],r[2]=e[1],r[3]=e[3];return r}function eB(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t*a-i*n;return o?(o=1/o,r[0]=a*o,r[1]=-n*o,r[2]=-i*o,r[3]=t*o,r):null}function tB(r,e){var t=e[0];return r[0]=e[3],r[1]=-e[1],r[2]=-e[2],r[3]=t,r}function rB(r){return r[0]*r[3]-r[2]*r[1]}function NA(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],f=t[2],l=t[3];return r[0]=n*s+a*u,r[1]=i*s+o*u,r[2]=n*f+a*l,r[3]=i*f+o*l,r}function nB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),u=Math.cos(t);return r[0]=n*u+a*s,r[1]=i*u+o*s,r[2]=n*-s+a*u,r[3]=i*-s+o*u,r}function iB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1];return r[0]=n*s,r[1]=i*s,r[2]=a*u,r[3]=o*u,r}function aB(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=-t,r[3]=n,r}function oB(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=e[1],r}function sB(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function uB(r){return Math.hypot(r[0],r[1],r[2],r[3])}function fB(r,e,t,n){return r[2]=n[2]/n[0],t[0]=n[0],t[1]=n[1],t[3]=n[3]-r[2]*t[1],[r,e,t]}function lB(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r}function OA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r}function cB(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}function hB(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=e[0],s=e[1],u=e[2],f=e[3];return Math.abs(t-o)<=Mt*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(n-s)<=Mt*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=Mt*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=Mt*Math.max(1,Math.abs(a),Math.abs(f))}function dB(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r}function vB(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r}var pB=NA,gB=OA;const yB=Object.freeze(Object.defineProperty({__proto__:null,LDU:fB,add:lB,adjoint:tB,clone:V5,copy:H5,create:q5,determinant:rB,equals:hB,exactEquals:cB,frob:uB,fromRotation:aB,fromScaling:oB,fromValues:K5,identity:Z5,invert:eB,mul:pB,multiply:NA,multiplyScalar:dB,multiplyScalarAndAdd:vB,rotate:nB,scale:iB,set:Q5,str:sB,sub:gB,subtract:OA,transpose:J5},Symbol.toStringTag,{value:"Module"}));function mB(){var r=new or(6);return or!=Float32Array&&(r[1]=0,r[2]=0,r[4]=0,r[5]=0),r[0]=1,r[3]=1,r}function bB(r){var e=new or(6);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e}function xB(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r}function wB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function EB(r,e,t,n,i,a){var o=new or(6);return o[0]=r,o[1]=e,o[2]=t,o[3]=n,o[4]=i,o[5]=a,o}function _B(r,e,t,n,i,a,o){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r}function SB(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=t*a-n*i;return u?(u=1/u,r[0]=a*u,r[1]=-n*u,r[2]=-i*u,r[3]=t*u,r[4]=(i*s-a*o)*u,r[5]=(n*o-t*s)*u,r):null}function MB(r){return r[0]*r[3]-r[1]*r[2]}function DA(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=t[0],l=t[1],c=t[2],h=t[3],d=t[4],v=t[5];return r[0]=n*f+a*l,r[1]=i*f+o*l,r[2]=n*c+a*h,r[3]=i*c+o*h,r[4]=n*d+a*v+s,r[5]=i*d+o*v+u,r}function CB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=Math.sin(t),l=Math.cos(t);return r[0]=n*l+a*f,r[1]=i*l+o*f,r[2]=n*-f+a*l,r[3]=i*-f+o*l,r[4]=s,r[5]=u,r}function AB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=t[0],l=t[1];return r[0]=n*f,r[1]=i*f,r[2]=a*l,r[3]=o*l,r[4]=s,r[5]=u,r}function TB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=t[0],l=t[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=n*f+a*l+s,r[5]=i*f+o*l+u,r}function IB(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=-t,r[3]=n,r[4]=0,r[5]=0,r}function kB(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=e[1],r[4]=0,r[5]=0,r}function LB(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=e[0],r[5]=e[1],r}function NB(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")"}function OB(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],1)}function DB(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r}function PA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r}function PB(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r}function RB(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r[4]=e[4]+t[4]*n,r[5]=e[5]+t[5]*n,r}function BB(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]}function FB(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=e[0],f=e[1],l=e[2],c=e[3],h=e[4],d=e[5];return Math.abs(t-u)<=Mt*Math.max(1,Math.abs(t),Math.abs(u))&&Math.abs(n-f)<=Mt*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-l)<=Mt*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-c)<=Mt*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-h)<=Mt*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-d)<=Mt*Math.max(1,Math.abs(s),Math.abs(d))}var GB=DA,zB=PA;const jB=Object.freeze(Object.defineProperty({__proto__:null,add:DB,clone:bB,copy:xB,create:mB,determinant:MB,equals:FB,exactEquals:BB,frob:OB,fromRotation:IB,fromScaling:kB,fromTranslation:LB,fromValues:EB,identity:wB,invert:SB,mul:GB,multiply:DA,multiplyScalar:PB,multiplyScalarAndAdd:RB,rotate:CB,scale:AB,set:_B,str:NB,sub:zB,subtract:PA,translate:TB},Symbol.toStringTag,{value:"Module"}));function RA(){var r=new or(9);return or!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function UB(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[4],r[4]=e[5],r[5]=e[6],r[6]=e[8],r[7]=e[9],r[8]=e[10],r}function $B(r){var e=new or(9);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function XB(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function YB(r,e,t,n,i,a,o,s,u){var f=new or(9);return f[0]=r,f[1]=e,f[2]=t,f[3]=n,f[4]=i,f[5]=a,f[6]=o,f[7]=s,f[8]=u,f}function WB(r,e,t,n,i,a,o,s,u,f){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=f,r}function qB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function VB(r,e){if(r===e){var t=e[1],n=e[2],i=e[5];r[1]=e[3],r[2]=e[6],r[3]=t,r[5]=e[7],r[6]=n,r[7]=i}else r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8];return r}function vm(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8],c=l*o-s*f,h=-l*a+s*u,d=f*a-o*u,v=t*c+n*h+i*d;return v?(v=1/v,r[0]=c*v,r[1]=(-l*n+i*f)*v,r[2]=(s*n-i*o)*v,r[3]=h*v,r[4]=(l*t-i*u)*v,r[5]=(-s*t+i*a)*v,r[6]=d*v,r[7]=(-f*t+n*u)*v,r[8]=(o*t-n*a)*v,r):null}function HB(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8];return r[0]=o*l-s*f,r[1]=i*f-n*l,r[2]=n*s-i*o,r[3]=s*u-a*l,r[4]=t*l-i*u,r[5]=i*a-t*s,r[6]=a*f-o*u,r[7]=n*u-t*f,r[8]=t*o-n*a,r}function ZB(r){var e=r[0],t=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],f=r[8];return e*(f*a-o*u)+t*(-f*i+o*s)+n*(u*i-a*s)}function pa(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=e[8],h=t[0],d=t[1],v=t[2],p=t[3],g=t[4],y=t[5],m=t[6],x=t[7],b=t[8];return r[0]=h*n+d*o+v*f,r[1]=h*i+d*s+v*l,r[2]=h*a+d*u+v*c,r[3]=p*n+g*o+y*f,r[4]=p*i+g*s+y*l,r[5]=p*a+g*u+y*c,r[6]=m*n+x*o+b*f,r[7]=m*i+x*s+b*l,r[8]=m*a+x*u+b*c,r}function KB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=e[8],h=t[0],d=t[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=u,r[6]=h*n+d*o+f,r[7]=h*i+d*s+l,r[8]=h*a+d*u+c,r}function QB(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=e[8],h=Math.sin(t),d=Math.cos(t);return r[0]=d*n+h*o,r[1]=d*i+h*s,r[2]=d*a+h*u,r[3]=d*o-h*n,r[4]=d*s-h*i,r[5]=d*u-h*a,r[6]=f,r[7]=l,r[8]=c,r}function JB(r,e,t){var n=t[0],i=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=i*e[3],r[4]=i*e[4],r[5]=i*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function pm(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=e[0],r[7]=e[1],r[8]=1,r}function gm(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=0,r[3]=-t,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function ym(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=e[1],r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function eF(r,e){return r[0]=e[0],r[1]=e[1],r[2]=0,r[3]=e[2],r[4]=e[3],r[5]=0,r[6]=e[4],r[7]=e[5],r[8]=1,r}function tF(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t+t,s=n+n,u=i+i,f=t*o,l=n*o,c=n*s,h=i*o,d=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[3]=l-y,r[6]=h+g,r[1]=l+y,r[4]=1-f-v,r[7]=d-p,r[2]=h-g,r[5]=d+p,r[8]=1-f-c,r}function rF(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8],c=e[9],h=e[10],d=e[11],v=e[12],p=e[13],g=e[14],y=e[15],m=t*s-n*o,x=t*u-i*o,b=t*f-a*o,w=n*u-i*s,E=n*f-a*s,S=i*f-a*u,_=l*p-c*v,C=l*g-h*v,M=l*y-d*v,A=c*g-h*p,T=c*y-d*p,I=h*y-d*g,L=m*I-x*T+b*A+w*M-E*C+S*_;return L?(L=1/L,r[0]=(s*I-u*T+f*A)*L,r[1]=(u*M-o*I-f*C)*L,r[2]=(o*T-s*M+f*_)*L,r[3]=(i*T-n*I-a*A)*L,r[4]=(t*I-i*M+a*C)*L,r[5]=(n*M-t*T-a*_)*L,r[6]=(p*S-g*E+y*w)*L,r[7]=(g*b-v*S-y*x)*L,r[8]=(v*E-p*b+y*m)*L,r):null}function nF(r,e,t){return r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}function iF(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function aF(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function oF(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r}function BA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r}function sF(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r}function uF(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r[4]=e[4]+t[4]*n,r[5]=e[5]+t[5]*n,r[6]=e[6]+t[6]*n,r[7]=e[7]+t[7]*n,r[8]=e[8]+t[8]*n,r}function fF(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]}function lF(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],c=e[0],h=e[1],d=e[2],v=e[3],p=e[4],g=e[5],y=e[6],m=e[7],x=e[8];return Math.abs(t-c)<=Mt*Math.max(1,Math.abs(t),Math.abs(c))&&Math.abs(n-h)<=Mt*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=Mt*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-v)<=Mt*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-p)<=Mt*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=Mt*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=Mt*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(f-m)<=Mt*Math.max(1,Math.abs(f),Math.abs(m))&&Math.abs(l-x)<=Mt*Math.max(1,Math.abs(l),Math.abs(x))}var cF=pa,hF=BA;const FA=Object.freeze(Object.defineProperty({__proto__:null,add:oF,adjoint:HB,clone:$B,copy:XB,create:RA,determinant:ZB,equals:lF,exactEquals:fF,frob:aF,fromMat2d:eF,fromMat4:UB,fromQuat:tF,fromRotation:gm,fromScaling:ym,fromTranslation:pm,fromValues:YB,identity:qB,invert:vm,mul:cF,multiply:pa,multiplyScalar:sF,multiplyScalarAndAdd:uF,normalFromMat4:rF,projection:nF,rotate:QB,scale:JB,set:WB,str:iF,sub:hF,subtract:BA,translate:KB,transpose:VB},Symbol.toStringTag,{value:"Module"}));function dF(){var r=new or(16);return or!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}function vF(r){var e=new or(16);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function pF(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function gF(r,e,t,n,i,a,o,s,u,f,l,c,h,d,v,p){var g=new or(16);return g[0]=r,g[1]=e,g[2]=t,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=f,g[10]=l,g[11]=c,g[12]=h,g[13]=d,g[14]=v,g[15]=p,g}function yF(r,e,t,n,i,a,o,s,u,f,l,c,h,d,v,p,g){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=f,r[9]=l,r[10]=c,r[11]=h,r[12]=d,r[13]=v,r[14]=p,r[15]=g,r}function GA(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function mF(r,e){if(r===e){var t=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=t,r[6]=e[9],r[7]=e[13],r[8]=n,r[9]=a,r[11]=e[14],r[12]=i,r[13]=o,r[14]=s}else r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15];return r}function bF(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8],c=e[9],h=e[10],d=e[11],v=e[12],p=e[13],g=e[14],y=e[15],m=t*s-n*o,x=t*u-i*o,b=t*f-a*o,w=n*u-i*s,E=n*f-a*s,S=i*f-a*u,_=l*p-c*v,C=l*g-h*v,M=l*y-d*v,A=c*g-h*p,T=c*y-d*p,I=h*y-d*g,L=m*I-x*T+b*A+w*M-E*C+S*_;return L?(L=1/L,r[0]=(s*I-u*T+f*A)*L,r[1]=(i*T-n*I-a*A)*L,r[2]=(p*S-g*E+y*w)*L,r[3]=(h*E-c*S-d*w)*L,r[4]=(u*M-o*I-f*C)*L,r[5]=(t*I-i*M+a*C)*L,r[6]=(g*b-v*S-y*x)*L,r[7]=(l*S-h*b+d*x)*L,r[8]=(o*T-s*M+f*_)*L,r[9]=(n*M-t*T-a*_)*L,r[10]=(v*E-p*b+y*m)*L,r[11]=(c*b-l*E-d*m)*L,r[12]=(s*C-o*A-u*_)*L,r[13]=(t*A-n*C+i*_)*L,r[14]=(p*x-v*w-g*m)*L,r[15]=(l*w-c*x+h*m)*L,r):null}function xF(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8],c=e[9],h=e[10],d=e[11],v=e[12],p=e[13],g=e[14],y=e[15];return r[0]=s*(h*y-d*g)-c*(u*y-f*g)+p*(u*d-f*h),r[1]=-(n*(h*y-d*g)-c*(i*y-a*g)+p*(i*d-a*h)),r[2]=n*(u*y-f*g)-s*(i*y-a*g)+p*(i*f-a*u),r[3]=-(n*(u*d-f*h)-s*(i*d-a*h)+c*(i*f-a*u)),r[4]=-(o*(h*y-d*g)-l*(u*y-f*g)+v*(u*d-f*h)),r[5]=t*(h*y-d*g)-l*(i*y-a*g)+v*(i*d-a*h),r[6]=-(t*(u*y-f*g)-o*(i*y-a*g)+v*(i*f-a*u)),r[7]=t*(u*d-f*h)-o*(i*d-a*h)+l*(i*f-a*u),r[8]=o*(c*y-d*p)-l*(s*y-f*p)+v*(s*d-f*c),r[9]=-(t*(c*y-d*p)-l*(n*y-a*p)+v*(n*d-a*c)),r[10]=t*(s*y-f*p)-o*(n*y-a*p)+v*(n*f-a*s),r[11]=-(t*(s*d-f*c)-o*(n*d-a*c)+l*(n*f-a*s)),r[12]=-(o*(c*g-h*p)-l*(s*g-u*p)+v*(s*h-u*c)),r[13]=t*(c*g-h*p)-l*(n*g-i*p)+v*(n*h-i*c),r[14]=-(t*(s*g-u*p)-o*(n*g-i*p)+v*(n*u-i*s)),r[15]=t*(s*h-u*c)-o*(n*h-i*c)+l*(n*u-i*s),r}function wF(r){var e=r[0],t=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],f=r[8],l=r[9],c=r[10],h=r[11],d=r[12],v=r[13],p=r[14],g=r[15],y=e*o-t*a,m=e*s-n*a,x=e*u-i*a,b=t*s-n*o,w=t*u-i*o,E=n*u-i*s,S=f*v-l*d,_=f*p-c*d,C=f*g-h*d,M=l*p-c*v,A=l*g-h*v,T=c*g-h*p;return y*T-m*A+x*M+b*C-w*_+E*S}function zA(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=e[8],h=e[9],d=e[10],v=e[11],p=e[12],g=e[13],y=e[14],m=e[15],x=t[0],b=t[1],w=t[2],E=t[3];return r[0]=x*n+b*s+w*c+E*p,r[1]=x*i+b*u+w*h+E*g,r[2]=x*a+b*f+w*d+E*y,r[3]=x*o+b*l+w*v+E*m,x=t[4],b=t[5],w=t[6],E=t[7],r[4]=x*n+b*s+w*c+E*p,r[5]=x*i+b*u+w*h+E*g,r[6]=x*a+b*f+w*d+E*y,r[7]=x*o+b*l+w*v+E*m,x=t[8],b=t[9],w=t[10],E=t[11],r[8]=x*n+b*s+w*c+E*p,r[9]=x*i+b*u+w*h+E*g,r[10]=x*a+b*f+w*d+E*y,r[11]=x*o+b*l+w*v+E*m,x=t[12],b=t[13],w=t[14],E=t[15],r[12]=x*n+b*s+w*c+E*p,r[13]=x*i+b*u+w*h+E*g,r[14]=x*a+b*f+w*d+E*y,r[15]=x*o+b*l+w*v+E*m,r}function EF(r,e,t){var n=t[0],i=t[1],a=t[2],o,s,u,f,l,c,h,d,v,p,g,y;return e===r?(r[12]=e[0]*n+e[4]*i+e[8]*a+e[12],r[13]=e[1]*n+e[5]*i+e[9]*a+e[13],r[14]=e[2]*n+e[6]*i+e[10]*a+e[14],r[15]=e[3]*n+e[7]*i+e[11]*a+e[15]):(o=e[0],s=e[1],u=e[2],f=e[3],l=e[4],c=e[5],h=e[6],d=e[7],v=e[8],p=e[9],g=e[10],y=e[11],r[0]=o,r[1]=s,r[2]=u,r[3]=f,r[4]=l,r[5]=c,r[6]=h,r[7]=d,r[8]=v,r[9]=p,r[10]=g,r[11]=y,r[12]=o*n+l*i+v*a+e[12],r[13]=s*n+c*i+p*a+e[13],r[14]=u*n+h*i+g*a+e[14],r[15]=f*n+d*i+y*a+e[15]),r}function _F(r,e,t){var n=t[0],i=t[1],a=t[2];return r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*i,r[5]=e[5]*i,r[6]=e[6]*i,r[7]=e[7]*i,r[8]=e[8]*a,r[9]=e[9]*a,r[10]=e[10]*a,r[11]=e[11]*a,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function SF(r,e,t,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),u,f,l,c,h,d,v,p,g,y,m,x,b,w,E,S,_,C,M,A,T,I,L,N;return s<Mt?null:(s=1/s,i*=s,a*=s,o*=s,u=Math.sin(t),f=Math.cos(t),l=1-f,c=e[0],h=e[1],d=e[2],v=e[3],p=e[4],g=e[5],y=e[6],m=e[7],x=e[8],b=e[9],w=e[10],E=e[11],S=i*i*l+f,_=a*i*l+o*u,C=o*i*l-a*u,M=i*a*l-o*u,A=a*a*l+f,T=o*a*l+i*u,I=i*o*l+a*u,L=a*o*l-i*u,N=o*o*l+f,r[0]=c*S+p*_+x*C,r[1]=h*S+g*_+b*C,r[2]=d*S+y*_+w*C,r[3]=v*S+m*_+E*C,r[4]=c*M+p*A+x*T,r[5]=h*M+g*A+b*T,r[6]=d*M+y*A+w*T,r[7]=v*M+m*A+E*T,r[8]=c*I+p*L+x*N,r[9]=h*I+g*L+b*N,r[10]=d*I+y*L+w*N,r[11]=v*I+m*L+E*N,e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r)}function MF(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[4],o=e[5],s=e[6],u=e[7],f=e[8],l=e[9],c=e[10],h=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=a*i+f*n,r[5]=o*i+l*n,r[6]=s*i+c*n,r[7]=u*i+h*n,r[8]=f*i-a*n,r[9]=l*i-o*n,r[10]=c*i-s*n,r[11]=h*i-u*n,r}function CF(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[0],o=e[1],s=e[2],u=e[3],f=e[8],l=e[9],c=e[10],h=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*i-f*n,r[1]=o*i-l*n,r[2]=s*i-c*n,r[3]=u*i-h*n,r[8]=a*n+f*i,r[9]=o*n+l*i,r[10]=s*n+c*i,r[11]=u*n+h*i,r}function AF(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[0],o=e[1],s=e[2],u=e[3],f=e[4],l=e[5],c=e[6],h=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*i+f*n,r[1]=o*i+l*n,r[2]=s*i+c*n,r[3]=u*i+h*n,r[4]=f*i-a*n,r[5]=l*i-o*n,r[6]=c*i-s*n,r[7]=h*i-u*n,r}function TF(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function IF(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function kF(r,e,t){var n=t[0],i=t[1],a=t[2],o=Math.hypot(n,i,a),s,u,f;return o<Mt?null:(o=1/o,n*=o,i*=o,a*=o,s=Math.sin(e),u=Math.cos(e),f=1-u,r[0]=n*n*f+u,r[1]=i*n*f+a*s,r[2]=a*n*f-i*s,r[3]=0,r[4]=n*i*f-a*s,r[5]=i*i*f+u,r[6]=a*i*f+n*s,r[7]=0,r[8]=n*a*f+i*s,r[9]=i*a*f-n*s,r[10]=a*a*f+u,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r)}function LF(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=n,r[6]=t,r[7]=0,r[8]=0,r[9]=-t,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function NF(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=0,r[2]=-t,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=t,r[9]=0,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function OF(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=0,r[3]=0,r[4]=-t,r[5]=n,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function jA(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,u=i+i,f=a+a,l=n*s,c=n*u,h=n*f,d=i*u,v=i*f,p=a*f,g=o*s,y=o*u,m=o*f;return r[0]=1-(d+p),r[1]=c+m,r[2]=h-y,r[3]=0,r[4]=c-m,r[5]=1-(l+p),r[6]=v+g,r[7]=0,r[8]=h+y,r[9]=v-g,r[10]=1-(l+d),r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function DF(r,e){var t=new or(3),n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=n*n+i*i+a*a+o*o;return c>0?(t[0]=(s*o+l*n+u*a-f*i)*2/c,t[1]=(u*o+l*i+f*n-s*a)*2/c,t[2]=(f*o+l*a+s*i-u*n)*2/c):(t[0]=(s*o+l*n+u*a-f*i)*2,t[1]=(u*o+l*i+f*n-s*a)*2,t[2]=(f*o+l*a+s*i-u*n)*2),jA(r,e,t),r}function UA(r,e){return r[0]=e[12],r[1]=e[13],r[2]=e[14],r}function $A(r,e){var t=e[0],n=e[1],i=e[2],a=e[4],o=e[5],s=e[6],u=e[8],f=e[9],l=e[10];return r[0]=Math.hypot(t,n,i),r[1]=Math.hypot(a,o,s),r[2]=Math.hypot(u,f,l),r}function XA(r,e){var t=new or(3);$A(t,e);var n=1/t[0],i=1/t[1],a=1/t[2],o=e[0]*n,s=e[1]*i,u=e[2]*a,f=e[4]*n,l=e[5]*i,c=e[6]*a,h=e[8]*n,d=e[9]*i,v=e[10]*a,p=o+l+v,g=0;return p>0?(g=Math.sqrt(p+1)*2,r[3]=.25*g,r[0]=(c-d)/g,r[1]=(h-u)/g,r[2]=(s-f)/g):o>l&&o>v?(g=Math.sqrt(1+o-l-v)*2,r[3]=(c-d)/g,r[0]=.25*g,r[1]=(s+f)/g,r[2]=(h+u)/g):l>v?(g=Math.sqrt(1+l-o-v)*2,r[3]=(h-u)/g,r[0]=(s+f)/g,r[1]=.25*g,r[2]=(c+d)/g):(g=Math.sqrt(1+v-o-l)*2,r[3]=(s-f)/g,r[0]=(h+u)/g,r[1]=(c+d)/g,r[2]=.25*g),r}function PF(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3],u=i+i,f=a+a,l=o+o,c=i*u,h=i*f,d=i*l,v=a*f,p=a*l,g=o*l,y=s*u,m=s*f,x=s*l,b=n[0],w=n[1],E=n[2];return r[0]=(1-(v+g))*b,r[1]=(h+x)*b,r[2]=(d-m)*b,r[3]=0,r[4]=(h-x)*w,r[5]=(1-(c+g))*w,r[6]=(p+y)*w,r[7]=0,r[8]=(d+m)*E,r[9]=(p-y)*E,r[10]=(1-(c+v))*E,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function RF(r,e,t,n,i){var a=e[0],o=e[1],s=e[2],u=e[3],f=a+a,l=o+o,c=s+s,h=a*f,d=a*l,v=a*c,p=o*l,g=o*c,y=s*c,m=u*f,x=u*l,b=u*c,w=n[0],E=n[1],S=n[2],_=i[0],C=i[1],M=i[2],A=(1-(p+y))*w,T=(d+b)*w,I=(v-x)*w,L=(d-b)*E,N=(1-(h+y))*E,O=(g+m)*E,B=(v+x)*S,W=(g-m)*S,D=(1-(h+p))*S;return r[0]=A,r[1]=T,r[2]=I,r[3]=0,r[4]=L,r[5]=N,r[6]=O,r[7]=0,r[8]=B,r[9]=W,r[10]=D,r[11]=0,r[12]=t[0]+_-(A*_+L*C+B*M),r[13]=t[1]+C-(T*_+N*C+W*M),r[14]=t[2]+M-(I*_+O*C+D*M),r[15]=1,r}function BF(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t+t,s=n+n,u=i+i,f=t*o,l=n*o,c=n*s,h=i*o,d=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[1]=l+y,r[2]=h-g,r[3]=0,r[4]=l-y,r[5]=1-f-v,r[6]=d+p,r[7]=0,r[8]=h+g,r[9]=d-p,r[10]=1-f-c,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function FF(r,e,t,n,i,a,o){var s=1/(t-e),u=1/(i-n),f=1/(a-o);return r[0]=a*2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*u,r[6]=0,r[7]=0,r[8]=(t+e)*s,r[9]=(i+n)*u,r[10]=(o+a)*f,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*a*2*f,r[15]=0,r}function YA(r,e,t,n,i){var a=1/Math.tan(e/2),o;return r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=(i+n)*o,r[14]=2*i*n*o):(r[10]=-1,r[14]=-2*n),r}var GF=YA;function zF(r,e,t,n,i){var a=1/Math.tan(e/2),o;return r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=i*o,r[14]=i*n*o):(r[10]=-1,r[14]=-n),r}function jF(r,e,t,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+s),f=2/(i+a);return r[0]=u,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=f,r[6]=0,r[7]=0,r[8]=-((o-s)*u*.5),r[9]=(i-a)*f*.5,r[10]=n/(t-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=n*t/(t-n),r[15]=0,r}function WA(r,e,t,n,i,a,o){var s=1/(e-t),u=1/(n-i),f=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*f,r[11]=0,r[12]=(e+t)*s,r[13]=(i+n)*u,r[14]=(o+a)*f,r[15]=1,r}var UF=WA;function $F(r,e,t,n,i,a,o){var s=1/(e-t),u=1/(n-i),f=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=f,r[11]=0,r[12]=(e+t)*s,r[13]=(i+n)*u,r[14]=a*f,r[15]=1,r}function XF(r,e,t,n){var i,a,o,s,u,f,l,c,h,d,v=e[0],p=e[1],g=e[2],y=n[0],m=n[1],x=n[2],b=t[0],w=t[1],E=t[2];return Math.abs(v-b)<Mt&&Math.abs(p-w)<Mt&&Math.abs(g-E)<Mt?GA(r):(l=v-b,c=p-w,h=g-E,d=1/Math.hypot(l,c,h),l*=d,c*=d,h*=d,i=m*h-x*c,a=x*l-y*h,o=y*c-m*l,d=Math.hypot(i,a,o),d?(d=1/d,i*=d,a*=d,o*=d):(i=0,a=0,o=0),s=c*o-h*a,u=h*i-l*o,f=l*a-c*i,d=Math.hypot(s,u,f),d?(d=1/d,s*=d,u*=d,f*=d):(s=0,u=0,f=0),r[0]=i,r[1]=s,r[2]=l,r[3]=0,r[4]=a,r[5]=u,r[6]=c,r[7]=0,r[8]=o,r[9]=f,r[10]=h,r[11]=0,r[12]=-(i*v+a*p+o*g),r[13]=-(s*v+u*p+f*g),r[14]=-(l*v+c*p+h*g),r[15]=1,r)}function YF(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=n[0],u=n[1],f=n[2],l=i-t[0],c=a-t[1],h=o-t[2],d=l*l+c*c+h*h;d>0&&(d=1/Math.sqrt(d),l*=d,c*=d,h*=d);var v=u*h-f*c,p=f*l-s*h,g=s*c-u*l;return d=v*v+p*p+g*g,d>0&&(d=1/Math.sqrt(d),v*=d,p*=d,g*=d),r[0]=v,r[1]=p,r[2]=g,r[3]=0,r[4]=c*g-h*p,r[5]=h*v-l*g,r[6]=l*p-c*v,r[7]=0,r[8]=l,r[9]=c,r[10]=h,r[11]=0,r[12]=i,r[13]=a,r[14]=o,r[15]=1,r}function WF(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}function qF(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}function VF(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r}function qA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r}function HF(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r}function ZF(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r[4]=e[4]+t[4]*n,r[5]=e[5]+t[5]*n,r[6]=e[6]+t[6]*n,r[7]=e[7]+t[7]*n,r[8]=e[8]+t[8]*n,r[9]=e[9]+t[9]*n,r[10]=e[10]+t[10]*n,r[11]=e[11]+t[11]*n,r[12]=e[12]+t[12]*n,r[13]=e[13]+t[13]*n,r[14]=e[14]+t[14]*n,r[15]=e[15]+t[15]*n,r}function KF(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]&&r[9]===e[9]&&r[10]===e[10]&&r[11]===e[11]&&r[12]===e[12]&&r[13]===e[13]&&r[14]===e[14]&&r[15]===e[15]}function QF(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],c=r[9],h=r[10],d=r[11],v=r[12],p=r[13],g=r[14],y=r[15],m=e[0],x=e[1],b=e[2],w=e[3],E=e[4],S=e[5],_=e[6],C=e[7],M=e[8],A=e[9],T=e[10],I=e[11],L=e[12],N=e[13],O=e[14],B=e[15];return Math.abs(t-m)<=Mt*Math.max(1,Math.abs(t),Math.abs(m))&&Math.abs(n-x)<=Mt*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-b)<=Mt*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-w)<=Mt*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-E)<=Mt*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(s-S)<=Mt*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(u-_)<=Mt*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(f-C)<=Mt*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(l-M)<=Mt*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(c-A)<=Mt*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(h-T)<=Mt*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-I)<=Mt*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(v-L)<=Mt*Math.max(1,Math.abs(v),Math.abs(L))&&Math.abs(p-N)<=Mt*Math.max(1,Math.abs(p),Math.abs(N))&&Math.abs(g-O)<=Mt*Math.max(1,Math.abs(g),Math.abs(O))&&Math.abs(y-B)<=Mt*Math.max(1,Math.abs(y),Math.abs(B))}var JF=zA,e4=qA;const t4=Object.freeze(Object.defineProperty({__proto__:null,add:VF,adjoint:xF,clone:vF,copy:pF,create:dF,determinant:wF,equals:QF,exactEquals:KF,frob:qF,fromQuat:BF,fromQuat2:DF,fromRotation:kF,fromRotationTranslation:jA,fromRotationTranslationScale:PF,fromRotationTranslationScaleOrigin:RF,fromScaling:IF,fromTranslation:TF,fromValues:gF,fromXRotation:LF,fromYRotation:NF,fromZRotation:OF,frustum:FF,getRotation:XA,getScaling:$A,getTranslation:UA,identity:GA,invert:bF,lookAt:XF,mul:JF,multiply:zA,multiplyScalar:HF,multiplyScalarAndAdd:ZF,ortho:UF,orthoNO:WA,orthoZO:$F,perspective:GF,perspectiveFromFieldOfView:jF,perspectiveNO:YA,perspectiveZO:zF,rotate:SF,rotateX:MF,rotateY:CF,rotateZ:AF,scale:_F,set:yF,str:WF,sub:e4,subtract:qA,targetTo:YF,translate:EF,transpose:mF},Symbol.toStringTag,{value:"Module"}));function mm(){var r=new or(3);return or!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function r4(r){var e=new or(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function VA(r){var e=r[0],t=r[1],n=r[2];return Math.hypot(e,t,n)}function B0(r,e,t){var n=new or(3);return n[0]=r,n[1]=e,n[2]=t,n}function n4(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function i4(r,e,t,n){return r[0]=e,r[1]=t,r[2]=n,r}function a4(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r}function HA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r}function ZA(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r}function KA(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r}function o4(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r}function s4(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r}function u4(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.min(e[2],t[2]),r}function f4(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r}function l4(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r}function c4(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r}function h4(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r}function QA(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2];return Math.hypot(t,n,i)}function JA(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2];return t*t+n*n+i*i}function eT(r){var e=r[0],t=r[1],n=r[2];return e*e+t*t+n*n}function d4(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r}function v4(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r}function tT(r,e){var t=e[0],n=e[1],i=e[2],a=t*t+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),r[0]=e[0]*a,r[1]=e[1]*a,r[2]=e[2]*a,r}function bm(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function nd(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[0],s=t[1],u=t[2];return r[0]=i*u-a*s,r[1]=a*o-n*u,r[2]=n*s-i*o,r}function p4(r,e,t,n){var i=e[0],a=e[1],o=e[2];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r[2]=o+n*(t[2]-o),r}function g4(r,e,t,n,i,a){var o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,f=o*(a-1),l=o*(3-2*a);return r[0]=e[0]*s+t[0]*u+n[0]*f+i[0]*l,r[1]=e[1]*s+t[1]*u+n[1]*f+i[1]*l,r[2]=e[2]*s+t[2]*u+n[2]*f+i[2]*l,r}function y4(r,e,t,n,i,a){var o=1-a,s=o*o,u=a*a,f=s*o,l=3*a*s,c=3*u*o,h=u*a;return r[0]=e[0]*f+t[0]*l+n[0]*c+i[0]*h,r[1]=e[1]*f+t[1]*l+n[1]*c+i[1]*h,r[2]=e[2]*f+t[2]*l+n[2]*c+i[2]*h,r}function m4(r,e){e=e||1;var t=Pi()*2*Math.PI,n=Pi()*2-1,i=Math.sqrt(1-n*n)*e;return r[0]=Math.cos(t)*i,r[1]=Math.sin(t)*i,r[2]=n*e,r}function b4(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[3]*n+t[7]*i+t[11]*a+t[15];return o=o||1,r[0]=(t[0]*n+t[4]*i+t[8]*a+t[12])/o,r[1]=(t[1]*n+t[5]*i+t[9]*a+t[13])/o,r[2]=(t[2]*n+t[6]*i+t[10]*a+t[14])/o,r}function xv(r,e,t){var n=e[0],i=e[1],a=e[2];return r[0]=n*t[0]+i*t[3]+a*t[6],r[1]=n*t[1]+i*t[4]+a*t[7],r[2]=n*t[2]+i*t[5]+a*t[8],r}function x4(r,e,t){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],f=e[2],l=i*f-a*u,c=a*s-n*f,h=n*u-i*s,d=i*h-a*c,v=a*l-n*h,p=n*c-i*l,g=o*2;return l*=g,c*=g,h*=g,d*=2,v*=2,p*=2,r[0]=s+l+d,r[1]=u+c+v,r[2]=f+h+p,r}function w4(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function E4(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function _4(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function S4(r,e){var t=r[0],n=r[1],i=r[2],a=e[0],o=e[1],s=e[2],u=Math.sqrt(t*t+n*n+i*i),f=Math.sqrt(a*a+o*o+s*s),l=u*f,c=l&&bm(r,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function M4(r){return r[0]=0,r[1]=0,r[2]=0,r}function C4(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function A4(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]}function T4(r,e){var t=r[0],n=r[1],i=r[2],a=e[0],o=e[1],s=e[2];return Math.abs(t-a)<=Mt*Math.max(1,Math.abs(t),Math.abs(a))&&Math.abs(n-o)<=Mt*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=Mt*Math.max(1,Math.abs(i),Math.abs(s))}var I4=HA,k4=ZA,L4=KA,N4=QA,O4=JA,rT=VA,D4=eT,P4=function(){var r=mm();return function(e,t,n,i,a,o){var s,u;for(t||(t=3),n||(n=0),i?u=Math.min(i*t+n,e.length):u=e.length,s=n;s<u;s+=t)r[0]=e[s],r[1]=e[s+1],r[2]=e[s+2],a(r,r,o),e[s]=r[0],e[s+1]=r[1],e[s+2]=r[2];return e}}();const R4=Object.freeze(Object.defineProperty({__proto__:null,add:a4,angle:S4,bezier:y4,ceil:o4,clone:r4,copy:n4,create:mm,cross:nd,dist:N4,distance:QA,div:L4,divide:KA,dot:bm,equals:T4,exactEquals:A4,floor:s4,forEach:P4,fromValues:B0,hermite:g4,inverse:v4,len:rT,length:VA,lerp:p4,max:f4,min:u4,mul:k4,multiply:ZA,negate:d4,normalize:tT,random:m4,rotateX:w4,rotateY:E4,rotateZ:_4,round:l4,scale:c4,scaleAndAdd:h4,set:i4,sqrDist:O4,sqrLen:D4,squaredDistance:JA,squaredLength:eT,str:C4,sub:I4,subtract:HA,transformMat3:xv,transformMat4:b4,transformQuat:x4,zero:M4},Symbol.toStringTag,{value:"Module"}));function nT(){var r=new or(4);return or!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function iT(r){var e=new or(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function aT(r,e,t,n){var i=new or(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}function oT(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function sT(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function uT(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r}function fT(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r}function lT(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r[3]=e[3]*t[3],r}function cT(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r[3]=e[3]/t[3],r}function B4(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r[3]=Math.ceil(e[3]),r}function F4(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r[3]=Math.floor(e[3]),r}function G4(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.min(e[2],t[2]),r[3]=Math.min(e[3],t[3]),r}function z4(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r[3]=Math.max(e[3],t[3]),r}function j4(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r[3]=Math.round(e[3]),r}function hT(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r}function U4(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r}function dT(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2],a=e[3]-r[3];return Math.hypot(t,n,i,a)}function vT(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2],a=e[3]-r[3];return t*t+n*n+i*i+a*a}function xm(r){var e=r[0],t=r[1],n=r[2],i=r[3];return Math.hypot(e,t,n,i)}function wm(r){var e=r[0],t=r[1],n=r[2],i=r[3];return e*e+t*t+n*n+i*i}function $4(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r}function X4(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r[3]=1/e[3],r}function pT(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t*t+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),r[0]=t*o,r[1]=n*o,r[2]=i*o,r[3]=a*o,r}function gT(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}function Y4(r,e,t,n){var i=t[0]*n[1]-t[1]*n[0],a=t[0]*n[2]-t[2]*n[0],o=t[0]*n[3]-t[3]*n[0],s=t[1]*n[2]-t[2]*n[1],u=t[1]*n[3]-t[3]*n[1],f=t[2]*n[3]-t[3]*n[2],l=e[0],c=e[1],h=e[2],d=e[3];return r[0]=c*f-h*u+d*s,r[1]=-(l*f)+h*o-d*a,r[2]=l*u-c*o+d*i,r[3]=-(l*s)+c*a-h*i,r}function yT(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r[2]=o+n*(t[2]-o),r[3]=s+n*(t[3]-s),r}function W4(r,e){e=e||1;var t,n,i,a,o,s;do t=Pi()*2-1,n=Pi()*2-1,o=t*t+n*n;while(o>=1);do i=Pi()*2-1,a=Pi()*2-1,s=i*i+a*a;while(s>=1);var u=Math.sqrt((1-o)/s);return r[0]=e*t,r[1]=e*n,r[2]=e*i*u,r[3]=e*a*u,r}function q4(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3];return r[0]=t[0]*n+t[4]*i+t[8]*a+t[12]*o,r[1]=t[1]*n+t[5]*i+t[9]*a+t[13]*o,r[2]=t[2]*n+t[6]*i+t[10]*a+t[14]*o,r[3]=t[3]*n+t[7]*i+t[11]*a+t[15]*o,r}function V4(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[0],s=t[1],u=t[2],f=t[3],l=f*n+s*a-u*i,c=f*i+u*n-o*a,h=f*a+o*i-s*n,d=-o*n-s*i-u*a;return r[0]=l*f+d*-o+c*-u-h*-s,r[1]=c*f+d*-s+h*-o-l*-u,r[2]=h*f+d*-u+l*-s-c*-o,r[3]=e[3],r}function H4(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function Z4(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function mT(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}function bT(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=e[0],s=e[1],u=e[2],f=e[3];return Math.abs(t-o)<=Mt*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(n-s)<=Mt*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=Mt*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=Mt*Math.max(1,Math.abs(a),Math.abs(f))}var K4=fT,Q4=lT,J4=cT,eG=dT,tG=vT,rG=xm,nG=wm,iG=function(){var r=nT();return function(e,t,n,i,a,o){var s,u;for(t||(t=4),n||(n=0),i?u=Math.min(i*t+n,e.length):u=e.length,s=n;s<u;s+=t)r[0]=e[s],r[1]=e[s+1],r[2]=e[s+2],r[3]=e[s+3],a(r,r,o),e[s]=r[0],e[s+1]=r[1],e[s+2]=r[2],e[s+3]=r[3];return e}}();const aG=Object.freeze(Object.defineProperty({__proto__:null,add:uT,ceil:B4,clone:iT,copy:oT,create:nT,cross:Y4,dist:eG,distance:dT,div:J4,divide:cT,dot:gT,equals:bT,exactEquals:mT,floor:F4,forEach:iG,fromValues:aT,inverse:X4,len:rG,length:xm,lerp:yT,max:z4,min:G4,mul:Q4,multiply:lT,negate:$4,normalize:pT,random:W4,round:j4,scale:hT,scaleAndAdd:U4,set:sT,sqrDist:tG,sqrLen:nG,squaredDistance:vT,squaredLength:wm,str:Z4,sub:K4,subtract:fT,transformMat4:q4,transformQuat:V4,zero:H4},Symbol.toStringTag,{value:"Module"}));function Td(){var r=new or(4);return or!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function oG(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function xT(r,e,t){t=t*.5;var n=Math.sin(t);return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=Math.cos(t),r}function sG(r,e){var t=Math.acos(e[3])*2,n=Math.sin(t/2);return n>Mt?(r[0]=e[0]/n,r[1]=e[1]/n,r[2]=e[2]/n):(r[0]=1,r[1]=0,r[2]=0),t}function uG(r,e){var t=_m(r,e);return Math.acos(2*t*t-1)}function wT(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],f=t[2],l=t[3];return r[0]=n*l+o*s+i*f-a*u,r[1]=i*l+o*u+a*s-n*f,r[2]=a*l+o*f+n*u-i*s,r[3]=o*l-n*s-i*u-a*f,r}function ET(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),u=Math.cos(t);return r[0]=n*u+o*s,r[1]=i*u+a*s,r[2]=a*u-i*s,r[3]=o*u-n*s,r}function _T(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),u=Math.cos(t);return r[0]=n*u-a*s,r[1]=i*u+o*s,r[2]=a*u+n*s,r[3]=o*u-i*s,r}function ST(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),u=Math.cos(t);return r[0]=n*u+i*s,r[1]=i*u-n*s,r[2]=a*u+o*s,r[3]=o*u-a*s,r}function fG(r,e){var t=e[0],n=e[1],i=e[2];return r[0]=t,r[1]=n,r[2]=i,r[3]=Math.sqrt(Math.abs(1-t*t-n*n-i*i)),r}function MT(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+n*n+i*i),s=Math.exp(a),u=o>0?s*Math.sin(o)/o:0;return r[0]=t*u,r[1]=n*u,r[2]=i*u,r[3]=s*Math.cos(o),r}function CT(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return r[0]=t*s,r[1]=n*s,r[2]=i*s,r[3]=.5*Math.log(t*t+n*n+i*i+a*a),r}function lG(r,e,t){return CT(r,e),TT(r,r,t),MT(r,r),r}function id(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3],u=t[0],f=t[1],l=t[2],c=t[3],h,d,v,p,g;return d=i*u+a*f+o*l+s*c,d<0&&(d=-d,u=-u,f=-f,l=-l,c=-c),1-d>Mt?(h=Math.acos(d),v=Math.sin(h),p=Math.sin((1-n)*h)/v,g=Math.sin(n*h)/v):(p=1-n,g=n),r[0]=p*i+g*u,r[1]=p*a+g*f,r[2]=p*o+g*l,r[3]=p*s+g*c,r}function cG(r){var e=Pi(),t=Pi(),n=Pi(),i=Math.sqrt(1-e),a=Math.sqrt(e);return r[0]=i*Math.sin(2*Math.PI*t),r[1]=i*Math.cos(2*Math.PI*t),r[2]=a*Math.sin(2*Math.PI*n),r[3]=a*Math.cos(2*Math.PI*n),r}function hG(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t*t+n*n+i*i+a*a,s=o?1/o:0;return r[0]=-t*s,r[1]=-n*s,r[2]=-i*s,r[3]=a*s,r}function dG(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r}function AT(r,e){var t=e[0]+e[4]+e[8],n;if(t>0)n=Math.sqrt(t+1),r[3]=.5*n,n=.5/n,r[0]=(e[5]-e[7])*n,r[1]=(e[6]-e[2])*n,r[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[a*3+a]-e[o*3+o]+1),r[i]=.5*n,n=.5/n,r[3]=(e[a*3+o]-e[o*3+a])*n,r[a]=(e[a*3+i]+e[i*3+a])*n,r[o]=(e[o*3+i]+e[i*3+o])*n}return r}function vG(r,e,t,n){var i=.5*Math.PI/180;e*=i,t*=i,n*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(t),u=Math.cos(t),f=Math.sin(n),l=Math.cos(n);return r[0]=a*u*l-o*s*f,r[1]=o*s*l+a*u*f,r[2]=o*u*f-a*s*l,r[3]=o*u*l+a*s*f,r}function pG(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var gG=iT,yG=aT,Em=oT,mG=sT,bG=uT,xG=wT,TT=hT,_m=gT,wG=yT,Sm=xm,EG=Sm,Mm=wm,_G=Mm,Cm=pT,SG=mT,MG=bT,CG=function(){var r=mm(),e=B0(1,0,0),t=B0(0,1,0);return function(n,i,a){var o=bm(i,a);return o<-.999999?(nd(r,e,i),rT(r)<1e-6&&nd(r,t,i),tT(r,r),xT(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(nd(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,Cm(n,n))}}(),AG=function(){var r=Td(),e=Td();return function(t,n,i,a,o,s){return id(r,n,o,s),id(e,i,a,s),id(t,r,e,2*s*(1-s)),t}}(),TG=function(){var r=RA();return function(e,t,n,i){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-t[0],r[5]=-t[1],r[8]=-t[2],Cm(e,AT(e,r))}}();const IG=Object.freeze(Object.defineProperty({__proto__:null,add:bG,calculateW:fG,clone:gG,conjugate:dG,copy:Em,create:Td,dot:_m,equals:MG,exactEquals:SG,exp:MT,fromEuler:vG,fromMat3:AT,fromValues:yG,getAngle:uG,getAxisAngle:sG,identity:oG,invert:hG,len:EG,length:Sm,lerp:wG,ln:CT,mul:xG,multiply:wT,normalize:Cm,pow:lG,random:cG,rotateX:ET,rotateY:_T,rotateZ:ST,rotationTo:CG,scale:TT,set:mG,setAxes:TG,setAxisAngle:xT,slerp:id,sqlerp:AG,sqrLen:_G,squaredLength:Mm,str:pG},Symbol.toStringTag,{value:"Module"}));function kG(){var r=new or(8);return or!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0),r[3]=1,r}function LG(r){var e=new or(8);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e}function NG(r,e,t,n,i,a,o,s){var u=new or(8);return u[0]=r,u[1]=e,u[2]=t,u[3]=n,u[4]=i,u[5]=a,u[6]=o,u[7]=s,u}function OG(r,e,t,n,i,a,o){var s=new or(8);s[0]=r,s[1]=e,s[2]=t,s[3]=n;var u=i*.5,f=a*.5,l=o*.5;return s[4]=u*n+f*t-l*e,s[5]=f*n+l*r-u*t,s[6]=l*n+u*e-f*r,s[7]=-u*r-f*e-l*t,s}function IT(r,e,t){var n=t[0]*.5,i=t[1]*.5,a=t[2]*.5,o=e[0],s=e[1],u=e[2],f=e[3];return r[0]=o,r[1]=s,r[2]=u,r[3]=f,r[4]=n*f+i*u-a*s,r[5]=i*f+a*o-n*u,r[6]=a*f+n*s-i*o,r[7]=-n*o-i*s-a*u,r}function DG(r,e){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=e[0]*.5,r[5]=e[1]*.5,r[6]=e[2]*.5,r[7]=0,r}function PG(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function RG(r,e){var t=Td();XA(t,e);var n=new or(3);return UA(n,e),IT(r,t,n),r}function kT(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r}function BG(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function FG(r,e,t,n,i,a,o,s,u){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r}var GG=Em;function zG(r,e){return r[0]=e[4],r[1]=e[5],r[2]=e[6],r[3]=e[7],r}var jG=Em;function UG(r,e){return r[4]=e[0],r[5]=e[1],r[6]=e[2],r[7]=e[3],r}function $G(r,e){var t=e[4],n=e[5],i=e[6],a=e[7],o=-e[0],s=-e[1],u=-e[2],f=e[3];return r[0]=(t*f+a*o+n*u-i*s)*2,r[1]=(n*f+a*s+i*o-t*u)*2,r[2]=(i*f+a*u+t*s-n*o)*2,r}function XG(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0]*.5,u=t[1]*.5,f=t[2]*.5,l=e[4],c=e[5],h=e[6],d=e[7];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=o*s+i*f-a*u+l,r[5]=o*u+a*s-n*f+c,r[6]=o*f+n*u-i*s+h,r[7]=-n*s-i*u-a*f+d,r}function YG(r,e,t){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return ET(r,e,t),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function WG(r,e,t){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return _T(r,e,t),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function qG(r,e,t){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],f=e[6],l=e[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return ST(r,e,t),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function VG(r,e,t){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],f=e[2],l=e[3];return r[0]=s*o+l*n+u*a-f*i,r[1]=u*o+l*i+f*n-s*a,r[2]=f*o+l*a+s*i-u*n,r[3]=l*o-s*n-u*i-f*a,s=e[4],u=e[5],f=e[6],l=e[7],r[4]=s*o+l*n+u*a-f*i,r[5]=u*o+l*i+f*n-s*a,r[6]=f*o+l*a+s*i-u*n,r[7]=l*o-s*n-u*i-f*a,r}function HG(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],f=t[2],l=t[3];return r[0]=n*l+o*s+i*f-a*u,r[1]=i*l+o*u+a*s-n*f,r[2]=a*l+o*f+n*u-i*s,r[3]=o*l-n*s-i*u-a*f,s=t[4],u=t[5],f=t[6],l=t[7],r[4]=n*l+o*s+i*f-a*u,r[5]=i*l+o*u+a*s-n*f,r[6]=a*l+o*f+n*u-i*s,r[7]=o*l-n*s-i*u-a*f,r}function ZG(r,e,t,n){if(Math.abs(n)<Mt)return kT(r,e);var i=Math.hypot(t[0],t[1],t[2]);n=n*.5;var a=Math.sin(n),o=a*t[0]/i,s=a*t[1]/i,u=a*t[2]/i,f=Math.cos(n),l=e[0],c=e[1],h=e[2],d=e[3];r[0]=l*f+d*o+c*u-h*s,r[1]=c*f+d*s+h*o-l*u,r[2]=h*f+d*u+l*s-c*o,r[3]=d*f-l*o-c*s-h*u;var v=e[4],p=e[5],g=e[6],y=e[7];return r[4]=v*f+y*o+p*u-g*s,r[5]=p*f+y*s+g*o-v*u,r[6]=g*f+y*u+v*s-p*o,r[7]=y*f-v*o-p*s-g*u,r}function KG(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r}function LT(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[4],u=t[5],f=t[6],l=t[7],c=e[4],h=e[5],d=e[6],v=e[7],p=t[0],g=t[1],y=t[2],m=t[3];return r[0]=n*m+o*p+i*y-a*g,r[1]=i*m+o*g+a*p-n*y,r[2]=a*m+o*y+n*g-i*p,r[3]=o*m-n*p-i*g-a*y,r[4]=n*l+o*s+i*f-a*u+c*m+v*p+h*y-d*g,r[5]=i*l+o*u+a*s-n*f+h*m+v*g+d*p-c*y,r[6]=a*l+o*f+n*u-i*s+d*m+v*y+c*g-h*p,r[7]=o*l-n*s-i*u-a*f+v*m-c*p-h*g-d*y,r}var QG=LT;function JG(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r}var NT=_m;function e6(r,e,t,n){var i=1-n;return NT(e,t)<0&&(n=-n),r[0]=e[0]*i+t[0]*n,r[1]=e[1]*i+t[1]*n,r[2]=e[2]*i+t[2]*n,r[3]=e[3]*i+t[3]*n,r[4]=e[4]*i+t[4]*n,r[5]=e[5]*i+t[5]*n,r[6]=e[6]*i+t[6]*n,r[7]=e[7]*i+t[7]*n,r}function t6(r,e){var t=wv(e);return r[0]=-e[0]/t,r[1]=-e[1]/t,r[2]=-e[2]/t,r[3]=e[3]/t,r[4]=-e[4]/t,r[5]=-e[5]/t,r[6]=-e[6]/t,r[7]=e[7]/t,r}function r6(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r[4]=-e[4],r[5]=-e[5],r[6]=-e[6],r[7]=e[7],r}var OT=Sm,n6=OT,wv=Mm,i6=wv;function a6(r,e){var t=wv(e);if(t>0){t=Math.sqrt(t);var n=e[0]/t,i=e[1]/t,a=e[2]/t,o=e[3]/t,s=e[4],u=e[5],f=e[6],l=e[7],c=n*s+i*u+a*f+o*l;r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=(s-n*c)/t,r[5]=(u-i*c)/t,r[6]=(f-a*c)/t,r[7]=(l-o*c)/t}return r}function o6(r){return"quat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+")"}function s6(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]}function u6(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=e[0],c=e[1],h=e[2],d=e[3],v=e[4],p=e[5],g=e[6],y=e[7];return Math.abs(t-l)<=Mt*Math.max(1,Math.abs(t),Math.abs(l))&&Math.abs(n-c)<=Mt*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-h)<=Mt*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-d)<=Mt*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-v)<=Mt*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=Mt*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(u-g)<=Mt*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(f-y)<=Mt*Math.max(1,Math.abs(f),Math.abs(y))}const f6=Object.freeze(Object.defineProperty({__proto__:null,add:KG,clone:LG,conjugate:r6,copy:kT,create:kG,dot:NT,equals:u6,exactEquals:s6,fromMat4:RG,fromRotation:PG,fromRotationTranslation:IT,fromRotationTranslationValues:OG,fromTranslation:DG,fromValues:NG,getDual:zG,getReal:GG,getTranslation:$G,identity:BG,invert:t6,len:n6,length:OT,lerp:e6,mul:QG,multiply:LT,normalize:a6,rotateAroundAxis:ZG,rotateByQuatAppend:VG,rotateByQuatPrepend:HG,rotateX:YG,rotateY:WG,rotateZ:qG,scale:JG,set:FG,setDual:UG,setReal:jG,sqrLen:i6,squaredLength:wv,str:o6,translate:XG},Symbol.toStringTag,{value:"Module"}));function DT(){var r=new or(2);return or!=Float32Array&&(r[0]=0,r[1]=0),r}function l6(r){var e=new or(2);return e[0]=r[0],e[1]=r[1],e}function c6(r,e){var t=new or(2);return t[0]=r,t[1]=e,t}function h6(r,e){return r[0]=e[0],r[1]=e[1],r}function d6(r,e,t){return r[0]=e,r[1]=t,r}function mn(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}function PT(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}function RT(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r}function BT(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r}function v6(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r}function p6(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r}function co(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}function ho(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}function g6(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r}function An(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r}function y6(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r}function Id(r,e){var t=e[0]-r[0],n=e[1]-r[1];return Math.hypot(t,n)}function FT(r,e){var t=e[0]-r[0],n=e[1]-r[1];return t*t+n*n}function GT(r){var e=r[0],t=r[1];return Math.hypot(e,t)}function zT(r){var e=r[0],t=r[1];return e*e+t*t}function m6(r,e){return r[0]=-e[0],r[1]=-e[1],r}function b6(r,e){return r[0]=1/e[0],r[1]=1/e[1],r}function _o(r,e){var t=e[0],n=e[1],i=t*t+n*n;return i>0&&(i=1/Math.sqrt(i)),r[0]=e[0]*i,r[1]=e[1]*i,r}function Am(r,e){return r[0]*e[0]+r[1]*e[1]}function x6(r,e,t){var n=e[0]*t[1]-e[1]*t[0];return r[0]=r[1]=0,r[2]=n,r}function w6(r,e,t,n){var i=e[0],a=e[1];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r}function E6(r,e){e=e||1;var t=Pi()*2*Math.PI;return r[0]=Math.cos(t)*e,r[1]=Math.sin(t)*e,r}function _6(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i,r[1]=t[1]*n+t[3]*i,r}function S6(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i+t[4],r[1]=t[1]*n+t[3]*i+t[5],r}function M6(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[3]*i+t[6],r[1]=t[1]*n+t[4]*i+t[7],r}function C6(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[4]*i+t[12],r[1]=t[1]*n+t[5]*i+t[13],r}function A6(r,e,t,n){var i=e[0]-t[0],a=e[1]-t[1],o=Math.sin(n),s=Math.cos(n);return r[0]=i*s-a*o+t[0],r[1]=i*o+a*s+t[1],r}function jT(r,e){var t=r[0],n=r[1],i=e[0],a=e[1],o=Math.sqrt(t*t+n*n)*Math.sqrt(i*i+a*a),s=o&&(t*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function T6(r){return r[0]=0,r[1]=0,r}function I6(r){return"vec2("+r[0]+", "+r[1]+")"}function Tm(r,e){return r[0]===e[0]&&r[1]===e[1]}function k6(r,e){var t=r[0],n=r[1],i=e[0],a=e[1];return Math.abs(t-i)<=Mt*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(n-a)<=Mt*Math.max(1,Math.abs(n),Math.abs(a))}var L6=GT,ad=PT,N6=RT,O6=BT,D6=Id,P6=FT,R6=zT,B6=function(){var r=DT();return function(e,t,n,i,a,o){var s,u;for(t||(t=2),n||(n=0),i?u=Math.min(i*t+n,e.length):u=e.length,s=n;s<u;s+=t)r[0]=e[s],r[1]=e[s+1],a(r,r,o),e[s]=r[0],e[s+1]=r[1];return e}}();const F6=Object.freeze(Object.defineProperty({__proto__:null,add:mn,angle:jT,ceil:v6,clone:l6,copy:h6,create:DT,cross:x6,dist:D6,distance:Id,div:O6,divide:BT,dot:Am,equals:k6,exactEquals:Tm,floor:p6,forEach:B6,fromValues:c6,inverse:b6,len:L6,length:GT,lerp:w6,max:ho,min:co,mul:N6,multiply:RT,negate:m6,normalize:_o,random:E6,rotate:A6,round:g6,scale:An,scaleAndAdd:y6,set:d6,sqrDist:P6,sqrLen:R6,squaredDistance:FT,squaredLength:zT,str:I6,sub:ad,subtract:PT,transformMat2:_6,transformMat2d:S6,transformMat3:M6,transformMat4:C6,zero:T6},Symbol.toStringTag,{value:"Module"})),G6=Object.freeze(Object.defineProperty({__proto__:null,glMatrix:W5,mat2:yB,mat2d:jB,mat3:FA,mat4:t4,quat:IG,quat2:f6,vec2:F6,vec3:R4,vec4:aG},Symbol.toStringTag,{value:"Module"}));function z6(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return pm(n,t),pa(r,n,e)}function j6(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return gm(n,t),pa(r,n,e)}function U6(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return ym(n,t),pa(r,n,e)}function $6(r,e,t){return pa(r,t,e)}function vi(r,e){for(var t=r?[].concat(r):[1,0,0,0,1,0,0,0,1],n=0,i=e.length;n<i;n++){var a=e[n];switch(a[0]){case"t":z6(t,t,[a[1],a[2]]);break;case"s":U6(t,t,[a[1],a[2]]);break;case"r":j6(t,t,a[1]);break;case"m":$6(t,t,a[1]);break}}return t}var Ts=function(e,t){var n=e.nodes,i=e.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var f=[];a.push(f)}),i&&i.forEach(function(s){var u=s.source,f=s.target,l=o[u],c=o[f];!l&&l!==0||!c&&c!==0||(a[l][c]=1,t||(a[c][l]=1))}),a},X6=function(e,t){return e===t},Rx=function(){function r(e,t){t===void 0&&(t=null),this.value=e,this.next=t}return r.prototype.toString=function(e){return e?e(this.value):"".concat(this.value)},r}(),UT=function(){function r(e){e===void 0&&(e=X6),this.head=null,this.tail=null,this.compare=e}return r.prototype.prepend=function(e){var t=new Rx(e,this.head);return this.head=t,this.tail||(this.tail=t),this},r.prototype.append=function(e){var t=new Rx(e);return this.head?(this.tail.next=t,this.tail=t,this):(this.head=t,this.tail=t,this)},r.prototype.delete=function(e){if(!this.head)return null;for(var t=null;this.head&&this.compare(this.head.value,e);)t=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,e)?(t=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,e)&&(this.tail=n),t},r.prototype.find=function(e){var t=e.value,n=t===void 0?void 0:t,i=e.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||n!==void 0&&this.compare(o.value,n))return o;o=o.next}return null},r.prototype.deleteTail=function(){var e=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,e;for(var t=this.head;t.next;)t.next.next?t=t.next:t.next=null;return this.tail=t,e},r.prototype.deleteHead=function(){if(!this.head)return null;var e=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),e},r.prototype.fromArray=function(e){var t=this;return e.forEach(function(n){return t.append(n)}),this},r.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},r.prototype.reverse=function(){for(var e=this.head,t=null,n=null;e;)n=e.next,e.next=t,t=e,e=n;this.tail=this.head,this.head=t},r.prototype.toString=function(e){return e===void 0&&(e=void 0),this.toArray().map(function(t){return t.toString(e)}).toString()},r}(),Y6=function(){function r(){this.linkedList=new UT}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(e){this.linkedList.append(e)},r.prototype.dequeue=function(){var e=this.linkedList.deleteHead();return e?e.value:null},r.prototype.toString=function(e){return this.linkedList.toString(e)},r}(),Kn=function(e,t,n){t===void 0&&(t=[]);var i=t.filter(function(u){return u.source===e||u.target===e});if(n==="target"){var a=function(f){return f.source===e};return i.filter(a).map(function(u){return u.target})}if(n==="source"){var o=function(f){return f.target===e};return i.filter(o).map(function(u){return u.source})}var s=function(f){return f.source===e?f.target:f.source};return i.map(s)},W6=function(e,t){return t.filter(function(n){return n.source===e})},od=function(e,t){return t.filter(function(n){return n.source===e||n.target===e})},$T=function(e){e===void 0&&(e=0);var t="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(e,"-").concat(t).concat(n)};function q6(r){r===void 0&&(r={});var e=r,t=function(){},n=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return e.allowTraversal=r.allowTraversal||n,e.enter=r.enter||t,e.leave=r.leave||t,e}var XT=function(e,t,n,i){i===void 0&&(i=!0);var a=q6(n),o=new Y6,s=e.edges,u=s===void 0?[]:s;o.enqueue(t);for(var f="",l=function(){var h=o.dequeue();a.enter({current:h,previous:f}),Kn(h,u,i?"target":void 0).forEach(function(d){a.allowTraversal({previous:f,current:h,next:d})&&o.enqueue(d)}),a.leave({current:h,previous:f}),f=h};!o.isEmpty();)l()},V6=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},u=[],f=function d(v){u.push(v),s[v.id]=!0;for(var p=Kn(v.id,a),g=function(x){var b=p[x];if(!s[b]){var w=n.filter(function(E){return E.id===b});w.length>0&&d(w[0])}},y=0;y<p.length;++y)g(y)},l=0;l<n.length;l++){var c=n[l];if(!s[c.id]){f(c);for(var h=[];u.length>0;)h.push(u.pop());o.push(h)}}return o},YT=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},u={},f={},l=[],c=0,h=function g(y){u[y.id]=c,f[y.id]=c,c+=1,o.push(y),s[y.id]=!0;for(var m=Kn(y.id,a,"target").filter(function(S){return n.map(function(_){return _.id}).indexOf(S)>-1}),x=function(_){var C=m[_];if(!u[C]&&u[C]!==0){var M=n.filter(function(A){return A.id===C});M.length>0&&g(M[0]),f[y.id]=Math.min(f[y.id],f[C])}else s[C]&&(f[y.id]=Math.min(f[y.id],u[C]))},b=0;b<m.length;b++)x(b);if(f[y.id]===u[y.id]){for(var w=[];o.length>0;){var E=o.pop();if(s[E.id]=!1,w.push(E),E===y)break}w.length>0&&l.push(w)}},d=0,v=n;d<v.length;d++){var p=v[d];!u[p.id]&&u[p.id]!==0&&h(p)}return l};function Im(r,e){return e?YT(r):V6(r)}var Ua=function(e){var t={},n=e.nodes,i=n===void 0?[]:n,a=e.edges,o=a===void 0?[]:a;return i.forEach(function(s){t[s.id]={degree:0,inDegree:0,outDegree:0}}),o.forEach(function(s){t[s.source].degree++,t[s.source].outDegree++,t[s.target].degree++,t[s.target].inDegree++}),t},WT=function(e,t){var n=Ua(e);return n[t]?Ua(e)[t].inDegree:0},qT=function(e,t){var n=Ua(e);return n[t]?Ua(e)[t].outDegree:0};function H6(r){r===void 0&&(r={});var e=r,t=function(){},n=function(){var i={};return function(a){var o=a.next;return i[o]?!1:(i[o]=!0,!0)}}();return e.allowTraversal=r.allowTraversal||n,e.enter=r.enter||t,e.leave=r.leave||t,e}function VT(r,e,t,n,i){i===void 0&&(i=!0),n.enter({current:e,previous:t});var a=r.edges,o=a===void 0?[]:a;Kn(e,o,i?"target":void 0).forEach(function(s){n.allowTraversal({previous:t,current:e,next:s})&&VT(r,s,e,n,i)}),n.leave({current:e,previous:t})}function km(r,e,t,n){n===void 0&&(n=!0),VT(r,e,"",H6(t),n)}var Lm=function(e){var t=null,n=e.nodes,i=n===void 0?[]:n,a={},o={},s={},u={};i.forEach(function(c){o[c.id]=c});for(var f={enter:function(h){var d=h.current,v=h.previous;if(s[d]){t={};for(var p=d,g=v;g!==d;)t[p]=g,p=g,g=a[g];t[p]=g}else s[d]=d,delete o[d],a[d]=v},leave:function(h){var d=h.current;u[d]=d,delete s[d]},allowTraversal:function(h){var d=h.next;return t?!1:!u[d]}};Object.keys(o).length;){var l=Object.keys(o)[0];km(e,l,f)}return t},Nm=function(e,t,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=Im(e,!1),u=0,f=s;u<f.length;u++){var l=f[u];if(l.length)for(var c=l[0],h=c.id,d=[c],v=(i={},i[h]=c,i),p=(a={},a[h]=new Set,a);d.length>0;)for(var g=d.pop(),y=g.id,m=Kn(y,e.edges),x=function(E){var S,_=m[E],C=e.nodes.find(function(N){return N.id===_});if(_===y)o.push((S={},S[_]=g,S));else if(!(_ in p))v[_]=g,d.push(C),p[_]=new Set([g]);else if(!p[y].has(C)){for(var M=!0,A=[C,g],T=v[y];p[_].size&&!p[_].has(T)&&(A.push(T),T!==v[T.id]);)T=v[T.id];if(A.push(T),t&&n?(M=!1,A.findIndex(function(N){return t.indexOf(N.id)>-1})>-1&&(M=!0)):t&&!n&&A.findIndex(function(N){return t.indexOf(N.id)>-1})>-1&&(M=!1),M){for(var I={},L=1;L<A.length;L+=1)I[A[L-1].id]=A[L];A.length&&(I[A[A.length-1].id]=A[0]),o.push(I)}p[_].add(g)}},b=0;b<m.length;b+=1)x(b)}return o},Om=function(e,t,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],u={},f={},l=function(T){for(var I=[T];I.length>0;){var L=I.pop();a.has(L)&&(a.delete(L),o[L.id].forEach(function(N){I.push(N)}),o[L.id].clear())}},c=function A(T,I,L){var N=!1;if(t&&n===!1&&t.indexOf(T.id)>-1)return N;i.push(T),a.add(T);for(var O=L[T.id],B=0;B<O.length;B+=1){var W=u[O[B]];if(W===I){for(var D={},P=1;P<i.length;P+=1)D[i[P-1].id]=i[P];i.length&&(D[i[i.length-1].id]=i[0]),s.push(D),N=!0}else a.has(W)||A(W,I,L)&&(N=!0)}if(N)l(T);else for(var B=0;B<O.length;B+=1){var W=u[O[B]];o[W.id].has(T)||o[W.id].add(T)}return i.pop(),N},h=e.nodes,d=h===void 0?[]:h,v=0;v<d.length;v+=1){var p=d[v],g=p.id;f[g]=v,u[v]=p}if(t&&n)for(var y=function(T){var I=t[T];f[d[T].id]=f[I],f[I]=0,u[0]=d.find(function(L){return L.id===I}),u[f[d[T].id]]=d[T]},v=0;v<t.length;v++)y(v);for(var m=function(T){for(var I,L,N=1/0,O=0;O<T.length;O+=1)for(var B=T[O],W=0;W<B.length;W++){var D=f[B[W].id];D<N&&(N=D,L=O)}for(var P=T[L],R=[],O=0;O<P.length;O+=1){var X=P[O];R[X.id]=[];for(var Y=0,ee=Kn(X.id,e.edges,"target").filter(function(K){return P.map(function(se){return se.id}).indexOf(K)>-1});Y<ee.length;Y++){var U=ee[Y];U===X.id&&!(n===!1&&t.indexOf(X.id)>-1)?s.push((I={},I[X.id]=X,I)):R[X.id].push(f[U])}}return{component:P,adjList:R,minIdx:N}},x=0;x<d.length;){var b=d.filter(function(A){return f[A.id]>=x}),w=YT({nodes:b,edges:e.edges}).filter(function(A){return A.length>1});if(w.length===0)break;var E=m(w),S=E.minIdx,_=E.adjList,C=E.component;if(C.length>1){C.forEach(function(A){o[A.id]=new Set});var M=u[S];if(t&&n&&t.indexOf(M.id)===-1)return s;c(M,M,_),x=S+1}else break}return s},HT=function(e,t,n,i){return i===void 0&&(i=!0),t?Om(e,n,i):Nm(e,n,i)},Z6=function(e,t,n){for(var i=1/0,a,o=0;o<t.length;o++){var s=t[o].id;!n[s]&&e[s]<=i&&(i=e[s],a=t[o])}return a},Il=function(e,t,n,i){var a=e.nodes,o=a===void 0?[]:a,s=e.edges,u=s===void 0?[]:s,f={},l={},c={};o.forEach(function(m,x){var b=m.id;l[b]=1/0,b===t&&(l[b]=0)});for(var h=o.length,d=function(x){var b=Z6(l,o,f),w=b.id;if(f[w]=!0,l[w]===1/0)return"continue";var E=[];n?E=W6(w,u):E=od(w,u),E.forEach(function(S){var _=S.target,C=S.source,M=_===w?C:_,A=i&&S[i]?S[i]:1;l[M]>l[b.id]+A?(l[M]=l[b.id]+A,c[M]=[b.id]):l[M]===l[b.id]+A&&c[M].push(b.id)})},v=0;v<h;v++)d();c[t]=[t];var p={};for(var g in l)l[g]!==1/0&&ZT(t,g,c,p);var y={};for(var g in p)y[g]=p[g][0];return{length:l,path:y,allPath:p}};function ZT(r,e,t,n){if(r===e)return[r];if(n[e])return n[e];for(var i=[],a=0,o=t[e];a<o.length;a++){var s=o[a],u=ZT(r,s,t,n);if(!u)return;for(var f=0,l=u;f<l.length;f++){var c=l[f];mt(c)?i.push(Qn(Qn([],c,!0),[e],!1)):i.push([c,e])}}return n[e]=i,n[e]}var KT=function(e,t,n,i,a){var o=Il(e,t,i,a),s=o.length,u=o.path,f=o.allPath;return{length:s[n],path:u[n],allPath:f[n]}},QT=function(e,t,n,i){var a;if(t===n)return[[t]];var o=e.edges,s=o===void 0?[]:o,u=[t],f=(a={},a[t]=!0,a),l=[],c=[],h=i?Kn(t,s,"target"):Kn(t,s);for(l.push(h);u.length>0&&l.length>0;){var d=l[l.length-1];if(d.length){var v=d.shift();v&&(u.push(v),f[v]=!0,h=i?Kn(v,s,"target"):Kn(v,s),l.push(h.filter(function(y){return!f[y]})))}else{var p=u.pop();f[p]=!1,l.pop();continue}if(u[u.length-1]===n){var g=u.map(function(m){return m});c.push(g);var p=u.pop();f[p]=!1,l.pop()}}return c},kl=function(e,t){for(var n=Ts(e,t),i=[],a=n.length,o=0;o<a;o+=1){i[o]=[];for(var s=0;s<a;s+=1)o===s?i[o][s]=0:n[o][s]===0||!n[o][s]?i[o][s]=1/0:i[o][s]=n[o][s]}for(var u=0;u<a;u+=1)for(var o=0;o<a;o+=1)for(var s=0;s<a;s+=1)i[o][s]>i[o][u]+i[u][s]&&(i[o][s]=i[o][u]+i[u][s]);return i},JT=function(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=e.nodes,o=a===void 0?[]:a,s=e.edges,u=s===void 0?[]:s,f={},l={};o.forEach(function(x,b){var w=$T();x.clusterId=w,f[w]={id:w,nodes:[x]},l[x.id]={node:x,idx:b}});var c=Ts(e,t),h={};c.forEach(function(x,b){var w=o[b].id;h[w]={},x.forEach(function(E,S){if(E){var _=o[S].id;h[w][_]=E}})});for(var d=0,v=function(){var b=!1;if(o.forEach(function(w){var E={};Object.keys(h[w.id]).forEach(function(L){var N=h[w.id][L],O=l[L].node,B=O.clusterId;E[B]||(E[B]=0),E[B]+=N});var S=-1/0,_=[];if(Object.keys(E).forEach(function(L){S<E[L]?(S=E[L],_=[L]):S===E[L]&&_.push(L)}),!(_.length===1&&_[0]===w.clusterId)){var C=_.indexOf(w.clusterId);if(C>=0&&_.splice(C,1),_&&_.length){b=!0;var M=f[w.clusterId],A=M.nodes.indexOf(w);M.nodes.splice(A,1);var T=Math.floor(Math.random()*_.length),I=f[_[T]];I.nodes.push(w),w.clusterId=I.id}}}),!b)return"break";d++};d<i;){var p=v();if(p==="break")break}Object.keys(f).forEach(function(x){var b=f[x];(!b.nodes||!b.nodes.length)&&delete f[x]});var g=[],y={};u.forEach(function(x){var b=x.source,w=x.target,E=x[n]||1,S=l[b].node.clusterId,_=l[w].node.clusterId,C="".concat(S,"---").concat(_);if(y[C])y[C].weight+=E,y[C].count++;else{var M={source:S,target:_,weight:E,count:1};y[C]=M,g.push(M)}});var m=[];return Object.keys(f).forEach(function(x){m.push(f[x])}),{clusters:m,clusterEdges:g}},li=function(){function r(e){this.arr=e}return r.prototype.getArr=function(){return this.arr||[]},r.prototype.add=function(e){var t,n=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+n[a];return new r(i)}},r.prototype.subtract=function(e){var t,n=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-n[a];return new r(i)}},r.prototype.avg=function(e){var t=[];if(e!==0)for(var n in this.arr)t[n]=this.arr[n]/e;return new r(t)},r.prototype.negate=function(){var e=[];for(var t in this.arr)e[t]=-this.arr[t];return new r(e)},r.prototype.squareEuclideanDistance=function(e){var t,n=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return i}},r.prototype.euclideanDistance=function(e){var t,n=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},r.prototype.normalize=function(){var e=[],t=Jt(this.arr);t.sort(function(o,s){return o-s});var n=t[t.length-1],i=t[0];for(var a in this.arr)e[a]=(this.arr[a]-i)/(n-i);return new r(e)},r.prototype.norm2=function(){var e;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return 0;var t=0;for(var n in this.arr)t+=Math.pow(this.arr[n],2);return Math.sqrt(t)},r.prototype.dot=function(e){var t,n=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=this.arr[a]*e.arr[a];return i}else console.error("The two vectors are unequal in length.")},r.prototype.equal=function(e){var t,n=e.arr;if(((t=this.arr)===null||t===void 0?void 0:t.length)!==(n==null?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0},r}(),Dm=function(e,t){t===void 0&&(t=void 0);var n=[];return e.forEach(function(i){t===void 0&&n.push(i),i[t]!==void 0&&n.push(i[t])}),n},Oi;(function(r){r.EuclideanDistance="euclideanDistance"})(Oi||(Oi={}));var K6=function(e,t,n){var i=[];t!=null&&t.length?i=t:(e.forEach(function(o){i=i.concat(Object.keys(o))}),i=Al(i));var a={};return i.forEach(function(o){var s=[];e.forEach(function(u){u[o]!==void 0&&u[o]!==""&&s.push(u[o])}),s.length&&!(n!=null&&n.includes(o))&&(a[o]=Al(s))}),a},Pm=function(e,t,n){var i=K6(e,t,n),a=[];if(!Object.keys(i).length)return a;var o=Object.values(i),s=o.every(function(u){return u.every(function(f){return typeof f=="number"})});return e.forEach(function(u,f){var l=[];Object.keys(i).forEach(function(c){var h=u[c],d=i[c],v=d.findIndex(function(y){return h===y}),p=[];if(s)p.push(h);else for(var g=0;g<d.length;g++)g===v?p.push(1):p.push(0);l=l.concat(p)}),a[f]=l}),a},Bx=function(e,t,n,i){n===void 0&&(n=Oi.EuclideanDistance);var a=0;switch(n){case Oi.EuclideanDistance:a=new li(e).euclideanDistance(new li(t));break}return a},Fx=function(e,t,n,i){for(var a=t.length,o=2*i,s=0,u=0;u<a;u++)for(var f=e[u].clusterId,l=0;l<a;l++){var c=e[l].clusterId;if(f===c){var h=t[u][l]||0,d=n[u]||0,v=n[l]||0;s+=h-d*v/o}}return s*=1/o,s},eg=function(e,t){e===void 0&&(e=[]);for(var n=e.length,i=new li([]),a=0;a<n;a++)i=i.add(new li(t[a]));var o=i.avg(n);o.normalize();for(var s=0,a=0;a<n;a++){var u=new li(t[a]),f=u.squareEuclideanDistance(o);s+=f}var l=[];e.forEach(function(){l.push([])});for(var a=0;a<n;a++){var u=new li(t[a]);e[a].clusterInertial=0;for(var c=0;c<n;c++){if(a===c){l[a][c]=0;continue}var h=new li(t[c]);l[a][c]=u.squareEuclideanDistance(h),e[a].clusterInertial+=l[a][c]}}for(var d=0,v=2*n*s,a=0;a<n;a++)for(var p=e[a].clusterId,c=0;c<n;c++){var g=e[c].clusterId;if(!(a===c||p!==g)){var y=e[a].clusterInertial*e[c].clusterInertial/Math.pow(v,2)-l[a][c]/v;d+=y}}return Number(d.toFixed(4))},Rm=function(e,t,n,i,a,o,s,u,f){t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),o===void 0&&(o=void 0),s===void 0&&(s=[]),u===void 0&&(u=["id"]),f===void 0&&(f=1);var l=e.nodes,c=l===void 0?[]:l,h=e.edges,d=h===void 0?[]:h,v=[];if(a){c.forEach(function(D,P){D.properties=D.properties||{},D.originIndex=P});var p=[];c.every(function(D){return D.hasOwnProperty("nodeType")})&&(p=Array.from(new Set(c.map(function(D){return D.nodeType}))),c.forEach(function(D){D.properties.nodeType=p.findIndex(function(P){return P===D.nodeType})}));var g=Dm(c,o);v=Pm(g,s,u)}var y=1,m={},x={};c.forEach(function(D,P){var R=String(y++);D.clusterId=R,m[R]={id:R,nodes:[D]},x[D.id]={node:D,idx:P}});var b=Ts(e,t),w=[],E={},S=0;b.forEach(function(D,P){var R=0,X=c[P].id;E[X]={},D.forEach(function(Y,ee){if(Y){R+=Y;var U=c[ee].id;E[X][U]=Y,S+=Y}}),w.push(R)}),S/=2;for(var _=1/0,C=1/0,M=0,A=[],T={};;){a&&c.every(function(D){return D.hasOwnProperty("properties")})?_=Fx(c,b,w,S)+eg(c,v)*f:_=Fx(c,b,w,S),M===0&&(C=_,A=c,T=m);var I=_>0&&_>C&&_-C<i;if(_>C&&(A=c.map(function(D){return{node:D,clusterId:D.clusterId}}),T=Jt(m),C=_),I||M>100)break;M++,Object.keys(m).forEach(function(D){var P=0;d.forEach(function(R){var X=R.source,Y=R.target,ee=x[X].node.clusterId,U=x[Y].node.clusterId;(ee===D&&U!==D||U===D&&ee!==D)&&(P=P+(R[n]||1))}),m[D].sumTot=P}),c.forEach(function(D,P){var R=m[D.clusterId],X=0,Y,ee=w[P]/(2*S),U=0,Z=R.nodes;Z.forEach(function(Ke){var xt=x[Ke.id].idx;U+=b[P][xt]||0});var K=U-R.sumTot*ee,se=Z.filter(function(Ke){return Ke.id!==D.id});se.forEach(function(Ke,xt){v[Ke.originIndex]});var re=eg(se,v)*f,J=E[D.id];if(Object.keys(J).forEach(function(Ke){var xt=x[Ke].node,kt=xt.clusterId;if(kt!==D.clusterId){var Lt=m[kt],vr=Lt.nodes;if(!(!vr||!vr.length)){var xr=0;vr.forEach(function(Ot){var ut=x[Ot.id].idx;xr+=b[P][ut]||0});var pt=xr-Lt.sumTot*ee,Nt=vr.concat([D]);Nt.forEach(function(Ot,ut){v[Ot.originIndex]});var F=eg(Nt,v)*f,zt=pt-K;a&&(zt=pt+F-(K+re)),zt>X&&(X=zt,Y=Lt)}}}),X>0){Y.nodes.push(D);var me=D.clusterId;D.clusterId=Y.id;var Ae=R.nodes.indexOf(D);R.nodes.splice(Ae,1);var Ye=0,Ve=0;d.forEach(function(Ke){var xt=Ke.source,kt=Ke.target,Lt=x[xt].node.clusterId,vr=x[kt].node.clusterId;(Lt===Y.id&&vr!==Y.id||vr===Y.id&&Lt!==Y.id)&&(Ye=Ye+(Ke[n]||1)),(Lt===me&&vr!==me||vr===me&&Lt!==me)&&(Ve=Ve+(Ke[n]||1))}),Y.sumTot=Ye,R.sumTot=Ve}})}var L={},N=0;Object.keys(T).forEach(function(D){var P=T[D];if(!P.nodes||!P.nodes.length){delete T[D];return}var R=String(N+1);R!==D&&(P.id=R,P.nodes=P.nodes.map(function(X){return{id:X.id,clusterId:R}}),T[R]=P,L[D]=R,delete T[D],N++)}),A.forEach(function(D){var P=D.node,R=D.clusterId;P&&(P.clusterId=R,P.clusterId&&L[P.clusterId]&&(P.clusterId=L[P.clusterId]))});var O=[],B={};d.forEach(function(D){var P=D.source,R=D.target,X=D[n]||1,Y=x[P].node.clusterId,ee=x[R].node.clusterId;if(!(!Y||!ee)){var U="".concat(Y,"---").concat(ee);if(B[U])B[U].weight+=X,B[U].count++;else{var Z={source:Y,target:ee,weight:X,count:1};B[U]=Z,O.push(Z)}}});var W=[];return Object.keys(T).forEach(function(D){W.push(T[D])}),{clusters:W,clusterEdges:O}},eI=function(e,t,n,i,a,o,s,u){return t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=void 0),o===void 0&&(o=[]),s===void 0&&(s=["id"]),u===void 0&&(u=1),Rm(e,t,n,i,!0,a,o,s,u)},tI=function(e,t){var n;t===void 0&&(t=1);for(var i=Jt(e),a=i.nodes,o=a===void 0?[]:a,s=i.edges,u=s===void 0?[]:s,f=function(){var h=Ua({nodes:o,edges:u}),d=Object.keys(h);d.sort(function(g,y){var m,x;return((m=h[g])===null||m===void 0?void 0:m.degree)-((x=h[y])===null||x===void 0?void 0:x.degree)});var v=d[0];if(!o.length||((n=h[v])===null||n===void 0?void 0:n.degree)>=t)return"break";var p=o.findIndex(function(g){return g.id===v});o.splice(p,1),u=u.filter(function(g){return!(g.source===v||g.target===v)})};;){var l=f();if(l==="break")break}return{nodes:o,edges:u}},Gx=function(e,t,n){var i=[];switch(e){case Oi.EuclideanDistance:i=t[n];break;default:i=[];break}return i},rI=function(e,t,n,i,a,o){t===void 0&&(t=3),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=["id"]),o===void 0&&(o=Oi.EuclideanDistance);var s=e.nodes,u=s===void 0?[]:s,f=e.edges,l=f===void 0?[]:f,c={clusters:[{id:"0",nodes:u}],clusterEdges:[]};if(o===Oi.EuclideanDistance&&!u.every(function(R){return R.hasOwnProperty(n)}))return c;var h=[],d=[];if(o===Oi.EuclideanDistance&&(h=Dm(u,n),d=Pm(h,i,a)),!d.length)return c;for(var v=Al(d.map(function(R){return R.join("")})),p=Math.min(t,u.length,v.length),g=0;g<u.length;g++)u[g].originIndex=g;for(var y=[],m=[],x=[],g=0;g<p;g++)if(g===0){var b=Math.floor(Math.random()*u.length);switch(o){case Oi.EuclideanDistance:y[g]=d[b];break;default:y[g]=[];break}m.push(b),x[g]=[u[b]],u[b].clusterId=String(g)}else{for(var w=-1/0,E=0,S=function(Y){if(!m.includes(Y)){for(var ee=0,U=0;U<y.length;U++){var Z=0;switch(o){case Oi.EuclideanDistance:Z=Bx(d[u[Y].originIndex],y[U],o);break}ee+=Z}var K=ee/y.length;K>w&&!y.find(function(se){return So(se,Gx(o,d,u[Y].originIndex))})&&(w=K,E=Y)}},_=0;_<u.length;_++)S(_);y[g]=Gx(o,d,E),m.push(E),x[g]=[u[E]],u[E].clusterId=String(g)}for(var C=0;;){for(var g=0;g<u.length;g++){var M=0,A=1/0;if(!(C===0&&m.includes(g))){for(var T=0;T<y.length;T++){var I=0;switch(o){case Oi.EuclideanDistance:I=Bx(d[g],y[T],o);break}I<A&&(A=I,M=T)}if(u[g].clusterId!==void 0)for(var L=x[Number(u[g].clusterId)].length-1;L>=0;L--)x[Number(u[g].clusterId)][L].id===u[g].id&&x[Number(u[g].clusterId)].splice(L,1);u[g].clusterId=String(M),x[M].push(u[g])}}for(var N=!1,g=0;g<x.length;g++){for(var O=x[g],B=new li([]),T=0;T<O.length;T++)B=B.add(new li(d[O[T].originIndex]));var W=B.avg(O.length);W.equal(new li(y[g]))||(N=!0,y[g]=W.getArr())}if(C++,u.every(function(R){return R.clusterId!==void 0})&&N||C>=1e3)break}var D=[],P={};return l.forEach(function(R){var X,Y,ee=R.source,U=R.target,Z=(X=u.find(function(J){return J.id===ee}))===null||X===void 0?void 0:X.clusterId,K=(Y=u.find(function(J){return J.id===U}))===null||Y===void 0?void 0:Y.clusterId,se="".concat(Z,"---").concat(K);if(P[se])P[se].count++;else{var re={source:Z,target:K,count:1};P[se]=re,D.push(re)}}),{clusters:x,clusterEdges:D}},Bm=function(e,t){var n=new li(t),i=n.norm2(),a=new li(e),o=a.norm2(),s=n.dot(a),u=i*o,f=u?s/u:0;return f},nI=function(e,t,n,i,a){e===void 0&&(e=[]),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=[]);var o=Jt(e.filter(function(h){return h.id!==t.id})),s=e.findIndex(function(h){return h.id===t.id}),u=Dm(e,n),f=Pm(u,i,a),l=f[s],c=[];return o.forEach(function(h,d){if(h.id!==t.id){var v=f[d],p=Bm(v,l);c.push(p),h.cosineSimilarity=p}}),o.sort(function(h,d){return d.cosineSimilarity-h.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},Q6=function(){function r(e){this.count=e.length,this.parent={};for(var t=0,n=e;t<n.length;t++){var i=n[t];this.parent[i]=i}}return r.prototype.find=function(e){for(;this.parent[e]!==e;)e=this.parent[e];return e},r.prototype.union=function(e,t){var n=this.find(e),i=this.find(t);n!==i&&(n<i?(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]):(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]))},r.prototype.connected=function(e,t){return this.find(e)===this.find(t)},r}(),J6=function(e,t){return e-t},ez=function(){function r(e){e===void 0&&(e=J6),this.compareFn=e,this.list=[]}return r.prototype.getLeft=function(e){return 2*e+1},r.prototype.getRight=function(e){return 2*e+2},r.prototype.getParent=function(e){return e===0?null:Math.floor((e-1)/2)},r.prototype.isEmpty=function(){return this.list.length<=0},r.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},r.prototype.delMin=function(){var e=this.top(),t=this.list.pop();return this.list.length>0&&(this.list[0]=t,this.moveDown(0)),e},r.prototype.insert=function(e){if(e!==null){this.list.push(e);var t=this.list.length-1;return this.moveUp(t),!0}return!1},r.prototype.moveUp=function(e){for(var t=this.getParent(e);e&&e>0&&this.compareFn(this.list[t],this.list[e])>0;){var n=this.list[t];this.list[t]=this.list[e],this.list[e]=n,e=t,t=this.getParent(e)}},r.prototype.moveDown=function(e){var t,n=e,i=this.getLeft(e),a=this.getRight(e),o=this.list.length;i!==null&&i<o&&this.compareFn(this.list[n],this.list[i])>0?n=i:a!==null&&a<o&&this.compareFn(this.list[n],this.list[a])>0&&(n=a),e!==n&&(t=[this.list[n],this.list[e]],this.list[e]=t[0],this.list[n]=t[1],this.moveDown(n))},r}(),tz=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=a[0],f=new Set;f.add(u);var l=function(g,y){return t?g.weight-y.weight:0},c=new ez(l);for(od(u.id,s).forEach(function(p){c.insert(p)});!c.isEmpty();){var h=c.delMin(),d=h.source,v=h.target;f.has(d)&&f.has(v)||(n.push(h),f.has(d)||(f.add(d),od(d,s).forEach(function(p){c.insert(p)})),f.has(v)||(f.add(v),od(v,s).forEach(function(p){c.insert(p)})))}return n},zx=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=s.map(function(d){return d});t&&u.sort(function(d,v){return d.weight-v.weight});for(var f=new Q6(a.map(function(d){return d.id}));u.length>0;){var l=u.shift(),c=l.source,h=l.target;f.connected(c,h)||(n.push(l),f.union(c,h))}return n},iI=function(e,t,n){var i={prim:tz,kruskal:zx};return n?i[n](e,t):zx(e,t)},aI=function(e,t,n){typeof t!="number"&&(t=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,o=1e3,s=e.nodes,u=s===void 0?[]:s,f=e.edges,l=f===void 0?[]:f,c=u.length,h,d={},v={},p=0;p<c;++p){var g=u[p],y=g.id;d[y]=1/c,v[y]=1/c}for(var m=Ua(e);o>0&&i>t;){a=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;if(h=0,m[g.id].inDegree===0)d[y]=0;else{for(var x=Kn(y,l,"source"),b=0;b<x.length;++b){var w=x[b],E=m[w].outDegree;E>0&&(h+=v[w]/E)}d[y]=n*h,a+=d[y]}}a=(1-a)/c,i=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;h=d[y]+a,i+=Math.abs(h-v[y]),v[y]=h}o-=1}return v},rz=-1,kd=-1,oI="-1",sa="-1",sI=-1,jx=function(){function r(e,t,n,i){e===void 0&&(e=rz),t===void 0&&(t=kd),n===void 0&&(n=kd),i===void 0&&(i=oI),this.id=e,this.from=t,this.to=n,this.label=i}return r}(),nz=function(){function r(e,t){e===void 0&&(e=kd),t===void 0&&(t=sa),this.id=e,this.label=t,this.edges=[],this.edgeMap={}}return r.prototype.addEdge=function(e){this.edges.push(e),this.edgeMap[e.id]=e},r}(),uI=function(){function r(e,t,n){e===void 0&&(e=kd),t===void 0&&(t=!0),n===void 0&&(n=!1),this.id=e,this.edgeIdAutoIncrease=t,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return r.prototype.getNodeNum=function(){return this.nodes.length},r.prototype.addNode=function(e,t){if(!this.nodeMap[e]){var n=new nz(e,t);this.nodes.push(n),this.nodeMap[e]=n,this.nodeLabelMap[t]||(this.nodeLabelMap[t]=[]),this.nodeLabelMap[t].push(e)}},r.prototype.addEdge=function(e,t,n,i){if((this.edgeIdAutoIncrease||e===void 0)&&(e=this.counter++),!(this.nodeMap[t]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[e])){var a=new jx(e,t,n,i);if(this.edges.push(a),this.edgeMap[e]=a,this.nodeMap[t].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var o=new jx(e,n,t,i);this.nodeMap[n].addEdge(o),this.edgeLabelMap[i].push(o)}}},r}(),hs=function(){function r(e,t,n,i,a){this.fromNode=e,this.toNode=t,this.nodeEdgeNodeLabel={nodeLabel1:n||sa,edgeLabel:i||oI,nodeLabel2:a||sa}}return r.prototype.equalTo=function(e){return this.fromNode===e.formNode&&this.toNode===e.toNode&&this.nodeEdgeNodeLabel===e.nodeEdgeNodeLabel},r.prototype.notEqualTo=function(e){return!this.equalTo(e)},r}(),Ux=function(){function r(){this.rmpath=[],this.dfsEdgeList=[]}return r.prototype.equalTo=function(e){var t=this.dfsEdgeList.length,n=e.length;if(t!==n)return!1;for(var i=0;i<t;i++)if(this.dfsEdgeList[i]!==e[i])return!1;return!0},r.prototype.notEqualTo=function(e){return!this.equalTo(e)},r.prototype.pushBack=function(e,t,n,i,a){return this.dfsEdgeList.push(new hs(e,t,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(e,t){e===void 0&&(e=sI),t===void 0&&(t=!1);var n=new uI(e,!0,t);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,o=i.toNode,s=i.nodeEdgeNodeLabel,u=s.nodeLabel1,f=s.edgeLabel,l=s.nodeLabel2;u!==sa&&n.addNode(a,u),l!==sa&&n.addNode(o,l),u!==sa&&l!==u&&n.addEdge(void 0,a,o,f)}),n},r.prototype.buildRmpath=function(){this.rmpath=[];for(var e=void 0,t=this.dfsEdgeList.length,n=t-1;n>=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,o=i.toNode;a<o&&(e===void 0||o===e)&&(this.rmpath.push(n),e=a)}return this.rmpath},r.prototype.getNodeNum=function(){var e={};return this.dfsEdgeList.forEach(function(t){e[t.fromNode]||(e[t.fromNode]=!0),e[t.toNode]||(e[t.toNode]=!0)}),Object.keys(e).length},r}(),Wc=function(){function r(e){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!e){for(;e;){var t=e.edge;this.edges.push(t),this.nodesUsed[t.from]=1,this.nodesUsed[t.to]=1,this.edgesUsed[t.id]=1,e=e.preNode}this.edges=this.edges.reverse()}}return r.prototype.hasNode=function(e){return this.nodesUsed[e.id]===1},r.prototype.hasEdge=function(e){return this.edgesUsed[e.id]===1},r}(),iz=function(){function r(e){var t=e.graphs,n=e.minSupport,i=n===void 0?2:n,a=e.minNodeNum,o=a===void 0?1:a,s=e.maxNodeNum,u=s===void 0?4:s,f=e.top,l=f===void 0?10:f,c=e.directed,h=c===void 0?!1:c,d=e.verbose,v=d===void 0?!1:d;this.graphs=t,this.dfsCode=new Ux,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=l,this.directed=h,this.counter=0,this.maxNodeNum=u,this.minNodeNum=o,this.verbose=v,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return r.prototype.findForwardRootEdges=function(e,t){var n=this,i=[],a=e.nodeMap;return t.edges.forEach(function(o){(n.directed||t.label<=a[o.to].label)&&i.push(o)}),i},r.prototype.findBackwardEdge=function(e,t,n,i){if(!this.directed&&t===n)return null;for(var a=e.nodeMap,o=a[n.to],s=o.edges,u=s.length,f=0;f<u;f++){var l=s[f];if(!(i.hasEdge(l)||l.to!==t.from)){if(this.directed){if(a[t.from].label<a[n.to].label||a[t.from].label===a[n.to].label&&t.label<=l.label)return l}else if(t.label<l.label||t.label===l.label&&a[t.to].label<=a[n.to].label)return l}}return null},r.prototype.findForwardPureEdges=function(e,t,n,i){for(var a=[],o=t.to,s=e.nodeMap[o].edges,u=s.length,f=0;f<u;f++){var l=s[f],c=e.nodeMap[l.to];n<=c.label&&!i.hasNode(c)&&a.push(l)}return a},r.prototype.findForwardRmpathEdges=function(e,t,n,i){for(var a=[],o=e.nodeMap,s=o[t.to].label,u=o[t.from],f=u.edges,l=f.length,c=0;c<l;c++){var h=f[c],d=o[h.to].label;t.to===h.to||n>d||i.hasNode(o[h.to])||(t.label<h.label||t.label===h.label&&s<=d)&&a.push(h)}return a},r.prototype.getSupport=function(e){var t={};return e.forEach(function(n){t[n.graphId]||(t[n.graphId]=!0)}),Object.keys(t).length},r.prototype.findMinLabel=function(e){var t=void 0;return Object.keys(e).forEach(function(n){var i=e[n],a=i.nodeLabel1,o=i.edgeLabel,s=i.nodeLabel2;if(!t){t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s};return}(a<t.nodeLabel1||a===t.nodeLabel1&&o<t.edgeLabel||a===t.nodeLabel1&&o===t.edgeLabel&&s<t.nodeLabel2)&&(t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s})}),t},r.prototype.isMin=function(){var e=this,t=this.dfsCode;if(this.verbose&&console.log("isMin checking",t),t.dfsEdgeList.length===1)return!0;var n=this.directed,i=t.toGraph(sI,n),a=i.nodeMap,o=new Ux,s={};i.nodes.forEach(function(c){var h=e.findForwardRootEdges(i,c);h.forEach(function(d){var v=a[d.to],p="".concat(c.label,"-").concat(d.label,"-").concat(v.label);s[p]||(s[p]={projected:[],nodeLabel1:c.label,edgeLabel:d.label,nodeLabel2:v.label});var g={graphId:i.id,edge:d,preNode:null};s[p].projected.push(g)})});var u=this.findMinLabel(s);if(u){o.dfsEdgeList.push(new hs(0,1,u.nodeLabel1,u.edgeLabel,u.nodeLabel2));var f=function c(h){for(var d=o.buildRmpath(),v=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,p=o.dfsEdgeList[d[0]].toNode,g={},y=!1,m=0,x=n?-1:0,b=function(B){if(y)return"break";h.forEach(function(W){var D=new Wc(W),P=e.findBackwardEdge(i,D.edges[d[B]],D.edges[d[0]],D);P&&(g[P.label]||(g[P.label]={projected:[],edgeLabel:P.label}),g[P.label].projected.push({graphId:i.id,edge:g,preNode:W}),m=o.dfsEdgeList[d[B]].fromNode,y=!0)})},w=d.length-1;w>x;w--){var E=b(w);if(E==="break")break}if(y){var S=e.findMinLabel(g);o.dfsEdgeList.push(new hs(p,m,sa,S.edgeLabel,sa));var _=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[_]!==o.dfsEdgeList[_]?!1:c(g[S.edgeLabel].projected)}var C={};y=!1;var M=0;h.forEach(function(O){var B=new Wc(O),W=e.findForwardPureEdges(i,B.edges[d[0]],v,B);W.length>0&&(y=!0,M=p,W.forEach(function(D){var P="".concat(D.label,"-").concat(a[D.to].label);C[P]||(C[P]={projected:[],edgeLabel:D.label,nodeLabel2:a[D.to].label}),C[P].projected.push({graphId:i.id,edge:D,preNode:O})}))});for(var A=d.length,T=function(B){if(y)return"break";var W=d[B];h.forEach(function(D){var P=new Wc(D),R=e.findForwardRmpathEdges(i,P.edges[W],v,P);R.length>0&&(y=!0,M=o.dfsEdgeList[W].fromNode,R.forEach(function(X){var Y="".concat(X.label,"-").concat(a[X.to].label);C[Y]||(C[Y]={projected:[],edgeLabel:X.label,nodeLabel2:a[X.to].label}),C[Y].projected.push({graphId:i.id,edge:X,preNode:D})}))})},w=0;w<A;w++){var I=T(w);if(I==="break")break}if(!y)return!0;var L=e.findMinLabel(C);o.dfsEdgeList.push(new hs(M,p+1,sa,L.edgeLabel,L.nodeLabel2));var N=o.dfsEdgeList.length-1;return t.dfsEdgeList[N]!==o.dfsEdgeList[N]?!1:c(C["".concat(L.edgeLabel,"-").concat(L.nodeLabel2)].projected)},l="".concat(u.nodeLabel1,"-").concat(u.edgeLabel,"-").concat(u.nodeLabel2);return f(s[l].projected)}},r.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var e=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(Jt(e))}},r.prototype.subGraphMining=function(e){var t=this,n=this.getSupport(e);if(!(n<this.minSupport)&&this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),o=this.dfsCode.dfsEdgeList[a[0]].toNode,s=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,u={},f={};e.forEach(function(l){for(var c=t.graphs[l.graphId],h=c.nodeMap,d=new Wc(l),v=a.length-1;v>=0;v--){var p=t.findBackwardEdge(c,d.edges[a[v]],d.edges[a[0]],d);if(p){var g="".concat(t.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(p.label);f[g]||(f[g]={projected:[],toNodeId:t.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:p.label}),f[g].projected.push({graphId:l.graphId,edge:p,preNode:l})}}if(!(i>=t.maxNodeNum)){var y=t.findForwardPureEdges(c,d.edges[a[0]],s,d);y.forEach(function(x){var b="".concat(o,"-").concat(x.label,"-").concat(h[x.to].label);u[b]||(u[b]={projected:[],fromNodeId:o,edgeLabel:x.label,nodeLabel2:h[x.to].label}),u[b].projected.push({graphId:l.graphId,edge:x,preNode:l})});for(var m=function(b){var w=t.findForwardRmpathEdges(c,d.edges[a[b]],s,d);w.forEach(function(E){var S="".concat(t.dfsCode.dfsEdgeList[a[b]].fromNode,"-").concat(E.label,"-").concat(h[E.to].label);u[S]||(u[S]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[b]].fromNode,edgeLabel:E.label,nodeLabel2:h[E.to].label}),u[S].projected.push({graphId:l.graphId,edge:E,preNode:l})})},v=0;v<a.length;v++)m(v)}}),Object.keys(f).forEach(function(l){var c=f[l],h=c.toNodeId,d=c.edgeLabel;t.dfsCode.dfsEdgeList.push(new hs(o,h,"-1",d,"-1")),t.subGraphMining(f[l].projected),t.dfsCode.dfsEdgeList.pop()}),Object.keys(u).forEach(function(l){var c=u[l],h=c.fromNodeId,d=c.edgeLabel,v=c.nodeLabel2;t.dfsCode.dfsEdgeList.push(new hs(h,o+1,sa,d,v)),t.subGraphMining(u[l].projected),t.dfsCode.dfsEdgeList.pop()})}},r.prototype.generate1EdgeFrequentSubGraphs=function(){var e=this.graphs,t=this.directed,n=this.minSupport,i=this.frequentSize1Subgraphs,a={},o={},s={};return Object.keys(e).forEach(function(u){var f=e[u],l=f.nodeMap;f.nodes.forEach(function(c,h){var d=c.label,v="".concat(u,"-").concat(d);if(!s[v]){var p=a[d]||0;p++,a[d]=p}s[v]={graphKey:u,label:d},c.edges.forEach(function(g){var y=d,m=l[g.to].label;if(!t&&y>m){var x=m;m=y,y=x}var b=g.label,w="".concat(y,"-").concat(b,"-").concat(m);if(!o[w]){var E=o[w]||0;E++,o[w]=E}})})}),Object.keys(a).forEach(function(u){var f=a[u];if(!(f<n)){var l={nodes:[],edges:[]};l.nodes.push({id:"0",label:u}),i.push(l)}}),i},r.prototype.run=function(){var e=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var t=this.graphs;this.directed;var n={};Object.keys(t).forEach(function(i){var a=t[i],o=a.nodeMap;a.nodes.forEach(function(s){var u=e.findForwardRootEdges(a,s);u.forEach(function(f){var l=o[f.to],c="".concat(s.label,"-").concat(f.label,"-").concat(l.label);n[c]||(n[c]={projected:[],nodeLabel1:s.label,edgeLabel:f.label,nodeLabel2:l.label});var h={graphId:i,edge:f,preNode:null};n[c].projected.push(h)})})}),Object.keys(n).forEach(function(i){var a=n[i],o=a.projected,s=a.nodeLabel1,u=a.edgeLabel,f=a.nodeLabel2;e.dfsCode.dfsEdgeList.push(new hs(0,1,s,u,f)),e.subGraphMining(o),e.dfsCode.dfsEdgeList.pop()})}},r}(),az=function(e,t,n,i){var a={};return Object.keys(e).forEach(function(o,s){var u=e[o],f=new uI(s,!0,t),l={};u.nodes.forEach(function(c,h){f.addNode(h,c[n]),l[c.id]=h}),u.edges.forEach(function(c,h){var d=l[c.source],v=l[c.target];f.addEdge(-1,d,v,c[i])}),f&&f.getNodeNum()&&(a[f.id]=f)}),a},oz=function(e,t,n){var i=[];return e.forEach(function(a){var o={nodes:[],edges:[]};a.nodes.forEach(function(s){var u;o.nodes.push((u={id:"".concat(s.id)},u[t]=s.label,u))}),a.edges.forEach(function(s){var u;o.edges.push((u={source:"".concat(s.from),target:"".concat(s.to)},u[n]=s.label,u))}),i.push(o)}),i},$x="cluster",sz=function(e){var t=e.graphs,n=e.directed,i=n===void 0?!1:n,a=e.nodeLabelProp,o=a===void 0?$x:a,s=e.edgeLabelProp,u=s===void 0?$x:s,f=az(t,i,o,u),l=e.minSupport,c=e.maxNodeNum,h=e.minNodeNum,d=e.verbose,v=e.top,p={graphs:f,minSupport:l,maxNodeNum:c,minNodeNum:h,top:v,verbose:d,directed:i},g=new iz(p);g.run();var y=oz(g.frequentSubgraphs,o,u);return y},Xx=function(e,t,n,i){n===void 0&&(n="cluster"),i===void 0&&(i=2);var a=[],o=e.nodes;return t.forEach(function(s,u){a.push(fI(o,s,u,n,i))}),a},fI=function(e,t,n,i,a){var o=[n],s=[],u={};return t.forEach(function(f,l){if(f<=a&&n!==l){o.push(l),s.push(e[l]);var c=e[l][i];u[c]?(u[c].count++,u[c].dists.push(f)):u[c]={count:1,dists:[f]}}}),Object.keys(u).forEach(function(f){u[f].dists=u[f].dists.sort(function(l,c){return l-c})}),{nodeIdx:n,nodeId:e[n].id,nodeIdxs:o,neighbors:s,neighborNum:o.length-1,nodeLabelCountMap:u}},uz=function(e,t,n,i,a){var o=Math.ceil(n/t),s={},u=0;return i.forEach(function(f,l){for(var c=0,h=0,d=f.nodeIdxs,v=f.neighborNum-1;c<o;){for(var p=d[1+Math.floor(Math.random()*v)],g=0;(s["".concat(l,"-").concat(p)]||s["".concat(p,"-").concat(l)])&&(p=Math.floor(Math.random()*t),g++,!(g>2*t)););if(g<2*t&&(s["".concat(l,"-").concat(p)]={start:l,end:p,distance:a[l][p]},c++,u++,u>=n))return s;if(h++,h>2*t)break}if(c<o){var y=o-c;o=(o+y)/(t-l-1)}}),s},sd=function(e,t,n,i){var a=n.nodes;return i||(i={}),Object.keys(e).forEach(function(o){var s,u;if(!(i&&i[o])){i[o]={nodes:[],edges:[]};var f=e[o],l=(s=t[f.start])===null||s===void 0?void 0:s.nodeIdxs,c=(u=t[f.end])===null||u===void 0?void 0:u.nodeIdxs;if(!(!l||!c)){var h=new Set(c),d=l.filter(function(m){return h.has(m)});if(!(!d||!d.length)){for(var v={},p=d.length,g=0;g<p;g++){var y=a[d[g]];i[o].nodes.push(y),v[y.id]=!0}n.edges.forEach(function(m){v[m.source]&&v[m.target]&&i[o].edges.push(m)})}}}}),i},ud=function(e,t,n,i){var a,o,s={};e.nodes.forEach(function(f){s[f.id]=f});var u=0;return!(!((a=t==null?void 0:t.edges)===null||a===void 0)&&a.length)||((o=t==null?void 0:t.nodes)===null||o===void 0?void 0:o.length)<2?0:(e.edges.forEach(function(f){var l=s[f.source][n],c=s[f.target][n],h=t==null?void 0:t.nodes[0][n],d=t==null?void 0:t.nodes[1][n],v=t==null?void 0:t.edges[0][i];f[i]===v&&(l===h&&c===d||l===d&&c===h)&&u++}),u)},fz=function(e,t,n){for(var i=1/0,a=0,o=function(f){var l=e[f],c=Object.keys(l).sort(function(m,x){return l[m]-l[x]}),h=10,d=[];c.forEach(function(m,x){d[x%h]||(d[x%h]={graphs:[],totalCount:0,aveCount:0}),d[x%h].graphs.push(m),d[x%h].totalCount+=l[m]});var v=0,p=[];d.forEach(function(m){var x=m.totalCount/m.graphs.length;m.aveCount=x,p.push(x);var b=0,w=m.length;m.graphs.forEach(function(E,S){var _=l[E];m.graphs.forEach(function(C,M){S!==M&&(b+=Math.abs(_-l[C]))})}),b/=w*(w-1)/2,v+=b}),v/=d.length;var g=0;p.forEach(function(m,x){p.forEach(function(b,w){x!==w&&(g+=Math.abs(m-b))}),g/=p.length*(p.length-1)/2});var y=g-v;i<y&&(i=y,a=f)},s=0;s<t;s++)o(s);return{structure:n[a],structureCountMap:e[a]}},Yx=function(e,t){var n={},i={};return e.forEach(function(a,o){n[a.id]={idx:o,node:a,degree:0,inDegree:0,outDegree:0};var s=a[t];i[s]||(i[s]=[]),i[s].push(a)}),{nodeMap:n,nodeLabelMap:i}},Wx=function(e,t,n){var i={},a={};return e.forEach(function(o,s){i["".concat($T)]={idx:s,edge:o};var u=o[t];a[u]||(a[u]=[]),a[u].push(o);var f=n[o.source];f&&(f.degree++,f.outDegree++);var l=n[o.target];l&&(l.degree++,l.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},qx=function(e,t,n){var i=t.length,a={};return t.forEach(function(o,s){for(var u=n?0:s+1,f=e[s].id,l=u;l<i;l++)if(s!==l){var c=e[l].id,h=o[l];a["".concat(f,"-").concat(c)]=h,n||(a["".concat(c,"-").concat(f)]=h)}}),a},lz=function(e,t,n,i,a,o,s,u,f,l,c){var h,d="".concat(t.id,"-").concat(n.id);if(l&&l[d])return l[d];var v=c?c[d]:void 0;if(!v){var p=(h={},h[d]={start:i[t.id].idx,end:i[n.id].idx,distance:a},h);c=sd(p,o,e,c),v=c[d]}return ud(v,s,u,f)},Vx=function(e,t,n,i){var a,o,s,u=(a=e[t])===null||a===void 0?void 0:a.degree,f=(o=e[t])===null||o===void 0?void 0:o.inDegree,l=(s=e[t])===null||s===void 0?void 0:s.outDegree;return e[t]===void 0&&(u=1/0,f=1/0,l=1/0,i[t].forEach(function(c){var h=n[c.id].degree;u>h&&(u=h);var d=n[c.id].inDegree;f>d&&(f=d);var v=n[c.id].outDegree;l>v&&(l=v)}),e[t]={degree:u,inDegree:f,outDegree:l}),{minPatternNodeLabelDegree:u,minPatternNodeLabelInDegree:f,minPatternNodeLabelOutDegree:l}},lI=function(e,t,n,i,a,o,s){var u;if(n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!e||!e.nodes)){var f=e.nodes.length;if(f){var l=kl(e,n),c=kl(t,n),h=qx(e.nodes,l,n),d=qx(t.nodes,c,n),v=Yx(e.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,y=Yx(t.nodes,o),m=y.nodeMap,x=y.nodeLabelMap;Wx(e.edges,s,p);var b=Wx(t.edges,s,m).edgeLabelMap,w=[];c==null||c.forEach(function(pt){w=w.concat(pt)}),a||(a=Math.max.apply(Math,Qn(Qn([],w,!1),[2],!1))),i||(i=a);var E=Xx(e,l,o,i),S=Xx(t,c,o,i),_=Math.min(100,f*(f-1)/2),C=uz(i,f,_,E,l),M=sd(C,E,e),A=10,T=1,I=1,L=4,N={graphs:M,nodeLabelProp:o,edgeLabelProp:s,minSupport:T,minNodeNum:I,maxNodeNum:L,directed:n},O=sz(N).slice(0,A),B=O.length,W=[];O.forEach(function(pt,Nt){W[Nt]={},Object.keys(M).forEach(function(F){var zt=M[F],Ot=ud(zt,pt,o,s);W[Nt][F]=Ot})});var D=fz(W,B,O),P=D.structure,R=D.structureCountMap,X=t.nodes[0],Y=[],ee=(u=t.nodes[0])===null||u===void 0?void 0:u[o],U=-1/0;t.nodes.forEach(function(pt){var Nt=pt[o],F=g[Nt];(F==null?void 0:F.length)>U&&(U=F.length,Y=F,ee=Nt,X=pt)});var Z={},K={},se={},re={},J={},me={};Object.keys(x).forEach(function(pt,Nt){J[pt]=[],n&&(me[pt]=[]);var F=x[pt],zt={};F.forEach(function(ct){var ve=d["".concat(X.id,"-").concat(ct.id)];if(ve&&J[pt].push(ve),zt["".concat(X.id,"-").concat(ct.id)]={start:0,end:m[ct.id].idx,distance:ve},n){var Te=d["".concat(ct.id,"-").concat(X.id)];Te&&me[pt].push(Te)}}),J[pt]=J[pt].sort(function(ct,ve){return ct-ve}),n&&(me[pt]=me[pt].sort(function(ct,ve){return ct-ve})),K=sd(zt,S,t,K);var Ot=[];if(Object.keys(zt).forEach(function(ct){if(se[ct]){Ot.push(se[ct]);return}var ve=K[ct];se[ct]=ud(ve,P,o,s),Ot.push(se[ct])}),Ot=Ot.sort(function(ct,ve){return ve-ct}),re["".concat(X.id,"-").concat(pt)]=Ot,pt!==ee)for(var ut=(Y==null?void 0:Y.length)||0,Gt=function(ve){var Te=Y[ve],nt=E[p[Te.id].idx],st=nt.nodeLabelCountMap[pt],gt=x[pt].length;if(!st||st.count<gt)return Y.splice(ve,1),"continue";for(var Ct=!1,Bt=0;Bt<gt;Bt++)if(st.dists[Bt]>J[pt][Bt]){Ct=!0;break}if(Ct)return Y.splice(ve,1),"continue";var Sr={};nt.neighbors.forEach(function(wt){var er=h["".concat(Te.id,"-").concat(wt.id)];Sr["".concat(Te.id,"-").concat(wt.id)]={start:p[Te.id].idx,end:p[wt.id].idx,distance:er}}),M=sd(Sr,E,e,M);var yr=[];Object.keys(Sr).forEach(function(wt){if(R[wt]){yr.push(R[wt]);return}var er=M[wt];R[wt]=ud(er,P,o,s),yr.push(R[wt])}),yr=yr.sort(function(wt,er){return er-wt});for(var Rr=!1,Bt=0;Bt<gt;Bt++)if(yr[Bt]<Ot[Bt]){Rr=!0;break}if(Rr)return Y.splice(ve,1),"continue"},_t=ut-1;_t>=0;_t--)Gt(_t)});var Ae=[];Y==null||Y.forEach(function(pt){for(var Nt=p[pt.id].idx,F=fI(e.nodes,l[Nt],Nt,o,a),zt=F.neighbors,Ot=zt.length,ut=!1,Gt=Ot-1;Gt>=0;Gt--){if(zt.length+1<t.nodes.length){ut=!0;return}var _t=zt[Gt],ct=_t[o];if(!x[ct]||!x[ct].length){zt.splice(Gt,1);continue}if(!J[ct]||!J[ct].length){zt.splice(Gt,1);continue}var ve="".concat(pt.id,"-").concat(_t.id),Te=h[ve],nt=J[ct].length-1,st=J[ct][nt];if(Te>st){zt.splice(Gt,1);continue}if(n){var gt="".concat(_t.id,"-").concat(pt.id),Ct=h[gt];nt=me[ct].length-1;var Bt=me[ct][nt];if(Ct>Bt){zt.splice(Gt,1);continue}}var Sr=R[ve]?R[ve]:lz(e,pt,_t,p,Te,E,P,o,s,R,M),yr="".concat(X.id,"-").concat(ct),Rr=re[yr][re[yr].length-1];if(Sr<Rr){zt.splice(Gt,1);continue}var wt=Vx(Z,ct,m,x),er=wt.minPatternNodeLabelDegree;if(wt.minPatternNodeLabelInDegree,wt.minPatternNodeLabelOutDegree,p[_t.id].degree<er){zt.splice(Gt,1);continue}}ut||Ae.push({nodes:[pt].concat(zt)})});var Ye=Il(t,X.id,!1).length,Ve={};n?(Object.keys(Ye).forEach(function(pt){var Nt=m[pt].node[o];Ve[Nt]?Ve[Nt].push(Ye[pt]):Ve[Nt]=[Ye[pt]]}),Object.keys(Ve).forEach(function(pt){Ve[pt].sort(function(Nt,F){return Nt-F})})):Ve=J;for(var Ke=Ae.length,xt=function(Nt){var F=Ae[Nt],zt=F.nodes[0],Ot={},ut={};F.nodes.forEach(function(sr,Er){ut[sr.id]={idx:Er,node:sr,degree:0,inDegree:0,outDegree:0};var jt=sr[o];Ot[jt]?Ot[jt]++:Ot[jt]=1});var Gt=[],_t={};e.edges.forEach(function(sr){ut[sr.source]&&ut[sr.target]&&(Gt.push(sr),_t[sr[s]]?_t[sr[s]]++:_t[sr[s]]=1,ut[sr.source].degree++,ut[sr.target].degree++,ut[sr.source].outDegree++,ut[sr.target].inDegree++)});for(var ct=Object.keys(b).length,ve=!1,Te=0;Te<ct;Te++){var nt=Object.keys(b)[Te];if(!_t[nt]||_t[nt]<b[nt].length){ve=!0;break}}if(ve)return Ae.splice(Nt,1),"continue";var st=Gt.length;if(st<t.edges.length)return Ae.splice(Nt,1),"break";for(var gt=!1,Ct=function(Er){var jt=Gt[Er],_r=jt[s],an=b[_r];if(!an||!an.length)return _t[_r]--,an&&_t[_r]<an.length?(gt=!0,"break"):(Gt.splice(Er,1),ut[jt.source].degree--,ut[jt.target].degree--,ut[jt.source].outDegree--,ut[jt.target].inDegree--,"continue");var xa=ut[jt.source].node[o],Xn=ut[jt.target].node[o],Ha=!1;if(an.forEach(function(js){var Us=m[js.source].node,$s=m[js.target].node;Us[o]===xa&&$s[o]===Xn&&(Ha=!0),!n&&Us[o]===Xn&&$s[o]===xa&&(Ha=!0)}),!Ha)return _t[_r]--,an&&_t[_r]<an.length?(gt=!0,"break"):(Gt.splice(Er,1),ut[jt.source].degree--,ut[jt.target].degree--,ut[jt.source].outDegree--,ut[jt.target].inDegree--,"continue")},Te=st-1;Te>=0;Te--){var Bt=Ct(Te);if(Bt==="break")break}if(gt)return Ae.splice(Nt,1),"continue";F.edges=Gt;var Sr=Il(F,F.nodes[0].id,!1).length;if(Object.keys(Sr).reverse().forEach(function(sr){if(!(sr===F.nodes[0].id||gt)){if(Sr[sr]===1/0){var Er=ut[sr].node[o];if(Ot[Er]--,Ot[Er]<x[Er].length){gt=!0;return}var jt=F.nodes.indexOf(ut[sr].node);F.nodes.splice(jt,1),ut[sr]=void 0;return}var _r=p[sr].node[o];if(!Ve[_r]||!Ve[_r].length||Sr[sr]>Ve[_r][Ve[_r].length-1]){var Er=ut[sr].node[o];if(Ot[Er]--,Ot[Er]<x[Er].length){gt=!0;return}var jt=F.nodes.indexOf(ut[sr].node);F.nodes.splice(jt,1),ut[sr]=void 0}}}),gt)return Ae.splice(Nt,1),"continue";for(var yr=!0,Rr=0;yr&&!gt;){yr=!1;var wt=n?ut[zt.id].degree<m[X.id].degree||ut[zt.id].inDegree<m[X.id].inDegree||ut[zt.id].outDegree<m[X.id].outDegree:ut[zt.id].degree<m[X.id].degree;if(wt){gt=!0;break}if(Ot[zt[o]]<x[zt[o]].length){gt=!0;break}for(var er=F.nodes.length,ir=er-1;ir>=0;ir--){var Yt=F.nodes[ir],br=ut[Yt.id].degree,It=ut[Yt.id].inDegree,wr=ut[Yt.id].outDegree,Ht=Yt[o],fr=Vx(Z,Ht,m,x),mr=fr.minPatternNodeLabelDegree,Lr=fr.minPatternNodeLabelInDegree,Vr=fr.minPatternNodeLabelOutDegree,cn=n?br<mr||It<Lr||wr<Vr:br<mr;if(cn){if(Ot[Yt[o]]--,Ot[Yt[o]]<x[Yt[o]].length){gt=!0;break}F.nodes.splice(ir,1),ut[Yt.id]=void 0,yr=!0}}if(gt||!yr&&Rr!==0)break;st=Gt.length;for(var Mr=st-1;Mr>=0;Mr--){var hn=Gt[Mr];if(!ut[hn.source]||!ut[hn.target]){Gt.splice(Mr,1);var rn=hn[s];if(_t[rn]--,ut[hn.source]&&(ut[hn.source].degree--,ut[hn.source].outDegree--),ut[hn.target]&&(ut[hn.target].degree--,ut[hn.target].inDegree--),b[rn]&&_t[rn]<b[rn].length){gt=!0;break}yr=!0}}Rr++}if(gt||gt||F.nodes.length<t.nodes.length||Gt.length<t.edges.length)return Ae.splice(Nt,1),"continue"},kt=Ke-1;kt>=0;kt--){var Lt=xt(kt);if(Lt==="break")break}for(var vr=Ae.length,xr=function(Nt){var F=Ae[Nt],zt={};F.edges.forEach(function(Gt){var _t="".concat(Gt.source,"-").concat(Gt.target,"-").concat(Gt.label);zt[_t]?zt[_t]++:zt[_t]=1});for(var Ot=function(_t){var ct=Ae[_t],ve={};ct.edges.forEach(function(nt){var st="".concat(nt.source,"-").concat(nt.target,"-").concat(nt.label);ve[st]?ve[st]++:ve[st]=1});var Te=!0;Object.keys(ve).length!==Object.keys(zt).length?Te=!1:Object.keys(zt).forEach(function(nt){ve[nt]!==zt[nt]&&(Te=!1)}),Te&&Ae.splice(_t,1)},ut=vr-1;ut>Nt;ut--)Ot(ut);vr=Ae.length},kt=0;kt<=vr-1;kt++)xr(kt);return Ae}}},Iu=function(){function r(e){e===void 0&&(e=10),this.linkedList=new UT,this.maxStep=e}return Object.defineProperty(r.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},r.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},r.prototype.push=function(e){this.linkedList.prepend(e),this.length>this.maxStep&&this.linkedList.deleteTail()},r.prototype.pop=function(){var e=this.linkedList.deleteHead();return e?e.value:null},r.prototype.toArray=function(){return this.linkedList.toArray().map(function(e){return e.value})},r.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},r}(),cI=Lm;const cz={getAdjMatrix:Ts,breadthFirstSearch:XT,connectedComponent:Im,getDegree:Ua,getInDegree:WT,getOutDegree:qT,detectCycle:Lm,detectDirectedCycle:cI,detectAllCycles:HT,detectAllDirectedCycle:Om,detectAllUndirectedCycle:Nm,depthFirstSearch:km,dijkstra:Il,findAllPath:QT,findShortestPath:KT,floydWarshall:kl,labelPropagation:JT,louvain:Rm,iLouvain:eI,kCore:tI,kMeans:rI,cosineSimilarity:Bm,nodesCosineSimilarity:nI,minimumSpanningTree:iI,pageRank:aI,getNeighbors:Kn,Stack:Iu,GADDI:lI},hz=Object.freeze(Object.defineProperty({__proto__:null,GADDI:lI,Stack:Iu,breadthFirstSearch:XT,connectedComponent:Im,cosineSimilarity:Bm,default:cz,depthFirstSearch:km,detectAllCycles:HT,detectAllDirectedCycle:Om,detectAllUndirectedCycle:Nm,detectCycle:Lm,detectDirectedCycle:cI,dijkstra:Il,findAllPath:QT,findShortestPath:KT,floydWarshall:kl,getAdjMatrix:Ts,getDegree:Ua,getInDegree:WT,getNeighbors:Kn,getOutDegree:qT,iLouvain:eI,kCore:tI,kMeans:rI,labelPropagation:JT,louvain:Rm,minimumSpanningTree:iI,nodesCosineSimilarity:nI,pageRank:aI},Symbol.toStringTag,{value:"Module"}));var Ld=vi,dz=function(e){return function(t,n){return t[e]-n[e]}},Hx=function(e,t,n){return e>=t&&e<=n},Ev=function(e,t,n,i){var a=1e-4,o={x:n.x-e.x,y:n.y-e.y},s={x:t.x-e.x,y:t.y-e.y},u={x:i.x-n.x,y:i.y-n.y},f=s.x*u.y-s.y*u.x,l=f*f,c=1/f,h=s.x*s.x+s.y*s.y,d=u.x*u.x+u.y*u.y;if(l>a*h*d){var v=(o.x*u.y-o.y*u.x)*c,p=(o.x*s.y-o.y*s.x)*c;return!Hx(v,0,1)||!Hx(p,0,1)?null:{x:e.x+v*s.x,y:e.y+v*s.y}}return null},hI=function(e,t){var n=e.x,i=e.y,a=e.width,o=e.height,s=n+a/2,u=i+o/2,f=[],l={x:s,y:u};f.push({x:n,y:i}),f.push({x:n+a,y:i}),f.push({x:n+a,y:i+o}),f.push({x:n,y:i+o}),f.push({x:n,y:i});for(var c=null,h=1;h<f.length&&(c=Ev(f[h-1],f[h],l,t),!c);h++);return c},dI=function(e,t){var n=e.x,i=e.y,a=e.r,o=t.x,s=t.y,u=o-n,f=s-i;if(u*u+f*f<a*a)return null;var l=Math.atan(f/u);return{x:n+Math.abs(a*Math.cos(l))*Math.sign(u),y:i+Math.abs(a*Math.sin(l))*Math.sign(f)}},vI=function(e,t){var n=e.rx,i=e.ry,a=e.x,o=e.y,s=t.x-a,u=t.y-o,f=Math.atan2(u/i,s/n);return f<0&&(f+=2*Math.PI),{x:a+n*Math.cos(f),y:o+i*Math.sin(f)}},Nu=function(e,t,n){n===void 0&&(n=1);var i=[e.x,e.y,n];return(!t||isNaN(t[0]))&&(t=[1,0,0,0,1,0,0,0,1]),xv(i,i,t),{x:i[0],y:i[1]}},pI=function(e,t,n){n===void 0&&(n=1),(!t||isNaN(t[0]))&&(t=[1,0,0,0,1,0,0,0,1]);var i=vm([1,0,0,0,1,0,0,0,1],t);i||(i=[1,0,0,0,1,0,0,0,1]);var a=[e.x,e.y,n];return xv(a,a,i),{x:a[0],y:a[1]}},F0=function(e,t,n){var i=e.x-t.x,a=e.y-t.y,o=e.x-n.x,s=e.y-n.y,u=(e.x*e.x-t.x*t.x-t.y*t.y+e.y*e.y)/2,f=(e.x*e.x-n.x*n.x-n.y*n.y+e.y*e.y)/2,l=a*o-i*s;return{x:-(s*u-a*f)/l,y:-(i*f-o*u)/l}},Nd=function(e,t){var n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)},vz=function(e,t){var n=[];return e.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*t)}),n.push(a)}),n},pz=function(e){for(var t=[],n=e.length,i=0;i<n;i+=1){t[i]=[];for(var a=0;a<n;a+=1)i===a?t[i][a]=0:e[i][a]===0||!e[i][a]?t[i][a]=1/0:t[i][a]=e[i][a]}for(var o=0;o<n;o+=1)for(var i=0;i<n;i+=1)for(var a=0;a<n;a+=1)t[i][a]>t[i][o]+t[o][a]&&(t[i][a]=t[i][o]+t[o][a]);return t},gz=function(e,t){var n=e.nodes,i=e.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var f=[];a.push(f)}),i&&i.forEach(function(s){var u=s.source,f=s.target,l=o[u],c=o[f];a[l][c]=1,t||(a[c][l]=1)}),a},gI=function(e,t){e.translate(t.x,t.y)},G0=function(e,t,n,i){i===void 0&&(i={duration:500});var a=e.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var o=e.getCanvasBBox(),s=t.x-o.minX,u=t.y-o.minY;if(n){var f=s*a[0],l=u*a[4],c=0,h=0,d=0,v=0;e.animate(function(g){return d=f*g,v=l*g,a=Ld(a,[["t",d-c,v-h]]),c=d,h=v,{matrix:a}},i)}else{var p=Ld(a,[["t",s,u]]);e.setMatrix(p)}},yz=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var i=t;mt(t)||(i=[t,t]),mt(t)&&t.length===1&&(i=[t[0],t[0]]),n=Ld(n,[["s",i[0],i[1]]]),e.setMatrix(n)},mz=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=Ld(n,[["r",t]]),e.setMatrix(n)},bz=function(e,t,n){for(var i=[],a=0;a<e;a++)i[a]=0;return n.forEach(function(o){o.source&&(i[t[o.source]]+=1),o.target&&(i[t[o.target]]+=1)}),i};function xz(r,e,t){return(t[0]-r[0])*(e[1]-r[1])===(e[0]-r[0])*(t[1]-r[1])&&Math.min(r[0],e[0])<=t[0]&&t[0]<=Math.max(r[0],e[0])&&Math.min(r[1],e[1])<=t[1]&&t[1]<=Math.max(r[1],e[1])}var Ll=function(e,t,n){var i=!1,a=e.length,o=1e-6;function s(c){return Math.abs(c)<o?0:c<0?-1:1}if(a<=2)return!1;for(var u=0;u<a;u++){var f=e[u],l=e[(u+1)%a];if(xz(f,l,[t,n]))return!0;s(f[1]-n)>0!=s(l[1]-n)>0&&s(t-(n-f[1])*(f[0]-l[0])/(f[1]-l[1])-f[0])<0&&(i=!i)}return i},yI=function(e,t){return!(t.minX>e.maxX||t.maxX<e.minX||t.minY>e.maxY||t.maxY<e.minY)},wz=function(e,t){var n=!1;return _e(e,function(i){if(Ev(i.from,i.to,t.from,t.to))return n=!0,!1}),n},mI=function(e,t){var n=function(h){var d=h.map(function(p){return p[0]}),v=h.map(function(p){return p[1]});return{minX:Math.min.apply(null,d),maxX:Math.max.apply(null,d),minY:Math.min.apply(null,v),maxY:Math.max.apply(null,v)}},i=function(h){for(var d=[],v=h.length,p=0;p<v-1;p++){var g=h[p],y=h[p+1];d.push({from:{x:g[0],y:g[1]},to:{x:y[0],y:y[1]}})}if(d.length>1){var m=h[0],x=h[v-1];d.push({from:{x:x[0],y:x[1]},to:{x:m[0],y:m[1]}})}return d};if(e.length<2||t.length<2)return!1;var a=n(e),o=n(t);if(!yI(a,o))return!1;var s=!1;if(_e(t,function(c){if(Ll(e,c[0],c[1]))return s=!0,!1}),s||(_e(e,function(c){if(Ll(t,c[0],c[1]))return s=!0,!1}),s))return!0;var u=i(e),f=i(t),l=!1;return _e(f,function(c){if(wz(u,c))return l=!0,!1}),l},Is=function(){function r(e,t,n,i){this.x1=e,this.y1=t,this.x2=n,this.y2=i}return r.prototype.getBBox=function(){var e=Math.min(this.x1,this.x2),t=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),i=Math.max(this.y1,this.y2),a={x:e,y:t,minX:e,minY:t,maxX:n,maxY:i,width:n-e,height:i-t};return a},r}(),Fm=function(e,t){var n={top:[e.minX,e.minY,e.maxX,e.minY],left:[e.minX,e.minY,e.minX,e.maxY],bottom:[e.minX,e.maxY,e.maxX,e.maxY],right:[e.maxX,e.minY,e.maxX,e.maxY]};return n[t]},Ez=function(e,t){var n=(t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1),i=(e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1),a=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(a){var o=n/a,s=i/a;if(o>=0&&o<=1&&s>=0&&s<=1)return o}return Number.POSITIVE_INFINITY},bI=function(e,t){for(var n=["top","left","bottom","right"],i=e.getBBox(),a=0,o=[],s=0;s<4;s++){var u=Fm(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3];o[s]=Ev({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},{x:f,y:l},{x:c,y:h}),o[s]&&(a+=1)}return[o,a]},Gm=function(e,t){for(var n=["top","left","bottom","right"],i=e.getBBox(),a=Number.POSITIVE_INFINITY,o=0,s=0;s<4;s++){var u=Fm(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3],d=Ez(t,new Is(f,l,c,h));d=Math.abs(d-.5),d>=0&&d<=1&&(o+=1,a=d<a?d:a)}return o===0?-1:a},xI=function(e){var t=0,n=0;if(e.length>0){for(var i=0,a=e;i<a.length;i++){var o=a[i];t+=o.x,n+=o.y}t/=e.length,n/=e.length}return{x:t,y:n}},Od=function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)},wI=function(e,t){var n=t.x1,i=t.y1,a=t.x2-n,o=t.y2-i,s=e.x-n,u=e.y-i,f=s*a+u*o,l;f<=0?l=0:(s=a-s,u=o-u,f=s*a+u*o,f<=0?l=0:l=f*f/(a*a+o*o));var c=s*s+u*u-l;return c<0&&(c=0),c},z0=function(e,t,n){return n===void 0&&(n=.001),Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<Math.pow(n,2)},EI=function(e,t){var n=e.x<t.x,i=e.x>t.x+t.width,a=e.y>t.y+t.height,o=e.y<t.y,s=n||i||a||o;if(!s)return 0;if(a&&!n&&!i)return Math.pow(t.y+t.height-e.y,2);if(o&&!n&&!i)return Math.pow(e.y-t.y,2);if(n&&!a&&!o)return Math.pow(t.x-e.x,2);if(i&&!a&&!o)return Math.pow(t.x+t.width-e.x,2);var u=Math.min(Math.abs(t.x-e.x),Math.abs(t.x+t.width-e.x)),f=Math.min(Math.abs(t.y-e.y),Math.abs(t.y+t.height-e.y));return u*u+f*f},_z=function(e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t.x,u=t.y,f=[a-n,o-i];if(Tm(f,[0,0]))return NaN;var l=[-f[1],f[0]];_o(l,l);var c=[s-n,u-i];return Math.abs(Am(c,l))},zm=function(e,t,n){return e+(t-e)*n},j0=function(e,t,n){for(var i=Math.min(e.length,t.length),a=new Array(i),o=0;o<i;o++)a[o]=zm(e[o],t[o],n);return a};const Sz=Object.freeze(Object.defineProperty({__proto__:null,Line:Is,applyMatrix:Nu,compare:dz,distance:Nd,floydWarshall:pz,fractionToLine:Gm,getAdjMatrix:gz,getBBoxBoundLine:Fm,getCircleCenterByPoints:F0,getCircleIntersectByPoint:dI,getDegree:bz,getEllipseIntersectByPoint:vI,getLineIntersect:Ev,getPointsCenter:xI,getRectIntersectByPoint:hI,intersectBBox:yI,invertMatrix:pI,isPointInPolygon:Ll,isPointsOverlap:z0,isPolygonsIntersect:mI,itemIntersectByLine:bI,lerp:zm,lerpArray:j0,move:G0,pointLineDistance:_z,pointLineSquareDist:wI,pointRectSquareDist:EI,rotate:mz,scale:yz,scaleMatrix:vz,squareDist:Od,translate:gI},Symbol.toStringTag,{value:"Module"}));var to="rgb(95, 149, 255)",Mz="rgb(255, 255, 255)",Zx="rgb(0, 0, 0)",tg="rgb(247, 250, 255)",_I="rgb(239, 244, 255)",qc="rgb(253, 253, 253)",Kx="rgb(250, 250, 250)",Vc="rgb(224, 224, 224)",Qx="rgb(234, 234, 234)",Cz="rgb(245, 245, 245)",Az="rgb(191, 213, 255)",Jx="#4572d9",Tz="rgb(223, 234, 255)",hr={mainStroke:to,mainFill:_I,activeStroke:to,activeFill:tg,inactiveStroke:Az,inactiveFill:tg,selectedStroke:to,selectedFill:Mz,highlightStroke:Jx,highlightFill:Tz,disableStroke:Vc,disableFill:Kx,edgeMainStroke:Vc,edgeActiveStroke:to,edgeInactiveStroke:Qx,edgeSelectedStroke:to,edgeHighlightStroke:to,edgeDisableStroke:Cz,comboMainStroke:Vc,comboMainFill:qc,comboActiveStroke:to,comboActiveFill:tg,comboInactiveStroke:Vc,comboInactiveFill:qc,comboSelectedStroke:to,comboSelectedFill:qc,comboHighlightStroke:Jx,comboHighlightFill:qc,comboDisableStroke:Qx,comboDisableFill:Kx};const lt={version:"0.8.23",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:hr.mainStroke,fill:_I},size:20,color:hr.mainStroke,linkPoints:{size:8,lineWidth:1,fill:hr.activeFill,stroke:hr.activeStroke}},nodeStateStyles:{active:{fill:hr.activeFill,stroke:hr.activeStroke,lineWidth:2,shadowColor:hr.mainStroke,shadowBlur:10},selected:{fill:hr.selectedFill,stroke:hr.selectedStroke,lineWidth:4,shadowColor:hr.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:hr.highlightFill,stroke:hr.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:hr.inactiveFill,stroke:hr.inactiveStroke,lineWidth:1},disable:{fill:hr.disableFill,stroke:hr.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:Zx,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:hr.edgeMainStroke,lineAppendWidth:2},color:hr.edgeMainStroke},edgeStateStyles:{active:{stroke:hr.edgeActiveStroke,lineWidth:1},selected:{stroke:hr.edgeSelectedStroke,lineWidth:2,shadowColor:hr.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:hr.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:hr.edgeInactiveStroke,lineWidth:1},disable:{stroke:hr.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:Zx,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:hr.comboMainFill,lineWidth:1,stroke:hr.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:hr.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:hr.comboActiveStroke,lineWidth:1,fill:hr.comboActiveFill},selected:{stroke:hr.comboSelectedStroke,lineWidth:2,fill:hr.comboSelectedFill,shadowColor:hr.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:hr.comboHighlightStroke,lineWidth:2,fill:hr.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:hr.comboInactiveStroke,fill:hr.comboInactiveFill,lineWidth:1},disable:{stroke:hr.comboDisableStroke,fill:hr.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:typeof window<"u"&&window.getComputedStyle&&document.body&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},Iz={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,0:.6,1:.40099945068359377,2:.6,3:.6,4:.6,5:.6,6:.6,7:.5469985961914062,8:.6,9:.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875};var ra=Math.PI,U0=Math.sin,$0=Math.cos,gn=U0(ra/8),yn=$0(ra/8),Dd=function(e,t){var n=e.getBBox(),i={x:n.minX,y:n.minY},a={x:n.maxX,y:n.maxY};if(t){var o=t.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),i=Nu(i,o),a=Nu(a,o)}var s=i.x,u=i.y,f=a.x,l=a.y;return{x:s,y:u,minX:s,minY:u,maxX:f,maxY:l,width:f-s,height:l-u}},SI=function(e){var t=e.sourceNode||e.targetNode,n=t.get("group"),i=n.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var a=t.getKeyShape(),o=a.getBBox(),s=e.loopCfg||{},u=s.dist||Math.max(o.width,o.height)*2,f=s.position||lt.defaultLoopPosition,l=[(o.minX+o.maxX)/2+i[6],(o.minY+o.maxY)/2+i[7]],c=[e.startPoint.x,e.startPoint.y],h=[e.endPoint.x,e.endPoint.y],d=o.height/2,v=o.width/2,p=d,g=d,y=p*gn,m=p*yn,x=g*gn,b=g*yn,w=a.get("type"),E=Math.min(d/2,v/2),S=Math.min(d,v),_=s!=null&&s.pointPadding?Math.min(S,s==null?void 0:s.pointPadding):E;if(c[0]===h[0]&&c[1]===h[1]){switch(f){case"top":w==="circle"?(c=[l[0]-y,l[1]-m],h=[l[0]+x,l[1]-b]):(c=[l[0]-_,l[1]-d],h=[l[0]+_,l[1]-d]);break;case"top-right":p=d,g=v,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]+y,l[1]-m],h=[l[0]+b,l[1]-x]):(c=[l[0]+v-_,l[1]-d],h=[l[0]+v,l[1]-d+_]);break;case"right":p=v,g=v,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]+m,l[1]-y],h=[l[0]+b,l[1]+x]):(c=[l[0]+v,l[1]-_],h=[l[0]+v,l[1]+_]);break;case"bottom-right":p=v,g=d,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]+m,l[1]+y],h=[l[0]+x,l[1]+b]):(c=[l[0]+v,l[1]+d-_],h=[l[0]+v-_,l[1]+d]);break;case"bottom":p=d,g=d,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]+y,l[1]+m],h=[l[0]-x,l[1]+b]):(c=[l[0]-_,l[1]+d],h=[l[0]+_,l[1]+d]);break;case"bottom-left":p=d,g=v,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]-y,l[1]+m],h=[l[0]-b,l[1]+x]):(c=[l[0]-v,l[1]+d-_],h=[l[0]-v+_,l[1]+d]);break;case"left":p=v,g=v,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]-m,l[1]+y],h=[l[0]-b,l[1]-x]):(c=[l[0]-v,l[1]-_],h=[l[0]-v,l[1]+_]);break;case"top-left":p=v,g=d,w==="circle"?(y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]-m,l[1]-y],h=[l[0]-x,l[1]-b]):(c=[l[0]-v+_,l[1]-d],h=[l[0]-v,l[1]-d+_]);break;default:p=v,g=v,y=p*gn,m=p*yn,x=g*gn,b=g*yn,c=[l[0]-y,l[1]-m],h=[l[0]+x,l[1]-b]}if(s.clockwise===!1){var C=[c[0],c[1]];c=[h[0],h[1]],h=[C[0],C[1]]}}var M=[c[0]-l[0],c[1]-l[1]],A=(p+u)/p,T=(g+u)/g;s.clockwise===!1&&(A=(g+u)/g,T=(p+u)/p);var I=An([0,0],M,A),L=[l[0]+I[0],l[1]+I[1]],N=[h[0]-l[0],h[1]-l[1]],O=An([0,0],N,T),B=[l[0]+O[0],l[1]+O[1]];return e.startPoint={x:c[0],y:c[1]},e.endPoint={x:h[0],y:h[1]},e.controlPoints=[{x:L[0],y:L[1]},{x:B[0],y:B[1]}],e},MI=function(e,t,n,i,a){var o=1e-4,s=[],u=e==null?void 0:e.getPoint(t);if(!u)return{x:0,y:0,angle:0};if(t<o)s=e.getStartTangent().reverse();else if(t>1-o)s=e.getEndTangent();else{var f=e==null?void 0:e.getPoint(t+o);s.push([u.x,u.y]),s.push([f.x,f.y])}var l=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(l<0&&(l+=ra*2),n&&(u.x+=$0(l)*n,u.y+=U0(l)*n),i){var c=l-ra/2;l>1/2*ra&&l<3*1/2*ra&&(c-=ra),u.x+=$0(c)*i,u.y+=U0(c)*i}var h={x:u.x,y:u.y,angle:l};return a?(l>.5*ra&&l<1.5*ra&&(l-=ra),z({rotate:l},h)):h},kz=function r(e,t,n,i){if(i(e,t,n)===!1)return!1;if(e&&e.children){for(var a=e.children.length-1;a>=0;a--)if(!r(e.children[a],e,a,i))return!1}return!0},Lz=function r(e,t,n,i){if(e&&e.children){for(var a=e.children.length-1;a>=0;a--)if(!r(e.children[a],e,a,i))return}return i(e,t,n)!==!1},Cn=function(e,t){typeof t=="function"&&kz(e,null,-1,t)},na=function(e,t){typeof t=="function"&&Lz(e,null,-1,t)},CI=function(e,t){return t*(Iz[e]||1)},AI=function(e,t){var n=0,i=new RegExp("[一-龥]+");return e.split("").forEach(function(a){i.test(a)?n+=t:n+=CI(a,t)}),[n,t]},TI=function(e,t){return typeof t!="number"||t<=0||t>=e.length?e:e.substring(0,t)+"..."},X0=function(e,t){var n=[],i={},a={};e.forEach(function(u){a[u.id]=u}),e.forEach(function(u,f){var l=Jt(u);l.itemType="combo",l.children=void 0,l.parentId===l.id?(console.warn("The parentId for combo ".concat(l.id," can not be the same as the combo's id")),delete l.parentId):l.parentId&&!a[l.parentId]&&(console.warn("The parent combo for combo ".concat(l.id," does not exist!")),delete l.parentId);var c=i[l.id];if(c){if(l.children=c.children,i[l.id]=l,c=l,!c.parentId){n.push(c);return}var h=i[c.parentId];if(h)h.children?h.children.push(l):h.children=[l];else{var d={id:c.parentId,children:[c]};i[c.parentId]=d,i[l.id]=l}return}if(Fe(u.parentId)){var v=i[u.parentId];if(v)v.children?v.children.push(l):v.children=[l],i[l.id]=l;else{var p={id:u.parentId,children:[l]};i[p.id]=p,i[l.id]=l}}else n.push(l),i[l.id]=l});var o={};(t||[]).forEach(function(u){o[u.id]=u;var f=i[u.comboId];if(f){var l={id:u.id,comboId:u.comboId};f.children?f.children.push(l):f.children=[l],l.itemType="node",i[u.id]=l}});var s=0;return n.forEach(function(u){u.depth=s+10,Cn(u,function(f){var l,c=i[f.id].itemType;c==="node"?l=i[f.comboId]:l=i[f.parentId],l&&c==="node"?f.depth=s+1:f.depth=s+10,s<f.depth&&(s=f.depth);var h=o[f.id];return h&&(h.depth=f.depth),!0})}),n},Y0=function(e,t,n){var i,a=e,o,s={root:{children:e}},u=!1,f="root";(e||[]).forEach(function(v){if(!u){if(v.id===t){o=v,v.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0;return}Cn(v,function(p){var g;return s[p.id]={children:(p==null?void 0:p.children)||[]},a=(g=s[p.parentId||p.comboId||"root"])===null||g===void 0?void 0:g.children,p&&(p.removed||t===p.id)&&a?(f=p.parentId||p.comboId||"root",o=p,p.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0,!1):!0})}}),a=(i=s[f])===null||i===void 0?void 0:i.children;var l=a?a.indexOf(o):-1;if(l>-1&&a.splice(l,1),u||(o={id:t,itemType:"node",comboId:n},s[t]={children:void 0}),t){var c=!1;if(n){var h=0;(e||[]).forEach(function(v){c||Cn(v,function(p){return n===p.id?(c=!0,p.children?p.children.push(o):p.children=[o],h=p.depth,o.itemType==="node"?o.depth=h+2:o.depth=h+1,!1):!0})})}else(!n||!c)&&o.itemType!=="node"&&e.push(o);var d=o.depth;Cn(o,function(v){return v.itemType==="node"?d+=2:d+=1,v.depth=d,!0})}return e},fd=function(e,t,n){var i={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};if(!e||e.length===0){var a=n==null?void 0:n.getModel(),o=a||{},s=o.x,u=o.y,f=o.fixSize,l=o.collapsed,c=o.fixCollapseSize,h=l?c:f,d=mt(h)?h:[h,h],v=d[0],p=d[1],g=[v/2,p/2];return{minX:s-g[0],minY:u-g[1],maxX:s+g[0],maxY:u+g[1],x:s,y:u,width:v,height:p}}return e.forEach(function(y){var m=t.findById(y.id);if(!(!m||!m.isVisible())){m.set("bboxCanvasCache",void 0);var x=m.getCanvasBBox();x.x&&i.minX>x.minX&&(i.minX=x.minX),x.y&&i.minY>x.minY&&(i.minY=x.minY),x.x&&i.maxX<x.maxX&&(i.maxX=x.maxX),x.y&&i.maxY<x.maxY&&(i.maxY=x.maxY)}}),i.x=(i.minX+i.maxX)/2,i.y=(i.minY+i.maxY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY,i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2,(n==null?void 0:n.getKeyShape().get("type"))==="circle"&&(i.width=Math.hypot(i.height,i.width),i.height=i.width),Object.keys(i).forEach(function(y){(i[y]===1/0||i[y]===-1/0)&&(i[y]=void 0)}),i},Nz=function(e){var t=dt(e.x)||dt(e.y)||e.type||e.anchorPoints||e.size;return e.style&&(t=t||dt(e.style.r)||dt(e.style.width)||dt(e.style.height)||dt(e.style.rx)||dt(e.style.ry)),t},ld=function(e){var t={};return Object.keys(e).forEach(function(n){var i=e[n];if(!(n==="img"&&!Fe(i)))if(wn(i)&&!mt(i)){var a={};Object.keys(i).forEach(function(o){var s=i[o];o==="img"&&!Fe(s)||(a[o]=Jt(s))}),t[n]=a}else t[n]=Jt(i)}),t},Nl=function(e){var t=e.animateCfg,n=e.callback,i;if(!t)i={duration:500,callback:n};else if(i=Jt(t),t.callback){var a=t.callback;i.callback=function(){n(),a()}}else i.callback=n;return i};const Oz=Object.freeze(Object.defineProperty({__proto__:null,cloneBesidesImg:ld,getAnimateCfgWithCallback:Nl,getBBox:Dd,getComboBBox:fd,getLabelPosition:MI,getLetterWidth:CI,getLoopCfgs:SI,getTextSize:AI,plainCombosToTrees:X0,reconstructTree:Y0,shouldRefreshEdge:Nz,traverseTree:Cn,traverseTreeUp:na,truncateLabelByLength:TI},Symbol.toStringTag,{value:"Module"}));var ew=function(e){if(!e)return console.error("G6 Error Tips: the data must be defined"),!1;var t=e.nodes,n=e.edges,i=e.combos,a=i===void 0?[]:i;if(!t&&!n){var o=!0;return Cn(e,function(h){return Fe(h.id)?!0:(o=!1,!1)}),o}var s=(t||[]).find(function(h){return!Fe(h.id)});if(s)return console.warn("G6 Warning Tips: missing 'id' property, or %c".concat(s.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1;var u=(t||[]).map(function(h){return h.id}),f=a==null?void 0:a.map(function(h){return h.id}),l=Qn(Qn([],u,!0),f,!0),c=(n||[]).find(function(h){return!l.includes(h.source)||!l.includes(h.target)});return c?(console.warn("G6 Warning Tips: The source %c".concat(c.source,"%c or the target %c").concat(c.target,"%c of the edge do not exist in the nodes or combos."),"font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1):!0},Dz=function(e,t){if(e==="node"||e==="combo"){if(t.id&&!Fe(t.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(t.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(e==="edge"&&(!t.source||!t.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0},Pz=function(){function r(e){this.graph=e,this.destroyed=!1,this.modes=e.get("modes")||{default:[]},this.formatModes(),this.mode=e.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return r.prototype.formatModes=function(){var e=this.modes;_e(e,function(t){_e(t,function(n,i){Fe(n)&&(t[i]={type:n})})})},r.prototype.setBehaviors=function(e){var t=this.graph,n=this.modes[e],i=[],a;_e(n||[],function(o){var s=dm.getBehavior(o.type||o);s&&(a=new s(o),a&&(a.bind(t),i.push(a)))}),this.currentBehaves=i},r.mergeBehaviors=function(e,t){return _e(t,function(n){e.indexOf(n)<0&&(Fe(n)&&(n={type:n}),e.push(n))}),e},r.filterBehaviors=function(e,t){var n=[];return e.forEach(function(i){var a="";Fe(i)?a=i:a=i.type,t.indexOf(a)<0&&n.push(i)}),n},r.prototype.setMode=function(e){var t=this,n=t.modes,i=t.graph,a=e,o=n[a];o&&(i.emit("beforemodechange",{mode:e}),_e(this.currentBehaves,function(s){s.delegate&&s.delegate.remove(),s.unbind(i)}),this.setBehaviors(a),i.emit("aftermodechange",{mode:e}),this.mode=e)},r.prototype.getMode=function(){return this.mode},r.prototype.manipulateBehaviors=function(e,t,n){var i=this,a;if(mt(e)?a=e:a=[e],mt(t))return _e(t,function(s){i.modes[s]?n?i.modes[s]=r.mergeBehaviors(i.modes[s]||[],a):i.modes[s]=r.filterBehaviors(i.modes[s]||[],a):n&&(i.modes[s]=a)}),this;var o=t;return t||(o=this.mode),this.modes[o]||n&&(this.modes[o]=a),n?this.modes[o]=r.mergeBehaviors(this.modes[o]||[],a):this.modes[o]=r.filterBehaviors(this.modes[o]||[],a),this.formatModes(),this.setMode(this.mode),this},r.prototype.updateBehavior=function(e,t,n){Fe(e)&&(e={type:e});var i=[];if(!n||n===this.mode||n==="default"){if(i=this.currentBehaves,!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var a=i.length,o=0;o<a;o++){var s=i[o];if(s.type===e.type)return s.updateCfg(t),this;o===a-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(i=this.modes[n],!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var u=i.length,o=0;o<u;o++){var s=i[o];if(s.type===e.type||s===e.type)return s===e.type&&(s={type:s}),Object.assign(s,t),i[o]=s,this;o===u-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},r.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},r}(),vl=`
2
2
  \v\f\r   ᠎              \u2028\u2029`,Rz=new RegExp("([a-z])["+vl+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+vl+"]*,?["+vl+"]*)+)","ig"),Bz=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+vl+"]*,?["+vl+"]*","ig"),ku=function(r){if(!r)return null;if(mt(r))return r;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},t=[];return String(r).replace(Rz,function(n,i,a){var o=[],s=i.toLowerCase();if(a.replace(Bz,function(u,f){f&&o.push(+f)}),s==="m"&&o.length>2&&(t.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([i,o[0]]),s==="r")t.push([i].concat(o));else for(;o.length>=e[s]&&(t.push([i].concat(o.splice(0,e[s]))),!!e[s]););return r}),t},W0=function(r,e){for(var t=[],n=0,i=r.length;i-2*!e>n;n+=2){var a=[{x:+r[n-2],y:+r[n-1]},{x:+r[n],y:+r[n+1]},{x:+r[n+2],y:+r[n+3]},{x:+r[n+4],y:+r[n+5]}];e?n?i-4===n?a[3]={x:+r[0],y:+r[1]}:i-2===n&&(a[2]={x:+r[0],y:+r[1]},a[3]={x:+r[2],y:+r[3]}):a[0]={x:+r[i-2],y:+r[i-1]}:i-4===n?a[3]=a[2]:n||(a[0]={x:+r[n],y:+r[n+1]}),t.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return t},Hc=function(r,e,t,n,i){var a=[];if(i===null&&n===null&&(n=t),r=+r,e=+e,t=+t,n=+n,i!==null){var o=Math.PI/180,s=r+t*Math.cos(-n*o),u=r+t*Math.cos(-i*o),f=e+t*Math.sin(-n*o),l=e+t*Math.sin(-i*o);a=[["M",s,f],["A",t,t,0,+(i-n>180),0,u,l]]}else a=[["M",r,e],["m",0,-n],["a",t,n,0,1,1,0,2*n],["a",t,n,0,1,1,0,-2*n],["z"]];return a},q0=function(r){if(r=ku(r),!r||!r.length)return[["M",0,0]];var e=[],t=0,n=0,i=0,a=0,o=0,s,u;r[0][0]==="M"&&(t=+r[0][1],n=+r[0][2],i=t,a=n,o++,e[0]=["M",t,n]);for(var f=r.length===3&&r[0][0]==="M"&&r[1][0].toUpperCase()==="R"&&r[2][0].toUpperCase()==="Z",l=void 0,c=void 0,h=o,d=r.length;h<d;h++){if(e.push(l=[]),c=r[h],s=c[0],s!==s.toUpperCase())switch(l[0]=s.toUpperCase(),l[0]){case"A":l[1]=c[1],l[2]=c[2],l[3]=c[3],l[4]=c[4],l[5]=c[5],l[6]=+c[6]+t,l[7]=+c[7]+n;break;case"V":l[1]=+c[1]+n;break;case"H":l[1]=+c[1]+t;break;case"R":u=[t,n].concat(c.slice(1));for(var v=2,p=u.length;v<p;v++)u[v]=+u[v]+t,u[++v]=+u[v]+n;e.pop(),e=e.concat(W0(u,f));break;case"O":e.pop(),u=Hc(t,n,c[1],c[2]),u.push(u[0]),e=e.concat(u);break;case"U":e.pop(),e=e.concat(Hc(t,n,c[1],c[2],c[3])),l=["U"].concat(e[e.length-1].slice(-2));break;case"M":i=+c[1]+t,a=+c[2]+n;break;default:for(var v=1,p=c.length;v<p;v++)l[v]=+c[v]+(v%2?t:n)}else if(s==="R")u=[t,n].concat(c.slice(1)),e.pop(),e=e.concat(W0(u,f)),l=["R"].concat(c.slice(-2));else if(s==="O")e.pop(),u=Hc(t,n,c[1],c[2]),u.push(u[0]),e=e.concat(u);else if(s==="U")e.pop(),e=e.concat(Hc(t,n,c[1],c[2],c[3])),l=["U"].concat(e[e.length-1].slice(-2));else for(var g=0,y=c.length;g<y;g++)l[g]=c[g];if(s=s.toUpperCase(),s!=="O")switch(l[0]){case"Z":t=+i,n=+a;break;case"H":t=l[1];break;case"V":n=l[1];break;case"M":i=l[l.length-2],a=l[l.length-1];break;default:t=l[l.length-2],n=l[l.length-1]}}return e},Zc=function(r,e,t,n){return[r,e,t,n,t,n]},tw=function(r,e,t,n,i,a){var o=.3333333333333333,s=2/3;return[o*r+s*t,o*e+s*n,o*i+s*t,o*a+s*n,i,a]},II=function(r,e,t,n,i,a,o,s,u,f){t===n&&(t+=1);var l=Math.PI*120/180,c=Math.PI/180*(+i||0),h=[],d,v,p,g,y,m=function(K,se,re){var J=K*Math.cos(re)-se*Math.sin(re),me=K*Math.sin(re)+se*Math.cos(re);return{x:J,y:me}};if(f)v=f[0],p=f[1],g=f[2],y=f[3];else{d=m(r,e,-c),r=d.x,e=d.y,d=m(s,u,-c),s=d.x,u=d.y,r===s&&e===u&&(s+=1,u+=1);var x=(r-s)/2,b=(e-u)/2,w=x*x/(t*t)+b*b/(n*n);w>1&&(w=Math.sqrt(w),t=w*t,n=w*n);var E=t*t,S=n*n,_=(a===o?-1:1)*Math.sqrt(Math.abs((E*S-E*b*b-S*x*x)/(E*b*b+S*x*x)));g=_*t*b/n+(r+s)/2,y=_*-n*x/t+(e+u)/2,v=Math.asin(((e-y)/n).toFixed(9)),p=Math.asin(((u-y)/n).toFixed(9)),v=r<g?Math.PI-v:v,p=s<g?Math.PI-p:p,v<0&&(v=Math.PI*2+v),p<0&&(p=Math.PI*2+p),o&&v>p&&(v=v-Math.PI*2),!o&&p>v&&(p=p-Math.PI*2)}var C=p-v;if(Math.abs(C)>l){var M=p,A=s,T=u;p=v+l*(o&&p>v?1:-1),s=g+t*Math.cos(p),u=y+n*Math.sin(p),h=II(s,u,t,n,i,0,o,A,T,[p,M,g,y])}C=p-v;var I=Math.cos(v),L=Math.sin(v),N=Math.cos(p),O=Math.sin(p),B=Math.tan(C/4),W=4/3*t*B,D=4/3*n*B,P=[r,e],R=[r+W*L,e-D*I],X=[s+W*O,u-D*N],Y=[s,u];if(R[0]=2*P[0]-R[0],R[1]=2*P[1]-R[1],f)return[R,X,Y].concat(h);h=[R,X,Y].concat(h).join().split(",");for(var ee=[],U=0,Z=h.length;U<Z;U++)ee[U]=U%2?m(h[U-1],h[U],c).y:m(h[U],h[U+1],c).x;return ee},V0=function(r,e){var t=q0(r),n=e&&q0(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=[],s=[],u="",f="",l,c=function(x,b,w){var E,S;if(!x)return["C",b.x,b.y,b.x,b.y,b.x,b.y];switch(!(x[0]in{T:1,Q:1})&&(b.qx=b.qy=null),x[0]){case"M":b.X=x[1],b.Y=x[2];break;case"A":x=["C"].concat(II.apply(0,[b.x,b.y].concat(x.slice(1))));break;case"S":w==="C"||w==="S"?(E=b.x*2-b.bx,S=b.y*2-b.by):(E=b.x,S=b.y),x=["C",E,S].concat(x.slice(1));break;case"T":w==="Q"||w==="T"?(b.qx=b.x*2-b.qx,b.qy=b.y*2-b.qy):(b.qx=b.x,b.qy=b.y),x=["C"].concat(tw(b.x,b.y,b.qx,b.qy,x[1],x[2]));break;case"Q":b.qx=x[1],b.qy=x[2],x=["C"].concat(tw(b.x,b.y,x[1],x[2],x[3],x[4]));break;case"L":x=["C"].concat(Zc(b.x,b.y,x[1],x[2]));break;case"H":x=["C"].concat(Zc(b.x,b.y,x[1],b.y));break;case"V":x=["C"].concat(Zc(b.x,b.y,b.x,x[1]));break;case"Z":x=["C"].concat(Zc(b.x,b.y,b.X,b.Y));break}return x},h=function(x,b){if(x[b].length>7){x[b].shift();for(var w=x[b];w.length;)o[b]="A",n&&(s[b]="A"),x.splice(b++,0,["C"].concat(w.splice(0,6)));x.splice(b,1),l=Math.max(t.length,n&&n.length||0)}},d=function(x,b,w,E,S){x&&b&&x[S][0]==="M"&&b[S][0]!=="M"&&(b.splice(S,0,["M",E.x,E.y]),w.bx=0,w.by=0,w.x=x[S][1],w.y=x[S][2],l=Math.max(t.length,n&&n.length||0))};l=Math.max(t.length,n&&n.length||0);for(var v=0;v<l;v++){t[v]&&(u=t[v][0]),u!=="C"&&(o[v]=u,v&&(f=o[v-1])),t[v]=c(t[v],i,f),o[v]!=="A"&&u==="C"&&(o[v]="C"),h(t,v),n&&(n[v]&&(u=n[v][0]),u!=="C"&&(s[v]=u,v&&(f=s[v-1])),n[v]=c(n[v],a,f),s[v]!=="A"&&u==="C"&&(s[v]="C"),h(n,v)),d(t,n,i,a,v),d(n,t,a,i,v);var p=t[v],g=n&&n[v],y=p.length,m=n&&g.length;i.x=p[y-2],i.y=p[y-1],i.bx=parseFloat(p[y-4])||i.x,i.by=parseFloat(p[y-3])||i.y,a.bx=n&&(parseFloat(g[m-4])||a.x),a.by=n&&(parseFloat(g[m-3])||a.y),a.x=n&&g[m-2],a.y=n&&g[m-1]}return n?[t,n]:t},Fz=/,?([a-z]),?/gi,kI=function(r){return r.join(",").replace(Fz,"$1")},rw=function(r,e,t,n,i){var a=-3*e+9*t-9*n+3*i,o=r*a+6*e-12*t+6*n;return r*o-3*e+3*t},nw=function(r,e,t,n,i,a,o,s,u){u===null&&(u=1),u=u>1?1:u<0?0:u;for(var f=u/2,l=12,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,v=0;v<l;v++){var p=f*c[v]+f,g=rw(p,r,t,i,o),y=rw(p,e,n,a,s),m=g*g+y*y;d+=h[v]*Math.sqrt(m)}return f*d},Gz=function(r,e,t,n,i,a,o,s){for(var u=[],f=[[],[]],l,c,h,d,v=0;v<2;++v){if(v===0?(c=6*r-12*t+6*i,l=-3*r+9*t-9*i+3*o,h=3*t-3*r):(c=6*e-12*n+6*a,l=-3*e+9*n-9*a+3*s,h=3*n-3*e),Math.abs(l)<1e-12){if(Math.abs(c)<1e-12)continue;d=-h/c,d>0&&d<1&&u.push(d);continue}var p=c*c-4*h*l,g=Math.sqrt(p);if(!(p<0)){var y=(-c+g)/(2*l);y>0&&y<1&&u.push(y);var m=(-c-g)/(2*l);m>0&&m<1&&u.push(m)}}for(var x=u.length,b=x,w;x--;)d=u[x],w=1-d,f[0][x]=w*w*w*r+3*w*w*d*t+3*w*d*d*i+d*d*d*o,f[1][x]=w*w*w*e+3*w*w*d*n+3*w*d*d*a+d*d*d*s;return f[0][b]=r,f[1][b]=e,f[0][b+1]=o,f[1][b+1]=s,f[0].length=f[1].length=b+2,{min:{x:Math.min.apply(0,f[0]),y:Math.min.apply(0,f[1])},max:{x:Math.max.apply(0,f[0]),y:Math.max.apply(0,f[1])}}},zz=function(r,e,t,n,i,a,o,s){if(!(Math.max(r,t)<Math.min(i,o)||Math.min(r,t)>Math.max(i,o)||Math.max(e,n)<Math.min(a,s)||Math.min(e,n)>Math.max(a,s))){var u=(r*n-e*t)*(i-o)-(r-t)*(i*s-a*o),f=(r*n-e*t)*(a-s)-(e-n)*(i*s-a*o),l=(r-t)*(a-s)-(e-n)*(i-o);if(l){var c=u/l,h=f/l,d=+c.toFixed(2),v=+h.toFixed(2);if(!(d<+Math.min(r,t).toFixed(2)||d>+Math.max(r,t).toFixed(2)||d<+Math.min(i,o).toFixed(2)||d>+Math.max(i,o).toFixed(2)||v<+Math.min(e,n).toFixed(2)||v>+Math.max(e,n).toFixed(2)||v<+Math.min(a,s).toFixed(2)||v>+Math.max(a,s).toFixed(2)))return{x:c,y:h}}}},ro=function(r,e,t){return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height},LI=function(r,e,t,n,i){if(i)return[["M",+r+ +i,e],["l",t-i*2,0],["a",i,i,0,0,1,i,i],["l",0,n-i*2],["a",i,i,0,0,1,-i,i],["l",i*2-t,0],["a",i,i,0,0,1,-i,-i],["l",0,i*2-n],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",r,e],["l",t,0],["l",0,n],["l",-t,0],["z"]];return a.parsePathArray=kI,a},H0=function(r,e,t,n){return r===null&&(r=e=t=n=0),e===null&&(e=r.y,t=r.width,n=r.height,r=r.x),{x:r,y:e,width:t,w:t,height:n,h:n,x2:r+t,y2:e+n,cx:r+t/2,cy:e+n/2,r1:Math.min(t,n)/2,r2:Math.max(t,n)/2,r0:Math.sqrt(t*t+n*n)/2,path:LI(r,e,t,n),vb:[r,e,t,n].join(" ")}},jz=function(r,e){return r=H0(r),e=H0(e),ro(e,r.x,r.y)||ro(e,r.x2,r.y)||ro(e,r.x,r.y2)||ro(e,r.x2,r.y2)||ro(r,e.x,e.y)||ro(r,e.x2,e.y)||ro(r,e.x,e.y2)||ro(r,e.x2,e.y2)||(r.x<e.x2&&r.x>e.x||e.x<r.x2&&e.x>r.x)&&(r.y<e.y2&&r.y>e.y||e.y<r.y2&&e.y>r.y)},iw=function(r,e,t,n,i,a,o,s){mt(r)||(r=[r,e,t,n,i,a,o,s]);var u=Gz.apply(null,r);return H0(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},aw=function(r,e,t,n,i,a,o,s,u){var f=1-u,l=Math.pow(f,3),c=Math.pow(f,2),h=u*u,d=h*u,v=l*r+c*3*u*t+f*3*u*u*i+d*o,p=l*e+c*3*u*n+f*3*u*u*a+d*s,g=r+2*u*(t-r)+h*(i-2*t+r),y=e+2*u*(n-e)+h*(a-2*n+e),m=t+2*u*(i-t)+h*(o-2*i+t),x=n+2*u*(a-n)+h*(s-2*a+n),b=f*r+u*t,w=f*e+u*n,E=f*i+u*o,S=f*a+u*s,_=90-Math.atan2(g-m,y-x)*180/Math.PI;return{x:v,y:p,m:{x:g,y},n:{x:m,y:x},start:{x:b,y:w},end:{x:E,y:S},alpha:_}},Uz=function(r,e,t){var n=iw(r),i=iw(e);if(!jz(n,i))return t?0:[];for(var a=nw.apply(0,r),o=nw.apply(0,e),s=~~(a/8),u=~~(o/8),f=[],l=[],c={},h=t?0:[],d=0;d<s+1;d++){var v=aw.apply(0,r.concat(d/s));f.push({x:v.x,y:v.y,t:d/s})}for(var d=0;d<u+1;d++){var v=aw.apply(0,e.concat(d/u));l.push({x:v.x,y:v.y,t:d/u})}for(var d=0;d<s;d++)for(var p=0;p<u;p++){var g=f[d],y=f[d+1],m=l[p],x=l[p+1],b=Math.abs(y.x-g.x)<.001?"y":"x",w=Math.abs(x.x-m.x)<.001?"y":"x",E=zz(g.x,g.y,y.x,y.y,m.x,m.y,x.x,x.y);if(E){if(c[E.x.toFixed(4)]===E.y.toFixed(4))continue;c[E.x.toFixed(4)]=E.y.toFixed(4);var S=g.t+Math.abs((E[b]-g[b])/(y[b]-g[b]))*(y.t-g.t),_=m.t+Math.abs((E[w]-m[w])/(x[w]-m[w]))*(x.t-m.t);S>=0&&S<=1&&_>=0&&_<=1&&(t?h+=1:h.push({x:E.x,y:E.y,t1:S,t2:_}))}}return h},$z=function(r,e,t){r=V0(r),e=V0(e);for(var n,i,a,o,s,u,f,l,c,h,d=t?0:[],v=0,p=r.length;v<p;v++){var g=r[v];if(g[0]==="M")n=s=g[1],i=u=g[2];else{g[0]==="C"?(c=[n,i].concat(g.slice(1)),n=c[6],i=c[7]):(c=[n,i,n,i,s,u,s,u],n=s,i=u);for(var y=0,m=e.length;y<m;y++){var x=e[y];if(x[0]==="M")a=f=x[1],o=l=x[2];else{x[0]==="C"?(h=[a,o].concat(x.slice(1)),a=h[6],o=h[7]):(h=[a,o,a,o,f,l,f,l],a=f,o=l);var b=Uz(c,h,t);if(t)d+=b;else{for(var w=0,E=b.length;w<E;w++)b[w].segment1=v,b[w].segment2=y,b[w].bez1=c,b[w].bez2=h;d=d.concat(b)}}}}}return d},Xz=function(r,e){return $z(r,e)};function Yz(r,e){var t=[],n=[];function i(a,o){if(a.length===1)t.push(a[0]),n.push(a[0]);else{for(var s=[],u=0;u<a.length-1;u++)u===0&&t.push(a[0]),u===a.length-2&&n.push(a[u+1]),s[u]=[(1-o)*a[u][0]+o*a[u+1][0],(1-o)*a[u][1]+o*a[u+1][1]];i(s,o)}}return r.length&&i(r,e),{left:t,right:n.reverse()}}function Wz(r,e,t){var n=[[r[1],r[2]]];t=t||2;var i=[];e[0]==="A"?(n.push(e[6]),n.push(e[7])):e[0]==="C"?(n.push([e[1],e[2]]),n.push([e[3],e[4]]),n.push([e[5],e[6]])):e[0]==="S"||e[0]==="Q"?(n.push([e[1],e[2]]),n.push([e[3],e[4]])):n.push([e[1],e[2]]);for(var a=n,o=1/t,s=0;s<t-1;s++){var u=o/(1-o*s),f=Yz(a,u);i.push(f.left),a=f.right}i.push(a);var l=i.map(function(c){var h=[];return c.length===4&&(h.push("C"),h=h.concat(c[2])),c.length>=3&&(c.length===3&&h.push("Q"),h=h.concat(c[1])),c.length===2&&h.push("L"),h=h.concat(c[c.length-1]),h});return l}var qz=function(r,e,t){if(t===1)return[[].concat(r)];var n=[];if(e[0]==="L"||e[0]==="C"||e[0]==="Q")n=n.concat(Wz(r,e,t));else{var i=[].concat(r);i[0]==="M"&&(i[0]="L");for(var a=0;a<=t-1;a++)n.push(i)}return n},Vz=function(r,e){if(r.length===1)return r;var t=r.length-1,n=e.length-1,i=t/n,a=[];if(r.length===1&&r[0][0]==="M"){for(var o=0;o<n-t;o++)r.push(r[0]);return r}for(var o=0;o<n;o++){var s=Math.floor(i*o);a[s]=(a[s]||0)+1}var u=a.reduce(function(f,l,c){return c===t?f.concat(r[t]):f.concat(qz(r[c],r[c+1],l))},[]);return u.unshift(r[0]),(e[n]==="Z"||e[n]==="z")&&u.push("Z"),u},Hz=function(r,e){if(r.length!==e.length)return!1;var t=!0;return _e(r,function(n,i){if(n!==e[i])return t=!1,!1}),t};function Zz(r,e,t){var n=null,i=t;return e<i&&(i=e,n="add"),r<i&&(i=r,n="del"),{type:n,min:i}}var Kz=function(r,e){var t=r.length,n=e.length,i,a,o=0;if(t===0||n===0)return null;for(var s=[],u=0;u<=t;u++)s[u]=[],s[u][0]={min:u};for(var f=0;f<=n;f++)s[0][f]={min:f};for(var u=1;u<=t;u++){i=r[u-1];for(var f=1;f<=n;f++){a=e[f-1],Hz(i,a)?o=0:o=1;var l=s[u-1][f].min+1,c=s[u][f-1].min+1,h=s[u-1][f-1].min+o;s[u][f]=Zz(l,c,h)}}return s},NI=function(r,e){var t=Kz(r,e),n=r.length,i=e.length,a=[],o=1,s=1;if(t[n][i].min!==n){for(var u=1;u<=n;u++){var f=t[u][u].min;s=u;for(var l=o;l<=i;l++)t[u][l].min<f&&(f=t[u][l].min,s=l);o=s,t[u][o].type&&a.push({index:u-1,type:t[u][o].type})}for(var u=a.length-1;u>=0;u--)o=a[u].index,a[u].type==="add"?r.splice(o,0,[].concat(r[o])):r.splice(o,1)}n=r.length;var c=i-n;if(n<i)for(var u=0;u<c;u++)r[n-1][0]==="z"||r[n-1][0]==="Z"?r.splice(n-2,0,r[n-2]):r.push(r[n-1]),n+=1;return r};function rg(r,e,t){for(var n=[].concat(r),i,a=1/(t+1),o=OI(e)[0],s=1;s<=t;s++)a*=s,i=Math.floor(r.length*a),i===0?n.unshift([o[0]*a+r[i][0]*(1-a),o[1]*a+r[i][1]*(1-a)]):n.splice(i,0,[o[0]*a+r[i][0]*(1-a),o[1]*a+r[i][1]*(1-a)]);return n}function OI(r){var e=[];switch(r[0]){case"M":e.push([r[1],r[2]]);break;case"L":e.push([r[1],r[2]]);break;case"A":e.push([r[6],r[7]]);break;case"Q":e.push([r[3],r[4]]),e.push([r[1],r[2]]);break;case"T":e.push([r[1],r[2]]);break;case"C":e.push([r[5],r[6]]),e.push([r[1],r[2]]),e.push([r[3],r[4]]);break;case"S":e.push([r[3],r[4]]),e.push([r[1],r[2]]);break;case"H":e.push([r[1],r[1]]);break;case"V":e.push([r[1],r[1]]);break}return e}var Z0=function(r,e){if(r.length<=1)return r;for(var t,n=0;n<e.length;n++)if(r[n][0]!==e[n][0])switch(t=OI(r[n]),e[n][0]){case"M":r[n]=["M"].concat(t[0]);break;case"L":r[n]=["L"].concat(t[0]);break;case"A":r[n]=[].concat(e[n]),r[n][6]=t[0][0],r[n][7]=t[0][1];break;case"Q":if(t.length<2)if(n>0)t=rg(t,r[n-1],1);else{r[n]=e[n];break}r[n]=["Q"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;case"T":r[n]=["T"].concat(t[0]);break;case"C":if(t.length<3)if(n>0)t=rg(t,r[n-1],2);else{r[n]=e[n];break}r[n]=["C"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;case"S":if(t.length<2)if(n>0)t=rg(t,r[n-1],1);else{r[n]=e[n];break}r[n]=["S"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;default:r[n]=e[n]}return r};const Qz=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:W0,fillPath:Vz,fillPathByDiff:NI,formatPath:Z0,intersection:Xz,parsePathArray:kI,parsePathString:ku,pathToAbsolute:q0,pathToCurve:V0,rectPath:LI},Symbol.toStringTag,{value:"Module"}));var DI=function(){function r(e,t){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=e,this.name=e,this.originalEvent=t,this.timeStamp=t.timeStamp}return r.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},r.prototype.stopPropagation=function(){this.propagationStopped=!0},r.prototype.toString=function(){var e=this.type;return"[Event (type="+e+")]"},r.prototype.save=function(){},r.prototype.restore=function(){},r}();function PI(r,e){var t=r.indexOf(e);t!==-1&&r.splice(t,1)}var ow=typeof window<"u"&&typeof window.document<"u";function RI(r,e){if(r.isCanvas())return!0;for(var t=e.getParent(),n=!1;t;){if(t===r){n=!0;break}t=t.getParent()}return n}function K0(r){return r.cfg.visible&&r.cfg.capture}var Jz=function(r){Rt(e,r);function e(t){var n=r.call(this)||this;n.destroyed=!1;var i=n.getDefaultCfg();return n.cfg=bt(i,t),n}return e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,n){this.cfg[t]=n},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(LA),sw=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))},e8=function(){function r(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"}return r}(),t8=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return r}(),r8=function(){function r(e,t,n,i){this.name=e,this.version=t,this.os=n,this.bot=i,this.type="bot-device"}return r}(),n8=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),i8=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),a8=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,o8=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,uw=3,s8=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",a8]],fw=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function BI(r){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new i8:typeof navigator<"u"?f8(navigator.userAgent):c8()}function u8(r){return r!==""&&s8.reduce(function(e,t){var n=t[0],i=t[1];if(e)return e;var a=i.exec(r);return!!a&&[n,a]},!1)}function f8(r){var e=u8(r);if(!e)return null;var t=e[0],n=e[1];if(t==="searchbot")return new n8;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<uw&&(i=sw(sw([],i,!0),h8(uw-i.length),!0)):i=[];var a=i.join("."),o=l8(r),s=o8.exec(r);return s&&s[1]?new r8(t,a,o,s[1]):new e8(t,a,o)}function l8(r){for(var e=0,t=fw.length;e<t;e++){var n=fw[e],i=n[0],a=n[1],o=a.exec(r);if(o)return i}return null}function c8(){var r=typeof process<"u"&&process.version;return r?new t8(process.version.slice(1)):null}function h8(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}function lw(r,e){var t=[],n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],f=r[6],l=r[7],c=r[8],h=e[0],d=e[1],v=e[2],p=e[3],g=e[4],y=e[5],m=e[6],x=e[7],b=e[8];return t[0]=h*n+d*o+v*f,t[1]=h*i+d*s+v*l,t[2]=h*a+d*u+v*c,t[3]=p*n+g*o+y*f,t[4]=p*i+g*s+y*l,t[5]=p*a+g*u+y*c,t[6]=m*n+x*o+b*f,t[7]=m*i+x*s+b*l,t[8]=m*a+x*u+b*c,t}function ys(r,e){var t=[],n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function FI(r){var e=[],t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],c=l*o-s*f,h=-l*a+s*u,d=f*a-o*u,v=t*c+n*h+i*d;return v?(v=1/v,e[0]=c*v,e[1]=(-l*n+i*f)*v,e[2]=(s*n-i*o)*v,e[3]=h*v,e[4]=(l*t-i*u)*v,e[5]=(-s*t+i*a)*v,e[6]=d*v,e[7]=(-f*t+n*u)*v,e[8]=(o*t-n*a)*v,e):null}var Mf=vi,ng="matrix",d8=["zIndex","capture","visible","type"],v8=["repeat"],p8=":",g8="*";function y8(r){for(var e=[],t=0;t<r.length;t++)mt(r[t])?e.push([].concat(r[t])):e.push(r[t]);return e}function m8(r,e){var t={},n=e.attrs;for(var i in r)t[i]=n[i];return t}function b8(r,e){var t={},n=e.attr();return _e(r,function(i,a){v8.indexOf(a)===-1&&!So(n[a],i)&&(t[a]=i)}),t}function x8(r,e){if(e.onFrame)return r;var t=e.startTime,n=e.delay,i=e.duration,a=Object.prototype.hasOwnProperty;return _e(r,function(o){t+n<o.startTime+o.delay+o.duration&&i>o.delay&&_e(e.toAttrs,function(s,u){a.call(o.toAttrs,u)&&(delete o.toAttrs[u],delete o.fromAttrs[u])})}),r}var GI=function(r){Rt(e,r);function e(t){var n=r.call(this,t)||this;n.attrs={};var i=n.getDefaultAttrs();return bt(i,t.attrs),n.attrs=i,n.initAttrs(i),n.initAnimate(),n}return 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,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=n[0],o=n[1];if(!a)return this.attrs;if(wn(a)){for(var s in a)this.setAttr(s,a[s]);return this.afterAttrsChange(a),this}return n.length===2?(this.setAttr(a,o),this.afterAttrsChange((t={},t[a]=o,t)),this):this.attrs[a]},e.prototype.isClipped=function(t,n){var i=this.getClip();return i&&!i.isHit(t,n)},e.prototype.setAttr=function(t,n){var i=this.attrs[t];i!==n&&(this.attrs[t]=n,this.onAttrChange(t,n,i))},e.prototype.onAttrChange=function(t,n,i){t==="matrix"&&this.set("totalMatrix",null)},e.prototype.afterAttrsChange=function(t){if(this.cfg.isClipShape){var n=this.cfg.applyTo;n&&n.onCanvasChange("clip")}else this.onCanvasChange("attr")},e.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},e.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},e.prototype.setZIndex=function(t){this.set("zIndex",t);var n=this.getParent();return n&&n.sort(),this},e.prototype.toFront=function(){var t=this.getParent();if(t){var n=t.getChildren();this.get("el");var i=n.indexOf(this);n.splice(i,1),n.push(this),this.onCanvasChange("zIndex")}},e.prototype.toBack=function(){var t=this.getParent();if(t){var n=t.getChildren();this.get("el");var i=n.indexOf(this);n.splice(i,1),n.unshift(this),this.onCanvasChange("zIndex")}},e.prototype.remove=function(t){t===void 0&&(t=!0);var n=this.getParent();n?(PI(n.getChildren(),this),n.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},e.prototype.resetMatrix=function(){this.attr(ng,this.getDefaultMatrix()),this.onCanvasChange("matrix")},e.prototype.getMatrix=function(){return this.attr(ng)},e.prototype.setMatrix=function(t){this.attr(ng,t),this.onCanvasChange("matrix")},e.prototype.getTotalMatrix=function(){var t=this.cfg.totalMatrix;if(!t){var n=this.attr("matrix"),i=this.cfg.parentMatrix;i&&n?t=lw(i,n):t=n||i,this.set("totalMatrix",t)}return t},e.prototype.applyMatrix=function(t){var n=this.attr("matrix"),i=null;t&&n?i=lw(t,n):i=n||t,this.set("totalMatrix",i),this.set("parentMatrix",t)},e.prototype.getDefaultMatrix=function(){return null},e.prototype.applyToMatrix=function(t){var n=this.attr("matrix");return n?ys(n,t):t},e.prototype.invertFromMatrix=function(t){var n=this.attr("matrix");if(n){var i=FI(n);if(i)return ys(i,t)}return t},e.prototype.setClip=function(t){var n=this.getCanvas(),i=null;if(t){var a=this.getShapeBase(),o=zu(t.type),s=a[o];s&&(i=new s({type:t.type,isClipShape:!0,applyTo:this,attrs:t.attrs,canvas:n}))}return this.set("clipShape",i),this.onCanvasChange("clip"),i},e.prototype.getClip=function(){var t=this.cfg.clipShape;return t||null},e.prototype.clone=function(){var t=this,n=this.attrs,i={};_e(n,function(s,u){mt(n[u])?i[u]=y8(n[u]):i[u]=n[u]});var a=this.constructor,o=new a({attrs:i});return _e(d8,function(s){o.set(s,t.get(s))}),o},e.prototype.destroy=function(){var t=this.destroyed;t||(this.attrs={},r.prototype.destroy.call(this))},e.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},e.prototype.animate=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(!(!this.get("timeline")&&!this.get("canvas"))){this.set("animating",!0);var i=this.get("timeline");i||(i=this.get("canvas").get("timeline"),this.set("timeline",i));var a=this.get("animations")||[];i.timer||i.initTimer();var o=t[0],s=t[1],u=t[2],f=u===void 0?"easeLinear":u,l=t[3],c=l===void 0?nl:l,h=t[4],d=h===void 0?0:h,v,p,g,y,m;Pr(o)?(v=o,o={}):wn(o)&&o.onFrame&&(v=o.onFrame,p=o.repeat),wn(s)?(m=s,s=m.duration,f=m.easing||"easeLinear",d=m.delay||0,p=m.repeat||p||!1,c=m.callback||nl,g=m.pauseCallback||nl,y=m.resumeCallback||nl):(dt(c)&&(d=c,c=null),Pr(f)?(c=f,f="easeLinear"):f=f||"easeLinear");var x=b8(o,this),b={fromAttrs:m8(x,this),toAttrs:x,duration:s,easing:f,repeat:p,callback:c,pauseCallback:g,resumeCallback:y,delay:d,startTime:i.getTime(),id:ha(),onFrame:v,pathFormatted:!1};a.length>0?a=x8(a,b):i.addAnimator(this),a.push(b),this.set("animations",a),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var n=this;t===void 0&&(t=!0);var i=this.get("animations");_e(i,function(a){t&&(a.onFrame?n.attr(a.onFrame(1)):n.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),n=this.get("animations"),i=t.getTime();return _e(n,function(a){a._paused=!0,a._pauseTime=i,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:i}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline"),n=t.getTime(),i=this.get("animations"),a=this.get("_pause").pauseTime;return _e(i,function(o){o.startTime=o.startTime+(n-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",i),this},e.prototype.emitDelegation=function(t,n){var i=this,a=n.propagationPath;this.getEvents();var o;t==="mouseenter"?o=n.fromShape:t==="mouseleave"&&(o=n.toShape);for(var s=function(c){var h=a[c],d=h.get("name");if(d){if((h.isGroup()||h.isCanvas&&h.isCanvas())&&o&&RI(h,o))return"break";mt(d)?_e(d,function(v){i.emitDelegateEvent(h,v,n)}):u.emitDelegateEvent(h,d,n)}},u=this,f=0;f<a.length;f++){var l=s(f);if(l==="break")break}},e.prototype.emitDelegateEvent=function(t,n,i){var a=this.getEvents(),o=n+p8+i.type;(a[o]||a[g8])&&(i.name=o,i.currentTarget=t,i.delegateTarget=this,i.delegateObject=t.get("delegateObject"),this.emit(o,i))},e.prototype.translate=function(t,n){t===void 0&&(t=0),n===void 0&&(n=0);var i=this.getMatrix(),a=Mf(i,[["t",t,n]]);return this.setMatrix(a),this},e.prototype.move=function(t,n){var i=this.attr("x")||0,a=this.attr("y")||0;return this.translate(t-i,n-a),this},e.prototype.moveTo=function(t,n){return this.move(t,n)},e.prototype.scale=function(t,n){var i=this.getMatrix(),a=Mf(i,[["s",t,n||t]]);return this.setMatrix(a),this},e.prototype.rotate=function(t){var n=this.getMatrix(),i=Mf(n,[["r",t]]);return this.setMatrix(i),this},e.prototype.rotateAtStart=function(t){var n=this.attr(),i=n.x,a=n.y,o=this.getMatrix(),s=Mf(o,[["t",-i,-a],["r",t],["t",i,a]]);return this.setMatrix(s),this},e.prototype.rotateAtPoint=function(t,n,i){var a=this.getMatrix(),o=Mf(a,[["t",-t,-n],["r",i],["t",t,n]]);return this.setMatrix(o),this},e}(Jz),cw={},Q0="_INDEX";function zI(r,e){if(r.set("canvas",e),r.isGroup()){var t=r.get("children");t.length&&t.forEach(function(n){zI(n,e)})}}function jI(r,e){if(r.set("timeline",e),r.isGroup()){var t=r.get("children");t.length&&t.forEach(function(n){jI(n,e)})}}function w8(r,e,t){e.set("parent",null),e.set("canvas",null),PI(r.getChildren(),e)}function E8(r){return function(e,t){var n=r(e,t);return n===0?e[Q0]-t[Q0]:n}}var UI=function(r){Rt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,n=-1/0,i=1/0,a=-1/0,o=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});o.length>0?_e(o,function(u){var f=u.getBBox(),l=f.minX,c=f.maxX,h=f.minY,d=f.maxY;l<t&&(t=l),c>n&&(n=c),h<i&&(i=h),d>a&&(a=d)}):(t=0,n=0,i=0,a=0);var s={x:t,y:i,minX:t,minY:i,maxX:n,maxY:a,width:n-t,height:a-i};return s},e.prototype.getCanvasBBox=function(){var t=1/0,n=-1/0,i=1/0,a=-1/0,o=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});o.length>0?_e(o,function(u){var f=u.getCanvasBBox(),l=f.minX,c=f.maxX,h=f.minY,d=f.maxY;l<t&&(t=l),c>n&&(n=c),h<i&&(i=h),d>a&&(a=d)}):(t=0,n=0,i=0,a=0);var s={x:t,y:i,minX:t,minY:i,maxX:n,maxY:a,width:n-t,height:a-i};return s},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.children=[],t},e.prototype.onAttrChange=function(t,n,i){if(r.prototype.onAttrChange.call(this,t,n,i),t==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},e.prototype.applyMatrix=function(t){var n=this.getTotalMatrix();r.prototype.applyMatrix.call(this,t);var i=this.getTotalMatrix();i!==n&&this._applyChildrenMarix(i)},e.prototype._applyChildrenMarix=function(t){var n=this.getChildren();_e(n,function(i){i.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=t[0],a=t[1];wn(i)?a=i:a.type=i;var o=cw[a.type];o||(o=zu(a.type),cw[a.type]=o);var s=this.getShapeBase(),u=new s[o](a);return this.add(u),u},e.prototype.addGroup=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=t[0],a=t[1],o;if(Pr(i))a?o=new i(a):o=new i({parent:this});else{var s=i||{},u=this.getGroupBase();o=new u(s)}return this.add(o),o},e.prototype.getCanvas=function(){var t;return this.isCanvas()?t=this:t=this.get("canvas"),t},e.prototype.getShape=function(t,n,i){if(!K0(this))return null;var a=this.getChildren(),o;if(this.isCanvas())o=this._findShape(a,t,n,i);else{var s=[t,n,1];s=this.invertFromMatrix(s),this.isClipped(s[0],s[1])||(o=this._findShape(a,s[0],s[1],i))}return o},e.prototype._findShape=function(t,n,i,a){for(var o=null,s=t.length-1;s>=0;s--){var u=t[s];if(K0(u)&&(u.isGroup()?o=u.getShape(n,i,a):u.isHit(n,i)&&(o=u)),o)break}return o},e.prototype.add=function(t){var n=this.getCanvas(),i=this.getChildren(),a=this.get("timeline"),o=t.getParent();o&&w8(o,t),t.set("parent",this),n&&zI(t,n),a&&jI(t,a),i.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var n=this.getTotalMatrix();n&&t.applyMatrix(n)},e.prototype.getChildren=function(){return this.get("children")||[]},e.prototype.sort=function(){var t=this.getChildren();_e(t,function(n,i){return n[Q0]=i,n}),t.sort(E8(function(n,i){return n.get("zIndex")-i.get("zIndex")})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),n=t.length-1;n>=0;n--)t[n].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),r.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){var n=this.getChildren();return n[t]},e.prototype.getCount=function(){var t=this.getChildren();return t.length},e.prototype.contain=function(t){var n=this.getChildren();return n.indexOf(t)>-1},e.prototype.removeChild=function(t,n){n===void 0&&(n=!0),this.contain(t)&&t.remove(n)},e.prototype.findAll=function(t){var n=[],i=this.getChildren();return _e(i,function(a){t(a)&&n.push(a),a.isGroup()&&(n=n.concat(a.findAll(t)))}),n},e.prototype.find=function(t){var n=null,i=this.getChildren();return _e(i,function(a){if(t(a)?n=a:a.isGroup()&&(n=a.find(t)),n)return!1}),n},e.prototype.findById=function(t){return this.find(function(n){return n.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(n){return n.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(n){return n.get("name")===t})},e}(GI),ju=0,al=0,Cf=0,$I=1e3,Pd,ol,Rd=0,ks=0,_v=0,Ol=typeof performance=="object"&&performance.now?performance:Date,XI=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function YI(){return ks||(XI(_8),ks=Ol.now()+_v)}function _8(){ks=0}function J0(){this._call=this._time=this._next=null}J0.prototype=WI.prototype={constructor:J0,restart:function(r,e,t){if(typeof r!="function")throw new TypeError("callback is not a function");t=(t==null?YI():+t)+(e==null?0:+e),!this._next&&ol!==this&&(ol?ol._next=this:Pd=this,ol=this),this._call=r,this._time=t,ey()},stop:function(){this._call&&(this._call=null,this._time=1/0,ey())}};function WI(r,e,t){var n=new J0;return n.restart(r,e,t),n}function S8(){YI(),++ju;for(var r=Pd,e;r;)(e=ks-r._time)>=0&&r._call.call(null,e),r=r._next;--ju}function hw(){ks=(Rd=Ol.now())+_v,ju=al=0;try{S8()}finally{ju=0,C8(),ks=0}}function M8(){var r=Ol.now(),e=r-Rd;e>$I&&(_v-=e,Rd=r)}function C8(){for(var r,e=Pd,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),r=e,e=e._next):(t=e._next,e._next=null,e=r?r._next=t:Pd=t);ol=r,ey(n)}function ey(r){if(!ju){al&&(al=clearTimeout(al));var e=r-ks;e>24?(r<1/0&&(al=setTimeout(hw,r-Ol.now()-_v)),Cf&&(Cf=clearInterval(Cf))):(Cf||(Rd=Ol.now(),Cf=setInterval(M8,$I)),ju=1,XI(hw))}}function jm(r,e,t){r.prototype=e.prototype=t,t.constructor=r}function qI(r,e){var t=Object.create(r.prototype);for(var n in e)t[n]=e[n];return t}function Ql(){}var Dl=.7,Bd=1/Dl,Ou="\\s*([+-]?\\d+)\\s*",Pl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",A8=/^#([0-9a-f]{3,8})$/,T8=new RegExp(`^rgb\\(${Ou},${Ou},${Ou}\\)$`),I8=new RegExp(`^rgb\\(${fa},${fa},${fa}\\)$`),k8=new RegExp(`^rgba\\(${Ou},${Ou},${Ou},${Pl}\\)$`),L8=new RegExp(`^rgba\\(${fa},${fa},${fa},${Pl}\\)$`),N8=new RegExp(`^hsl\\(${Pl},${fa},${fa}\\)$`),O8=new RegExp(`^hsla\\(${Pl},${fa},${fa},${Pl}\\)$`),dw={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};jm(Ql,Rl,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:vw,formatHex:vw,formatHex8:D8,formatHsl:P8,formatRgb:pw,toString:pw});function vw(){return this.rgb().formatHex()}function D8(){return this.rgb().formatHex8()}function P8(){return VI(this).formatHsl()}function pw(){return this.rgb().formatRgb()}function Rl(r){var e,t;return r=(r+"").trim().toLowerCase(),(e=A8.exec(r))?(t=e[1].length,e=parseInt(e[1],16),t===6?gw(e):t===3?new Gn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Kc(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Kc(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=T8.exec(r))?new Gn(e[1],e[2],e[3],1):(e=I8.exec(r))?new Gn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=k8.exec(r))?Kc(e[1],e[2],e[3],e[4]):(e=L8.exec(r))?Kc(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=N8.exec(r))?bw(e[1],e[2]/100,e[3]/100,1):(e=O8.exec(r))?bw(e[1],e[2]/100,e[3]/100,e[4]):dw.hasOwnProperty(r)?gw(dw[r]):r==="transparent"?new Gn(NaN,NaN,NaN,0):null}function gw(r){return new Gn(r>>16&255,r>>8&255,r&255,1)}function Kc(r,e,t,n){return n<=0&&(r=e=t=NaN),new Gn(r,e,t,n)}function R8(r){return r instanceof Ql||(r=Rl(r)),r?(r=r.rgb(),new Gn(r.r,r.g,r.b,r.opacity)):new Gn}function ty(r,e,t,n){return arguments.length===1?R8(r):new Gn(r,e,t,n==null?1:n)}function Gn(r,e,t,n){this.r=+r,this.g=+e,this.b=+t,this.opacity=+n}jm(Gn,ty,qI(Ql,{brighter(r){return r=r==null?Bd:Math.pow(Bd,r),new Gn(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Dl:Math.pow(Dl,r),new Gn(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new Gn(ws(this.r),ws(this.g),ws(this.b),Fd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yw,formatHex:yw,formatHex8:B8,formatRgb:mw,toString:mw}));function yw(){return`#${ms(this.r)}${ms(this.g)}${ms(this.b)}`}function B8(){return`#${ms(this.r)}${ms(this.g)}${ms(this.b)}${ms((isNaN(this.opacity)?1:this.opacity)*255)}`}function mw(){const r=Fd(this.opacity);return`${r===1?"rgb(":"rgba("}${ws(this.r)}, ${ws(this.g)}, ${ws(this.b)}${r===1?")":`, ${r})`}`}function Fd(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function ws(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function ms(r){return r=ws(r),(r<16?"0":"")+r.toString(16)}function bw(r,e,t,n){return n<=0?r=e=t=NaN:t<=0||t>=1?r=e=NaN:e<=0&&(r=NaN),new Di(r,e,t,n)}function VI(r){if(r instanceof Di)return new Di(r.h,r.s,r.l,r.opacity);if(r instanceof Ql||(r=Rl(r)),!r)return new Di;if(r instanceof Di)return r;r=r.rgb();var e=r.r/255,t=r.g/255,n=r.b/255,i=Math.min(e,t,n),a=Math.max(e,t,n),o=NaN,s=a-i,u=(a+i)/2;return s?(e===a?o=(t-n)/s+(t<n)*6:t===a?o=(n-e)/s+2:o=(e-t)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new Di(o,s,u,r.opacity)}function F8(r,e,t,n){return arguments.length===1?VI(r):new Di(r,e,t,n==null?1:n)}function Di(r,e,t,n){this.h=+r,this.s=+e,this.l=+t,this.opacity=+n}jm(Di,F8,qI(Ql,{brighter(r){return r=r==null?Bd:Math.pow(Bd,r),new Di(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Dl:Math.pow(Dl,r),new Di(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,e=isNaN(r)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,i=2*t-n;return new Gn(ig(r>=240?r-240:r+120,i,n),ig(r,i,n),ig(r<120?r+240:r-120,i,n),this.opacity)},clamp(){return new Di(xw(this.h),Qc(this.s),Qc(this.l),Fd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=Fd(this.opacity);return`${r===1?"hsl(":"hsla("}${xw(this.h)}, ${Qc(this.s)*100}%, ${Qc(this.l)*100}%${r===1?")":`, ${r})`}`}}));function xw(r){return r=(r||0)%360,r<0?r+360:r}function Qc(r){return Math.max(0,Math.min(1,r||0))}function ig(r,e,t){return(r<60?e+(t-e)*r/60:r<180?t:r<240?e+(t-e)*(240-r)/60:e)*255}const Um=r=>()=>r;function G8(r,e){return function(t){return r+t*e}}function z8(r,e,t){return r=Math.pow(r,t),e=Math.pow(e,t)-r,t=1/t,function(n){return Math.pow(r+n*e,t)}}function j8(r){return(r=+r)==1?HI:function(e,t){return t-e?z8(e,t,r):Um(isNaN(e)?t:e)}}function HI(r,e){var t=e-r;return t?G8(r,t):Um(isNaN(r)?e:r)}const ww=function r(e){var t=j8(e);function n(i,a){var o=t((i=ty(i)).r,(a=ty(a)).r),s=t(i.g,a.g),u=t(i.b,a.b),f=HI(i.opacity,a.opacity);return function(l){return i.r=o(l),i.g=s(l),i.b=u(l),i.opacity=f(l),i+""}}return n.gamma=r,n}(1);function ZI(r,e){e||(e=[]);var t=r?Math.min(e.length,r.length):0,n=e.slice(),i;return function(a){for(i=0;i<t;++i)n[i]=r[i]*(1-a)+e[i]*a;return n}}function KI(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function U8(r,e){return(KI(e)?ZI:QI)(r,e)}function QI(r,e){var t=e?e.length:0,n=r?Math.min(t,r.length):0,i=new Array(n),a=new Array(t),o;for(o=0;o<n;++o)i[o]=Gd(r[o],e[o]);for(;o<t;++o)a[o]=e[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function $8(r,e){var t=new Date;return r=+r,e=+e,function(n){return t.setTime(r*(1-n)+e*n),t}}function ry(r,e){return r=+r,e=+e,function(t){return r*(1-t)+e*t}}function X8(r,e){var t={},n={},i;(r===null||typeof r!="object")&&(r={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in r?t[i]=Gd(r[i],e[i]):n[i]=e[i];return function(a){for(i in t)n[i]=t[i](a);return n}}var ny=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ag=new RegExp(ny.source,"g");function Y8(r){return function(){return r}}function W8(r){return function(e){return r(e)+""}}function q8(r,e){var t=ny.lastIndex=ag.lastIndex=0,n,i,a,o=-1,s=[],u=[];for(r=r+"",e=e+"";(n=ny.exec(r))&&(i=ag.exec(e));)(a=i.index)>t&&(a=e.slice(t,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,u.push({i:o,x:ry(n,i)})),t=ag.lastIndex;return t<e.length&&(a=e.slice(t),s[o]?s[o]+=a:s[++o]=a),s.length<2?u[0]?W8(u[0].x):Y8(e):(e=u.length,function(f){for(var l=0,c;l<e;++l)s[(c=u[l]).i]=c.x(f);return s.join("")})}function Gd(r,e){var t=typeof e,n;return e==null||t==="boolean"?Um(e):(t==="number"?ry:t==="string"?(n=Rl(e))?(e=n,ww):q8:e instanceof Rl?ww:e instanceof Date?$8:KI(e)?ZI:Array.isArray(e)?QI:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?X8:ry)(r,e)}function V8(r){return+r}function H8(r){return r*r}function Z8(r){return r*(2-r)}function Ew(r){return((r*=2)<=1?r*r:--r*(2-r)+1)/2}function K8(r){return r*r*r}function Q8(r){return--r*r*r+1}function _w(r){return((r*=2)<=1?r*r*r:(r-=2)*r*r+2)/2}var $m=3,J8=function r(e){e=+e;function t(n){return Math.pow(n,e)}return t.exponent=r,t}($m),ej=function r(e){e=+e;function t(n){return 1-Math.pow(1-n,e)}return t.exponent=r,t}($m),Sw=function r(e){e=+e;function t(n){return((n*=2)<=1?Math.pow(n,e):2-Math.pow(2-n,e))/2}return t.exponent=r,t}($m),JI=Math.PI,ek=JI/2;function tj(r){return+r==1?1:1-Math.cos(r*ek)}function rj(r){return Math.sin(r*ek)}function Mw(r){return(1-Math.cos(JI*r))/2}function Mo(r){return(Math.pow(2,-10*r)-.0009765625)*1.0009775171065494}function nj(r){return Mo(1-+r)}function ij(r){return 1-Mo(r)}function Cw(r){return((r*=2)<=1?Mo(1-r):2-Mo(r-1))/2}function aj(r){return 1-Math.sqrt(1-r*r)}function oj(r){return Math.sqrt(1- --r*r)}function Aw(r){return((r*=2)<=1?1-Math.sqrt(1-r*r):Math.sqrt(1-(r-=2)*r)+1)/2}var iy=4/11,sj=6/11,uj=8/11,fj=3/4,lj=9/11,cj=10/11,hj=15/16,dj=21/22,vj=63/64,Jc=1/iy/iy;function pj(r){return 1-Bl(1-r)}function Bl(r){return(r=+r)<iy?Jc*r*r:r<uj?Jc*(r-=sj)*r+fj:r<cj?Jc*(r-=lj)*r+hj:Jc*(r-=dj)*r+vj}function gj(r){return((r*=2)<=1?1-Bl(1-r):Bl(r-1)+1)/2}var Xm=1.70158,yj=function r(e){e=+e;function t(n){return(n=+n)*n*(e*(n-1)+n)}return t.overshoot=r,t}(Xm),mj=function r(e){e=+e;function t(n){return--n*n*((n+1)*e+n)+1}return t.overshoot=r,t}(Xm),Tw=function r(e){e=+e;function t(n){return((n*=2)<1?n*n*((e+1)*n-e):(n-=2)*n*((e+1)*n+e)+2)/2}return t.overshoot=r,t}(Xm),Uu=2*Math.PI,Ym=1,Wm=.3,bj=function r(e,t){var n=Math.asin(1/(e=Math.max(1,e)))*(t/=Uu);function i(a){return e*Mo(- --a)*Math.sin((n-a)/t)}return i.amplitude=function(a){return r(a,t*Uu)},i.period=function(a){return r(e,a)},i}(Ym,Wm),Iw=function r(e,t){var n=Math.asin(1/(e=Math.max(1,e)))*(t/=Uu);function i(a){return 1-e*Mo(a=+a)*Math.sin((a+n)/t)}return i.amplitude=function(a){return r(a,t*Uu)},i.period=function(a){return r(e,a)},i}(Ym,Wm),xj=function r(e,t){var n=Math.asin(1/(e=Math.max(1,e)))*(t/=Uu);function i(a){return((a=a*2-1)<0?e*Mo(-a)*Math.sin((n-a)/t):2-e*Mo(a)*Math.sin((n+a)/t))/2}return i.amplitude=function(a){return r(a,t*Uu)},i.period=function(a){return r(e,a)},i}(Ym,Wm);const wj=Object.freeze(Object.defineProperty({__proto__:null,easeBack:Tw,easeBackIn:yj,easeBackInOut:Tw,easeBackOut:mj,easeBounce:Bl,easeBounceIn:pj,easeBounceInOut:gj,easeBounceOut:Bl,easeCircle:Aw,easeCircleIn:aj,easeCircleInOut:Aw,easeCircleOut:oj,easeCubic:_w,easeCubicIn:K8,easeCubicInOut:_w,easeCubicOut:Q8,easeElastic:Iw,easeElasticIn:bj,easeElasticInOut:xj,easeElasticOut:Iw,easeExp:Cw,easeExpIn:nj,easeExpInOut:Cw,easeExpOut:ij,easeLinear:V8,easePoly:Sw,easePolyIn:J8,easePolyInOut:Sw,easePolyOut:ej,easeQuad:Ew,easeQuadIn:H8,easeQuadInOut:Ew,easeQuadOut:Z8,easeSin:Mw,easeSinIn:tj,easeSinInOut:Mw,easeSinOut:rj},Symbol.toStringTag,{value:"Module"}));var Ej={};function _j(r){return Ej[r.toLowerCase()]||wj[r]}var Sj=function(r){return["fill","stroke","fillStyle","strokeStyle"].includes(r)},Mj=function(r){return/^[r,R,L,l]{1}[\s]*\(/.test(r)},kw=[1,0,0,0,1,0,0,0,1];function Cj(r,e,t){var n={},i=e.fromAttrs,a=e.toAttrs;if(!r.destroyed){var o;for(var s in a)if(!So(i[s],a[s]))if(s==="path"){var u=a[s],f=i[s];u.length>f.length?(u=ku(a[s]),f=ku(i[s]),f=NI(f,u),f=Z0(f,u),e.fromAttrs.path=f,e.toAttrs.path=u):e.pathFormatted||(u=ku(a[s]),f=ku(i[s]),f=Z0(f,u),e.fromAttrs.path=f,e.toAttrs.path=u,e.pathFormatted=!0),n[s]=[];for(var l=0;l<u.length;l++){for(var c=u[l],h=f[l],d=[],v=0;v<c.length;v++)dt(c[v])&&h&&dt(h[v])?(o=Gd(h[v],c[v]),d.push(o(t))):d.push(c[v]);n[s].push(d)}}else if(s==="matrix"){var p=U8(i[s]||kw,a[s]||kw),g=p(t);n[s]=g}else Sj(s)&&Mj(a[s])?n[s]=a[s]:Pr(a[s])||(o=Gd(i[s],a[s]),n[s]=o(t));r.attr(n)}}function Aj(r,e,t){var n=e.startTime,i=e.delay;if(t<n+i||e._paused)return!1;var a,o=e.duration,s=e.easing,u=_j(s);if(t=t-n-e.delay,e.repeat)a=t%o/o,a=u(a);else if(a=t/o,a<1)a=u(a);else return e.onFrame?r.attr(e.onFrame(1)):r.attr(e.toAttrs),!0;if(e.onFrame){var f=e.onFrame(a);r.attr(f)}else Cj(r,e,a);return!1}var Tj=function(){function r(e){this.animators=[],this.current=0,this.timer=null,this.canvas=e}return r.prototype.initTimer=function(){var e=this,t=!1,n,i,a;this.timer=WI(function(o){if(e.current=o,e.animators.length>0){for(var s=e.animators.length-1;s>=0;s--){if(n=e.animators[s],n.destroyed){e.removeAnimator(s);continue}if(!n.isAnimatePaused()){i=n.get("animations");for(var u=i.length-1;u>=0;u--)a=i[u],t=Aj(n,a,o),t&&(i.splice(u,1),t=!1,a.callback&&a.callback())}i.length===0&&e.removeAnimator(s)}var f=e.canvas.get("autoDraw");f||e.canvas.draw()}})},r.prototype.addAnimator=function(e){this.animators.push(e)},r.prototype.removeAnimator=function(e){this.animators.splice(e,1)},r.prototype.isAnimating=function(){return!!this.animators.length},r.prototype.stop=function(){this.timer&&this.timer.stop()},r.prototype.stopAllAnimations=function(e){e===void 0&&(e=!0),this.animators.forEach(function(t){t.stopAnimate(e)}),this.animators=[],this.canvas.draw()},r.prototype.getTime=function(){return this.current},r}(),Ij=40,Lw=0,Nw=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function Ow(r,e,t){t.name=e,t.target=r,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}function kj(r,e,t){if(t.bubbles){var n=void 0,i=!1;if(e==="mouseenter"?(n=t.fromShape,i=!0):e==="mouseleave"&&(i=!0,n=t.toShape),r.isCanvas()&&i)return;if(n&&RI(r,n)){t.bubbles=!1;return}t.name=e,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}}var Lj=function(){function r(e){var t=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(n){var i=n.type;t._triggerEvent(i,n)},this._onDocumentMove=function(n){var i=t.canvas,a=i.get("el");if(a!==n.target&&(t.dragging||t.currentShape)){var o=t._getPointInfo(n);t.dragging&&t._emitEvent("drag",n,o,t.draggingShape)}},this._onDocumentMouseUp=function(n){var i=t.canvas,a=i.get("el");if(a!==n.target&&t.dragging){var o=t._getPointInfo(n);t.draggingShape&&t._emitEvent("drop",n,o,null),t._emitEvent("dragend",n,o,t.draggingShape),t._afterDrag(t.draggingShape,o,n)}},this.canvas=e.canvas}return r.prototype.init=function(){this._bindEvents()},r.prototype._bindEvents=function(){var e=this,t=this.canvas.get("el");_e(Nw,function(n){t.addEventListener(n,e._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._clearEvents=function(){var e=this,t=this.canvas.get("el");_e(Nw,function(n){t.removeEventListener(n,e._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._getEventObj=function(e,t,n,i,a,o){var s=new DI(e,t);return s.fromShape=a,s.toShape=o,s.x=n.x,s.y=n.y,s.clientX=n.clientX,s.clientY=n.clientY,s.propagationPath.push(i),s},r.prototype._getShape=function(e,t){return this.canvas.getShape(e.x,e.y,t)},r.prototype._getPointInfo=function(e){var t=this.canvas,n=t.getClientByEvent(e),i=t.getPointByEvent(e);return{x:i.x,y:i.y,clientX:n.x,clientY:n.y}},r.prototype._triggerEvent=function(e,t){var n=this._getPointInfo(t),i=this._getShape(n,t),a=this["_on"+e],o=!1;if(a)a.call(this,n,i,t);else{var s=this.currentShape;e==="mouseenter"||e==="dragenter"||e==="mouseover"?(this._emitEvent(e,t,n,null,null,i),i&&this._emitEvent(e,t,n,i,null,i),e==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",t,n,null)):e==="mouseleave"||e==="dragleave"||e==="mouseout"?(o=!0,s&&this._emitEvent(e,t,n,s,s,null),this._emitEvent(e,t,n,null,s,null),e==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",t,n,null)):this._emitEvent(e,t,n,i,null,null)}if(o||(this.currentShape=i),i&&!i.get("destroyed")){var u=this.canvas,f=u.get("el");f.style.cursor=i.attr("cursor")||u.get("cursor")}},r.prototype._onmousedown=function(e,t,n){n.button===Lw&&(this.mousedownShape=t,this.mousedownPoint=e,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,e,t,null,null)},r.prototype._emitMouseoverEvents=function(e,t,n,i){var a=this.canvas.get("el");n!==i&&(n&&(this._emitEvent("mouseout",e,t,n,n,i),this._emitEvent("mouseleave",e,t,n,n,i),(!i||i.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),i&&(this._emitEvent("mouseover",e,t,i,n,i),this._emitEvent("mouseenter",e,t,i,n,i)))},r.prototype._emitDragoverEvents=function(e,t,n,i,a){i?(i!==n&&(n&&this._emitEvent("dragleave",e,t,n,n,i),this._emitEvent("dragenter",e,t,i,n,i)),a||this._emitEvent("dragover",e,t,i)):n&&this._emitEvent("dragleave",e,t,n,n,i),a&&this._emitEvent("dragover",e,t,i)},r.prototype._afterDrag=function(e,t,n){e&&(e.set("capture",!0),this.draggingShape=null),this.dragging=!1;var i=this._getShape(t,n);i!==e&&this._emitMouseoverEvents(n,t,e,i),this.currentShape=i},r.prototype._onmouseup=function(e,t,n){if(n.button===Lw){var i=this.draggingShape;this.dragging?(i&&this._emitEvent("drop",n,e,t),this._emitEvent("dragend",n,e,i),this._afterDrag(i,e,n)):(this._emitEvent("mouseup",n,e,t),t===this.mousedownShape&&this._emitEvent("click",n,e,t),this.mousedownShape=null,this.mousedownPoint=null)}},r.prototype._ondragover=function(e,t,n){n.preventDefault();var i=this.currentShape;this._emitDragoverEvents(n,e,i,t,!0)},r.prototype._onmousemove=function(e,t,n){var i=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,e,a,t,!1),this._emitEvent("drag",n,e,o);else{var s=this.mousedownPoint;if(s){var u=this.mousedownShape,f=n.timeStamp,l=f-this.mousedownTimeStamp,c=s.clientX-e.clientX,h=s.clientY-e.clientY,d=c*c+h*h;l>120||d>Ij?u&&u.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,e,o),this.mousedownShape=null,this.mousedownPoint=null):!u&&i.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,e,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,e,a,t),this._emitEvent("mousemove",n,e,t)):(this._emitMouseoverEvents(n,e,a,t),this._emitEvent("mousemove",n,e,t))}else this._emitMouseoverEvents(n,e,a,t),this._emitEvent("mousemove",n,e,t)}},r.prototype._emitEvent=function(e,t,n,i,a,o){var s=this._getEventObj(e,t,n,i,a,o);if(i){s.shape=i,Ow(i,e,s);for(var u=i.getParent();u;)u.emitDelegation(e,s),s.propagationStopped||kj(u,e,s),s.propagationPath.push(u),u=u.getParent()}else{var f=this.canvas;Ow(f,e,s)}},r.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},r}(),Dw="px",Pw=BI(),Nj=Pw&&Pw.name==="firefox",tk=function(r){Rt(e,r);function e(t){var n=r.call(this,t)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.cursor="default",t.supportCSSTransform=!1,t},e.prototype.initContainer=function(){var t=this.get("container");Fe(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t);var n=this.get("container");n.appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new Lj({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new Tj(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,n){var i=this.get("el");ow&&(i.style.width=t+Dw,i.style.height=n+Dw)},e.prototype.changeSize=function(t,n){this.setDOMSize(t,n),this.set("width",t),this.set("height",n),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 n=this.get("el");ow&&n&&(n.style.cursor=t)},e.prototype.getPointByEvent=function(t){var n=this.get("supportCSSTransform");if(n){if(Nj&&!ht(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!ht(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var i=this.getClientByEvent(t),a=i.x,o=i.y;return this.getPointByClient(a,o)},e.prototype.getClientByEvent=function(t){var n=t;return t.touches&&(t.type==="touchend"?n=t.changedTouches[0]:n=t.touches[0]),{x:n.clientX,y:n.clientY}},e.prototype.getPointByClient=function(t,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:t-a.left,y:n-a.top}},e.prototype.getClientByPoint=function(t,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:t+a.left,y:n+a.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){var t=this.get("eventController");t.destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var t=this.get("timeline");this.get("destroyed")||(this.clear(),t&&t.stop(),this.clearEvents(),this.removeDom(),r.prototype.destroy.call(this))},e}(UI),rk=function(r){Rt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var t=r.prototype.clone.call(this),n=this.getChildren(),i=0;i<n.length;i++){var a=n[i];t.add(a.clone())}return t},e}(UI),nk=function(r){Rt(e,r);function e(t){return r.call(this,t)||this}return e.prototype._isInBBox=function(t,n){var i=this.getBBox();return i.minX<=t&&i.maxX>=t&&i.minY<=n&&i.maxY>=n},e.prototype.afterAttrsChange=function(t){r.prototype.afterAttrsChange.call(this,t),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(t){r.prototype.applyMatrix.call(this,t),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),n=this.getTotalMatrix(),i=t.minX,a=t.minY,o=t.maxX,s=t.maxY;if(n){var u=ys(n,[t.minX,t.minY]),f=ys(n,[t.maxX,t.minY]),l=ys(n,[t.minX,t.maxY]),c=ys(n,[t.maxX,t.maxY]);i=Math.min(u[0],f[0],l[0],c[0]),o=Math.max(u[0],f[0],l[0],c[0]),a=Math.min(u[1],f[1],l[1],c[1]),s=Math.max(u[1],f[1],l[1],c[1])}var h=this.attrs;if(h.shadowColor){var d=h.shadowBlur,v=d===void 0?0:d,p=h.shadowOffsetX,g=p===void 0?0:p,y=h.shadowOffsetY,m=y===void 0?0:y,x=i-v+g,b=o+v+g,w=a-v+m,E=s+v+m;i=Math.min(i,x),o=Math.max(o,b),a=Math.min(a,w),s=Math.max(s,E)}return{x:i,y:a,minX:i,minY:a,maxX:o,maxY:s,width:o-i,height:s-a}},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,n){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,n){var i=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[t,n,1];o=this.invertFromMatrix(o);var s=o[0],u=o[1],f=this._isInBBox(s,u);return this.isOnlyHitBox()?f:!!(f&&!this.isClipped(s,u)&&(this.isInShape(s,u)||i&&i.isHit(s,u)||a&&a.isHit(s,u)))},e}(GI),ik=new Map;function ga(r,e){ik.set(r,e)}function ak(r){return ik.get(r)}function ok(r){var e=r.attr(),t=e.x,n=e.y,i=e.width,a=e.height;return{x:t,y:n,width:i,height:a}}function sk(r){var e=r.attr(),t=e.x,n=e.y,i=e.r;return{x:t-i,y:n-i,width:i*2,height:i*2}}function Tn(r,e,t,n){var i=r-t,a=e-n;return Math.sqrt(i*i+a*a)}function cd(r,e){return Math.abs(r-e)<.001}function tf(r,e){var t=ca(r),n=ca(e),i=la(r),a=la(e);return{x:t,y:n,width:i-t,height:a-n}}function Sv(r){return(r+Math.PI*2)%(Math.PI*2)}const xn={box:function(r,e,t,n){return tf([r,t],[e,n])},length:function(r,e,t,n){return Tn(r,e,t,n)},pointAt:function(r,e,t,n,i){return{x:(1-i)*r+i*t,y:(1-i)*e+i*n}},pointDistance:function(r,e,t,n,i,a){var o=(t-r)*(i-r)+(n-e)*(a-e);if(o<0)return Tn(r,e,i,a);var s=(t-r)*(t-r)+(n-e)*(n-e);return o>s?Tn(t,n,i,a):this.pointToLine(r,e,t,n,i,a)},pointToLine:function(r,e,t,n,i,a){var o=[t-r,n-e];if(Tm(o,[0,0]))return Math.sqrt((i-r)*(i-r)+(a-e)*(a-e));var s=[-o[1],o[0]];_o(s,s);var u=[i-r,a-e];return Math.abs(Am(u,s))},tangentAngle:function(r,e,t,n){return Math.atan2(n-e,t-r)}};var Oj=1e-4;function uk(r,e,t,n,i,a){var o,s=1/0,u=[t,n],f=20;a&&a>200&&(f=a/10);for(var l=1/f,c=l/10,h=0;h<=f;h++){var d=h*l,v=[i.apply(null,r.concat([d])),i.apply(null,e.concat([d]))],p=Tn(u[0],u[1],v[0],v[1]);p<s&&(o=d,s=p)}if(o===0)return{x:r[0],y:e[0]};if(o===1){var g=r.length;return{x:r[g-1],y:e[g-1]}}s=1/0;for(var h=0;h<32&&!(c<Oj);h++){var y=o-c,m=o+c,v=[i.apply(null,r.concat([y])),i.apply(null,e.concat([y]))],p=Tn(u[0],u[1],v[0],v[1]);if(y>=0&&p<s)o=y,s=p;else{var x=[i.apply(null,r.concat([m])),i.apply(null,e.concat([m]))],b=Tn(u[0],u[1],x[0],x[1]);m<=1&&b<s?(o=m,s=b):c*=.5}}return{x:i.apply(null,r.concat([o])),y:i.apply(null,e.concat([o]))}}function Dj(r,e){for(var t=0,n=r.length,i=0;i<n;i++){var a=r[i],o=e[i],s=r[(i+1)%n],u=e[(i+1)%n];t+=Tn(a,o,s,u)}return t/2}function po(r,e,t,n){var i=1-n;return i*i*r+2*n*i*e+n*n*t}function Rw(r,e,t){var n=r+t-2*e;if(cd(n,0))return[.5];var i=(r-e)/n;return i<=1&&i>=0?[i]:[]}function Bw(r,e,t,n){return 2*(1-n)*(e-r)+2*n*(t-e)}function fk(r,e,t,n,i,a,o){var s=po(r,t,i,o),u=po(e,n,a,o),f=xn.pointAt(r,e,t,n,o),l=xn.pointAt(t,n,i,a,o);return[[r,e,f.x,f.y,s,u],[s,u,l.x,l.y,i,a]]}function ay(r,e,t,n,i,a,o){if(o===0)return(Tn(r,e,t,n)+Tn(t,n,i,a)+Tn(r,e,i,a))/2;var s=fk(r,e,t,n,i,a,.5),u=s[0],f=s[1];return u.push(o-1),f.push(o-1),ay.apply(null,u)+ay.apply(null,f)}const lk={box:function(r,e,t,n,i,a){var o=Rw(r,t,i)[0],s=Rw(e,n,a)[0],u=[r,i],f=[e,a];return o!==void 0&&u.push(po(r,t,i,o)),s!==void 0&&f.push(po(e,n,a,s)),tf(u,f)},length:function(r,e,t,n,i,a){return ay(r,e,t,n,i,a,3)},nearestPoint:function(r,e,t,n,i,a,o,s){return uk([r,t,i],[e,n,a],o,s,po)},pointDistance:function(r,e,t,n,i,a,o,s){var u=this.nearestPoint(r,e,t,n,i,a,o,s);return Tn(u.x,u.y,o,s)},interpolationAt:po,pointAt:function(r,e,t,n,i,a,o){return{x:po(r,t,i,o),y:po(e,n,a,o)}},divide:function(r,e,t,n,i,a,o){return fk(r,e,t,n,i,a,o)},tangentAngle:function(r,e,t,n,i,a,o){var s=Bw(r,t,i,o),u=Bw(e,n,a,o),f=Math.atan2(u,s);return Sv(f)}};function go(r,e,t,n,i){var a=1-i;return a*a*a*r+3*e*i*a*a+3*t*i*i*a+n*i*i*i}function Fw(r,e,t,n,i){var a=1-i;return 3*(a*a*(e-r)+2*a*i*(t-e)+i*i*(n-t))}function og(r,e,t,n){var i=-3*r+9*e-9*t+3*n,a=6*r-12*e+6*t,o=3*e-3*r,s=[],u,f,l;if(cd(i,0))cd(a,0)||(u=-o/a,u>=0&&u<=1&&s.push(u));else{var c=a*a-4*i*o;cd(c,0)?s.push(-a/(2*i)):c>0&&(l=Math.sqrt(c),u=(-a+l)/(2*i),f=(-a-l)/(2*i),u>=0&&u<=1&&s.push(u),f>=0&&f<=1&&s.push(f))}return s}function ck(r,e,t,n,i,a,o,s,u){var f=go(r,t,i,o,u),l=go(e,n,a,s,u),c=xn.pointAt(r,e,t,n,u),h=xn.pointAt(t,n,i,a,u),d=xn.pointAt(i,a,o,s,u),v=xn.pointAt(c.x,c.y,h.x,h.y,u),p=xn.pointAt(h.x,h.y,d.x,d.y,u);return[[r,e,c.x,c.y,v.x,v.y,f,l],[f,l,p.x,p.y,d.x,d.y,o,s]]}function oy(r,e,t,n,i,a,o,s,u){if(u===0)return Dj([r,t,i,o],[e,n,a,s]);var f=ck(r,e,t,n,i,a,o,s,.5),l=f[0],c=f[1];return l.push(u-1),c.push(u-1),oy.apply(null,l)+oy.apply(null,c)}const pl={extrema:og,box:function(r,e,t,n,i,a,o,s){for(var u=[r,o],f=[e,s],l=og(r,t,i,o),c=og(e,n,a,s),h=0;h<l.length;h++)u.push(go(r,t,i,o,l[h]));for(var h=0;h<c.length;h++)f.push(go(e,n,a,s,c[h]));return tf(u,f)},length:function(r,e,t,n,i,a,o,s){return oy(r,e,t,n,i,a,o,s,3)},nearestPoint:function(r,e,t,n,i,a,o,s,u,f,l){return uk([r,t,i,o],[e,n,a,s],u,f,go,l)},pointDistance:function(r,e,t,n,i,a,o,s,u,f,l){var c=this.nearestPoint(r,e,t,n,i,a,o,s,u,f,l);return Tn(c.x,c.y,u,f)},interpolationAt:go,pointAt:function(r,e,t,n,i,a,o,s,u){return{x:go(r,t,i,o,u),y:go(e,n,a,s,u)}},divide:function(r,e,t,n,i,a,o,s,u){return ck(r,e,t,n,i,a,o,s,u)},tangentAngle:function(r,e,t,n,i,a,o,s,u){var f=Fw(r,t,i,o,u),l=Fw(e,n,a,s,u);return Sv(Math.atan2(l,f))}};function Gw(r,e){var t=Math.abs(r);return e>0?t:t*-1}const Pj={box:function(r,e,t,n){return{x:r-t,y:e-n,width:t*2,height:n*2}},length:function(r,e,t,n){return Math.PI*(3*(t+n)-Math.sqrt((3*t+n)*(t+3*n)))},nearestPoint:function(r,e,t,n,i,a){var o=t,s=n;if(o===0||s===0)return{x:r,y:e};for(var u=i-r,f=a-e,l=Math.abs(u),c=Math.abs(f),h=o*o,d=s*s,v=Math.PI/4,p,g,y=0;y<4;y++){p=o*Math.cos(v),g=s*Math.sin(v);var m=(h-d)*Math.pow(Math.cos(v),3)/o,x=(d-h)*Math.pow(Math.sin(v),3)/s,b=p-m,w=g-x,E=l-m,S=c-x,_=Math.hypot(w,b),C=Math.hypot(S,E),M=_*Math.asin((b*S-w*E)/(_*C)),A=M/Math.sqrt(h+d-p*p-g*g);v+=A,v=Math.min(Math.PI/2,Math.max(0,v))}return{x:r+Gw(p,u),y:e+Gw(g,f)}},pointDistance:function(r,e,t,n,i,a){var o=this.nearestPoint(r,e,t,n,i,a);return Tn(o.x,o.y,i,a)},pointAt:function(r,e,t,n,i){var a=2*Math.PI*i;return{x:r+t*Math.cos(a),y:e+n*Math.sin(a)}},tangentAngle:function(r,e,t,n,i){var a=2*Math.PI*i,o=Math.atan2(n*Math.cos(a),-t*Math.sin(a));return Sv(o)}};function Rj(r,e,t,n,i,a,o,s){return-1*t*Math.cos(i)*Math.sin(s)-n*Math.sin(i)*Math.cos(s)}function Bj(r,e,t,n,i,a,o,s){return-1*t*Math.sin(i)*Math.sin(s)+n*Math.cos(i)*Math.cos(s)}function Fj(r,e,t){return Math.atan(-e/r*Math.tan(t))}function Gj(r,e,t){return Math.atan(e/(r*Math.tan(t)))}function zw(r,e,t,n,i,a){return t*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+r}function jw(r,e,t,n,i,a){return t*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+e}function zj(r,e,t,n){var i=Math.atan2(n*r,t*e);return(i+Math.PI*2)%(Math.PI*2)}function Uw(r,e,t){return{x:r*Math.cos(t),y:e*Math.sin(t)}}function $w(r,e,t){var n=Math.cos(t),i=Math.sin(t);return[r*n-e*i,r*i+e*n]}const jj={box:function(r,e,t,n,i,a,o){for(var s=Fj(t,n,i),u=1/0,f=-1/0,l=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var h=s+c;a<o?a<h&&h<o&&l.push(h):o<h&&h<a&&l.push(h)}for(var c=0;c<l.length;c++){var d=zw(r,e,t,n,i,l[c]);d<u&&(u=d),d>f&&(f=d)}for(var v=Gj(t,n,i),p=1/0,g=-1/0,y=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var m=v+c;a<o?a<m&&m<o&&y.push(m):o<m&&m<a&&y.push(m)}for(var c=0;c<y.length;c++){var x=jw(r,e,t,n,i,y[c]);x<p&&(p=x),x>g&&(g=x)}return{x:u,y:p,width:f-u,height:g-p}},length:function(r,e,t,n,i,a,o){},nearestPoint:function(r,e,t,n,i,a,o,s,u){var f=$w(s-r,u-e,-i),l=f[0],c=f[1],h=Pj.nearestPoint(0,0,t,n,l,c),d=zj(t,n,h.x,h.y);d<a?h=Uw(t,n,a):d>o&&(h=Uw(t,n,o));var v=$w(h.x,h.y,i);return{x:v[0]+r,y:v[1]+e}},pointDistance:function(r,e,t,n,i,a,o,s,u){var f=this.nearestPoint(r,e,t,n,s,u);return Tn(f.x,f.y,s,u)},pointAt:function(r,e,t,n,i,a,o,s){var u=(o-a)*s+a;return{x:zw(r,e,t,n,i,u),y:jw(r,e,t,n,i,u)}},tangentAngle:function(r,e,t,n,i,a,o,s){var u=(o-a)*s+a,f=Rj(r,e,t,n,i,a,o,u),l=Bj(r,e,t,n,i,a,o,u);return Sv(Math.atan2(l,f))}};function hk(r){for(var e=0,t=[],n=0;n<r.length-1;n++){var i=r[n],a=r[n+1],o=Tn(i[0],i[1],a[0],a[1]),s={from:i,to:a,length:o};t.push(s),e+=o}return{segments:t,totalLength:e}}function Uj(r){if(r.length<2)return 0;for(var e=0,t=0;t<r.length-1;t++){var n=r[t],i=r[t+1];e+=Tn(n[0],n[1],i[0],i[1])}return e}function $j(r,e){if(e>1||e<0||r.length<2)return null;var t=hk(r),n=t.segments,i=t.totalLength;if(i===0)return{x:r[0][0],y:r[0][1]};for(var a=0,o=null,s=0;s<n.length;s++){var u=n[s],f=u.from,l=u.to,c=u.length/i;if(e>=a&&e<=a+c){var h=(e-a)/c;o=xn.pointAt(f[0],f[1],l[0],l[1],h);break}a+=c}return o}function Xj(r,e){if(e>1||e<0||r.length<2)return 0;for(var t=hk(r),n=t.segments,i=t.totalLength,a=0,o=0,s=0;s<n.length;s++){var u=n[s],f=u.from,l=u.to,c=u.length/i;if(e>=a&&e<=a+c){o=Math.atan2(l[1]-f[1],l[0]-f[0]);break}a+=c}return o}function Yj(r,e,t){for(var n=1/0,i=0;i<r.length-1;i++){var a=r[i],o=r[i+1],s=xn.pointDistance(a[0],a[1],o[0],o[1],e,t);s<n&&(n=s)}return n}const dk={box:function(r){for(var e=[],t=[],n=0;n<r.length;n++){var i=r[n];e.push(i[0]),t.push(i[1])}return tf(e,t)},length:function(r){return Uj(r)},pointAt:function(r,e){return $j(r,e)},pointDistance:function(r,e,t){return Yj(r,e,t)},tangentAngle:function(r,e){return Xj(r,e)}};function Xw(r,e){return!r||!e?r||e:{minX:Math.min(r.minX,e.minX),minY:Math.min(r.minY,e.minY),maxX:Math.max(r.maxX,e.maxX),maxY:Math.max(r.maxY,e.maxY)}}function qm(r,e){var t=r.get("startArrowShape"),n=r.get("endArrowShape"),i=null,a=null;return t&&(i=t.getCanvasBBox(),e=Xw(e,i)),n&&(a=n.getCanvasBBox(),e=Xw(e,a)),e}function Wj(r){for(var e=r.attr(),t=e.points,n=[],i=[],a=0;a<t.length;a++){var o=t[a];n.push(o[0]),i.push(o[1])}var s=tf(n,i),u=s.x,f=s.y,l=s.width,c=s.height,h={minX:u,minY:f,maxX:u+l,maxY:f+c};return h=qm(r,h),{x:h.minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}}function qj(r){for(var e=r.attr(),t=e.points,n=[],i=[],a=0;a<t.length;a++){var o=t[a];n.push(o[0]),i.push(o[1])}return tf(n,i)}var sg=null;function vk(){if(!sg){var r=document.createElement("canvas");r.width=1,r.height=1,sg=r.getContext("2d")}return sg}function pk(r,e,t){var n=1;if(Fe(r)&&(n=r.split(`
3
3
  `).length),n>1){var i=Vj(e,t);return e*n+i*(n-1)}return e}function Vj(r,e){return e?e-r:r*.14}function Hj(r,e){var t=vk(),n=0;if(ht(r)||r==="")return n;if(t.save(),t.font=e,Fe(r)&&r.includes(`
4
4
  `)){var i=r.split(`
@@ -667,4 +667,4 @@ class CalcAveMovement {
667
667
  </div>
668
668
  `).concat(h,`
669
669
  </div>`)}},e.prototype.init=function(){var t=this;if(!t.destroyed){var n=t.get("graph"),i=n.getContainer(),a=t.get("container"),o=this.get("containerCfg");o?(a=this.createContainer(),i.appendChild(a)):a=i,this.set("container",a);var s=i.getBoundingClientRect(),u=new Fa({container:i,width:s.right-s.left,height:s.bottom-s.top});Qt(u.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",Kl(function(){return t.resizeCanvas(t)},100));var f=u.addGroup({id:"annotation-link-group"});t.set("linkGroup",f),t.set("canvas",u),t.get("getTitle")||t.set("getTitle",function(c){var h,d=((h=c==null?void 0:c.getModel)===null||h===void 0?void 0:h.call(c))||{},v=d.label,p=d.id;return v||p||"-"}),t.get("getContent")||t.set("getContent",function(c){var h,d;if(!c)return"-";var v=((h=c.getModel)===null||h===void 0?void 0:h.call(c))||{},p=v.label,g=v.id,y=(d=c.getType)===null||d===void 0?void 0:d.call(c),m=y?"".concat(y,": "):"";return"".concat(m).concat(p||g||"")});var l=t.get("defaultData");l&&this.readData(l)}},e.prototype.createContainer=function(){var t=this;if(!this.destroyed){var n=this.get("containerCfg"),i=this.get("graph"),a=i.getContainer(),o=a.getBoundingClientRect(),s=o.left,u=o.right,f=o.top,l=o.bottom,c=l-f,h=u-s,d=n.position,v=d===void 0?"top":d,p=n.offsetX,g=p===void 0?0:p,y=n.offsetY,m=y===void 0?0:y,x=kC(n,["position","offsetX","offsetY"]),b=n.height,w=b===void 0?"fit-content":b,E=n.width,S=E===void 0?i.getWidth():E;w==="100%"&&(w=c),S==="100%"&&(S=h);var _="unset",C="unset",M={};switch(v){case"right":_="".concat(c,"px"),M={top:0,right:0},M.right+=s+g,M.top+=f+m;break;case"bottom":C="".concat(h,"px"),M={bottom:0,left:0},M.left+=s+g,M.bottom+=f+m;break;case"top":C="".concat(h,"px");case"left":_="".concat(c,"px");default:M={top:0,left:0},M.left+=s+g,M.top+=f+m;break}Object.keys(M).forEach(function(T){M[T]="".concat(M[T],"px")});var A=Or("<div class='".concat(n.className," g6-annotation-container'></div>"));return Qt(A,oi(oi({position:"absolute",display:v==="top"||v==="bottom"?"inline-flex":"unset",width:dt(S)?"".concat(S,"px"):S,height:dt(w)?"".concat(w,"px"):w,maxHeight:_,maxWidth:C,overflow:"scroll"},M),x)),a.appendChild(A),A.addEventListener("scroll",function(T){t.updateLinks()}),A}},e.prototype.resizeCanvas=function(t){clearTimeout(t.resizeTimer),t.resizeTimer=setTimeout(function(){if(!(!t||t.destroyed)){var n=t.get("container").getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top;t.get("canvas").changeSize(i,a),t.updateOutsideCards(t)}},250)},e.prototype.updateOutsideCards=function(t){var n=t||this,i=n.get("cardInfoMap")||{},a=n.get("graph"),o=a.getPointByCanvas(0,0),s=a.getPointByCanvas(a.getWidth(),a.getHeight()),u=a.getClientByPoint(o.x,o.y),f=u.x,l=u.y,c=a.getClientByPoint(s.x,s.y),h=c.x,d=c.y;Object.values(i).forEach(function(v){var p=v.card;if(p){var g=p.style,y=cs(g.left),m=cs(g.top),x=p.getBoundingClientRect(),b=x.width,w=x.height,E=y,S=m;y+b>h-f&&(E=h-f-b),y<0&&(E=0),m+w>d-l&&(S=d-l-w),m<0&&(S=0),Qt(p,{left:"".concat(E,"px"),top:"".concat(S,"px")})}}),n.updateLinks()},e.prototype.showAnnotation=function(t){if(!this.destroyed){var n=t.item;this.toggleAnnotation(n)}},e.prototype.hideCards=function(){var t=this;if(!t.destroyed){var n=t.get("cardInfoMap")||{};Object.keys(n).forEach(function(i){t.hideCard(i)})}},e.prototype.toggleAnnotation=function(t,n){var i,a;n===void 0&&(n={});var o=this;if(!o.destroyed){var s=o.get("cardInfoMap")||{},u=o.get("graph"),f=o.get("container"),l=o.get("containerCfg"),c=Object.assign({},o.get("cardCfg")||{},n),h=c.minHeight,d=c.minWidth,v=c.width,p=c.height,g=c.collapsed,y=g===void 0?!1:g,m=c.x,x=c.y,b=c.title,w=c.content,E=c.maxTitleLength,S=c.defaultBegin,_=kC(c,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),C=o.get("linkGroup"),M=this.get("rows")||[[]],A=(i=t.isCanvas)===null||i===void 0?void 0:i.call(t),T=A?LC:t.getID(),I=s[T]||{},L=I.card,N=I.link,O=I.x,B=I.y,W=I.title,D=I.content,P=this.get("getTitle"),R=this.get("getContent"),X=this.get("getContentPlaceholder")||function(){return""},Y=this.get("getTitlePlaceHolder")||function(){return""},ee=X(t),U=Y(t),Z=Or(this.getDOMContent(oi({itemId:T,collapsed:y,title:((a=W||b||(P==null?void 0:P(t)))===null||a===void 0?void 0:a.substr(0,E))||U,content:D||w||(R==null?void 0:R(t))||ee},_))),K=dt(h)?"".concat(h,"px"):h;Qt(Z,{minHeight:y?"unset":K,minWidth:dt(d)?"".concat(d,"px"):d,height:p,width:v});var se=!!L;se?(N==null||N.remove(!0),f.replaceChild(Z,L)):f.appendChild(Z);var re;if(!l){if(re=f.getBoundingClientRect()||{},m!==void 0&&x!==void 0)O=m,B=x;else if(!se&&!A){var J=re.top,me=S||{},Ae=me.left,Ye=me.right,Ve=Ye===void 0?16:Ye,Ke=me.top,xt=Ke===void 0?8:Ke,kt=me.bottom,Lt=Ve,vr=xt;isNaN(Ae)||(Lt=f.scrollWidth-Ae),isNaN(kt)||(vr=f.scrollHeight-kt);var xr=dt(d)?d:100;O=f.scrollWidth-Z.scrollWidth-(M.length-1)*xr-Lt;var pt=M[M.length-1],Nt=(pt[pt.length-1]||{}).bbox;B=(Nt==null?void 0:Nt.bottom)-J||vr}Qt(Z,{position:"absolute",left:"".concat(O,"px"),top:"".concat(B,"px"),cusor:l?"unset":"move"})}this.bindListener(Z,T);var F=Z.getBoundingClientRect();if(!A){var zt=D0(t,F,u,this.get("canvas")),Ot=this.get("linkStyle");N=C.addShape("path",{attrs:oi({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:zt},Ot)})}if(s[T]=oi(oi({},s[T]||{}),{id:T,collapsed:y,card:Z,link:N,x:O,y:B,cardBBox:F,content:D||w,title:W||b,contentPlaceholder:ee,titlePlaceholder:U,isCanvas:A}),o.set("cardInfoMap",s),l)this.updateCardPositionsInConatainer(),this.updateLinks();else{var ut=!isNaN(m)&&!isNaN(x);if(!se&&!A&&!ut){var Gt=re.bottom,_t=Gt===void 0?0:Gt,J=re.top;M[M.length-1].push({id:T,bbox:F}),F.top>_t-J-F.height-16&&M.push([]),this.set("rows",M)}}this.updateCardSize(T);var ct=this.get("onAnnotationChange");ct==null||ct(s[T],se?"update":"create")}},e.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var t=this.get("cardInfoMap");if(t){var n=this.get("container"),i=this.get("containerCfg").position,a=n.getBoundingClientRect().width,o=getComputedStyle(n),s=cs(o.paddingLeft)+cs(o.paddingRight);a-=s,Object.values(t).forEach(function(u){var f=u.card,l=f.getBoundingClientRect().width;switch(i){case"right":Qt(f,{marginLeft:a?"".concat(a-l,"px"):"0px"});break;case"top":case"bottom":Qt(f,{marginLeft:"8px"})}})}}},e.prototype.handleExpandCollapseCard=function(t){if(!this.destroyed){var n=this.get("graph"),i=this.get("cardInfoMap");if(i){var a=i[t].collapsed,o=n.findById(t);if(o){var s=this.get("cardCfg").collapseType;s==="hide"&&!a?this.hideCard(t):this.toggleAnnotation(o,{collapsed:!a}),i[t]=oi(oi({},i[t]),{collapsed:!a})}}}},e.prototype.hideCard=function(t){if(!this.destroyed){var n=this.get("cardInfoMap");if(!(!n||!n[t])){var i=n[t],a=i.card,o=i.link;Qt(a,{display:"none"}),o==null||o.hide();var s=this.get("onAnnotationChange");s(n[t],"hide")}}},e.prototype.removeCard=function(t){if(!this.destroyed){var n=this.get("cardInfoMap");if(n){var i=n[t],a=i.card,o=i.link,s=this.get("container");s.removeChild(a),o==null||o.remove(!0),delete n[t];var u=this.get("onAnnotationChange");u(i,"remove")}}},e.prototype.bindListener=function(t,n){var i=this;if(!this.destroyed){t.addEventListener("mousemove",function(u){var f;if(u.target.className==="g6-annotation-collapse"?f="collapse":u.target.className==="g6-annotation-expand"?f="expand":u.target.className==="g6-annotation-close"&&(f="close"),f){var l=i.get("cardCfg").onMouseEnterIcon,c=l===void 0?function(){}:l;c(u,n,f)}}),t.addEventListener("mouseout",function(u){var f;if(u.target.className==="g6-annotation-collapse"?f="collapse":u.target.className==="g6-annotation-expand"?f="expand":u.target.className==="g6-annotation-close"&&(f="close"),f){var l=i.get("cardCfg").onMouseLeaveIcon,c=l===void 0?function(){}:l;c(u,n,f)}}),t.addEventListener("mouseenter",function(u){var f=i.get("cardInfoMap");if(f){var l=i.get("graph"),c=l.findById(n);if(c){var h=i.get("itemHighlightState");l.setItemState(c,h,!0)}var d=f[n].link;if(d){var v=i.get("linkHighlightStyle")||{};d.attr(v)}}}),t.addEventListener("mouseleave",function(u){var f=i.get("cardInfoMap");if(f){var l=i.get("graph"),c=l.findById(n);if(c){var h=i.get("itemHighlightState");l.setItemState(c,h,!1)}var d=f[n].link;if(d){var v=i.get("linkHighlightStyle")||{};Object.keys(v).forEach(function(g){d.attr(g,void 0),d.attr(g,void 0)});var p=i.get("linkStyle");d.attr(p)}}}),t.addEventListener("click",function(u){var f=(i.get("cardCfg")||{}).onClickIcon;if(u.target.className==="g6-annotation-collapse"||u.target.className==="g6-annotation-expand"){var l=i.get("cardCfg").collapseType;l==="hide"?i.hideCard(n):i.handleExpandCollapseCard(n),f==null||f(u,n,u.target.className==="g6-annotation-collapse"?"collapse":"expand")}else if(u.target.className==="g6-annotation-close"){var c=i.get("cardCfg").closeType;c==="remove"?i.removeCard(n):i.hideCard(n),f==null||f(u,n,"close")}});var a=this.get("editable");a&&t.addEventListener("dblclick",function(u){var f=i.get("cardInfoMap"),l=(i.get("cardCfg")||{}).maxTitleLength,c=l===void 0?20:l;if(f){var h=u.target,d=h.className;if(!(d!=="g6-annotation-title"&&d!=="g6-annotation-content")){var v=d==="g6-annotation-title"?h.getBoundingClientRect():h.parentNode.getBoundingClientRect(),p=v.width,g=v.height,y=getComputedStyle(h),m=d==="g6-annotation-title"?"input":"textarea",x=Or("<".concat(m,' class="').concat(d,'-input" type="textarea" style="width:').concat(p,"px; height: ").concat(g,'px; min-width: 16px;"/>')),b=Or('<div class="'.concat(d,'-input-wrapper" style="width: ').concat(p,"px; height: ").concat(g,"px; min-width: 16px; margin-right: ").concat(y.marginRight,'" />'));b.appendChild(x),h.parentNode.replaceChild(b,h);var w=f[n],E=w.contentPlaceholder,S=w.titlePlaceholder,_=w.content,C=w.title,M=_;d==="g6-annotation-title"?(x.name="title",x.maxLength=c,M=C):x.name="content",M?(x.innerHTML=h.innerHTML,x.value=h.innerHTML):x.placeholder=d==="g6-annotation-title"?S:E,x.focus(),x.addEventListener("blur",function(A){x.value&&(h.innerHTML=x.value,w[x.name||"title"]=x.value),b.parentNode.replaceChild(h,b),i.updateCardSize(n);var T=i.get("onAnnotationChange");T==null||T(w,"update")})}}});var o=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];t.draggable=!0,t.addEventListener("dragstart",function(u){var f=u.target.className;if(!o.includes(f)){var l=t.style;i.set("dragging",{card:t,x:u.clientX,y:u.clientY,left:cs(l.left),top:cs(l.top)})}}),t.addEventListener("drag",function(u){u.preventDefault();var f=i.get("cardInfoMap");if(f){var l=u.clientX,c=u.clientY,h=i.get("dragging");if(!(isNaN(l)||isNaN(c)||!h)){var d=h.x,v=h.y,p=h.left,g=h.top,y=h.card,m=l-d,x=c-v;p+=m,g+=x;var b=i.get("graph"),w=b.getPointByCanvas(0,0),E=b.getPointByCanvas(b.getWidth(),b.getHeight()),S=b.getClientByPoint(w.x,w.y),_=S.x,C=S.y,M=b.getClientByPoint(E.x,E.y),A=M.x,T=M.y,I=y.getBoundingClientRect(),L=I.right-I.left,N=I.bottom-I.top;(p>A-_-L&&m>0||p<0&&m<0)&&(p-=m),(g>T-C-N&&x>0||g<0&&x<0)&&(g-=x),Qt(y,{left:"".concat(p,"px"),top:"".concat(g,"px"),visibility:"hidden"}),d=l,v=c;var O=(f[n]||{}).link;if(O){var B=b.findById(n);O.attr("path",D0(B,I,b,i.get("canvas")))}i.set("dragging",{x:d,y:v,left:p,top:g,card:y})}}});var s=function(f){var l=i.get("cardInfoMap");if(l){var c=i.get("dragging");if(c){var h=c.left,d=c.top,v=c.card;l[n].x=h,l[n].y=d,Qt(v,{visibility:"visible"}),i.set("dragging",!1);var p=i.get("rows");p==null||p.forEach(function(y){for(var m=y.length-1;m>=0;m--)y[m].id===n&&y.splice(m,1)});var g=i.get("onAnnotationChange");g==null||g(l[n],"update")}}};t.addEventListener("dragend",s)}},e.prototype.updateCardSize=function(t){var n=this.get("cardInfoMap");if(n){var i=n[t].card,a=i.getBoundingClientRect().width,o=i.getElementsByClassName("g6-annotation-title")[0];if(o){var s=getComputedStyle(o),u=cs(s.marginLeft),f=o.getBoundingClientRect().width;Qt(o,{marginRight:"".concat(a-u-24-16-f,"px")})}}},e.prototype.updateLink=function(t){var n=t.item;if(n){var i=this.get("cardInfoMap");if(i){var a=this.get("canvas"),o=this.get("graph"),s=n.getID(),u=i[s]||{},f=u.link,l=u.card;if(f){var c=D0(n,l.getBoundingClientRect(),o,a);f.attr("path",c)}}}},e.prototype.updateLinks=function(){var t=this;if(!this.destroyed){var n=this.get("cardInfoMap");if(n){var i=this.get("graph");Object.values(n).forEach(function(a){var o=a.id,s=i.findById(o);t.updateLink({item:s})})}}},e.prototype.onGraphDataChange=function(){var t=this,n=this.get("cardInfoMap");if(n){var i=this.get("graph");Object.values(n).forEach(function(a){var o=a.id,s=a.card,u=a.isCanvas;if(!(!s||u||s.style.display==="none")){var f=i.findById(o);f&&f.isVisible()?t.toggleAnnotation(f):t.hideCard(o)}})}},e.prototype.onGraphItemVisibilityChange=function(t){var n=t.item,i=t.visible;if(!(!n||n.destroyed)){var a=this.get("cardInfoMap");if(a){var o=n.getID();a[o]&&(i||this.hideCard(o))}}},e.prototype.saveData=function(t){t===void 0&&(t=!1);var n=this.get("cardInfoMap");if(n){var i=this.get("graph"),a=this.get("getTitle"),o=this.get("getContent"),s=[];return Object.values(n).forEach(function(u){var f=u.title,l=u.content,c=u.x,h=u.y,d=u.id,v=u.collapsed,p=u.card;if(!(p&&p.style.display==="none"&&!t)){var g=i.findById(d)||i.get("canvas");s.push({id:d,x:c,y:h,collapsed:v,title:f||(a==null?void 0:a(g)),content:l||(o==null?void 0:o(g)),visible:p&&p.style.display!=="none"})}}),s}},e.prototype.readData=function(t){var n=this,i=this.get("graph");t.forEach(function(a){var o=a.id,s=a.x,u=a.y,f=a.title,l=a.content,c=a.collapsed,h=a.visible,d=i.findById(o);if(!d&&o===LC&&(d=i.get("canvas")),!d){var v=n.get("cardInfoMap")||{};v[o]=a,n.set("cardInfoMap",v);return}n.toggleAnnotation(d,{x:s,y:u,title:f,content:l,collapsed:c}),h||n.hideCard(o)})},e.prototype.clear=function(){var t=this.get("cardInfoMap");if(t){var n=this.get("container");Object.values(t).forEach(function(i){var a=i.card,o=i.link;n.removeChild(a),o==null||o.remove(!0)}),this.set("cardInfoMap",{})}},e.prototype.destroy=function(){var t;this.clear(),(t=this.get("canvas"))===null||t===void 0||t.destroy();var n=this.get("graph");!n||n.destroyed||(this.get("containerCfg")&&n.getContainer().removeChild(this.get("container")),this.destroyed=!0)},e}($n),Xie=function(e,t){var n,i,a=1/0;Object.keys(e).forEach(function(u){var f=e[u];Object.keys(t).forEach(function(l){var c=t[l],h=f.x-c.x,d=f.y-c.y,v=h*h+d*d;a>v&&(a=v,n=f,i=c)})});var o=20,s=Sn.getControlPoint(n,i,.5,o);return[["M",n.x,n.y],["Q",s.x,s.y,i.x,i.y]]},D0=function(e,t,n,i){var a,o,s=e.getType();if(s==="edge")o=[e.getKeyShape().getPoint(.5)];else{var u=(a=e.getKeyShape)===null||a===void 0?void 0:a.call(e).getBBox(),f=u.minX,l=u.minY,c=u.maxX,h=u.maxY,d=e.getModel(),v=d.x,p=d.y;f+=v,l+=p,c+=v,h+=p,o={left:{x:f,y:(l+h)/2},right:{x:c,y:(l+h)/2},top:{x:(f+c)/2,y:l},bottom:{x:(f+c)/2,y:h}}}Object.keys(o).forEach(function(C){var M=o[C],A=M.x,T=M.y,I=n.getClientByPoint(A,T);o[C]=i.getPointByClient(I.x,I.y)});var g=t.top,y=g===void 0?0:g,m=t.left,x=m===void 0?0:m,b=t.right,w=b===void 0?0:b,E=t.bottom,S=E===void 0?0:E,_={left:i.getPointByClient(x,(y+S)/2),right:i.getPointByClient(w,(y+S)/2),top:i.getPointByClient((x+w)/2,y),bottom:i.getPointByClient((x+w)/2,S)};return Xie(o,_)},cs=function(e){return Number(e.replace(/\s+|px/gi,""))||0},Zn={PluginBase:$n,Menu:Nre,Grid:Tre,Minimap:Fre,Bundling:jre,ToolBar:Wre,Tooltip:Vre,Fisheye:$re,TimeBar:Aie,ImageMinimap:Lie,EdgeFilterLens:Die,SnapLine:Fie,Legend:jie,Annotation:$ie};$a("circle",{options:{size:Je.defaultNode.size,style:{x:0,y:0,stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:z({},Je.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=Tr({},i,e.icon),s="".concat(this.type,"-keyShape"),u=t.addShape("circle",{attrs:a,className:s,name:s,draggable:!0});t.shapeMap[s]=u;var f=o.width,l=o.height,c=o.show,h=o.text;if(c){var d="".concat(this.type,"-icon");h?t.shapeMap[d]=t.addShape("text",{attrs:z({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:d,name:d,draggable:!0}):t.shapeMap[d]=t.addShape("image",{attrs:z({x:-f/2,y:-l/2},o),className:d,name:d,draggable:!0})}return this.drawLinkPoints(e,t),u},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints;if(n){var i=n||{},a=i.top,o=i.left,s=i.right,u=i.bottom,f=i.size,l=i.r,c=un(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0]/2;if(o){var v="link-point-left";t.shapeMap[v]=t.addShape("circle",{attrs:z(z({},c),{x:-d,y:0,r:f/2||l||5}),className:v,name:v,isAnchorPoint:!0})}if(s){var p="link-point-right";t.shapeMap[p]=t.addShape("circle",{attrs:z(z({},c),{x:d,y:0,r:f/2||l||5}),className:p,name:p,isAnchorPoint:!0})}if(a){var g="link-point-top";t.shapeMap[g]=t.addShape("circle",{attrs:z(z({},c),{x:0,y:-d,r:f/2||l||5}),className:g,name:g,isAnchorPoint:!0})}if(u){var y="link-point-bottom";t.shapeMap[y]=t.addShape("circle",{attrs:z(z({},c),{x:0,y:d,r:f/2||l||5}),className:y,name:y,isAnchorPoint:!0})}}},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=Tr({},t,n),a=this.getSize(e),o=a[0]/2,s=z({x:0,y:0,r:o},i);return s},update:function(e,t,n){var i=t.getContainer(),a=this.getSize(e),o=z({},e.style);e.style.stroke===void 0&&e.color&&(o.stroke=e.color),e.style.r===void 0&&!isNaN(a[0])&&(o.r=a[0]/2),this.updateShape(e,t,o,!0,n),this.updateLinkPoints(e,i)}},"single-node");$a("rect",{options:{size:[100,30],style:{radius:0,stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:z({},Je.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(e,t){var n=this.getShapeStyle(e),i=t.addShape("rect",{attrs:n,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return t.shapeMap["".concat(this.type,"-keyShape")]=i,this.drawLinkPoints(e,t),i},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,f=i.size,l=i.r,c=un(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0],v=h[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:z(z({},c),{x:-d/2,y:0,r:f/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:z(z({},c),{x:d/2,y:0,r:f/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:z(z({},c),{x:0,y:-v/2,r:f/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:z(z({},c),{x:0,y:v/2,r:f/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=bt({},t,n),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],u=z({x:-o/2,y:-s/2,width:o,height:s},i);return u},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s=t.get("keyShape");e.size||(o[0]=s.attr("width")||a.width,o[1]=s.attr("height")||a.height);var u={stroke:e.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},f=bt({},a,s.attr(),u);f=bt(f,e.style),this.updateShape(e,t,f,!1,n),this.updateLinkPoints(e,i)}},"single-node");$a("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:z({},Je.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=t.addShape("ellipse",{attrs:a,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});t.shapeMap["ellipse-keyShape"]=o;var s=i.width,u=i.height,f=i.show,l=i.text;return f&&(l?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:z({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:z({x:-s/2,y:-u/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,f=i.size,l=i.r,c=un(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0]/2,v=h[1]/2;o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:z(z({},c),{x:-d,y:0,r:f/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:z(z({},c),{x:d,y:0,r:f/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:z(z({},c),{x:0,y:-v,r:f/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:z(z({},c),{x:0,y:v,r:f/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=bt({},t,n),a=this.getSize(e),o=a[0]/2,s=a[1]/2,u=z({x:0,y:0,rx:o,ry:s},i);return u},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s={stroke:e.color,rx:o[0]/2,ry:o[1]/2},u=t.get("keyShape"),f=bt({},a,u.attr(),s);f=bt(f,e.style),this.updateShape(e,t,f,!0,n),this.updateLinkPoints(e,i)}},"single-node");$a("diamond",{options:{size:[80,80],style:{stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:z({},Je.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,u=i.height,f=i.show,l=i.text;return f&&(l?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:z({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:z({x:-s/2,y:-u/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,f=i.size,l=i.r,c=un(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0],v=h[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:z(z({},c),{x:-d/2,y:0,r:f/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:z(z({},c),{x:d/2,y:0,r:f/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:z(z({},c),{x:0,y:-v/2,r:f/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:z(z({},c),{x:0,y:v/2,r:f/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(e){var t=this.getSize(e),n=t[0],i=t[1],a=[["M",0,-i/2],["L",n/2,0],["L",0,i/2],["L",-n/2,0],["Z"]];return a},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=bt({},t,n),a=this.getPath(e),o=z({path:a},i);return o},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},u=t.get("keyShape"),f=bt({},a,u.attr(),s);f=bt(f,e.style),this.updateShape(e,t,f,!0,n),this.updateLinkPoints(e,i)}},"single-node");$a("triangle",{options:{size:40,direction:"up",style:{stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:z({},Je.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(e,t){var n=this.mergeStyle||this.getOptions(e),i=n.icon,a=i===void 0?{}:i,o=n.direction,s=this.getShapeStyle(e),u=e.direction||o,f=t.addShape("path",{attrs:s,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=f;var l=a.width,c=a.height,h=a.show,d=a.offset,v=a.text;if(h)if(v)t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:z({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var p=-l/2,g=-c/2;(u==="up"||u==="down")&&(g+=d),(u==="left"||u==="right")&&(p+=d),t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:z({x:p,y:g},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(e,t),f},drawLinkPoints:function(e,t){var n=this.mergeStyle||this.getOptions(e),i=n.linkPoints,a=i===void 0?{}:i,o=n.direction,s=e.direction||o,u=a.top,f=a.left,l=a.right,c=a.bottom,h=a.size,d=a.r,v=un(a,["top","left","right","bottom","size","r"]),p=this.getSize(e),g=p[0];if(f){var y=null,m=g*Math.sin(1/3*Math.PI),x=g*Math.sin(1/3*Math.PI);s==="up"?y=[-x,m]:s==="down"?y=[-x,-m]:s==="left"&&(y=[-x,x-m]),y&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:z(z({},v),{x:y[0],y:y[1],r:h/2||d||5}),className:"link-point-left",name:"link-point-left"}))}if(l){var b=null,m=g*Math.sin(1/3*Math.PI),x=g*Math.sin(1/3*Math.PI);s==="up"?b=[x,m]:s==="down"?b=[x,-m]:s==="right"&&(b=[x,x-m]),b&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:z(z({},v),{x:b[0],y:b[1],r:h/2||d||5}),className:"link-point-right",name:"link-point-right"}))}if(u){var w=null,m=g*Math.sin(1/3*Math.PI),x=g*Math.sin(1/3*Math.PI);s==="up"?w=[x-m,-m]:s==="left"?w=[x,-m]:s==="right"&&(w=[-x,-m]),w&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:z(z({},v),{x:w[0],y:w[1],r:h/2||d||5}),className:"link-point-top",name:"link-point-top"}))}if(c){var E=null,m=g*Math.sin(1/3*Math.PI),x=g*Math.sin(1/3*Math.PI);s==="down"?E=[-x+m,m]:s==="left"?E=[x,m]:s==="right"&&(E=[-x,m]),E&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:z(z({},v),{x:E[0],y:E[1],r:h/2||d||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(e){var t=(this.mergeStyle||this.getOptions(e)).direction,n=e.direction||t,i=this.getSize(e),a=i[0],o=a*Math.sin(1/3*Math.PI),s=a*Math.sin(1/3*Math.PI),u=[["M",-s,o],["L",0,-o],["L",s,o],["Z"]];return n==="down"?u=[["M",-s,-o],["L",s,-o],["L",0,o],["Z"]]:n==="left"?u=[["M",-s,s-o],["L",s,-s],["L",s,s],["Z"]]:n==="right"&&(u=[["M",s,s-o],["L",-s,s],["L",-s,-s],["Z"]]),u},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=bt({},t,n),a=this.getPath(e),o=z({path:a},i);return o},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},u=t.get("keyShape"),f=bt({},a,u.attr(),s);f=bt(f,e.style),this.updateShape(e,t,f,!0,n),this.updateLinkPoints(e,i)},updateLinkPoints:function(e,t){var n=this.getOptions({}),i=n.linkPoints,a=n.direction,o=e.direction||a,s=t.shapeMap["link-point-left"]||t.find(function(O){return O.get("className")==="link-point-left"}),u=t.shapeMap["link-point-right"]||t.find(function(O){return O.get("className")==="link-point-right"}),f=t.shapeMap["link-point-top"]||t.find(function(O){return O.get("className")==="link-point-top"}),l=t.shapeMap["link-point-bottom"]||t.find(function(O){return O.get("className")==="link-point-bottom"}),c=i,h=s||u||f||l;h&&(c=h.attr());var d=bt({},c,e.linkPoints),v=d.fill,p=d.stroke,g=d.lineWidth,y=d.size/2;y||(y=d.r);var m=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},x=m.left,b=m.right,w=m.top,E=m.bottom,S=this.getSize(e),_=S[0],C={r:y,fill:v,stroke:p,lineWidth:g},M=null,A=_*Math.sin(1/3*Math.PI),T=_*Math.sin(1/3*Math.PI);o==="up"?M=[-T,A]:o==="down"?M=[-T,-A]:o==="left"&&(M=[-T,T-A]),M&&(s?!x&&x!==void 0?(s.remove(),delete t.shapeMap["link-point-left"]):s.attr(z(z({},C),{x:M[0],y:M[1]})):x&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:z(z({},C),{x:M[0],y:M[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var I=null;o==="up"?I=[T,A]:o==="down"?I=[T,-A]:o==="right"&&(I=[T,T-A]),I&&(u?!b&&b!==void 0?(u.remove(),delete t.shapeMap["link-point-right"]):u.attr(z(z({},C),{x:I[0],y:I[1]})):b&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:z(z({},C),{x:I[0],y:I[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var L=null;o==="up"?L=[T-A,-A]:o==="left"?L=[T,-A]:o==="right"&&(L=[-T,-A]),L&&(f?!w&&w!==void 0?(f.remove(),delete t.shapeMap["link-point-top"]):f.attr(z(z({},C),{x:L[0],y:L[1]})):w&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:z(z({},C),{x:L[0],y:L[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var N=null;o==="down"?N=[-T+A,A]:o==="left"?N=[T,A]:o==="right"&&(N=[-T,A]),N&&(l?!E&&E!==void 0?(l.remove(),delete t.shapeMap["link-point-bottom"]):l.attr(z(z({},C),{x:N[0],y:N[1]})):E&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:z(z({},C),{x:N[0],y:N[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node");$a("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:Je.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:Je.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:Je.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).preRect,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=this.getSize(e),s=o[0],u=o[1],f=t.addShape("rect",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=f;var l=i.show,c=un(i,["show"]);return l&&(t.shapeMap["pre-rect"]=t.addShape("rect",{attrs:z({x:-s/2,y:-u/2,height:u},c),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(e,t),this.drawStateIcon(e,t),this.drawLinkPoints(e,t),f},drawLogoIcon:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).logoIcon,i=n===void 0?{}:n,a=this.getSize(e),o=a[0];if(i.show){var s=i.width,u=i.height,f=i.x,l=i.y,c=i.offset,h=i.text,d=un(i,["width","height","x","y","offset","text"]);h?t.shapeMap["rect-logo-icon"]=t.addShape("text",{attrs:z({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):t.shapeMap["rect-logo-icon"]=t.addShape("image",{attrs:z(z({},d),{x:f||-o/2+s+c,y:l||-u/2,width:s,height:u}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).stateIcon,i=n===void 0?{}:n,a=this.getSize(e),o=a[0];if(i.show){var s=i.width,u=i.height,f=i.x,l=i.y,c=i.offset,h=i.text,d=un(i,["width","height","x","y","offset","text"]);h?t.shapeMap["rect-state-icon"]=t.addShape("text",{attrs:z({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):t.shapeMap["rect-state-icon"]=t.addShape("image",{attrs:z(z({},d),{x:f||o/2-s+c,y:l||-u/2,width:s,height:u}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,f=i.size,l=i.r,c=un(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0],v=h[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:z(z({},c),{x:-d/2,y:0,r:f/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:z(z({},c),{x:d/2,y:0,r:f/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:z(z({},c),{x:0,y:-v/2,r:f/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:z(z({},c),{x:0,y:v/2,r:f/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(e,t){var n=this.getOptions(e),i=n.labelCfg,a=i===void 0?{}:i,o=n.logoIcon,s=o===void 0?{}:o,u=n.descriptionCfg,f=u===void 0?{}:u,l=this.getSize(e),c=l[0],h=null,d=s.show,v=s.width,p=-c/2+a.offset;d&&(p=-c/2+v+a.offset);var g=a.style,y=f.style,m=f.paddingTop;return Fe(e.description)?(h=t.addShape("text",{attrs:z(z({},g),{x:p,y:-5,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=h,t.shapeMap["rect-description"]=t.addShape("text",{attrs:z(z({},y),{x:p,y:17+(m||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(h=t.addShape("text",{attrs:z(z({},g),{x:p,y:7,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=h),h},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=bt({},t,n),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],u=z({x:-o/2,y:-s/2,width:o,height:s},i);return u},update:function(e,t){var n=this.mergeStyle||this.getOptions(e),i=n.style,a=i===void 0?{}:i,o=n.labelCfg,s=o===void 0?{}:o,u=n.descriptionCfg,f=u===void 0?{}:u,l=this.getSize(e),c=l[0],h=l[1],d=t.get("keyShape");d.attr(z(z({},a),{x:-c/2,y:-h/2,width:c,height:h}));var v=t.getContainer(),p=v.shapeMap["rect-logo-icon"]||v.find(function(Z){return Z.get("className")==="rect-logo-icon"}),g=p?p.attr():{},y=bt({},g,e.logoIcon),m=y.width;m===void 0&&(m=this.options.logoIcon.width);var x=e.logoIcon?e.logoIcon.show:void 0,b=s.offset,w=-c/2+m+b;!x&&x!==void 0&&(w=-c/2+b);var E=v.shapeMap["node-label"]||v.find(function(Z){return Z.get("className")==="node-label"}),S=v.shapeMap["rect-description"]||v.find(function(Z){return Z.get("className")==="rect-description"});if(e.label)if(!E)v.shapeMap["node-label"]=v.addShape("text",{attrs:z(z({},s.style),{x:w,y:e.description?-5:7,text:e.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});else{var _=e.labelCfg?e.labelCfg.style:{},C=bt({},E.attr(),_);e.label&&(C.text=e.label),C.x=w,Fe(e.description)&&(C.y=-5),S&&(S.resetMatrix(),S.attr({x:w})),E.resetMatrix(),E.attr(C)}if(Fe(e.description)){var M=f.paddingTop;if(!S)v.shapeMap["rect-description"]=v.addShape("text",{attrs:z(z({},f.style),{x:w,y:17+(M||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0});else{var _=e.descriptionCfg?e.descriptionCfg.style:{},A=bt({},S.attr(),_);Fe(e.description)&&(A.text=e.description),A.x=w,S.resetMatrix(),S.attr(z(z({},A),{y:17+(M||0)}))}}var T=v.shapeMap["pre-rect"]||v.find(function(Z){return Z.get("className")==="pre-rect"});if(T&&!T.destroyed){var I=bt({},T.attr(),e.preRect);T.attr(z(z({},I),{x:-c/2,y:-h/2,height:h}))}if(p&&!p.destroyed)if(!x&&x!==void 0)p.remove(),delete v.shapeMap["pre-rect"];else{var L=y.width,N=y.height,O=y.x,B=y.y,W=y.offset,D=un(y,["width","height","x","y","offset"]);p.attr(z(z({},D),{x:O||-c/2+L+W,y:B||-N/2,width:L,height:N}))}else x&&this.drawLogoIcon(e,v);var P=v.shapeMap["rect-state-icon"]||v.find(function(Z){return Z.get("className")==="rect-state-icon"}),R=P?P.attr():{},X=bt({},R,e.stateIcon);if(P){!X.show&&X.show!==void 0&&(P.remove(),delete v.shapeMap["rect-state-icon"]);var Y=X.width,N=X.height,O=X.x,B=X.y,ee=X.offset,U=un(X,["width","height","x","y","offset"]);P.attr(z(z({},U),{x:O||c/2-Y+ee,y:B||-N/2,width:Y,height:N}))}else X.show&&this.drawStateIcon(e,v);this.updateLinkPoints(e,v)},getOptions:function(e,t){return t==="move"?e:Tr({},this.options,this.getCustomConfig(e)||{},e)}},"single-node");$a("star",{options:{size:60,style:{stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:z({},Je.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,u=i.height,f=i.show,l=i.text;return f&&(l?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:z({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:z({x:-s/2,y:-u/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.leftBottom,f=i.rightBottom,l=i.size,c=i.r,h=un(i,["top","left","right","leftBottom","rightBottom","size","r"]),d=this.getSize(e),v=d[0];if(s){var p=Math.cos(.1*Math.PI)*v,g=Math.sin((18+72*0)/180*Math.PI)*v;t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:z(z({},h),{x:p,y:-g,r:l/2||c||5}),className:"link-point-right",name:"link-point-right"})}if(a){var p=Math.cos(.5*Math.PI)*v,g=Math.sin((18+72*1)/180*Math.PI)*v;t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:z(z({},h),{x:p,y:-g,r:l/2||c||5}),className:"link-point-top",name:"link-point-top"})}if(o){var p=Math.cos(.9*Math.PI)*v,g=Math.sin((18+72*2)/180*Math.PI)*v;t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:z(z({},h),{x:p,y:-g,r:l/2||c||5}),className:"link-point-left",name:"link-point-left"})}if(u){var p=Math.cos(1.3*Math.PI)*v,g=Math.sin((18+72*3)/180*Math.PI)*v;t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:z(z({},h),{x:p,y:-g,r:l/2||c||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(f){var p=Math.cos(1.7*Math.PI)*v,g=Math.sin((18+72*4)/180*Math.PI)*v;t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:z(z({},h),{x:p,y:-g,r:l/2||c||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(e){var t=this.getSize(e),n=t[0],i=n*3/8,a=e.innerR||i;return Sn.getStarPath(n,a)},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=bt({},t,n),a=this.getPath(e),o=z({path:a},i);return o},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},u=t.get("keyShape"),f=bt({},a,u.attr(),s);f=bt(f,e.style),this.updateShape(e,t,f,!0,n),this.updateLinkPoints(e,i)},updateLinkPoints:function(e,t){var n=this.getOptions({}).linkPoints,i=t.shapeMap["link-point-left"]||t.find(function(A){return A.get("className")==="link-point-left"}),a=t.shapeMap["link-point-right"]||t.find(function(A){return A.get("className")==="link-point-right"}),o=t.shapeMap["link-point-top"]||t.find(function(A){return A.get("className")==="link-point-top"}),s=t.shapeMap["link-point-left-bottom"]||t.find(function(A){return A.get("className")==="link-point-left-bottom"}),u=t.shapeMap["link-point-left-bottom"]||t.find(function(A){return A.get("className")==="link-point-right-bottom"}),f=n,l=i||a||o||s||u;l&&(f=l.attr());var c=bt({},f,e.linkPoints),h=c.fill,d=c.stroke,v=c.lineWidth,p=c.size/2;p||(p=c.r);var g=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},y=g.left,m=g.right,x=g.top,b=g.leftBottom,w=g.rightBottom,E=this.getSize(e),S=E[0],_={r:p,fill:h,stroke:d,lineWidth:v},C=Math.cos((18+72*0)/180*Math.PI)*S,M=Math.sin((18+72*0)/180*Math.PI)*S;a?!m&&m!==void 0?(a.remove(),delete t.shapeMap["link-point-right"]):a.attr(z(z({},_),{x:C,y:-M})):m&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:z(z({},_),{x:C,y:-M}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),C=Math.cos((18+72*1)/180*Math.PI)*S,M=Math.sin((18+72*1)/180*Math.PI)*S,o?!x&&x!==void 0?(o.remove(),delete t.shapeMap["link-point-top"]):o.attr(z(z({},_),{x:C,y:-M})):x&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:z(z({},_),{x:C,y:-M}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),C=Math.cos((18+72*2)/180*Math.PI)*S,M=Math.sin((18+72*2)/180*Math.PI)*S,i?!y&&y!==void 0?(i.remove(),delete t.shapeMap["link-point-left"]):i.attr(z(z({},_),{x:C,y:-M})):y&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:z(z({},_),{x:C,y:-M}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),C=Math.cos((18+72*3)/180*Math.PI)*S,M=Math.sin((18+72*3)/180*Math.PI)*S,s?!b&&b!==void 0?(s.remove(),delete t.shapeMap["link-point-left-bottom"]):s.attr(z(z({},_),{x:C,y:-M})):b&&(t.shapeMap["link-point-left-bottom"]=t.addShape("circle",{attrs:z(z({},_),{x:C,y:-M}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),C=Math.cos((18+72*4)/180*Math.PI)*S,M=Math.sin((18+72*4)/180*Math.PI)*S,u?!w&&w!==void 0?(u.remove(),delete t.shapeMap["link-point-right-bottom"]):u.attr(z(z({},_),{x:C,y:-M})):w&&(t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:z(z({},_),{x:C,y:-M}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var NC=Sn.defaultSubjectColors,Cl="fan-shape-";$a("donut",{options:{size:Je.defaultNode.size,style:{x:0,y:0,stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:z({},Je.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=Tr({},i,e.icon),s=t.addShape("circle",{attrs:a,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});t.shapeMap["".concat(this.type,"-keyShape")]=s;var u=o.width,f=o.height,l=o.show,c=o.text;return l&&(c?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:z({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:z({x:-u/2,y:-f/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),Yie(e,t,s),this.drawLinkPoints(e,t),s},updateShape:function(e,t,n,i,a){var o=t.get("keyShape");o.attr(z({},n)),Wie(e,t,o),this.updateLabel(e,t,a),i&&this.updateIcon(e,t)}},"circle");var Yie=function(e,t,n){var i=e.donutAttrs,a=i===void 0?{}:i,o=e.donutColorMap,s=o===void 0?{}:o,u=Object.keys(a).length;if(a&&u>1){var f=zD(a,s),l=f.configs,c=f.totalValue;if(c){var h=jD(n),d=h.lineWidth,v=h.arcR,p=[v,0],g=0;if(u===1){rm(t,{arcR:v,arcBegin:p,beginAngle:g,config:l[0],fanIndex:0,lineWidth:d,totalValue:c,drawWhole:!0});return}for(var y=0;y<l.length;y++){var m=rm(t,{arcR:v,arcBegin:p,beginAngle:g,config:l[y],fanIndex:y,lineWidth:d,totalValue:c});if(m.shouldEnd)return;p=m.arcBegin,g=m.beginAngle}}}},rm=function(e,t){var n=t.arcR,i=t.arcBegin,a=t.beginAngle,o=t.config,s=t.fanIndex,u=t.lineWidth,f=t.totalValue,l=t.drawWhole,c=l===void 0?!1:l,h=t.updateShape,d=h===void 0?void 0:h,v=o.value/f;if(v<.001)return{beginAngle:a,arcBegin:i,shape:void 0,shouldEnd:!1};var p,g,y;if(c||v>.999)p=[n,1e-4],y=1;else{var m=v*Math.PI*2;g=a+m,p=[n*Math.cos(g),-n*Math.sin(g)],y=m>Math.PI?1:0}var x={path:[["M",i[0],i[1]],["A",n,n,0,y,0,p[0],p[1]]],stroke:o.color||(d==null?void 0:d.attr("stroke"))||NC[s%NC.length],lineWidth:u};return d?d.attr(x):e.shapeMap["".concat(Cl).concat(s)]=e.addShape("path",{attrs:x,name:"".concat(Cl).concat(s),draggable:!0}),{beginAngle:g,arcBegin:p,shape:e.shapeMap["".concat(Cl).concat(s)],shouldEnd:c||v>.999}},Wie=function(e,t,n){var i=e.donutAttrs,a=e.donutColorMap,o=a===void 0?{}:a,s={},u=t.getContainer();if(i){var f=zD(i,o),l=f.configs,c=f.totalValue;if(c)for(var h=jD(n),d=h.lineWidth,v=h.arcR,p=[v,0],g=0,y=0;y<l.length;y++){var m="".concat(Cl).concat(y),x=rm(u,{arcR:v,arcBegin:p,beginAngle:g,config:l[y],fanIndex:y,lineWidth:d,totalValue:c,drawWhole:l.length===1,updateShape:u.shapeMap[m]});if(x.shape&&(s[m]=!0),x.shouldEnd)break;p=x.arcBegin,g=x.beginAngle}}var b=Object.keys(u.shapeMap).filter(function(w){return w.includes(Cl)});b.forEach(function(w){s[w]||(u.shapeMap[w].remove(!0),delete u.shapeMap[w])})},zD=function(e,t){var n=0,i=[];return Object.keys(e).forEach(function(a){var o=+e[a];isNaN(o)||(i.push({key:a,value:o,color:t[a]}),n+=o)}),{totalValue:n,configs:i}},jD=function(e){var t=e.attr("r"),n=.6*t,i=(t+n)/2,a=t-n;return{lineWidth:a,arcR:i}},Zh=function(e){var t=e.x,n=e.y;return{x:t,y:n,centerX:t,centerY:n,minX:t,minY:n,maxX:t,maxY:n,height:0,width:0}},qie=function(e){e===void 0&&(e=[]);var t=[],n=[];e.forEach(function(u){t.push(u.x),n.push(u.y)});var i=Math.min.apply(Math,t),a=Math.max.apply(Math,t),o=Math.min.apply(Math,n),s=Math.max.apply(Math,n);return{centerX:(i+a)/2,centerY:(o+s)/2,maxX:a,maxY:s,minX:i,minY:o,height:s-o,width:a-i}},j1=function(e){for(var t=[],n={},i=e.length,a=i-1;a>=0;a--){var o=e[a];o.id="".concat(o.x,"|||").concat(o.y),n[o.id]||(n[o.id]=o,t.push(o))}return t},UD=function(e){return j1(e)},dv=function(e,t){return e.width||e.height?{centerX:e.centerX,centerY:e.centerY,minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t,height:e.height+2*t,width:e.width+2*t}:e},Vie=function(e,t){var n=Math.abs(e.x-t.centerX),i=Math.abs(e.y-t.centerY);return n===0&&i===0?0:n/t.width>i/t.height},nm=function(e,t,n){var i=Vie(t,e);if(i===0){var a=e.centerX,o=e.centerY;return n.y<t.y?o=e.minY:n.x>t.x?a=e.maxX:n.x<t.x?a=e.minX:n.x===t.x&&(o=e.maxY),{x:a,y:o}}return i?{x:t.x>e.centerX?e.maxX:e.minX,y:t.y}:{x:t.x,y:t.y>e.centerY?e.maxY:e.minY}},OC=function(e,t){var n=Math.min(e.minX,t.minX),i=Math.min(e.minY,t.minY),a=Math.max(e.maxX,t.maxX),o=Math.max(e.maxY,t.maxY);return{centerX:(n+a)/2,centerY:(i+o)/2,minX:n,minY:i,maxX:a,maxY:o,height:o-i,width:a-n}},im=function(e){return[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}]},Kh=function(e,t){var n=e.x,i=e.y;return n<t.minX||n>t.maxX||i<t.minY||i>t.maxY},Hie=function(e,t){return t<e.minX||t>e.maxX?[]:[{x:t,y:e.minY},{x:t,y:e.maxY}]},Zie=function(e,t){return t<e.minY||t>e.maxY?[]:[{x:e.minX,y:t},{x:e.maxX,y:t}]},Kie=function(e,t){return Hie(e,t.x).concat(Zie(e,t.y))},Hl=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},Qie=function(e,t){var n=-2,i=0;return t.forEach(function(a){a&&(e.x===a.x&&(i+=n),e.y===a.y&&(i+=n))}),i},DC=function(e,t,n,i,a){return Hl(e,t)+Hl(e,n)+Qie(e,[t,n,i,a])},Jie=function r(e,t,n,i,a){a===void 0&&(a=0),e.unshift(t[i]),n[i]&&n[i]!==i&&a<=100&&r(e,t,n,n[i],a+1)},Qh=function(e,t,n,i){var a=n.x-e.x,o=n.y-e.y,s=i.x-e.x,u=i.y-e.y,f=n.x-t.x,l=n.y-t.y,c=i.x-t.x,h=i.y-t.y,d=a*u-o*s,v=f*h-l*c,p=a*l-o*f,g=s*h-u*c;return d*v<=0&&p*g<=0},am=function(e,t,n){if(n.width||n.height){var i=im(n),a=i[0],o=i[1],s=i[2],u=i[3];return Qh(e,t,a,o)||Qh(e,t,a,u)||Qh(e,t,o,s)||Qh(e,t,s,u)}return!1},eae=function(e,t,n,i){var a=[];return e.forEach(function(o){if(o!==t&&(o.x===t.x||o.y===t.y)){if(am(o,t,n)||am(o,t,i))return;a.push(o)}}),j1(a)},tae=function(e,t,n,i,a,o,s){var u,f=[],l=(u={},u[t.id]=t,u),c={},h={},d={};h[t.id]=0,d[t.id]=DC(t,n,t);var v=new XD;v.add({id:t.id,value:d[t.id]});var p={};e.forEach(function(w){p[w.id]=w});for(var g;Object.keys(l).length;){var y=v.minId(!1);if(y)g=l[y];else break;if(g===n){var m=[];return Jie(m,p,c,n.id),m}delete l[g.id],v.remove(g.id),f.push(g);var x=eae(e,g,i,a),b=function(E){E.forEach(function(S){if(f.indexOf(S)===-1){var _=S.id;l[_]||(l[_]=S);var C=d[g.id]+Hl(g,S);if(h[_]&&C>=h[_]){v.add({id:_,value:d[_]});return}c[_]=g.id,h[_]=C,d[_]=h[_]+DC(S,n,t,o,s),v.add({id:_,value:d[_]})}})};b(x)}return[t,n]},rae=function(e,t,n){return!(e.x===t.x&&t.x===n.x||e.y===t.y&&t.y===n.y)},nae=function(e,t,n,i){var a=Hl(e,t),o=Hl(n,t);a<i&&(i=a),o<i&&(i=o);var s={x:t.x-i/a*(t.x-e.x),y:t.y-i/a*(t.y-e.y)},u={x:t.x-i/o*(t.x-n.x),y:t.y-i/o*(t.y-n.y)};return[s,u]},PC=function(e,t){var n=[],i=e[0];return n.push("M".concat(i.x," ").concat(i.y)),e.forEach(function(a,o){var s=e[o+1],u=e[o+2];if(s&&u)if(rae(a,s,u)){var f=nae(a,s,u,t),l=f[0],c=f[1];n.push("L".concat(l.x," ").concat(l.y)),n.push("Q".concat(s.x," ").concat(s.y," ").concat(c.x," ").concat(c.y)),n.push("L".concat(c.x," ").concat(c.y))}else n.push("L".concat(s.x," ").concat(s.y));else s&&n.push("L".concat(s.x," ").concat(s.y))}),n.join("")},$D=function(e,t,n,i,a){var o,s;if(!n||!n.getType())o=Zh(e);else if(n.getType()==="combo"){var u=n.getKeyShape().getBBox();if(u){var f=n.getModel(),l=f.x,c=f.y;o={x:l,y:c,width:u.width,height:u.height,minX:u.minX+l,maxX:u.maxX+l,minY:u.minY+c,maxY:u.maxY+c},o.centerX=(o.minX+o.maxX)/2,o.centerY=(o.minY+o.maxY)/2}else o=Zh(e)}else o=n&&n.getBBox();if(!i||!i.getType())s=Zh(t);else if(i.getType()==="combo"){var h=i.getKeyShape().getBBox();if(h){var d=i.getModel(),v=d.x,p=d.y;s={x:v,y:p,width:h.width,height:h.height,minX:h.minX+v,maxX:h.maxX+v,minY:h.minY+p,maxY:h.maxY+p},s.centerX=(s.minX+s.maxX)/2,s.centerY=(s.minY+s.maxY)/2}else s=Zh(t)}else s=i&&i.getBBox();var g=dv(o,a),y=dv(s,a),m=nm(g,e,t),x=nm(y,t,e),b=qie([m,x]),w=OC(g,b),E=OC(y,b),S=[];S=S.concat(im(w)).concat(im(E));var _={x:(e.x+t.x)/2,y:(e.y+t.y)/2};[b,w,E].forEach(function(M){S=S.concat(Kie(M,_).filter(function(A){return Kh(A,g)&&Kh(A,y)}))}),[{x:m.x,y:x.y},{x:x.x,y:m.y}].forEach(function(M){Kh(M,g)&&Kh(M,y)&&S.push(M)}),S.unshift(m),S.push(x),S=j1(S);var C=tae(S,m,x,o,s,e,t);return C.unshift(e),C.push(t),UD(C)},iae=function(e){if(!(e!=null&&e.length))return e;for(var t=e[e.length-1],n={x:t.x,y:t.y},i=[t],a=[t],o=e.length-2;o>=0;o--){var s=e[o];if(s.x===n.x?i.push(s):(i=[s],n.x=s.x),s.y===n.y?a.push(s):(a=[s],n.y=s.y),i.length>2){var u=e.indexOf(i[1]);u>-1&&e.splice(u,1);continue}if(a.length>2){var u=e.indexOf(a[1]);u>-1&&e.splice(u,1)}}return e},XD=function(){function r(){this.arr=[],this.map={},this.arr=[],this.map={}}return r.prototype._innerAdd=function(e,t){for(var n=[0,t-1];n[1]-n[0]>1;){var i=Math.floor((n[0]+n[1])/2);if(this.arr[i].value>e.value)n[1]=i;else if(this.arr[i].value<e.value)n[0]=i;else{this.arr.splice(i,0,e),this.map[e.id]=!0;return}}this.arr.splice(n[1],0,e),this.map[e.id]=!0},r.prototype.add=function(e){delete this.map[e.id];var t=this.arr.length;if(!t){this.arr.push(e),this.map[e.id]=!0;return}if(this.arr[t-1].value<e.value){this.arr.push(e),this.map[e.id]=!0;return}this._innerAdd(e,t)},r.prototype.remove=function(e){this.map[e]&&delete this.map[e]},r.prototype._clearAndGetMinId=function(){for(var e,t=this.arr.length-1;t>=0;t--)this.map[this.arr[t].id]?e=this.arr[t].id:this.arr.splice(t,1);return e},r.prototype._findFirstId=function(){for(;this.arr.length;){var e=this.arr.shift();if(this.map[e.id])return e.id}},r.prototype.minId=function(e){return e?this._clearAndGetMinId():this._findFirstId()},r}(),aae=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},oae=function(e,t,n,i,a){return UD($D(e,t,n,i,a.offset))},sae={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:aae,fallbackRoute:oae},ja=function(e,t){var n=Math.round(Math.abs(e/t)),i=e<0?-1:1;return n<0?0:i*n},uae=function(e,t,n){var i={};return e.forEach(function(a){if(a)for(var o=dv(a.getBBox(),n),s=ja(o.minX,t);s<=ja(o.maxX,t);s+=1)for(var u=ja(o.minY,t);u<=ja(o.maxY,t);u+=1)i["".concat(s,"|||").concat(u)]=!0}),i},P0=function(e,t){var n=t.x-e.x,i=t.y-e.y;return n||i?Math.atan2(i,n):0},RC=function(e,t){var n=Math.abs(e-t);return n>Math.PI?2*Math.PI-n:n},BC=function(e,t,n){for(var i=1/0,a=0,o=t.length;a<o;a++){var s=n(e,t[a]);s<i&&(i=s)}return i},FC=function(e,t,n,i,a){var o=[];if(!n)return[e];var s=a.directions,u=a.offset,f=n.getBBox(),l=t.x>f.minX&&t.x<f.maxX&&t.y>f.minY&&t.y<f.maxY,c=dv(f,u);for(var h in c)c[h]=ja(c[h],a.gridSize);if(l){for(var d=0,v=s;d<v.length;d++)for(var p=v[d],g=[[{x:c.minX,y:c.minY},{x:c.maxX,y:c.minY}],[{x:c.minX,y:c.minY},{x:c.minX,y:c.maxY}],[{x:c.maxX,y:c.minY},{x:c.maxX,y:c.maxY}],[{x:c.minX,y:c.maxY},{x:c.maxX,y:c.maxY}]],h=0;h<4;h++){var y=g[h],m=Sn.getLineIntersect(e,{x:e.x+p.stepX*c.width,y:e.y+p.stepY*c.height},y[0],y[1]);m&&!am(e,m,f)&&(m.id="".concat(m.x,"|||").concat(m.y),o.push(m))}return o}var x=nm(c,e,i);return x.id="".concat(x.x,"|||").concat(x.y),[x]},om=function(e,t,n,i){var a=P0(e,t),o=n[e.id];if(!o){var s=P0(i,e);return RC(s,a)}var u=P0({x:o.x,y:o.y},e);return RC(u,a)},fae=function(e,t,n,i,a,o,s){var u=[i],f=i,l=e.id,c=e.x,h=e.y,d={x:c,y:h,id:l};om(d,o,t,n)&&(f={x:o.x===i.x?i.x:d.x*s,y:o.y===i.y?i.y:d.y*s},u.unshift(f));for(var v=t[l];v&&v.id!==l;){var p={x:c,y:h,id:l},g={x:v.x,y:v.y,id:v.id},y=om(g,p,t,n);y&&(f={x:g.x===p.x?f.x:g.x*s,y:g.y===p.y?f.y:g.y*s},u.unshift(f)),l=g.id,c=g.x,h=g.y,v=t[l]}return u[0].x=c===n.x?a.x:f.x,u[0].y=h===n.y?a.y:f.y,u.unshift(a),u},lae=function(e,t,n,i,a){if(isNaN(e.x)||isNaN(t.x))return[];var o=Tr(sae,a);o.obstacles=o.obstacles||[];var s=o.penalties,u=o.gridSize,f=uae(o.obstacles.concat([n,i]),u,o.offset),l={x:ja(e.x,u),y:ja(e.y,u)},c={x:ja(t.x,u),y:ja(t.y,u)};e.id="".concat(l.x,"|||").concat(l.y),t.id="".concat(c.x,"|||").concat(c.y);var h=FC(l,e,n,c,o),d=FC(c,t,i,l,o);h.forEach(function(D){delete f[D.id]}),d.forEach(function(D){delete f[D.id]});for(var v={},p={},g={},y={},m={},x=new XD,b=0;b<h.length;b++){var w=h[b];v[w.id]=w,y[w.id]=0,m[w.id]=BC(w,d,o.distFunc),x.add({id:w.id,value:m[w.id]})}var E=o.maximumLoops,S,_,C,M,A,T,I=1/0,L={};for(d.forEach(function(D){L["".concat(D.x,"|||").concat(D.y)]=!0}),Object.keys(v).forEach(function(D){var P=v[D].id;m[P]<=I&&(I=m[P],S=v[P])});Object.keys(v).length>0&&E>0;){var N=x.minId((E+1)%30===0);if(N)S=v[N];else break;if(L["".concat(S.x,"|||").concat(S.y)])return fae(S,g,l,t,e,c,u);delete v[S.id],x.remove(S.id),p[S.id]=!0;for(var b=0;b<o.directions.length;b++){_=o.directions[b];var O="".concat(Math.round(S.x)+_.stepX,"|||").concat(Math.round(S.y)+_.stepY);if(C={x:S.x+_.stepX,y:S.y+_.stepY,id:O},!p[O]&&(T=om(S,C,g,l),!(T>o.maxAllowedDirectionChange)&&!f[O])){v[O]||(v[O]=C);var B=s[T];M=o.distFunc(S,C)+(isNaN(B)?u:B),A=y[S.id]+M;var W=y[O];W&&A>=W||(g[O]=S,y[O]=A,m[O]=A+BC(C,d,o.distFunc),x.add({id:O,value:m[O]}))}}E-=1}return o.fallbackRoute(e,t,n,i,o)};Bk("polyline",{options:{color:Je.defaultEdge.color,size:Je.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:Je.defaultEdge.style.stroke,lineAppendWidth:Je.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:Je.edgeLabel.style.fill,fontSize:Je.edgeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:z({},Je.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(e,t){var n=this.getShapeStyle(e);n.radius===0&&delete n.radius;var i=t.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n});return t.shapeMap["edge-shape"]=i,i},getShapeStyle:function(e){var t=this.options.style,n={stroke:e.color},i=bt({},t,n,e.style);e=this.getPathPoints(e),this.radius=i.radius,this.offset=i.offset;var a=e.startPoint,o=e.endPoint,s=this.getControlPoints(e),u=[a];s&&(u=u.concat(s)),u.push(o);var f=e.sourceNode,l=e.targetNode,c=i.radius,h=this.options.routeCfg,d=bt({},h,e.routeCfg);d.offset=i.offset;var v=this.getPath(u,f,l,c,d,!s);(mt(v)&&v.length<=1||Fe(v)&&v.indexOf("L")===-1)&&(v="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(o.x)||isNaN(o.y))&&(v="M0 0, L0 0");var p=bt({},Je.defaultEdge.style,i,{lineWidth:e.size,path:v});return p},updateShapeStyle:function(e,t){var n=t.getContainer();if(t.isVisible()){var i={stroke:e.color},a=n.shapeMap["edge-shape"]||n.find(function(b){return b.get("className")==="edge-shape"})||t.getKeyShape(),o=e.size;e=this.getPathPoints(e);var s=e.startPoint,u=e.endPoint,f=this.getControlPoints(e),l=[s];f&&(l=l.concat(f)),l.push(u);var c=a.attr(),h=bt({},i,c,e.style),d=e.sourceNode,v=e.targetNode,p=h.radius,g=this.options.routeCfg,y=bt({},g,e.routeCfg);y.offset=h.offset;var m=this.getPath(l,d,v,p,y,!f);(mt(m)&&m.length<=1||Fe(m)&&m.indexOf("L")===-1)&&(m="M0 0, L0 0"),(isNaN(s.x)||isNaN(s.y)||isNaN(u.x)||isNaN(u.y))&&(m="M0 0, L0 0"),c.endArrow&&h.endArrow===!1&&(e.style.endArrow={path:""}),c.startArrow&&h.startArrow===!1&&(e.style.startArrow={path:""});var x=bt(i,a.attr(),{lineWidth:o,path:m},e.style);a&&a.attr(x)}},getPath:function(e,t,n,i,a,o){var s=a.offset,u=a.obstacles,f=a.simple;if(!s||e.length>2||o===!1){if(i)return PC(e,i);var l=[];return _e(e,function(v,p){p===0?l.push(["M",v.x,v.y]):l.push(["L",v.x,v.y])}),l}f!==!1&&!(u!=null&&u.length)&&(f=!0);var c=f?$D(e[e.length-1],e[0],n,t,s):lae(e[0],e[e.length-1],t,n,a);if(!c||!c.length)return"M0 0, L0 0";if(i){var h=PC(c,i);return h}c=iae(c);var d=Sn.pointsToPolygon(c);return d}},"single-edge");var GC=Va.cloneEvent,zC=Va.isNaN,jC=Math.abs,cae=10,hae=["shift","ctrl","alt","control"];const dae={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(e){var t=this.origin,n=+e.clientX,i=+e.clientY;if(!(zC(n)||zC(i))){var a=n-t.x,o=i-t.y;this.get("direction")==="x"?o=0:this.get("direction")==="y"&&(a=0),this.origin={x:n,y:i};var s=this.graph.get("width"),u=this.graph.get("height"),f=this.graph.get("canvas").getCanvasBBox(),l=this.scalableRange,c=this.scalableRange;l<1&&l>-1&&(l=s*l,c=u*c),(f.minX<=s+l&&f.minX+a>s+l||f.maxX+l>=0&&f.maxX+l+a<0)&&(a=0),(f.minY<=u+c&&f.minY+o>u+c||f.maxY+c>=0&&f.maxY+c+o<0)&&(o=0),this.graph.translate(a,o)}},onTouchStart:function(e){var t=this,n=e.originalEvent.touches,i=n[0],a=n[1];i&&a||(e.preventDefault(),this.mousedown=!0,t.onDragStart(e))},onMouseDown:function(e){this.mousedown=!0},onDragMove:function(e){this.mousedown&&(this.dragstart?this.onDrag(e):(this.dragstart=!0,this.onDragStart(e)))},onDragStart:function(e){var t=this,n=e.originalEvent;if(!(n&&e.name!=="touchstart"&&n.button!==0)&&!(e.name!=="touchstart"&&typeof window<"u"&&window.event&&!window.event.buttons&&!window.event.button)&&this.shouldBegin(e,this)&&!t.keydown&&this.allowDrag(e)){if(t.origin={x:e.clientX,y:e.clientY},t.dragging=!1,this.enableOptimize){for(var i=this.graph,a=i.getEdges(),o=0,s=a.length;o<s;o++){var u=a[o].get("group").get("children");u&&u.forEach(function(x){x.set("ori-visibility",x.get("ori-visibility")||x.get("visible")),x.hide()})}for(var f=i.getNodes(),l=0,c=f.length;l<c;l++)for(var h=f[l].getContainer(),d=h.get("children"),v=0,p=d;v<p.length;v++){var g=p[v],y=g.get("isKeyShape");y||(g.set("ori-visibility",g.get("ori-visibility")||g.get("visible")),g.hide())}}if(typeof window<"u"){var m=this;this.handleDOMContextMenu=function(x){return m.onMouseUp(x)},document.body.addEventListener("contextmenu",this.handleDOMContextMenu)}}},onTouchMove:function(e){var t=this,n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a){this.onMouseUp(e);return}e.preventDefault(),t.onDrag(e)},onDrag:function(e){if(this.mousedown){var t=this.graph;if(!this.keydown&&this.allowDrag(e)&&(e=GC(e),!!this.origin)){if(this.dragging)e.type="drag",t.emit("canvas:drag",e);else{if(jC(this.origin.x-e.clientX)+jC(this.origin.y-e.clientY)<cae)return;this.shouldBegin(e,this)&&(e.type="dragstart",t.emit("canvas:dragstart",e),this.originPosition={x:e.clientX,y:e.clientY},this.dragging=!0)}this.shouldUpdate(e,this)&&this.updateViewport(e)}}},onMouseUp:function(e){var t,n;this.mousedown=!1,this.dragstart=!1;var i=this.graph;if(!this.keydown){var a=i.getZoom(),o=i.get("modeController"),s=(n=(t=o==null?void 0:o.modes[o.mode])===null||t===void 0?void 0:t.filter(function(S){return S.type==="zoom-canvas"}))===null||n===void 0?void 0:n[0],u=s?s.optimizeZoom||.1:0;if(this.enableOptimize){for(var f=i.getEdges(),l=0,c=f.length;l<c;l++){var h=f[l].get("group").get("children");h&&h.forEach(function(S){var _=S.get("ori-visibility");S.set("ori-visibility",void 0),_&&S.show()})}if(a>u)for(var d=i.getNodes(),v=0,p=d.length;v<p;v++)for(var g=d[v].getContainer(),y=g.get("children"),m=0,x=y;m<x.length;m++){var b=x[m],w=b.get("isKeyShape");if(!w){var E=b.get("ori-visibility");b.set("ori-visibility",void 0),E&&b.show()}}}if(!this.dragging){this.origin=null;return}e=GC(e),this.shouldEnd(e,this)&&this.updateViewport(e),e.type="dragend",e.dx=e.clientX-this.originPosition.x,e.dy=e.clientY-this.originPosition.y,i.emit("canvas:dragend",e),this.endDrag(),typeof window<"u"&&document.body.removeEventListener("contextmenu",this.handleDOMContextMenu)}},endDrag:function(){this.origin=null,this.dragging=!1,this.dragbegin=!1,this.mousedown=!1,this.dragstart=!1},onKeyDown:function(e){var t=this,n=e.key;n&&(hae.indexOf(n.toLowerCase())>-1?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(e){var t,n,i=e.target,a=i&&i.isCanvas&&i.isCanvas();if(Zl(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if(wn(this.allowDragOnItem)){var o=this.allowDragOnItem,s=o.node,u=o.edge,f=o.combo,l=(n=(t=e.item)===null||t===void 0?void 0:t.getType)===null||n===void 0?void 0:n.call(t);if(!s&&l==="node"||!u&&l==="edge"||!f&&l==="combo")return!1}return!0}},vae={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(e){if(!this.origin||!e||e.destroyed)return!1;var t=e.getType();return t==="combo"},onTouchStart:function(e){if(e.item){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;e.preventDefault()}catch{console.warn("Touch original event not exist!")}this.mousedown={item:e.item,target:e.target,origin:{x:e.x,y:e.y}},this.dragstart=!0,t.onDragStart(e)}},onTouchMove:function(e){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a){t.onDragEnd(e);return}e.preventDefault()}catch{console.warn("Touch original event not exist!")}t.onDrag(e)},onMouseDown:function(e){this.mousedown={item:e.item,target:e.target,origin:{x:e.x,y:e.y}},typeof window<"u"&&!this.windowEventBinded&&(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(e){var t,n;if(((n=(t=e.item)===null||t===void 0?void 0:t.getType)===null||n===void 0?void 0:n.call(t))!=="node"){this.onDragEnd();return}this.mousedown&&(this.dragstart?this.onDrag(z(z({},e),this.mousedown)):(this.dragstart=!0,this.onDragStart(e)))},onDragStart:function(e){var t=this;if(this.currentShouldEnd=!0,!!this.shouldBegin(z(z({},e),this.mousedown),this)){var n=this.mousedown,i=n.item,a=n.target;if(!(!i||i.destroyed||i.hasLocked())){var o=i.getContainer();if(o.set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(i),a){var s=a.get("isAnchorPoint");if(s)return}var u=this.graph;this.targets=[],this.targetCombo=null;var f=u.findAllByState("node",this.selectedState),l=i.get("id"),c=f.filter(function(d){var v=d.get("id");return l===v});if(c.length===0?this.targets.push(i):f.length>1?f.forEach(function(d){var v=d.hasLocked();v||t.targets.push(d)}):this.targets.push(i),this.graph.get("enabledStack")&&this.enableStack){var h=[];this.targets.forEach(function(d){var v=d.getModel(),p=v.x,g=v.y,y=v.id;h.push({x:p,y:g,id:y})}),this.set("beforeDragNodes",h)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(d){var v=d.getEdges();v.forEach(function(p){p.isVisible()&&(t.hidenEdge[p.getID()]=!0,p.hide())})}),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(e){var t=this;if(!(!this.mousedown||!this.origin)&&this.shouldUpdate(e,this))if(this.get("enableDelegate"))this.updateDelegate(e);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:e,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var n={};this.targets.map(function(i){t.update(i,e);var a=i.getModel().comboId;a&&(n[a]=t.graph.findById(a))}),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(e){var t=this,n;if(this.mousedown=!1,this.dragstart=!1,typeof window<"u"&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),!!this.origin){(n=this.cachedCaptureItems)===null||n===void 0||n.forEach(function(o){var s=o.getContainer();s.set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(o){var s=o.getEdges();s.forEach(function(u){t.hidenEdge[u.getID()]&&u.show(),u.refresh()})}),this.hidenEdge={};var i=this.graph;if(i.get("enabledStack")&&this.enableStack){var a={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(o){a.before.nodes.push(o)}),this.targets.forEach(function(o){var s=o.getModel(),u=s.x,f=s.y,l=s.id;a.after.nodes.push({x:u,y:f,id:l})}),i.pushStack("update",Jt(a))}i.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(e){var t=e.item;if(this.currentShouldEnd=this.shouldEnd(e,t,this),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!this.validationCombo(t))){var n=this.graph;if(this.comboActiveState&&n.setItemState(t,this.comboActiveState,!1),this.targetCombo=t,this.onlyChangeComboSize)n.updateCombos();else{var i=t.getModel();this.targets.map(function(a){var o=a.getModel();o.comboId!==i.id&&n.updateComboTree(a,i.id)}),n.updateCombo(t)}n.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(e){var t=this.graph;this.currentShouldEnd=this.shouldEnd(e,void 0,this),this.updatePositions(e,!this.currentShouldEnd),!(!this.targets||this.targets.length===0||!this.currentShouldEnd)&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map(function(n){var i=n.getModel();i.comboId&&t.updateComboTree(n)}))},onDropNode:function(e){if(!(!this.targets||this.targets.length===0)){var t=this,n=e.item,i=t.graph,a=n.getModel().comboId,o=a?i.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(e,o,this),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(a){var s=i.findById(a);t.comboActiveState&&i.setItemState(s,t.comboActiveState,!1),this.targets.map(function(u){var f=u.getModel();a!==f.comboId&&i.updateComboTree(u,a)}),i.updateCombo(s)}else this.targets.map(function(u){var f=u.getModel();f.comboId&&i.updateComboTree(u)});i.emit("dragnodeend",{items:this.targets,targetItem:n})}}},onDragEnter:function(e){var t=e.item;if(this.validationCombo(t)){var n=this.graph;this.comboActiveState&&n.setItemState(t,this.comboActiveState,!0)}},onDragLeave:function(e){var t=e.item;if(this.validationCombo(t)){var n=this.graph;this.comboActiveState&&n.setItemState(t,this.comboActiveState,!1)}},updatePositions:function(e,t){var n=this;!this.targets||this.targets.length===0||(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:e,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):t||this.targets.map(function(i){return n.update(i,e)}):this.targets.map(function(i){return n.update(i,e,t)}))},update:function(e,t,n){var i=this.origin,a=e.get("model"),o=e.get("id");this.point[o]||(this.point[o]={x:a.x||0,y:a.y||0});var s=t.x-i.x+this.point[o].x,u=t.y-i.y+this.point[o].y;n&&(s+=i.x-t.x,u+=i.y-t.y);var f={x:s,y:u};this.get("updateEdge")?this.graph.updateItem(e,f,!1):e.updatePosition(f)},debounceUpdate:Kl(function(r){var e=r.targets,t=r.graph,n=r.point,i=r.origin,a=r.evt,o=r.updateEdge,s=r.onlyChangeComboSize,u=r.updateParentCombos;e.map(function(f){var l=f.get("model"),c=f.get("id");n[c]||(n[c]={x:l.x||0,y:l.y||0});var h=a.x-i.x+n[c].x,d=a.y-i.y+n[c].y,v={x:h,y:d};o?t.updateItem(f,v,!1):f.updatePosition(v)}),s&&u(t,e)},50,!0),updateDelegate:function(e){var t=this.graph;if(this.delegateRect){var h=e.x-this.origin.x+this.originPoint.minX,d=e.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:h,y:d})}else{var n=t.get("group"),i=Tr({},_s.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(e),o=a.x,s=a.y,u=a.width,f=a.height,l=a.minX,c=a.minY;this.originPoint={x:o,y:s,width:u,height:f,minX:l,minY:c},this.delegateRect=n.addShape("rect",{attrs:z({width:u,height:f,x:o,y:s},i),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(e){var t=this.targets;t.length===0&&t.push(e.item);for(var n=1/0,i=-1/0,a=1/0,o=-1/0,s=0;s<t.length;s++){var u=t[s],f=u.getBBox(),l=f.minX,c=f.minY,h=f.maxX,d=f.maxY;l<n&&(n=l),c<a&&(a=c),h>i&&(i=h),d>o&&(o=d)}var v=Math.floor(n),p=Math.floor(a),g=Math.ceil(i)-Math.floor(n),y=Math.ceil(o)-Math.floor(a);return{x:v,y:p,width:g,height:y,minX:n,minY:a}},updateParentCombos:function(e,t){var n=e||this.graph,i=t||this.targets,a={};i==null||i.forEach(function(o){var s=o.getModel().comboId;s&&(a[s]=n.findById(s))}),Object.values(a).forEach(function(o){o&&n.updateCombo(o)})}};var Jh=null;const pae={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldClearStatusOnSecond:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return this.get("trigger")==="mouseenter"?{"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(e){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;e.preventDefault()}catch{console.warn("Touch original event not exist!")}t.setAllItemStates(e)},clearOnTouchStart:function(e){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;e.preventDefault()}catch{console.warn("Touch original event not exist!")}t.clearActiveState(e)},setAllItemStates:function(e){clearTimeout(this.timer),this.throttleSetAllItemStates(e,this)},clearActiveState:function(e){var t=this,n=this.shouldClearStatusOnSecond;n&&(Jh=null),this.timer=setTimeout(function(){t.throttleClearActiveState(e,t)},50)},throttleSetAllItemStates:Tl(function(r,e){var t=r.item,n=e.graph;if(!(!n||n.destroyed)&&(e.item=t,!!e.shouldUpdate(r.item,{event:r,action:"activate"},e))){var i=e.shouldClearStatusOnSecond,a=t.getModel().id;if(Jh===a&&i){e.throttleClearActiveState(r,e),Jh=null;return}for(var o=e.activeState,s=e.inactiveState,u=n.getNodes(),f=n.getCombos(),l=n.getEdges(),c=n.get("vedges"),h=u.length,d=f.length,v=l.length,p=c.length,g=e.inactiveItems||{},y=e.activeItems||{},m=0;m<h;m++){var x=u[m],b=x.getID(),w=x.hasState("selected");e.resetSelected&&w&&n.setItemState(x,"selected",!1),y[b]&&(n.setItemState(x,o,!1),delete y[b]),s&&!g[b]&&(n.setItemState(x,s,!0),g[b]=x)}for(var m=0;m<d;m++){var E=f[m],S=E.getID(),w=E.hasState("selected");e.resetSelected&&w&&n.setItemState(E,"selected",!1),y[S]&&(n.setItemState(E,o,!1),delete y[S]),s&&!g[S]&&(n.setItemState(E,s,!0),g[S]=E)}for(var m=0;m<v;m++){var _=l[m],C=_.getID();y[C]&&(n.setItemState(_,o,!1),delete y[C]),s&&!g[C]&&(n.setItemState(_,s,!0),g[C]=_)}for(var m=0;m<p;m++){var M=c[m],A=M.getID();y[A]&&(n.setItemState(M,o,!1),delete y[A]),s&&!g[A]&&(n.setItemState(M,s,!0),g[A]=M)}if(t&&!t.destroyed){s&&(n.setItemState(t,s,!1),delete g[t.getID()]),y[t.getID()]||(n.setItemState(t,o,!0),y[t.getID()]=t);for(var T=t.getEdges(),I=T.length,m=0;m<I;m++){var _=T[m],C=_.getID(),L=void 0;_.getSource()===t?L=_.getTarget():L=_.getSource();var N=L.getID();s&&g[N]&&(n.setItemState(L,s,!1),delete g[N]),y[N]||(n.setItemState(L,o,!0),y[N]=L),g[C]&&(n.setItemState(_,s,!1),delete g[C]),y[C]||(n.setItemState(_,o,!0),y[C]=_),_.toFront()}}e.activeItems=y,e.inactiveItems=g,i&&(Jh=t.getModel().id),n.emit("afteractivaterelations",{item:r.item,action:"activate"})}},50,{trailing:!0,leading:!0}),throttleClearActiveState:Tl(function(r,e){var t=e.get("graph");if(!(!t||t.destroyed)&&e.shouldUpdate(r.item,{event:r,action:"deactivate"},e)){var n=e.activeState,i=e.inactiveState,a=e.activeItems||{},o=e.inactiveItems||{};Object.values(a).filter(function(s){return!s.destroyed}).forEach(function(s){t.clearItemStates(s,n)}),Object.values(o).filter(function(s){return!s.destroyed}).forEach(function(s){t.clearItemStates(s,i)}),e.activeItems={},e.inactiveItems={},t.emit("afteractivaterelations",{item:r.item||e.get("item"),action:"deactivate"})}},50,{trailing:!0,leading:!0})};var ed=Math.min,UC=Math.max,$C=Math.abs,XC="shift",gae=["drag","shift","ctrl","alt","control"];const yae={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:XC,includeEdges:!0,includeCombos:!1,selectOnCombo:!1,selectedEdges:[],selectedNodes:[],selectedCombos:[]}},getEvents:function(){return gae.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=XC,console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.trigger==="drag"?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(e){var t=e.item,n=this.brush,i=this.selectOnCombo,a=(t==null?void 0:t.getType())==="combo";a&&!i||!a&&t||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates(),n||(n=this.createBrush()),this.originPoint={x:e.canvasX,y:e.canvasY},n.attr({width:0,height:0}),n.show(),this.dragging=!0)},onMouseMove:function(e){this.dragging&&(this.trigger!=="drag"&&!this.keydown||this.updateBrush(e))},onMouseUp:function(e){this.graph,!(!this.brush&&!this.dragging)&&(this.trigger!=="drag"&&!this.keydown||(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(e),this.dragging=!1))},clearStates:function(){var e=this,t=e.graph,n=e.selectedState,i=t.findAllByState("node",n),a=t.findAllByState("edge",n),o=t.findAllByState("combo",n);i.forEach(function(s){return t.setItemState(s,n,!1)}),a.forEach(function(s){return t.setItemState(s,n,!1)}),o.forEach(function(s){return t.setItemState(s,n,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(e,t,n,i,a){var o=e.getBBox();return o.centerX>=t&&o.centerX<=n&&o.centerY>=i&&o.centerY<=a},getSelectedNodes:function(e){var t=this,n=this,i=n.graph,a=n.originPoint,o=n.shouldUpdate,s=n.isBBoxCenterInRect,u=this.selectedState,f={x:e.x,y:e.y},l=i.getPointByCanvas(a.x,a.y),c=ed(f.x,l.x),h=UC(f.x,l.x),d=ed(f.y,l.y),v=UC(f.y,l.y),p=[],g=[];i.getNodes().forEach(function(x){if(x.isVisible()&&s(x,c,h,d,v)&&o(x,"select",t)){p.push(x);var b=x.getModel();g.push(b.id),i.setItemState(x,u,!0)}});var y=[];this.includeEdges&&p.forEach(function(x){var b=x.getOutEdges();b.forEach(function(w){if(w.isVisible()){var E=w.getModel(),S=E.source,_=E.target;g.includes(S)&&g.includes(_)&&o(w,"select",t)&&(y.push(w),i.setItemState(w,t.selectedState,!0))}})});var m=[];this.includeCombos&&i.getCombos().forEach(function(x){if(x.isVisible()&&s(x,c,h,d,v)&&o(x,"select",t)){m.push(x);var b=x.getModel();g.push(b.id),i.setItemState(x,u,!0)}}),this.selectedEdges=y,this.selectedNodes=p,this.selectedCombos=m,this.onSelect&&this.onSelect(p,y,m),i.emit("nodeselectchange",{selectedItems:{nodes:p,edges:y,combos:m},select:!0})},createBrush:function(){var e=this,t=e.graph.get("canvas").addShape("rect",{attrs:e.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(e){var t=this.originPoint;this.brush.attr({width:$C(e.canvasX-t.x),height:$C(e.canvasY-t.y),x:ed(e.canvasX,t.x),y:ed(e.canvasY,t.y)})},onKeyDown:function(e){var t=e.key;if(t){var n=this.trigger.toLowerCase(),i=t.toLowerCase();i===n||i==="control"&&n==="ctrl"||i==="ctrl"&&n==="control"?this.keydown=!0:this.keydown=!1}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}};var YC="shift",mae=["shift","ctrl","alt","control"];const bae={getDefaultCfg:function(){return{multiple:!0,trigger:YC,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var e=this;return mae.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=YC,console.warn("Behavior click-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),e.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(e){var t=this,n=e.item;if(!(!n||n.destroyed)){var i=n.getType(),a=t.graph,o=t.keydown,s=t.multiple,u=t.shouldUpdate,f=t.shouldBegin;if(f(e,t)){if(!o||!s){var l=a.findAllByState("node",t.selectedState).concat(a.findAllByState("edge",t.selectedState)).concat(a.findAllByState("combo",t.selectedState));_e(l,function(p){p!==n&&a.setItemState(p,t.selectedState,!1)})}var c=function(){switch(i){case"node":return t.selectNode;case"edge":return t.selectEdge;case"combo":return t.selectCombo;default:return!1}}();if(!c){var h=a.findAllByState("node",t.selectedState),d=a.findAllByState("edge",t.selectedState),v=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{selectedItems:{nodes:h,edges:d,combos:v},select:!1});return}if(n.hasState(t.selectedState)){u(e,t)&&a.setItemState(n,t.selectedState,!1);var h=a.findAllByState("node",t.selectedState),d=a.findAllByState("edge",t.selectedState),v=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:n,selectedItems:{nodes:h,edges:d,combos:v},select:!1})}else{u(e,t)&&a.setItemState(n,t.selectedState,!0);var h=a.findAllByState("node",t.selectedState),d=a.findAllByState("edge",t.selectedState),v=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:n,selectedItems:{nodes:h,edges:d,combos:v},select:!0})}}}},onCanvasClick:function(e){var t=this,n=this,i=n.graph,a=n.shouldBegin;if(a(e,this)){var o=i.findAllByState("node",this.selectedState);_e(o,function(f){i.setItemState(f,t.selectedState,!1)});var s=i.findAllByState("edge",this.selectedState);_e(s,function(f){i.setItemState(f,t.selectedState,!1)});var u=i.findAllByState("combo",this.selectedState);_e(u,function(f){i.setItemState(f,t.selectedState,!1)}),i.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(e){var t=this,n=e.key;n&&(n.toLowerCase()===this.trigger.toLowerCase()||n.toLowerCase()==="control"?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.keydown=!1}};var xae=vi,td=.05;const wae={getDefaultCfg:function(){return this.isFireFox=dD()==="firefox",{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var e=this.fixSelectedItems;return e.fixState||(e.fixState="selected"),e.fixAll&&(e.fixLineWidth=!0,e.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(e){var t=e.originalEvent.touches,n=t[0],i=t[1];e.preventDefault(),i&&(this.shouldBegin&&!this.shouldBegin(e,this)||(this.startPoint={pageX:n.pageX,pageY:n.pageY},this.moveable=!0,i&&(this.endPoint={pageX:i.pageX,pageY:i.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(e){if(this.moveable){e.preventDefault();var t=e.originalEvent.touches,n=t[0],i=t[1];if(i){this.endPoint||(this.endPoint={pageX:i.pageX,pageY:i.pageY});var a=function(p,g){return Math.hypot(g.x-p.x,g.y-p.y)},o=a({x:n.pageX,y:n.pageY},{x:i.pageX,y:i.pageY})/a({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),s=this.originScale*o;this.currentScale=s;var u=this.get("minZoom")||this.graph.get("minZoom"),f=this.get("maxZoom")||this.graph.get("maxZoom");if(!(s>f||s<u)){var l=this.get("animate"),c=this.get("animateCfg"),h=this.graph.get("canvas"),d=h.getPointByClient(e.clientX,e.clientY);this.graph.zoomTo(s,{x:d.x,y:d.y},l,c),this.graph.emit("wheelzoom",e)}}}},onTouchEnd:function(){this.moveable=!1,this.endPoint=null},onWheel:function(e){var t=this,n=this,i=n.graph,a=n.fixSelectedItems;if(!(this.shouldBegin&&!this.shouldBegin(e,this))&&this.shouldUpdate(e,this)){e.preventDefault();var o=i.get("canvas"),s=o.getPointByClient(e.clientX,e.clientY),u=this.get("sensitivity"),f=i.getZoom(),l=f,c=f;this.isFireFox?e.deltaY>0||e.wheelDelta<0?l=1-td*u:l=1/(1-td*u):e.wheelDelta<0?l=1-td*u:l=1/(1-td*u),c=f*l;var h=this.get("minZoom")||i.get("minZoom"),d=this.get("maxZoom")||i.get("maxZoom");c>d?c=d:c<h&&(c=h);var v=this.get("enableOptimize");if(v){var p=this.get("optimizeZoom"),g=this.get("optimized"),y=i.getNodes(),m=i.getEdges(),x=y.length,b=m.length;if(!g){for(var w=0;w<x;w++){var E=y[w];if(!E.destroyed)for(var S=E.get("group").get("children"),_=S.length,C=0;C<_;C++){var M=S[C];!M.destoryed&&!M.get("isKeyShape")&&(M.set("ori-visibility",M.get("ori-visibility")||M.get("visible")),M.hide())}}for(var A=0;A<b;A++)for(var T=m[A],S=T.get("group").get("children"),_=S.length,C=0;C<_;C++){var M=S[C];M.set("ori-visibility",M.get("ori-visibility")||M.get("visible")),M.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var I=setTimeout(function(){var pt=i.getZoom(),Nt=t.get("optimized");if(Nt){t.set("optimized",!1);for(var F=0;F<x;F++){var zt=y[F],Ot=zt.get("group").get("children"),ut=Ot.length;if(pt<p){var Gt=zt.getKeyShape(),_t=Gt.get("ori-visibility");Gt.set("ori-visibility",void 0),_t&&Gt.show()}else for(var ct=0;ct<ut;ct++){var ve=Ot[ct],_t=ve.get("ori-visibility");ve.set("ori-visibility",void 0),!ve.get("visible")&&_t&&_t&&ve.show()}}for(var Te=0;Te<b;Te++){var nt=m[Te],Ot=nt.get("group").get("children"),ut=Ot.length;if(pt<p){var Gt=nt.getKeyShape(),_t=Gt.get("ori-visibility");Gt.set("ori-visibility",void 0),_t&&Gt.show()}else for(var ct=0;ct<ut;ct++){var ve=Ot[ct];if(!ve.get("visible")){var _t=ve.get("ori-visibility");ve.set("ori-visibility",void 0),_t&&ve.show()}}}}},100);this.set("timeout",I)}if(f<=1){var L=void 0,N=void 0;if(a.fixAll||a.fixLineWidth||a.fixLabel){L=i.findAllByState("node",a.fixState),N=i.findAllByState("edge",a.fixState);for(var O=f/c,B=L.length,W=0;W<B;W++){var E=L[W],D=E.getContainer(),P=E.getModel(),R=E.getOriginStyle(),X=E.getStateStyle(a.fixState),Y=E.get("shapeFactory").getShape(P.type).getStateStyle(a.fixState,E)[a.fixState];if(a.fixAll){if(c<=1){var ee=Jt(D.getMatrix());ee||(ee=[1,0,0,0,1,0,0,0,1]);var U=E.getModel(),Z=U.x,K=U.y;ee=xae(ee,[["t",-Z,-K],["s",O,O],["t",Z,K]]),D.setMatrix(ee)}}else for(var S=D.get("children"),_=S.length,C=0;C<_;C++){var M=S[C],se=void 0,re=void 0;if(a.fixLabel){var J=M.get("type");if(J==="text"){se=M.attr("fontSize")||12;var me=X[M.get("name")],Ae=Y[M.get("name")],Ye=me?me.fontSize:12,Ve=Ae?Ae.fontSize:12,Ke=Ye||Ve||12;if(c<=1&&M.attr("fontSize",Ke/c),re)break}}if(a.fixLineWidth&&M.get("isKeyShape")){re=M.attr("lineWidth")||0;var xt=X.lineWidth||Y.lineWidth||R.lineWidth||0;if(c<=1&&M.attr("lineWidth",xt/c),se)break}}}for(var kt=N.length,Lt=0;Lt<kt;Lt++)for(var T=N[Lt],D=T.getContainer(),S=D.get("children"),P=T.getModel(),X=T.getStateStyle(a.fixState),Y=T.get("shapeFactory").getShape(P.type).getStateStyle(a.fixState,T)[a.fixState],_=S.length,C=0;C<_;C++){var M=S[C],se=void 0,re=void 0;if(a.fixLabel||a.fixAll){var J=M.get("type");if(J==="text"){se=M.attr("fontSize")||12;var me=X[M.get("name")],Ae=Y[M.get("name")],Ye=me?me.fontSize:12,Ve=Ae?Ae.fontSize:12,Ke=Ye||Ve||12;if(c<=1&&M.attr("fontSize",Ke/c),re)break}}if((a.fixLineWidth||a.fixAll)&&M.get("isKeyShape")){re=M.attr("lineWidth")||0;var xt=X.lineWidth||Y.lineWidth||1;if(c<=1&&M.attr("lineWidth",xt/c),se)break}}}}var vr=this.get("animate"),xr=this.get("animateCfg");i.zoomTo(c,{x:s.x,y:s.y},vr,xr),i.emit("wheelzoom",e)}}},YD={onMouseEnter:function(e){var t=e.item;this.currentTarget=t,this.showTooltip(e),this.graph.emit("tooltipchange",{item:e.item,action:"show"})},onMouseMove:function(e){if(!this.shouldUpdate(e,this)){this.hideTooltip();return}!this.currentTarget||e.item!==this.currentTarget||this.updatePosition(e)},onMouseLeave:function(e){this.shouldEnd(e,this)&&(this.hideTooltip(),this.graph.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null)},showTooltip:function(e){var t=this.container;if(!(!e.item||e.item.destroyed)){t||(t=this.createTooltip(this.graph.get("canvas")),this.container=t);var n=this.formatText(e.item.get("model"),e);t.innerHTML=n,Qt(this.container,{visibility:"visible"}),this.updatePosition(e)}},hideTooltip:function(){Qt(this.container,{visibility:"hidden"})},updatePosition:function(e){var t=this.get("shouldBegin"),n=this,i=n.width,a=n.height,o=n.container,s=n.graph;if(!t(e,this)){Qt(o,{visibility:"hidden"});return}var u=s.getPointByClient(e.clientX,e.clientY),f=s.getCanvasByPoint(u.x,u.y),l=f.x,c=f.y,h=o.getBoundingClientRect();l>i/2?l-=h.width:l+=this.offset,c>a/2?c-=h.height:c+=this.offset;var d="".concat(l,"px"),v="".concat(c,"px");Qt(this.container,{left:d,top:v,visibility:"visible"})},createTooltip:function(e){var t=e.get("el");t.style.position="relative";var n=Or('<div class="g6-tooltip g6-'.concat(this.item,'-tooltip"></div>'));return t.parentNode.appendChild(n),Qt(n,{position:"absolute",visibility:"visible"}),this.width=e.get("width"),this.height=e.get("height"),this.container=n,this.graph.get("tooltips").push(n),n}},Eae=z({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"}}},YD),_ae=z({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: ".concat(t.source," target: ").concat(t.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},YD);var WC="click",Sae=["click","dblclick"];const Mae={getDefaultCfg:function(){return{trigger:WC,onChange:function(){}}},getEvents:function(){var e,t;return Sae.includes(this.trigger)?t=this.trigger:(t=WC,console.warn("Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),e={},e["node:".concat(t)]="onNodeClick",e.touchstart="onNodeClick",e},onNodeClick:function(e){var t=this;if(this.trigger==="click"){if(this.timer){clearTimeout(this.timer),this.timer=0;return}this.timer=setTimeout(function(){t.toggle(e),clearTimeout(t.timer),t.timer=0},200)}else this.toggle(e)},toggle:function(e){var t=e.item;if(t){var n=this.graph.findDataById(t.get("id"));if(n){var i=n.children;if(!(!i||i.length===0)){var a=!n.collapsed;this.shouldBegin(e,a,this)&&(n.collapsed=a,t.getModel().collapsed=a,this.graph.emit("itemcollapsed",{item:e.item,collapsed:a}),this.shouldUpdate(e,a,this)&&(this.onChange(t,a,this),this.graph.layout()))}}}}};var Cae=Va.calculationItemsBBox,Aae=function r(e,t){if(t(e)!==!1&&e){var n=e.get("combos");if(n.length===0)return!1;_e(n,function(i){r(i,t)})}};const Tae={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(e){var t=e.item;if(!t||t.destroyed||!this.shouldUpdate(e,this))return!1;var n=t.getType();return n==="combo"},onMouseDown:function(e){this.origin={x:e.x,y:e.y}},onDragStart:function(e){var t=this,n=this.graph,i=e.item;if(this.currentShouldEnd=!0,!!this.validationCombo(e)){this.targets=[];var a=n.findAllByState("combo",this.selectedState),o=i.get("id"),s=a.filter(function(f){var l=f.get("id");return o===l});s.length===0?this.targets.push(i):this.targets=a;var u=[];this.targets.forEach(function(f){var l=f.getModel(),c=l.x,h=l.y,d=l.id;u.push({x:c,y:h,id:d})}),this.set("beforeDragItems",u),this.activeState&&this.targets.map(function(f){var l=f.getModel();if(l.parentId){var c=n.findById(l.parentId);c&&n.setItemState(c,t.activeState,!0)}}),this.point={},this.originPoint={},this.currentItemChildCombos=[],Aae(i,function(f){if(f.destroyed)return!1;var l=f.getModel();return t.currentItemChildCombos.push(l.id),!0})}},onDrag:function(e){var t=this;if(this.origin&&this.validationCombo(e))if(this.enableDelegate)this.updateDelegate(e);else{if(this.activeState){var n=this.graph,i=e.item,a=i.getModel(),o=n.getCombos(),s=i.getBBox(),u=s.centerX,f=s.centerY,l=s.width,c=o.filter(function(h){var d=h.getModel();return a.parentId,d.id!==a.id&&!t.currentItemChildCombos.includes(d.id)});c.map(function(h){var d=h.getBBox(),v=d.centerX,p=d.centerY,g=d.width,y=u-v,m=f-p,x=2*Math.sqrt(y*y+m*m);l+g-x>.8*l?n.setItemState(h,t.activeState,!0):n.setItemState(h,t.activeState,!1)})}_e(this.targets,function(h){t.updateCombo(h,e)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(e,t){var n=this;(this.enableDelegate||t)&&_e(this.targets,function(i){n.updateCombo(i,e,t)})},onDrop:function(e){var t=this,n=e.item;if(this.currentShouldEnd=this.shouldEnd(e,n,this),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!n||!this.targets||n.destroyed)){var i=this.graph,a=n.getModel();this.targets.map(function(o){var s=o.getModel();s.parentId!==a.id?(t.activeState&&i.setItemState(n,t.activeState,!1),t.onlyChangeComboSize?i.updateCombo(o):i.updateComboTree(o,a.id,!1)):i.updateCombo(n)}),this.end(n,e),this.endComparison=!0}},onNodeDrop:function(e){var t=this;if(!(!this.targets||this.targets.length===0)){var n=this.graph,i=e.item,a=i.getModel().comboId,o=a?n.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(e,o,this),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){var s;if(a){if(this.activeState){var u=n.findById(a);n.setItemState(u,this.activeState,!1)}this.targets.map(function(f){t.onlyChangeComboSize?n.updateCombo(f):a!==f.getID()&&(s=n.findById(a),a!==f.getModel().parentId&&n.updateComboTree(f,a,!1))})}else this.targets.map(function(f){if(t.onlyChangeComboSize)n.updateCombo(f);else{var l=f.getModel();l.comboId&&n.updateComboTree(f,void 0,!1)}});this.endComparison=!0,this.end(s,e)}}},onDragEnter:function(e){if(this.origin&&this.validationCombo(e)){var t=e.item,n=this.graph;this.activeState&&n.setItemState(t,this.activeState,!0)}},onDragLeave:function(e){if(this.origin&&this.validationCombo(e)){var t=e.item,n=this.graph;this.activeState&&n.setItemState(t,this.activeState,!1)}},onDragEnd:function(e){if(!(!this.targets||this.targets.length===0)){var t=e.item;this.currentShouldEnd&&this.updatePositions(e);var n=this.getParentCombo(t.getModel().parentId),i=this.graph;n&&this.activeState&&i.setItemState(n,this.activeState,!1),this.end(void 0,e)}},end:function(e,t){var n=this;if(this.origin){var i=this.graph;if(this.delegateShape){var a=i.get("delegateGroup");a.clear(),this.delegateShape=null}if(e&&this.activeState&&i.setItemState(e,this.activeState,!1),!e){var o=i.get("enabledStack")&&this.enableStack,s={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map(function(u){if(!n.onlyChangeComboSize)i.updateComboTree(u,void 0,o);else{i.updateCombo(u);var f=u.getModel(),l=f.x,c=f.y,h=f.id;s.after.combos.push({x:l,y:c,id:h}),i.pushStack("update",s)}})}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(e,t,n){var i=this;if(n===void 0&&(n={}),t(e,n)!==!1&&e){var a=e.get("combos");_e(a,function(s){i.traverse(s,t,n)});var o=e.get("nodes");_e(o,function(s){i.traverse(s,t,n)})}},updateCombo:function(e,t,n){this.updateSingleItem(e,t,n);var i={};this.traverse(e,function(a,o){return a.destroyed?!1:(a.getEdges().forEach(function(s){return o[s.getID()]=s}),!0)},i),Object.values(i).forEach(function(a){return a.refresh()})},updateSingleItem:function(e,t,n){var i=this.origin,a=this.graph,o=e.getModel(),s=e.get("id");this.point[s]||(this.point[s]={x:o.x,y:o.y});var u=t.x-i.x+this.point[s].x,f=t.y-i.y+this.point[s].y;n&&(u+=i.x-t.x,f+=i.y-t.y),a.updateItem(e,{x:u,y:f},!1)},getParentCombo:function(e){var t=this.graph;if(e){var n=t.findById(e);if(n)return n}},updateDelegate:function(e){var t=this.graph;if(this.delegateShape){var h=e.x-this.origin.x+this.originPoint.minX,d=e.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:h,y:d})}else{var n=t.get("delegateGroup"),i=null;this.targets.length>1?i=Cae(this.targets):i=this.targets[0].getBBox();var a=i.x,o=i.y,s=i.width,u=i.height,f=i.minX,l=i.minY;this.originPoint={x:a,y:o,width:s,height:u,minX:f,minY:l};var c=z(z({},_s.delegateStyle),this.delegateStyle);this.delegateShape=n.addShape("rect",{attrs:z({width:i.width,height:i.height,x:i.x,y:i.y},c),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var e=this,t=e.graph,n=e.targets,i={};n==null||n.forEach(function(a){var o=a.getModel().parentId;o&&(i[o]=t.findById(o))}),Object.values(i).forEach(function(a){a&&t.updateCombo(a)})}};var qC="dblclick",Iae=["click","dblclick"];const kae={getDefaultCfg:function(){return{trigger:qC,relayout:!0}},getEvents:function(){var e,t;return Iae.includes(this.trigger)?t=this.trigger:(t=qC,console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),e={},e["combo:".concat(t)]="onComboClick",e},onComboClick:function(e){var t=e.item,n=this,i=n.graph,a=n.relayout;if(!(!t||t.destroyed||t.getType()!=="combo")){var o=t.getModel(),s=o.id;s&&(i.collapseExpandCombo(s),a&&i.get("layout")?i.layout():i.refreshPositions())}}};var Lae=Va.isPolygonsIntersect,Nae=Va.pathToPoints,VC="shift",Oae=["drag","shift","ctrl","alt","control"],Dae=function(e,t){var n,i=e.getKeyShape();if(e.get("type")==="path")n=Nae(i.attr("path"));else{var a=i.getCanvasBBox();n=[[a.minX,a.minY],[a.maxX,a.minY],[a.maxX,a.maxY],[a.minX,a.maxY]]}return Lae(t,n)};const Pae={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:VC,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return Oae.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=VC,console.warn("Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.trigger==="drag"?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(e){var t=this.lasso,n=e.item;n||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates("dragstart"),t||(t=this.createLasso()),this.dragging=!0,this.originPoint={x:e.x,y:e.y},this.points.push(this.originPoint),t.show())},onDragMove:function(e){this.dragging&&(this.trigger!=="drag"&&!this.keydown||(this.points.push({x:e.x,y:e.y}),this.updateLasso(e)))},onDragEnd:function(e){!this.lasso&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var e=this.points,t=[];return e.length&&(e.forEach(function(n,i){i===0?t.push(["M",n.x,n.y]):t.push(["L",n.x,n.y])}),t.push(["L",e[0].x,e[0].y])),t},clearStates:function(e){e===void 0&&(e="canvas:click");var t=this,n=t.graph,i=t.selectedState,a=t.shouldDeselect,o=n.findAllByState("node",i),s=n.findAllByState("edge",i);(!a||a({action:e,nodes:o,edges:s}))&&(o.forEach(function(u){return n.setItemState(u,i,!1)}),s.forEach(function(u){return n.setItemState(u,i,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],n.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var e=this,t=this,n=t.graph,i=t.shouldUpdate,a=this.points.map(function(l){return[n.getCanvasByPoint(l.x,l.y).x,n.getCanvasByPoint(l.x,l.y).y]}),o=this.selectedState,s=[],u=[];n.getNodes().forEach(function(l){if(l.isVisible()&&Dae(l,a)&&i(l,"select",e)){s.push(l);var c=l.getModel();u.push(c.id),n.setItemState(l,o,!0)}});var f=[];this.includeEdges&&s.forEach(function(l){var c=l.getOutEdges();c.forEach(function(h){if(h.isVisible()){var d=h.getModel(),v=d.source,p=d.target;u.includes(v)&&u.includes(p)&&i(h,"select",e)&&(f.push(h),n.setItemState(h,e.selectedState,!0))}})}),this.selectedEdges=f,this.selectedNodes=s,this.onSelect&&this.onSelect(s,f),n.emit("nodeselectchange",{selectedItems:{nodes:s,edges:f},select:!0})},createLasso:function(){var e=this,t=e.graph.get("delegateGroup").addShape("path",{attrs:z({path:[]},e.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(e){var t=this;this.lasso.attr({path:t.getLassoPath()})},onKeyDown:function(e){var t=e.key;t&&(t.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}};var HC="click",Rae=["click","drag"],ZC=void 0,Bae=["shift","ctrl","control","alt","meta",void 0];const Fae={getDefaultCfg:function(){return{trigger:HC,key:ZC,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var e=this;Rae.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=HC,console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),e.key&&Bae.indexOf(e.key.toLowerCase())===-1&&(e.trigger=ZC,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined"));var t;return e.trigger==="drag"?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:e.trigger==="click"&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),e.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(e){var t=this;if(!(t.key&&!t.keydown)){var n=e.item;(!n||n.getID()===t.source||n.getType()!=="node")&&t.cancelCreating({item:t.edge,x:e.x,y:e.y})}},onClick:function(e){var t=this;if(!(t.key&&!t.keydown)){var n=e.item,i=t.graph,a=n.getModel(),o=t.getEdgeConfig;if(t.addingEdge&&t.edge){if(!t.shouldEnd(e,t))return;var s=void 0;o&&Pr(o)?s=o({source:t.source,target:a.id},t):s=t.edgeConfig;var u=z({target:a.id},s);if(t.source===a.id&&(u.type="loop"),i.emit("beforecreateedge",{}),i.updateItem(t.edge,u,!1),i.get("enabledStack")){var f=z(z({},t.edge.getModel()),{itemType:"edge"}),l={};l.edges=[f],i.pushStack("add",{before:{},after:l})}i.emit("aftercreateedge",{edge:t.edge}),t.edge.getKeyShape().set("capture",!0),t.edge=null,t.addingEdge=!1}else{if(!t.shouldBegin(e,t))return;var s=void 0;o&&Pr(o)?s=o({source:a.id,target:a.id},t):s=t.edgeConfig,t.edge=i.addItem("edge",z({source:a.id,target:a.id},s),!1),t.source=a.id,t.addingEdge=!0,t.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(e){var t=this;if(!(t.key&&!t.keydown)){t.edge&&t.edge.destroyed&&t.cancelCreating({item:t.edge});var n={x:e.x,y:e.y};if(!t.graph.findById(t.source)){t.addingEdge=!1;return}t.addingEdge&&t.edge&&t.graph.updateItem(t.edge,{target:n},!1)}},cancelCreating:function(e){var t,n,i=this;if(!(i.key&&!i.keydown)){var a=i.graph,o=e.item;if(i.addingEdge&&(i.edge===o||!((n=(t=e.target)===null||t===void 0?void 0:t.isCanvas)===null||n===void 0)&&n.call(t))){i.edge&&!i.edge.destroyed&&a.removeItem(i.edge,!1),i.edge=null,i.addingEdge=!1;return}}},onKeyDown:function(e){var t=this,n=e.key;n&&(n.toLowerCase()===t.key.toLowerCase()?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.addingEdge&&e.edge&&(e.graph.removeItem(e.edge,!1),e.addingEdge=!1,e.edge=null),this.keydown=!1}};var KC="ctrl",Gae=["shift","ctrl","alt","control"],zae="1";const jae={getDefaultCfg:function(){return{trigger:KC,combinedKey:zae,functionName:"fitView",functionParams:[]}},getEvents:function(){return Gae.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=KC,console.warn("Behavior shortcuts-fit-view 的 trigger 参数 '".concat(this.trigger,"' 不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(e){var t=e.key;if(t){var n=this.trigger.toLowerCase(),i=t.toLowerCase();this.triggerKeydown||(i===n||i==="control"&&n==="ctrl"||i==="ctrl"&&n==="control"?this.triggerKeydown=!0:this.triggerKeydown=!1);var a=this.graph;if(!a[this.functionName])return console.warn("Behavior shortcuts-fit-view 的 functionName 参数 '".concat(this.functionName,"' 不合法,它不是 Graph 的一个函数名")),{};if(this.triggerKeydown&&!this.combinedKey){this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]();return}var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(i===o||i==="control"&&o==="ctrl"||i==="ctrl"&&o==="control")&&(this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]())}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}};var Uae=["shift","ctrl","alt","control","meta"];const $ae={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return(!this.zoomKey||Uae.indexOf(this.zoomKey)===-1)&&(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(e){var t=this;if(this.allowDrag(e)){var n=this.graph,i=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];i.includes("control")&&i.push("ctrl");var a=i.some(function(P){return e["".concat(P,"Key")]});if(a){var o=n.get("canvas"),s=o.getPointByClient(e.clientX,e.clientY),u=n.getZoom();e.wheelDelta>0?u=u+u*.05:u=u-u*.05,n.zoomTo(u,{x:s.x,y:s.y})}else{var f=e.deltaX||e.movementX,l=e.deltaY||e.movementY;!l&&navigator.userAgent.indexOf("Firefox")>-1&&(l=-e.wheelDelta*125/3);var c=this.graph.get("width"),h=this.graph.get("height"),d=this.graph.get("canvas").getCanvasBBox(),v=this.scalableRange,p=this.scalableRange;v<1&&v>-1&&(v=c*v,p=h*p);var g=d.minX,y=d.maxX,m=d.minY,x=d.maxY;f>0?y<-v?f=0:y-f<-v&&(f=y+v):f<0&&(g>c+v?f=0:g-f>c+v&&(f=g-(c+v))),l>0?x<-p?l=0:x-l<-p&&(l=x+p):l<0&&(m>h+p?l=0:m-l>h+p&&(l=m-(h+p))),this.get("direction")==="x"?l=0:this.get("direction")==="y"&&(f=0),n.translate(-f,-l)}e.preventDefault();var b=this.get("enableOptimize");if(b){var w=this.get("optimizeZoom"),E=this.get("optimized"),S=n.getNodes(),_=n.getEdges(),C=S.length,M=_.length;if(!E){for(var A=0;A<C;A++){var T=S[A];if(!T.destroyed)for(var I=T.get("group").get("children"),L=I.length,N=0;N<L;N++){var O=I[N];!O.destoryed&&!O.get("isKeyShape")&&(O.set("ori-visibility",O.get("ori-visibility")||O.get("visible")),O.hide())}}for(var B=0;B<M;B++)for(var W=_[B],I=W.get("group").get("children"),L=I.length,N=0;N<L;N++){var O=I[N];O.set("ori-visibility",O.get("ori-visibility")||O.get("visible")),O.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var D=setTimeout(function(){var P=n.getZoom(),R=t.get("optimized");if(R){t.set("optimized",!1);for(var X=0;X<C;X++){var Y=S[X],ee=Y.get("group").get("children"),U=ee.length;if(P<w){var Z=Y.getKeyShape(),K=Z.get("ori-visibility");K&&Z.show()}else for(var se=0;se<U;se++){var re=ee[se],K=re.get("ori-visibility");!re.get("visible")&&K&&K&&re.show()}}for(var J=0;J<M;J++){var me=_[J],ee=me.get("group").get("children"),U=ee.length;if(P<w){var Z=me.getKeyShape(),K=Z.get("ori-visibility");K&&Z.show()}else for(var se=0;se<U;se++){var re=ee[se];if(!re.get("visible")){var K=re.get("ori-visibility");K&&re.show()}}}}},100);this.set("timeout",D)}}},allowDrag:function(e){var t,n,i=e.target,a=i&&i.isCanvas&&i.isCanvas();if(Zl(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if(wn(this.allowDragOnItem)){var o=this.allowDragOnItem,s=o.node,u=o.edge,f=o.combo,l=(n=(t=e.item)===null||t===void 0?void 0:t.getType)===null||n===void 0?void 0:n.call(t);if(!s&&l==="node"||!u&&l==="edge"||!f&&l==="combo")return!1}return!0}};var Xae={"drag-canvas":dae,"zoom-canvas":wae,"drag-node":vae,"activate-relations":pae,"brush-select":yae,"click-select":bae,"lasso-select":Pae,tooltip:Eae,"edge-tooltip":_ae,"collapse-expand":Mae,"drag-combo":Tae,"collapse-expand-combo":kae,"create-edge":Fae,"shortcuts-call":jae,"scroll-canvas":$ae};_e(Xae,function(r,e){Fk(e,r)});var Yae=z(z({},hz),_9),Wae=Zn.Fisheye,qae=Zn.TimeBar,Vae=Zn.ImageMinimap,Hae=Zn.EdgeFilterLens,Zae=Zn.SnapLine,Kae=Zn.Annotation;const ep={version:_s.version,Graph:pD,TreeGraph:Cre,Util:Va,Layout:nr.Layouts,TreeLayout:dre,registerLayout:vre,Global:_s,registerBehavior:Fk,registerCombo:QU,registerEdge:Bk,registerNode:$a,Minimap:Zn.Minimap,Grid:Zn.Grid,Bundling:Zn.Bundling,Menu:Zn.Menu,ToolBar:Zn.ToolBar,Tooltip:Zn.Tooltip,Legend:Zn.Legend,TimeBar:qae,SnapLine:Zae,Fisheye:Wae,ImageMinimap:Vae,EdgeFilterLens:Hae,Annotation:Kae,Algorithm:Yae,Arrow:Nk,Marker:Ok,Shape:Ir};ep.version="4.8.23";ep.registerNode("file-node",{draw(r,e){const t=e.addShape("rect",{name:"rect-shape",attrs:{x:0,y:0,fill:"#fff",stroke:null}});return r.children.length==0||e.addShape("marker",{name:"marker-shape",attrs:{symbol:"triangle-down",x:0,y:0,r:4,fill:"#767c82"}}),e.addShape("text",{name:"text-shape",attrs:{x:6,y:8,fontSize:16,text:r.label,fill:r.tracked?"#00f":"#333639",textAlign:"left",fontFamily:window.getComputedStyle(document.body,null).getPropertyValue("font-family")}}),t}});ep.registerEdge("step-line",{getControlPoints(r){const e=r.startPoint,t=r.endPoint;return[e,{x:e==null?void 0:e.x,y:t==null?void 0:t.y},t]}},"polyline");const eoe=d3({__name:"TrackGraph",props:{track:{}},setup(r){const e=r,t=v3(()=>{var c;const o=Array.from(e.track.nodes).reverse(),s=(c=e.track.nodes[e.track.selector.targetIndex])==null?void 0:c.id,u=(()=>{const h=o.reduce((d,v)=>v.id<d.id?v:d,o[0]);return h.parent&&o.some(d=>d!==h&&d.pid==h.pid)?h.parent:h})(),f=new Set;f.add(u),o.forEach(h=>{f.add(h);let d=h;for(;d&&d!==u;)f.add(d),d=d.parent});const l=Array.from(f).map(h=>({_node:h,children:[],id:h.id.toString(),label:Ox(h),tracked:s===h.id}));return l.sort((h,d)=>h._node.id-d._node.id),l.forEach(h=>{const d=l.find(v=>v.id===h._node.pid.toString());d&&d.children.push(h)}),l.forEach(h=>{if(h.children.length<h._node.children.length){const d=[],v=()=>{for(;d.length>0;)d.pop()},p=()=>{if(d.length==0)return;const g=d[0].parent.children,y=d[0];if(g.length>1&&g.indexOf(y)==1&&g.indexOf(d.at(-1))==g.length-1){v();return}h.children.push({_node:y,children:[],id:y.id.toString(),label:d.length==1?Ox(y):`[${g.indexOf(y)} ... ${g.indexOf(d.at(-1))}]`,tracked:s===y.id}),v()};h._node.children.forEach(g=>{h.children.find(y=>y.id===g.id.toString())?p():d.push(g)}),d.length>0&&p(),h.children.sort((g,y)=>h._node.children.indexOf(g._node)-h._node.children.indexOf(y._node))}}),l}),n=p3();let i;g3(()=>{if(!n.value)return;i==null||i.destroy();const o=n.value.scrollWidth,s=n.value.scrollHeight||o;i=new ep.TreeGraph({container:n.value,width:o,height:s,modes:{default:["drag-canvas","zoom-canvas"]},layout:{type:"indented",indent:25,getHeight(){return 10}}}),i.node(c=>({type:"file-node"})),i.edge(c=>{if(c.id&&c.id.startsWith("-")){const h=Number.parseInt(c.source)>Number.parseInt(c.target)?-1:1,d=String(c.connect),v=Number(c.count);let p=40;if(d.startsWith("<<")){let y=u.find(x=>x.id.toString()==c.source).parent,m=1;for(;y&&y.id.toString()!=c.target;)y=y.parent,m++;m>1&&(p+=m*20)}return v>1&&(p+=(v-1)*20),p*=h,{type:"quadratic",color:"#ff00ff80",curveOffset:p,style:{startArrow:!0},label:d,labelCfg:{style:{fill:"#f00",fontSize:12,background:{fill:"#ffffff",stroke:"#f0f",lineWidth:1,padding:[2,1,0,1],radius:2}}}}}return{type:"step-line"}}),i.data({...t.value[0]}),i.render();const u=Array.from(e.track.nodes),f=e.track.selector.connectKeys,l={};u.forEach((c,h)=>{const d=u[h+1];if(d&&i){const v=d.id>c.id?`-${c.id}:${d.id}`:`-${d.id}:${c.id}`;l[v]=(l[v]||0)+1;const p=`${v}/${l[v]}`,g=f[f.length-h-1],y={"+":()=>d.parent.children.slice(0,d.parent.children.indexOf(d)).reverse().indexOf(c),"-":()=>d.parent.children.slice(d.parent.children.indexOf(d)+1).indexOf(c),">":()=>{let m=0,x=d.parent;for(;x;){if(x===c)return m;x=x.parent,m++}return m},"<":()=>d.children.indexOf(c),"<<":()=>{let m=0;const x=Array.from(d.children).reverse();for(;x.length>0;){const b=x.pop();if(b===c)return m;x.push(...Array.from(b.children).reverse()),m++}return m}}[g]()+1;i.addItem("edge",{source:c.id.toString(),target:d.id.toString(),id:p,connect:y>1?g+y:g,count:l[v]},!1)}}),i.fitView(30)}),Nx(()=>{i==null||i.destroy()});const a=()=>{!i||i.get("destroyed")||!n.value||!n.value||!n.value.scrollWidth||!n.value.scrollHeight||i.changeSize(n.value.scrollWidth,n.value.scrollHeight)};return window.addEventListener("resize",a),Nx(()=>{window.removeEventListener("resize",a)}),(o,s)=>(y3(),m3("div",{ref_key:"container",ref:n},null,512))}});export{eoe as default};
670
- //# sourceMappingURL=TrackGraph-DpD4rstl.js.map
670
+ //# sourceMappingURL=TrackGraph-C3QBHeit.js.map