@gkd-kit/inspect 0.0.1731259139405 → 0.0.1731308168581

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-D_2o3rZP.js → ActionCard.vue_vue_type_script_setup_true_lang-DHlxror0.js} +2 -2
  2. package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-D_2o3rZP.js.map → ActionCard.vue_vue_type_script_setup_true_lang-DHlxror0.js.map} +1 -1
  3. package/dist/assets/{DevicePage-BN6nS5fM.js → DevicePage-CDz852UB.js} +2 -2
  4. package/dist/assets/{DevicePage-BN6nS5fM.js.map → DevicePage-CDz852UB.js.map} +1 -1
  5. package/dist/assets/{HomePage-BJDQ-GtG.js → HomePage-B4VUUJWc.js} +2 -2
  6. package/dist/assets/{HomePage-BJDQ-GtG.js.map → HomePage-B4VUUJWc.js.map} +1 -1
  7. package/dist/assets/{ImportPage-BU7yKdGD.js → ImportPage-CDH0sMeJ.js} +2 -2
  8. package/dist/assets/{ImportPage-BU7yKdGD.js.map → ImportPage-CDH0sMeJ.js.map} +1 -1
  9. package/dist/assets/{SelectorPage-B-Lm1bSQ.js → SelectorPage-d3O5D0fD.js} +2 -2
  10. package/dist/assets/SelectorPage-d3O5D0fD.js.map +1 -0
  11. package/dist/assets/{SnapshotPage-BN0y1aYA.js → SnapshotPage-ChEpVk3a.js} +5 -5
  12. package/dist/assets/{SnapshotPage-BN0y1aYA.js.map → SnapshotPage-ChEpVk3a.js.map} +1 -1
  13. package/dist/assets/{TrackGraph-DHc1kT0P.js → TrackGraph-DcKRoN1f.js} +2 -2
  14. package/dist/assets/{TrackGraph-DHc1kT0P.js.map → TrackGraph-DcKRoN1f.js.map} +1 -1
  15. package/dist/assets/{_404Page-BggmxYkI.js → _404Page-BKg0y16w.js} +2 -2
  16. package/dist/assets/{_404Page-BggmxYkI.js.map → _404Page-BKg0y16w.js.map} +1 -1
  17. package/dist/assets/chunk-DTbao6kD.js +3 -0
  18. package/dist/assets/{chunk-Y3W1S-AV.js.map → chunk-DTbao6kD.js.map} +1 -1
  19. package/dist/assets/{dayjs.min-Bizq9jpW.js → dayjs.min-D1CZc5GV.js} +2 -2
  20. package/dist/assets/{dayjs.min-Bizq9jpW.js.map → dayjs.min-D1CZc5GV.js.map} +1 -1
  21. package/dist/assets/{error-C4MyxzW7.js → error-BXJuarq4.js} +2 -2
  22. package/dist/assets/{error-C4MyxzW7.js.map → error-BXJuarq4.js.map} +1 -1
  23. package/dist/assets/{import-OUve1afr.js → import-BpMO-EZT.js} +2 -2
  24. package/dist/assets/{import-OUve1afr.js.map → import-BpMO-EZT.js.map} +1 -1
  25. package/dist/assets/{index-Cv3emQKC.js → index-DJtt0fwN.js} +8 -8
  26. package/dist/assets/{index-Cv3emQKC.js.map → index-DJtt0fwN.js.map} +1 -1
  27. package/dist/assets/{jszip.min-cMHfaZoB.js → jszip.min-CVPtIiNV.js} +2 -2
  28. package/dist/assets/{jszip.min-cMHfaZoB.js.map → jszip.min-CVPtIiNV.js.map} +1 -1
  29. package/dist/assets/snapshot-CEg5rg31.js +3 -0
  30. package/dist/assets/snapshot-CEg5rg31.js.map +1 -0
  31. package/dist/assets/{table-DFFg7N9M.js → table-DH_jQzcx.js} +2 -2
  32. package/dist/assets/{table-DFFg7N9M.js.map → table-DH_jQzcx.js.map} +1 -1
  33. package/dist/index.html +3 -3
  34. package/package.json +1 -1
  35. package/dist/assets/SelectorPage-B-Lm1bSQ.js.map +0 -1
  36. package/dist/assets/chunk-Y3W1S-AV.js +0 -3
  37. package/dist/assets/snapshot-BL-RXHF4.js +0 -3
  38. package/dist/assets/snapshot-BL-RXHF4.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{cn as va,ci as pa,aW as xe,h as M5,m as C5,A as A5,D as T5,ax as xw,H as I5,I as k5}from"./index-Cv3emQKC.js";import{$ as ww}from"./dayjs.min-Bizq9jpW.js";function L5(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 lm=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Ri},get Circle(){return V7},get Ellipse(){return H7},get Image(){return q7},get Line(){return Z7},get Marker(){return Q7},get Path(){return u1},get Polygon(){return aX},get Polyline(){return oX},get Rect(){return fX},get Text(){return lX}},Symbol.toStringTag,{value:"Module"})),cm=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return mi},get Circle(){return vX},get Dom(){return pX},get Ellipse(){return gX},get Image(){return yX},get Line(){return mX},get Marker(){return bX},get Path(){return xX},get Polygon(){return wX},get Polyline(){return EX},get Rect(){return SX},get Text(){return TX}},Symbol.toStringTag,{value:"Module"}));var _0=function(r,e){return _0=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])},_0(r,e)};function kt(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");_0(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var B=function(){return B=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},B.apply(this,arguments)};function nn(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 eC(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 tC(r,e){return function(t,n){e(t,n,r)}}function N5(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 O5(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 D5(r){return typeof r=="symbol"?r:"".concat(r)}function P5(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 rC(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Wn(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 Vn(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 dv=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 nC(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&dv(e,r,t)}function md(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 hm(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 iC(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(hm(arguments[e]));return r}function vv(){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 Jn(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 Lu(r){return this instanceof Lu?(this.v=r,this):new Lu(r)}function aC(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 Lu?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 oC(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:Lu(r[i](o)),done:!1}:a?a(o):o}:a}}function sC(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 md=="function"?md(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 uC(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}var R5=Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e};function fC(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)&&dv(e,r,t);return R5(e,r),e}function lC(r){return r&&r.__esModule?r:{default:r}}function cC(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 hC(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 dC(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 vC(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 B5=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 pC(r){function e(n){r.error=r.hasError?new B5(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 F5={__extends:kt,__assign:B,__rest:nn,__decorate:eC,__param:tC,__metadata:rC,__awaiter:Wn,__generator:Vn,__createBinding:dv,__exportStar:nC,__values:md,__read:hm,__spread:iC,__spreadArrays:vv,__spreadArray:Jn,__await:Lu,__asyncGenerator:aC,__asyncDelegator:oC,__asyncValues:sC,__makeTemplateObject:uC,__importStar:fC,__importDefault:lC,__classPrivateFieldGet:cC,__classPrivateFieldSet:hC,__classPrivateFieldIn:dC,__addDisposableResource:vC,__disposeResources:pC},G5=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:vC,get __assign(){return B},__asyncDelegator:oC,__asyncGenerator:aC,__asyncValues:sC,__await:Lu,__awaiter:Wn,__classPrivateFieldGet:cC,__classPrivateFieldIn:dC,__classPrivateFieldSet:hC,__createBinding:dv,__decorate:eC,__disposeResources:pC,__esDecorate:N5,__exportStar:nC,__extends:kt,__generator:Vn,__importDefault:lC,__importStar:fC,__makeTemplateObject:uC,__metadata:rC,__param:tC,__propKey:D5,__read:hm,__rest:nn,__runInitializers:O5,__setFunctionName:P5,__spread:iC,__spreadArray:Jn,__spreadArrays:vv,__values:md,default:F5},Symbol.toStringTag,{value:"Module"}));var Gn=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},bd=function(r,e){return Gn(r)?r.indexOf(e)>-1:!1},pv=function(r,e){if(!Gn(r))return r;for(var t=[],n=0;n<r.length;n++){var i=r[n];e(i,n)&&t.push(i)}return t},z5=function(r,e){return e===void 0&&(e=[]),pv(r,function(t){return!bd(e,t)})},$5={}.toString,Pi=function(r,e){return $5.call(r)==="[object "+e+"]"};const Mr=function(r){return Pi(r,"Function")};var ct=function(r){return r==null};const pt=function(r){return Array.isArray?Array.isArray(r):Pi(r,"Array")},yn=function(r){var e=typeof r;return r!==null&&e==="object"||e==="function"};function me(r,e){if(r){var t;if(pt(r))for(var n=0,i=r.length;n<i&&(t=e(r[n],n),t!==!1);n++);else if(yn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(t=e(r[a],a),t===!1))break}}}var gC=Object.keys?function(r){return Object.keys(r)}:function(r){var e=[];return me(r,function(t,n){Mr(r)&&n==="prototype"||e.push(n)}),e};function yC(r,e){var t=gC(e),n=t.length;if(ct(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 xd=function(r){return typeof r=="object"&&r!==null},pn=function(r){if(!xd(r)||!Pi(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 j5(r,e){if(!pt(r))return null;var t;if(Mr(e)&&(t=e),pn(e)&&(t=function(i){return yC(i,e)}),t){for(var n=0;n<r.length;n+=1)if(t(r[n]))return r[n]}return null}function U5(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 X5=function(r,e){for(var t=null,n=0;n<r.length;n++){var i=r[n],a=i[e];if(!ct(a)){pt(a)?t=a[0]:t=a;break}}return t},Y5=function(r){if(!pt(r))return[];for(var e=[],t=0;t<r.length;t++)e=e.concat(r[t]);return e},mC=function(r,e){if(e===void 0&&(e=[]),!pt(r))e.push(r);else for(var t=0;t<r.length;t+=1)mC(r[t],e);return e};const ca=function(r){if(pt(r))return r.reduce(function(e,t){return Math.max(e,t)},r[0])},ha=function(r){if(pt(r))return r.reduce(function(e,t){return Math.min(e,t)},r[0])};var bC=function(r){var e=r.filter(function(o){return!isNaN(o)});if(!e.length)return{min:0,max:0};if(pt(r[0])){for(var t=[],n=0;n<r.length;n++)t=t.concat(r[n]);e=t}var i=ca(e),a=ha(e);return{min:a,max:i}},xC=Array.prototype,W5=xC.splice,V5=xC.indexOf,H5=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=V5.call(r,i))>-1;)W5.call(r,a,1);return r},q5=Array.prototype.splice,wC=function(e,t){if(!Gn(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,q5.call(e,o,1))}return e},EC=function(r,e,t){if(!pt(r)&&!pn(r))return r;var n=t;return me(r,function(i,a){n=e(n,i,a)}),n},Z5=function(r,e){var t=[];if(!Gn(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 wC(r,i),t};const Pe=function(r){return Pi(r,"String")};function K5(r,e){var t;if(Mr(e))t=function(i,a){return e(i)-e(a)};else{var n=[];Pe(e)?n.push(e):pt(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 gl(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 Q5=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return gl([].concat.apply([],r))};const J5=function(r,e){for(var t=[],n={},i=0;i<r.length;i++){var a=r[i],o=a[e];if(!ct(o)){pt(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(Gn(r))return r[0]}function vi(r){if(Gn(r)){var e=r;return e[e.length-1]}}function eR(r,e){return pt(r)||Pe(r)?r[0]===e:!1}function tR(r,e){return pt(r)||Pe(r)?r[r.length-1]===e:!1}var rR=function(r,e){for(var t=0;t<r.length;t++)if(!e(r[t],t))return!1;return!0},nR=function(r,e){for(var t=0;t<r.length;t++)if(e(r[t],t))return!0;return!1},iR=Object.prototype.hasOwnProperty;function wd(r,e){if(!e||!pt(r))return{};for(var t={},n=Mr(e)?e:function(s){return s[e]},i,a=0;a<r.length;a++){var o=r[a];i=n(o),iR.call(t,i)?t[i].push(o):t[i]=[o]}return t}function _C(r,e){if(!e)return{0:r};if(!Mr(e)){var t=pt(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 wd(r,e)}const aR=function(r,e){if(!e)return[r];var t=_C(r,e),n=[];for(var i in t)n.push(t[i]);return n};function oR(r,e){return r["_wrap_"+e]}function cs(r,e){if(r["_wrap_"+e])return r["_wrap_"+e];var t=function(n){r[e](n)};return r["_wrap_"+e]=t,t}var Ew={};function sR(r){var e=Ew[r];if(!e){for(var t=r.toString(16),n=t.length;n<6;n++)t="0"+t;e="#"+t,Ew[r]=e}return e}function uR(r){var e=0,t=0,n=0,i=0;return pt(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 fR=function(r,e,t){return r<e?e:r>t?t:r},Vh=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))},ht=function(r){return Pi(r,"Number")},lR=function(r){return ht(r)&&r%1!==0},cR=function(r){return ht(r)&&r%2===0},hR=Number.isInteger?Number.isInteger:function(r){return ht(r)&&r%1===0},dR=function(r){return ht(r)&&r<0},vR=1e-5;function SC(r,e,t){return t===void 0&&(t=vR),Math.abs(r-e)<t}var pR=function(r){return ht(r)&&r%2!==0},gR=function(r){return ht(r)&&r>0};const yR=function(r,e){if(pt(r)){for(var t,n=-1/0,i=0;i<r.length;i++){var a=r[i],o=Mr(e)?e(a):a[e];o>n&&(t=a,n=o)}return t}},mR=function(r,e){if(pt(r)){for(var t,n=1/0,i=0;i<r.length;i++){var a=r[i],o=Mr(e)?e(a):a[e];o<n&&(t=a,n=o)}return t}};var gv=function(r,e){return(r%e+e)%e},bR=180/Math.PI,xR=function(r){return bR*r};const wR=parseInt;var ER=Math.PI/180,yv=function(r){return ER*r};const _w=function(r,e){return r.hasOwnProperty(e)};var dm=Object.values?function(r){return Object.values(r)}:function(r){var e=[];return me(r,function(t,n){Mr(r)&&n==="prototype"||e.push(t)}),e};const _R=function(r,e){return bd(dm(r),e)},Zu=function(r){return ct(r)?"":r.toString()};var SR=function(r){return Zu(r).toLowerCase()},MR=function(r){var e=Zu(r);return e.charAt(0).toLowerCase()+e.substring(1)};function CR(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 AR=function(r){return Zu(r).toUpperCase()},Nu=function(r){var e=Zu(r);return e.charAt(0).toUpperCase()+e.substring(1)},TR={}.toString,MC=function(r){return TR.call(r).replace(/^\[object /,"").replace(/]$/,"")},IR=function(r){return Pi(r,"Arguments")},$l=function(r){return Pi(r,"Boolean")},vm=function(r){return Pi(r,"Date")},kR=function(r){return Pi(r,"Error")};function LR(r){return ht(r)&&isFinite(r)}var NR=function(r){return r===null},OR=Object.prototype,CC=function(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||OR;return r===t},DR=function(r){return Pi(r,"RegExp")},PR=function(r){return r===void 0},RR=function(r){return r instanceof Element||r instanceof HTMLDocument};function AC(r){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)};return e(r)}function TC(r){var e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;e(r)}function cg(r,e){for(var t in e)e.hasOwnProperty(t)&&t!=="constructor"&&e[t]!==void 0&&(r[t]=e[t])}function yt(r,e,t,n){return e&&cg(r,e),t&&cg(r,t),n&&cg(r,n),r}var BR=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];Mr(i)&&(i=i.prototype),yt(t.prototype,i)}},Vt=function(r){if(typeof r!="object"||r===null)return r;var e;if(pt(r)){e=[];for(var t=0,n=r.length;t<n;t++)typeof r[t]=="object"&&r[t]!=null?e[t]=Vt(r[t]):e[t]=r[t]}else{e={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?e[i]=Vt(r[i]):e[i]=r[i]}return e};function jl(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 IC=function(r,e){if(!Mr(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 FR=5;function kC(r,e,t,n){t=t||0,n=n||FR;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];a!==null&&pn(a)?(pn(r[i])||(r[i]={}),t<n?kC(r[i],a,t+1,n):r[i]=e[i]):pt(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var yr=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)kC(r,e[n]);return r},GR=function(r,e,t,n){Mr(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=yt(a,r.prototype),r.superclass=i(e.prototype,e),yt(a,t),yt(r,n),r},pm=function(r,e){if(!Gn(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},zR=Object.prototype.hasOwnProperty;function LC(r){if(ct(r))return!0;if(Gn(r))return!r.length;var e=MC(r);if(e==="Map"||e==="Set")return!r.size;if(CC(r))return!Object.keys(r).length;for(var t in r)if(zR.call(r,t))return!1;return!0}var Mo=function(r,e){if(r===e)return!0;if(!r||!e||Pe(r)||Pe(e))return!1;if(Gn(r)||Gn(e)){if(r.length!==e.length)return!1;for(var t=!0,n=0;n<r.length&&(t=Mo(r[n],e[n]),!!t);n++);return t}if(xd(r)||xd(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=Mo(r[i[n]],e[i[n]]),!!t);n++);return t}return!1};const $R=function(r,e,t){return Mr(t)?!!t(r,e):Mo(r,e)};var _s=function(r,e){if(!Gn(r))return r;for(var t=[],n=0;n<r.length;n++){var i=r[n];t.push(e(i,n))}return t},jR=function(r){return r};const UR=function(r,e){e===void 0&&(e=jR);var t={};return yn(r)&&!ct(r)&&Object.keys(r).forEach(function(n){t[n]=e(r[n],n)}),t},Oa=function(r,e,t){for(var n=0,i=Pe(e)?e.split("."):e;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?t:r},XR=function(r,e,t){var n=r,i=Pe(e)?e.split("."):e;return i.forEach(function(a,o){o<i.length-1?(yn(n[a])||(n[a]=ht(i[o+1])?[]:{}),n=n[a]):n[a]=t}),r};var YR=Object.prototype.hasOwnProperty;const WR=function(r,e){if(r===null||!pn(r))return{};var t={};return me(e,function(n){YR.call(r,n)&&(t[n]=r[n])}),t},VR=function(r,e){return EC(r,function(t,n,i){return e.includes(i)||(t[i]=n),t},{})},yl=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},NC=function(r){return Gn(r)?Array.prototype.slice.call(r):[]};var Hc={};const da=function(r){return r=r||"g",Hc[r]?Hc[r]+=1:Hc[r]=1,r+Hc[r]},Uf=function(){},HR=function(r){return r};function mv(r){return ct(r)?0:Gn(r)?r.length:Object.keys(r).length}var qc;const Xf=IC(function(r,e){e===void 0&&(e={});var t=e.fontSize,n=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return qc||(qc=document.createElement("canvas").getContext("2d")),qc.font=[a,o,i,t+"px",n].join(" "),qc.measureText(Pe(r)?r:"").width},function(r,e){return e===void 0&&(e={}),vv([r],dm(e)).join("")}),qR=function(r,e,t,n){n===void 0&&(n="...");var i=16,a=Xf(n,t),o=Pe(r)?r:Zu(r),s=e,u=[],f,l;if(Xf(r,t)<=e)return r;for(;f=o.substr(0,i),l=Xf(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=Xf(f,t),!(l+a>s);)if(u.push(f),s-=l,o=o.substr(1),!o)return u.join("");return""+u.join("")+n};var ZR=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 KR=Object.freeze(Object.defineProperty({__proto__:null,Cache:ZR,assign:yt,augment:BR,clamp:fR,clearAnimationFrame:TC,clone:Vt,contains:bd,debounce:jl,deepMix:yr,difference:z5,each:me,endsWith:tR,every:rR,extend:GR,filter:pv,find:j5,findIndex:U5,firstValue:X5,fixedBase:Vh,flatten:Y5,flattenDeep:mC,forIn:me,get:Oa,getEllipsisText:qR,getRange:bC,getType:MC,getWrapBehavior:oR,group:aR,groupBy:wd,groupToMap:_C,has:_w,hasKey:_w,hasValue:_R,head:ua,identity:HR,includes:bd,indexOf:pm,isArguments:IR,isArray:pt,isArrayLike:Gn,isBoolean:$l,isDate:vm,isDecimal:lR,isElement:RR,isEmpty:LC,isEqual:Mo,isEqualWith:$R,isError:kR,isEven:cR,isFinite:LR,isFunction:Mr,isInteger:hR,isMatch:yC,isNegative:dR,isNil:ct,isNull:NR,isNumber:ht,isNumberEqual:SC,isObject:yn,isObjectLike:xd,isOdd:pR,isPlainObject:pn,isPositive:gR,isPrototype:CC,isRegExp:DR,isString:Pe,isType:Pi,isUndefined:PR,keys:gC,last:vi,lowerCase:SR,lowerFirst:MR,map:_s,mapValues:UR,max:ca,maxBy:yR,measureTextWidth:Xf,memoize:IC,min:ha,minBy:mR,mix:yt,mod:gv,noop:Uf,number2color:sR,omit:VR,parseRadius:uR,pick:WR,pull:H5,pullAt:wC,reduce:EC,remove:Z5,requestAnimationFrame:AC,set:XR,size:mv,some:nR,sortBy:K5,startsWith:eR,substitute:CR,throttle:yl,toArray:NC,toDegree:xR,toInteger:wR,toRadian:yv,toString:Zu,union:Q5,uniq:gl,uniqueId:da,upperCase:AR,upperFirst:Nu,values:dm,valuesOfKey:J5,wrapBehavior:cs},Symbol.toStringTag,{value:"Module"})),QR={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),me(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),me(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 gm=function(){function r(){}return r.registerBehavior=function(e,t){if(!t)throw new Error("please specify handler for this behavior: ".concat(e));var n=Vt(QR);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&&(me(u,function(l,c){f[c]=cs(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}(),JR="*",OC=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[JR]||[],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}(),wt=1e-6,Qt=typeof Float32Array<"u"?Float32Array:Array,Li=Math.random;function eB(r){Qt=r}var tB=Math.PI/180;function rB(r){return r*tB}function nB(r,e){return Math.abs(r-e)<=wt*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 iB=Object.freeze(Object.defineProperty({__proto__:null,get ARRAY_TYPE(){return Qt},EPSILON:wt,RANDOM:Li,equals:nB,setMatrixArrayType:eB,toRadian:rB},Symbol.toStringTag,{value:"Module"}));function aB(){var r=new Qt(4);return Qt!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r}function oB(r){var e=new Qt(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function sB(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function uB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r}function fB(r,e,t,n){var i=new Qt(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}function lB(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function cB(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 hB(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 dB(r,e){var t=e[0];return r[0]=e[3],r[1]=-e[1],r[2]=-e[2],r[3]=t,r}function vB(r){return r[0]*r[3]-r[2]*r[1]}function DC(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 pB(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 gB(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 yB(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 mB(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=e[1],r}function bB(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function xB(r){return Math.hypot(r[0],r[1],r[2],r[3])}function wB(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 EB(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 PC(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 _B(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}function SB(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)<=wt*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(n-s)<=wt*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=wt*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=wt*Math.max(1,Math.abs(a),Math.abs(f))}function MB(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 CB(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 AB=DC,TB=PC;const IB=Object.freeze(Object.defineProperty({__proto__:null,LDU:wB,add:EB,adjoint:dB,clone:oB,copy:sB,create:aB,determinant:vB,equals:SB,exactEquals:_B,frob:xB,fromRotation:yB,fromScaling:mB,fromValues:fB,identity:uB,invert:hB,mul:AB,multiply:DC,multiplyScalar:MB,multiplyScalarAndAdd:CB,rotate:pB,scale:gB,set:lB,str:bB,sub:TB,subtract:PC,transpose:cB},Symbol.toStringTag,{value:"Module"}));function kB(){var r=new Qt(6);return Qt!=Float32Array&&(r[1]=0,r[2]=0,r[4]=0,r[5]=0),r[0]=1,r[3]=1,r}function LB(r){var e=new Qt(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 NB(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 OB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function DB(r,e,t,n,i,a){var o=new Qt(6);return o[0]=r,o[1]=e,o[2]=t,o[3]=n,o[4]=i,o[5]=a,o}function PB(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 RB(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 BB(r){return r[0]*r[3]-r[1]*r[2]}function RC(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 FB(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 GB(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 zB(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 $B(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 jB(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 UB(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 XB(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")"}function YB(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],1)}function WB(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 BC(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 VB(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 HB(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 qB(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 ZB(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)<=wt*Math.max(1,Math.abs(t),Math.abs(u))&&Math.abs(n-f)<=wt*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-l)<=wt*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-c)<=wt*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-h)<=wt*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-d)<=wt*Math.max(1,Math.abs(s),Math.abs(d))}var KB=RC,QB=BC;const JB=Object.freeze(Object.defineProperty({__proto__:null,add:WB,clone:LB,copy:NB,create:kB,determinant:BB,equals:ZB,exactEquals:qB,frob:YB,fromRotation:$B,fromScaling:jB,fromTranslation:UB,fromValues:DB,identity:OB,invert:RB,mul:KB,multiply:RC,multiplyScalar:VB,multiplyScalarAndAdd:HB,rotate:FB,scale:GB,set:PB,str:XB,sub:QB,subtract:BC,translate:zB},Symbol.toStringTag,{value:"Module"}));function FC(){var r=new Qt(9);return Qt!=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 eF(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 tF(r){var e=new Qt(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 rF(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 nF(r,e,t,n,i,a,o,s,u){var f=new Qt(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 iF(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 aF(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 oF(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 ym(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 sF(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 uF(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 ga(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],b=t[7],x=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+b*o+x*f,r[7]=m*i+b*s+x*l,r[8]=m*a+b*u+x*c,r}function fF(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 lF(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 cF(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 mm(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 bm(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 xm(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 hF(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 dF(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 vF(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,b=t*u-i*o,x=t*f-a*o,w=n*u-i*s,E=n*f-a*s,_=i*f-a*u,M=l*p-c*v,C=l*g-h*v,S=l*y-d*v,A=c*g-h*p,T=c*y-d*p,k=h*y-d*g,O=m*k-b*T+x*A+w*S-E*C+_*M;return O?(O=1/O,r[0]=(s*k-u*T+f*A)*O,r[1]=(u*S-o*k-f*C)*O,r[2]=(o*T-s*S+f*M)*O,r[3]=(i*T-n*k-a*A)*O,r[4]=(t*k-i*S+a*C)*O,r[5]=(n*S-t*T-a*M)*O,r[6]=(p*_-g*E+y*w)*O,r[7]=(g*x-v*_-y*b)*O,r[8]=(v*E-p*x+y*m)*O,r):null}function pF(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 gF(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function yF(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function mF(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 GC(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 bF(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 xF(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 wF(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 EF(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],b=e[8];return Math.abs(t-c)<=wt*Math.max(1,Math.abs(t),Math.abs(c))&&Math.abs(n-h)<=wt*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=wt*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-v)<=wt*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-p)<=wt*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=wt*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=wt*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(f-m)<=wt*Math.max(1,Math.abs(f),Math.abs(m))&&Math.abs(l-b)<=wt*Math.max(1,Math.abs(l),Math.abs(b))}var _F=ga,SF=GC;const zC=Object.freeze(Object.defineProperty({__proto__:null,add:mF,adjoint:sF,clone:tF,copy:rF,create:FC,determinant:uF,equals:EF,exactEquals:wF,frob:yF,fromMat2d:hF,fromMat4:eF,fromQuat:dF,fromRotation:bm,fromScaling:xm,fromTranslation:mm,fromValues:nF,identity:aF,invert:ym,mul:_F,multiply:ga,multiplyScalar:bF,multiplyScalarAndAdd:xF,normalFromMat4:vF,projection:pF,rotate:lF,scale:cF,set:iF,str:gF,sub:SF,subtract:GC,translate:fF,transpose:oF},Symbol.toStringTag,{value:"Module"}));function MF(){var r=new Qt(16);return Qt!=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 CF(r){var e=new Qt(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 AF(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 TF(r,e,t,n,i,a,o,s,u,f,l,c,h,d,v,p){var g=new Qt(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 IF(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 $C(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 kF(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 LF(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,b=t*u-i*o,x=t*f-a*o,w=n*u-i*s,E=n*f-a*s,_=i*f-a*u,M=l*p-c*v,C=l*g-h*v,S=l*y-d*v,A=c*g-h*p,T=c*y-d*p,k=h*y-d*g,O=m*k-b*T+x*A+w*S-E*C+_*M;return O?(O=1/O,r[0]=(s*k-u*T+f*A)*O,r[1]=(i*T-n*k-a*A)*O,r[2]=(p*_-g*E+y*w)*O,r[3]=(h*E-c*_-d*w)*O,r[4]=(u*S-o*k-f*C)*O,r[5]=(t*k-i*S+a*C)*O,r[6]=(g*x-v*_-y*b)*O,r[7]=(l*_-h*x+d*b)*O,r[8]=(o*T-s*S+f*M)*O,r[9]=(n*S-t*T-a*M)*O,r[10]=(v*E-p*x+y*m)*O,r[11]=(c*x-l*E-d*m)*O,r[12]=(s*C-o*A-u*M)*O,r[13]=(t*A-n*C+i*M)*O,r[14]=(p*b-v*w-g*m)*O,r[15]=(l*w-c*b+h*m)*O,r):null}function NF(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 OF(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,b=e*u-i*a,x=t*s-n*o,w=t*u-i*o,E=n*u-i*s,_=f*v-l*d,M=f*p-c*d,C=f*g-h*d,S=l*p-c*v,A=l*g-h*v,T=c*g-h*p;return y*T-m*A+b*S+x*C-w*M+E*_}function jC(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],b=t[0],x=t[1],w=t[2],E=t[3];return r[0]=b*n+x*s+w*c+E*p,r[1]=b*i+x*u+w*h+E*g,r[2]=b*a+x*f+w*d+E*y,r[3]=b*o+x*l+w*v+E*m,b=t[4],x=t[5],w=t[6],E=t[7],r[4]=b*n+x*s+w*c+E*p,r[5]=b*i+x*u+w*h+E*g,r[6]=b*a+x*f+w*d+E*y,r[7]=b*o+x*l+w*v+E*m,b=t[8],x=t[9],w=t[10],E=t[11],r[8]=b*n+x*s+w*c+E*p,r[9]=b*i+x*u+w*h+E*g,r[10]=b*a+x*f+w*d+E*y,r[11]=b*o+x*l+w*v+E*m,b=t[12],x=t[13],w=t[14],E=t[15],r[12]=b*n+x*s+w*c+E*p,r[13]=b*i+x*u+w*h+E*g,r[14]=b*a+x*f+w*d+E*y,r[15]=b*o+x*l+w*v+E*m,r}function DF(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 PF(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 RF(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,b,x,w,E,_,M,C,S,A,T,k,O,F;return s<wt?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],b=e[8],x=e[9],w=e[10],E=e[11],_=i*i*l+f,M=a*i*l+o*u,C=o*i*l-a*u,S=i*a*l-o*u,A=a*a*l+f,T=o*a*l+i*u,k=i*o*l+a*u,O=a*o*l-i*u,F=o*o*l+f,r[0]=c*_+p*M+b*C,r[1]=h*_+g*M+x*C,r[2]=d*_+y*M+w*C,r[3]=v*_+m*M+E*C,r[4]=c*S+p*A+b*T,r[5]=h*S+g*A+x*T,r[6]=d*S+y*A+w*T,r[7]=v*S+m*A+E*T,r[8]=c*k+p*O+b*F,r[9]=h*k+g*O+x*F,r[10]=d*k+y*O+w*F,r[11]=v*k+m*O+E*F,e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r)}function BF(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 FF(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 GF(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 zF(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 $F(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 jF(r,e,t){var n=t[0],i=t[1],a=t[2],o=Math.hypot(n,i,a),s,u,f;return o<wt?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 UF(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 XF(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 YF(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 UC(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 WF(r,e){var t=new Qt(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),UC(r,e,t),r}function XC(r,e){return r[0]=e[12],r[1]=e[13],r[2]=e[14],r}function YC(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 WC(r,e){var t=new Qt(3);YC(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 VF(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,b=s*l,x=n[0],w=n[1],E=n[2];return r[0]=(1-(v+g))*x,r[1]=(h+b)*x,r[2]=(d-m)*x,r[3]=0,r[4]=(h-b)*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 HF(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,b=u*l,x=u*c,w=n[0],E=n[1],_=n[2],M=i[0],C=i[1],S=i[2],A=(1-(p+y))*w,T=(d+x)*w,k=(v-b)*w,O=(d-x)*E,F=(1-(h+y))*E,D=(g+m)*E,$=(v+b)*_,Y=(g-m)*_,N=(1-(h+p))*_;return r[0]=A,r[1]=T,r[2]=k,r[3]=0,r[4]=O,r[5]=F,r[6]=D,r[7]=0,r[8]=$,r[9]=Y,r[10]=N,r[11]=0,r[12]=t[0]+M-(A*M+O*C+$*S),r[13]=t[1]+C-(T*M+F*C+Y*S),r[14]=t[2]+S-(k*M+D*C+N*S),r[15]=1,r}function qF(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 ZF(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 VC(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 KF=VC;function QF(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 HC(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 e4=HC;function t4(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 r4(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],b=n[2],x=t[0],w=t[1],E=t[2];return Math.abs(v-x)<wt&&Math.abs(p-w)<wt&&Math.abs(g-E)<wt?$C(r):(l=v-x,c=p-w,h=g-E,d=1/Math.hypot(l,c,h),l*=d,c*=d,h*=d,i=m*h-b*c,a=b*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 n4(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 i4(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 a4(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 o4(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 qC(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 s4(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 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[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 f4(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 l4(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],b=e[1],x=e[2],w=e[3],E=e[4],_=e[5],M=e[6],C=e[7],S=e[8],A=e[9],T=e[10],k=e[11],O=e[12],F=e[13],D=e[14],$=e[15];return Math.abs(t-m)<=wt*Math.max(1,Math.abs(t),Math.abs(m))&&Math.abs(n-b)<=wt*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-x)<=wt*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=wt*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-E)<=wt*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(s-_)<=wt*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(u-M)<=wt*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(f-C)<=wt*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(l-S)<=wt*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-A)<=wt*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(h-T)<=wt*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-k)<=wt*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(v-O)<=wt*Math.max(1,Math.abs(v),Math.abs(O))&&Math.abs(p-F)<=wt*Math.max(1,Math.abs(p),Math.abs(F))&&Math.abs(g-D)<=wt*Math.max(1,Math.abs(g),Math.abs(D))&&Math.abs(y-$)<=wt*Math.max(1,Math.abs(y),Math.abs($))}var c4=jC,h4=qC;const d4=Object.freeze(Object.defineProperty({__proto__:null,add:o4,adjoint:NF,clone:CF,copy:AF,create:MF,determinant:OF,equals:l4,exactEquals:f4,frob:a4,fromQuat:qF,fromQuat2:WF,fromRotation:jF,fromRotationTranslation:UC,fromRotationTranslationScale:VF,fromRotationTranslationScaleOrigin:HF,fromScaling:$F,fromTranslation:zF,fromValues:TF,fromXRotation:UF,fromYRotation:XF,fromZRotation:YF,frustum:ZF,getRotation:WC,getScaling:YC,getTranslation:XC,identity:$C,invert:LF,lookAt:r4,mul:c4,multiply:jC,multiplyScalar:s4,multiplyScalarAndAdd:u4,ortho:e4,orthoNO:HC,orthoZO:t4,perspective:KF,perspectiveFromFieldOfView:JF,perspectiveNO:VC,perspectiveZO:QF,rotate:RF,rotateX:BF,rotateY:FF,rotateZ:GF,scale:PF,set:IF,str:i4,sub:h4,subtract:qC,targetTo:n4,translate:DF,transpose:kF},Symbol.toStringTag,{value:"Module"}));function wm(){var r=new Qt(3);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function v4(r){var e=new Qt(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function ZC(r){var e=r[0],t=r[1],n=r[2];return Math.hypot(e,t,n)}function S0(r,e,t){var n=new Qt(3);return n[0]=r,n[1]=e,n[2]=t,n}function p4(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function g4(r,e,t,n){return r[0]=e,r[1]=t,r[2]=n,r}function y4(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r}function KC(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r}function QC(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r}function JC(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r}function m4(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r}function b4(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r}function x4(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 w4(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 E4(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r}function _4(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r}function S4(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 eA(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 tA(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 rA(r){var e=r[0],t=r[1],n=r[2];return e*e+t*t+n*n}function M4(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r}function C4(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r}function nA(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 Em(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function Hh(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 A4(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 T4(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 I4(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 k4(r,e){e=e||1;var t=Li()*2*Math.PI,n=Li()*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 L4(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 bv(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 N4(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 O4(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 D4(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 P4(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 R4(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&&Em(r,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function B4(r){return r[0]=0,r[1]=0,r[2]=0,r}function F4(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function G4(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]}function z4(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)<=wt*Math.max(1,Math.abs(t),Math.abs(a))&&Math.abs(n-o)<=wt*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=wt*Math.max(1,Math.abs(i),Math.abs(s))}var $4=KC,j4=QC,U4=JC,X4=eA,Y4=tA,iA=ZC,W4=rA,V4=function(){var r=wm();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 H4=Object.freeze(Object.defineProperty({__proto__:null,add:y4,angle:R4,bezier:I4,ceil:m4,clone:v4,copy:p4,create:wm,cross:Hh,dist:X4,distance:eA,div:U4,divide:JC,dot:Em,equals:z4,exactEquals:G4,floor:b4,forEach:V4,fromValues:S0,hermite:T4,inverse:C4,len:iA,length:ZC,lerp:A4,max:w4,min:x4,mul:j4,multiply:QC,negate:M4,normalize:nA,random:k4,rotateX:O4,rotateY:D4,rotateZ:P4,round:E4,scale:_4,scaleAndAdd:S4,set:g4,sqrDist:Y4,sqrLen:W4,squaredDistance:tA,squaredLength:rA,str:F4,sub:$4,subtract:KC,transformMat3:bv,transformMat4:L4,transformQuat:N4,zero:B4},Symbol.toStringTag,{value:"Module"}));function aA(){var r=new Qt(4);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function oA(r){var e=new Qt(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function sA(r,e,t,n){var i=new Qt(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}function uA(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function fA(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function lA(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 cA(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 hA(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 dA(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 q4(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 Z4(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 K4(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 Q4(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 vA(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 eG(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 pA(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 gA(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 _m(r){var e=r[0],t=r[1],n=r[2],i=r[3];return Math.hypot(e,t,n,i)}function Sm(r){var e=r[0],t=r[1],n=r[2],i=r[3];return e*e+t*t+n*n+i*i}function tG(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r}function rG(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 yA(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 mA(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}function nG(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 bA(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 iG(r,e){e=e||1;var t,n,i,a,o,s;do t=Li()*2-1,n=Li()*2-1,o=t*t+n*n;while(o>=1);do i=Li()*2-1,a=Li()*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 aG(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 oG(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 sG(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function uG(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function xA(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}function wA(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)<=wt*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(n-s)<=wt*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=wt*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=wt*Math.max(1,Math.abs(a),Math.abs(f))}var fG=cA,lG=hA,cG=dA,hG=pA,dG=gA,vG=_m,pG=Sm,gG=function(){var r=aA();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 yG=Object.freeze(Object.defineProperty({__proto__:null,add:lA,ceil:q4,clone:oA,copy:uA,create:aA,cross:nG,dist:hG,distance:pA,div:cG,divide:dA,dot:mA,equals:wA,exactEquals:xA,floor:Z4,forEach:gG,fromValues:sA,inverse:rG,len:vG,length:_m,lerp:bA,max:Q4,min:K4,mul:lG,multiply:hA,negate:tG,normalize:yA,random:iG,round:J4,scale:vA,scaleAndAdd:eG,set:fA,sqrDist:dG,sqrLen:pG,squaredDistance:gA,squaredLength:Sm,str:uG,sub:fG,subtract:cA,transformMat4:aG,transformQuat:oG,zero:sG},Symbol.toStringTag,{value:"Module"}));function Ed(){var r=new Qt(4);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function mG(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function EA(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 bG(r,e){var t=Math.acos(e[3])*2,n=Math.sin(t/2);return n>wt?(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 xG(r,e){var t=Cm(r,e);return Math.acos(2*t*t-1)}function _A(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 SA(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 MA(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 CA(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 wG(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 AA(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 TA(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 EG(r,e,t){return TA(r,e),kA(r,r,t),AA(r,r),r}function qh(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>wt?(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 _G(r){var e=Li(),t=Li(),n=Li(),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 SG(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 MG(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r}function IA(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 CG(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 AG(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var TG=oA,IG=sA,Mm=uA,kG=fA,LG=lA,NG=_A,kA=vA,Cm=mA,OG=bA,Am=_m,DG=Am,Tm=Sm,PG=Tm,Im=yA,RG=xA,BG=wA,FG=function(){var r=wm(),e=S0(1,0,0),t=S0(0,1,0);return function(n,i,a){var o=Em(i,a);return o<-.999999?(Hh(r,e,i),iA(r)<1e-6&&Hh(r,t,i),nA(r,r),EA(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Hh(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,Im(n,n))}}(),GG=function(){var r=Ed(),e=Ed();return function(t,n,i,a,o,s){return qh(r,n,o,s),qh(e,i,a,s),qh(t,r,e,2*s*(1-s)),t}}(),zG=function(){var r=FC();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],Im(e,IA(e,r))}}();const $G=Object.freeze(Object.defineProperty({__proto__:null,add:LG,calculateW:wG,clone:TG,conjugate:MG,copy:Mm,create:Ed,dot:Cm,equals:BG,exactEquals:RG,exp:AA,fromEuler:CG,fromMat3:IA,fromValues:IG,getAngle:xG,getAxisAngle:bG,identity:mG,invert:SG,len:DG,length:Am,lerp:OG,ln:TA,mul:NG,multiply:_A,normalize:Im,pow:EG,random:_G,rotateX:SA,rotateY:MA,rotateZ:CA,rotationTo:FG,scale:kA,set:kG,setAxes:zG,setAxisAngle:EA,slerp:qh,sqlerp:GG,sqrLen:PG,squaredLength:Tm,str:AG},Symbol.toStringTag,{value:"Module"}));function jG(){var r=new Qt(8);return Qt!=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 UG(r){var e=new Qt(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 XG(r,e,t,n,i,a,o,s){var u=new Qt(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 YG(r,e,t,n,i,a,o){var s=new Qt(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 LA(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 WG(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 VG(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 HG(r,e){var t=Ed();WC(t,e);var n=new Qt(3);return XC(n,e),LA(r,t,n),r}function NA(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 qG(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 ZG(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 KG=Mm;function QG(r,e){return r[0]=e[4],r[1]=e[5],r[2]=e[6],r[3]=e[7],r}var JG=Mm;function e6(r,e){return r[4]=e[0],r[5]=e[1],r[6]=e[2],r[7]=e[3],r}function t6(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 r6(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 n6(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 SA(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 i6(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 MA(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 a6(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 CA(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 o6(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 s6(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 u6(r,e,t,n){if(Math.abs(n)<wt)return NA(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 f6(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 OA(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 l6=OA;function c6(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 DA=Cm;function h6(r,e,t,n){var i=1-n;return DA(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 d6(r,e){var t=xv(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 v6(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 PA=Am,p6=PA,xv=Tm,g6=xv;function y6(r,e){var t=xv(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 m6(r){return"quat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+")"}function b6(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 x6(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)<=wt*Math.max(1,Math.abs(t),Math.abs(l))&&Math.abs(n-c)<=wt*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-h)<=wt*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-d)<=wt*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-v)<=wt*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=wt*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(u-g)<=wt*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(f-y)<=wt*Math.max(1,Math.abs(f),Math.abs(y))}const w6=Object.freeze(Object.defineProperty({__proto__:null,add:f6,clone:UG,conjugate:v6,copy:NA,create:jG,dot:DA,equals:x6,exactEquals:b6,fromMat4:HG,fromRotation:VG,fromRotationTranslation:LA,fromRotationTranslationValues:YG,fromTranslation:WG,fromValues:XG,getDual:QG,getReal:KG,getTranslation:t6,identity:qG,invert:d6,len:p6,length:PA,lerp:h6,mul:l6,multiply:OA,normalize:y6,rotateAroundAxis:u6,rotateByQuatAppend:o6,rotateByQuatPrepend:s6,rotateX:n6,rotateY:i6,rotateZ:a6,scale:c6,set:ZG,setDual:e6,setReal:JG,sqrLen:g6,squaredLength:xv,str:m6,translate:r6},Symbol.toStringTag,{value:"Module"}));function RA(){var r=new Qt(2);return Qt!=Float32Array&&(r[0]=0,r[1]=0),r}function E6(r){var e=new Qt(2);return e[0]=r[0],e[1]=r[1],e}function _6(r,e){var t=new Qt(2);return t[0]=r,t[1]=e,t}function S6(r,e){return r[0]=e[0],r[1]=e[1],r}function M6(r,e,t){return r[0]=e,r[1]=t,r}function vn(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}function BA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}function FA(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r}function GA(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r}function C6(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r}function A6(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r}function fo(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}function lo(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}function T6(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 I6(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r}function _d(r,e){var t=e[0]-r[0],n=e[1]-r[1];return Math.hypot(t,n)}function zA(r,e){var t=e[0]-r[0],n=e[1]-r[1];return t*t+n*n}function $A(r){var e=r[0],t=r[1];return Math.hypot(e,t)}function jA(r){var e=r[0],t=r[1];return e*e+t*t}function k6(r,e){return r[0]=-e[0],r[1]=-e[1],r}function L6(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 km(r,e){return r[0]*e[0]+r[1]*e[1]}function N6(r,e,t){var n=e[0]*t[1]-e[1]*t[0];return r[0]=r[1]=0,r[2]=n,r}function O6(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 D6(r,e){e=e||1;var t=Li()*2*Math.PI;return r[0]=Math.cos(t)*e,r[1]=Math.sin(t)*e,r}function P6(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 R6(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 B6(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 F6(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 G6(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 UA(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 z6(r){return r[0]=0,r[1]=0,r}function $6(r){return"vec2("+r[0]+", "+r[1]+")"}function Lm(r,e){return r[0]===e[0]&&r[1]===e[1]}function j6(r,e){var t=r[0],n=r[1],i=e[0],a=e[1];return Math.abs(t-i)<=wt*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(n-a)<=wt*Math.max(1,Math.abs(n),Math.abs(a))}var U6=$A,Zh=BA,X6=FA,Y6=GA,W6=_d,V6=zA,H6=jA,q6=function(){var r=RA();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 Z6=Object.freeze(Object.defineProperty({__proto__:null,add:vn,angle:UA,ceil:C6,clone:E6,copy:S6,create:RA,cross:N6,dist:W6,distance:_d,div:Y6,divide:GA,dot:km,equals:j6,exactEquals:Lm,floor:A6,forEach:q6,fromValues:_6,inverse:L6,len:U6,length:$A,lerp:O6,max:lo,min:fo,mul:X6,multiply:FA,negate:k6,normalize:_o,random:D6,rotate:G6,round:T6,scale:An,scaleAndAdd:I6,set:M6,sqrDist:V6,sqrLen:H6,squaredDistance:zA,squaredLength:jA,str:$6,sub:Zh,subtract:BA,transformMat2:P6,transformMat2d:R6,transformMat3:B6,transformMat4:F6,zero:z6},Symbol.toStringTag,{value:"Module"})),K6=Object.freeze(Object.defineProperty({__proto__:null,glMatrix:iB,mat2:IB,mat2d:JB,mat3:zC,mat4:d4,quat:$G,quat2:w6,vec2:Z6,vec3:H4,vec4:yG},Symbol.toStringTag,{value:"Module"}));function Q6(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return mm(n,t),ga(r,n,e)}function J6(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return bm(n,t),ga(r,n,e)}function ez(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return xm(n,t),ga(r,n,e)}function tz(r,e,t){return ga(r,t,e)}function yi(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":Q6(t,t,[a[1],a[2]]);break;case"s":ez(t,t,[a[1],a[2]]);break;case"r":J6(t,t,a[1]);break;case"m":tz(t,t,a[1]);break}}return t}var Ss=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},rz=function(e,t){return e===t},Sw=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}(),XA=function(){function r(e){e===void 0&&(e=rz),this.head=null,this.tail=null,this.compare=e}return r.prototype.prepend=function(e){var t=new Sw(e,this.head);return this.head=t,this.tail||(this.tail=t),this},r.prototype.append=function(e){var t=new Sw(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}(),nz=function(){function r(){this.linkedList=new XA}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)},iz=function(e,t){return t.filter(function(n){return n.source===e})},Kh=function(e,t){return t.filter(function(n){return n.source===e||n.target===e})},YA=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 az(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 WA=function(e,t,n,i){i===void 0&&(i=!0);var a=az(n),o=new nz,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()},oz=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(b){var x=p[b];if(!s[x]){var w=n.filter(function(E){return E.id===x});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},VA=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(_){return n.map(function(M){return M.id}).indexOf(_)>-1}),b=function(M){var C=m[M];if(!u[C]&&u[C]!==0){var S=n.filter(function(A){return A.id===C});S.length>0&&g(S[0]),f[y.id]=Math.min(f[y.id],f[C])}else s[C]&&(f[y.id]=Math.min(f[y.id],u[C]))},x=0;x<m.length;x++)b(x);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 Nm(r,e){return e?VA(r):oz(r)}var ja=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},HA=function(e,t){var n=ja(e);return n[t]?ja(e)[t].inDegree:0},qA=function(e,t){var n=ja(e);return n[t]?ja(e)[t].outDegree:0};function sz(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 ZA(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})&&ZA(r,s,e,n,i)}),n.leave({current:e,previous:t})}function Om(r,e,t,n){n===void 0&&(n=!0),ZA(r,e,"",sz(t),n)}var Dm=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];Om(e,l,f)}return t},Pm=function(e,t,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=Nm(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),b=function(E){var _,M=m[E],C=e.nodes.find(function(F){return F.id===M});if(M===y)o.push((_={},_[M]=g,_));else if(!(M in p))v[M]=g,d.push(C),p[M]=new Set([g]);else if(!p[y].has(C)){for(var S=!0,A=[C,g],T=v[y];p[M].size&&!p[M].has(T)&&(A.push(T),T!==v[T.id]);)T=v[T.id];if(A.push(T),t&&n?(S=!1,A.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(S=!0)):t&&!n&&A.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(S=!1),S){for(var k={},O=1;O<A.length;O+=1)k[A[O-1].id]=A[O];A.length&&(k[A[A.length-1].id]=A[0]),o.push(k)}p[M].add(g)}},x=0;x<m.length;x+=1)b(x)}return o},Rm=function(e,t,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],u={},f={},l=function(T){for(var k=[T];k.length>0;){var O=k.pop();a.has(O)&&(a.delete(O),o[O.id].forEach(function(F){k.push(F)}),o[O.id].clear())}},c=function A(T,k,O){var F=!1;if(t&&n===!1&&t.indexOf(T.id)>-1)return F;i.push(T),a.add(T);for(var D=O[T.id],$=0;$<D.length;$+=1){var Y=u[D[$]];if(Y===k){for(var N={},P=1;P<i.length;P+=1)N[i[P-1].id]=i[P];i.length&&(N[i[i.length-1].id]=i[0]),s.push(N),F=!0}else a.has(Y)||A(Y,k,O)&&(F=!0)}if(F)l(T);else for(var $=0;$<D.length;$+=1){var Y=u[D[$]];o[Y.id].has(T)||o[Y.id].add(T)}return i.pop(),F},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 k=t[T];f[d[T].id]=f[k],f[k]=0,u[0]=d.find(function(O){return O.id===k}),u[f[d[T].id]]=d[T]},v=0;v<t.length;v++)y(v);for(var m=function(T){for(var k,O,F=1/0,D=0;D<T.length;D+=1)for(var $=T[D],Y=0;Y<$.length;Y++){var N=f[$[Y].id];N<F&&(F=N,O=D)}for(var P=T[O],W=[],D=0;D<P.length;D+=1){var J=P[D];W[J.id]=[];for(var te=0,H=Kn(J.id,e.edges,"target").filter(function(Ne){return P.map(function(Ze){return Ze.id}).indexOf(Ne)>-1});te<H.length;te++){var pe=H[te];pe===J.id&&!(n===!1&&t.indexOf(J.id)>-1)?s.push((k={},k[J.id]=J,k)):W[J.id].push(f[pe])}}return{component:P,adjList:W,minIdx:F}},b=0;b<d.length;){var x=d.filter(function(A){return f[A.id]>=b}),w=VA({nodes:x,edges:e.edges}).filter(function(A){return A.length>1});if(w.length===0)break;var E=m(w),_=E.minIdx,M=E.adjList,C=E.component;if(C.length>1){C.forEach(function(A){o[A.id]=new Set});var S=u[_];if(t&&n&&t.indexOf(S.id)===-1)return s;c(S,S,M),b=_+1}else break}return s},KA=function(e,t,n,i){return i===void 0&&(i=!0),t?Rm(e,n,i):Pm(e,n,i)},uz=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},ml=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,b){var x=m.id;l[x]=1/0,x===t&&(l[x]=0)});for(var h=o.length,d=function(b){var x=uz(l,o,f),w=x.id;if(f[w]=!0,l[w]===1/0)return"continue";var E=[];n?E=iz(w,u):E=Kh(w,u),E.forEach(function(_){var M=_.target,C=_.source,S=M===w?C:M,A=i&&_[i]?_[i]:1;l[S]>l[x.id]+A?(l[S]=l[x.id]+A,c[S]=[x.id]):l[S]===l[x.id]+A&&c[S].push(x.id)})},v=0;v<h;v++)d();c[t]=[t];var p={};for(var g in l)l[g]!==1/0&&QA(t,g,c,p);var y={};for(var g in p)y[g]=p[g][0];return{length:l,path:y,allPath:p}};function QA(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=QA(r,s,t,n);if(!u)return;for(var f=0,l=u;f<l.length;f++){var c=l[f];pt(c)?i.push(Jn(Jn([],c,!0),[e],!1)):i.push([c,e])}}return n[e]=i,n[e]}var JA=function(e,t,n,i,a){var o=ml(e,t,i,a),s=o.length,u=o.path,f=o.allPath;return{length:s[n],path:u[n],allPath:f[n]}},eT=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},bl=function(e,t){for(var n=Ss(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},tT=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(b,x){var w=YA();b.clusterId=w,f[w]={id:w,nodes:[b]},l[b.id]={node:b,idx:x}});var c=Ss(e,t),h={};c.forEach(function(b,x){var w=o[x].id;h[w]={},b.forEach(function(E,_){if(E){var M=o[_].id;h[w][M]=E}})});for(var d=0,v=function(){var x=!1;if(o.forEach(function(w){var E={};Object.keys(h[w.id]).forEach(function(O){var F=h[w.id][O],D=l[O].node,$=D.clusterId;E[$]||(E[$]=0),E[$]+=F});var _=-1/0,M=[];if(Object.keys(E).forEach(function(O){_<E[O]?(_=E[O],M=[O]):_===E[O]&&M.push(O)}),!(M.length===1&&M[0]===w.clusterId)){var C=M.indexOf(w.clusterId);if(C>=0&&M.splice(C,1),M&&M.length){x=!0;var S=f[w.clusterId],A=S.nodes.indexOf(w);S.nodes.splice(A,1);var T=Math.floor(Math.random()*M.length),k=f[M[T]];k.nodes.push(w),w.clusterId=k.id}}}),!x)return"break";d++};d<i;){var p=v();if(p==="break")break}Object.keys(f).forEach(function(b){var x=f[b];(!x.nodes||!x.nodes.length)&&delete f[b]});var g=[],y={};u.forEach(function(b){var x=b.source,w=b.target,E=b[n]||1,_=l[x].node.clusterId,M=l[w].node.clusterId,C="".concat(_,"---").concat(M);if(y[C])y[C].weight+=E,y[C].count++;else{var S={source:_,target:M,weight:E,count:1};y[C]=S,g.push(S)}});var m=[];return Object.keys(f).forEach(function(b){m.push(f[b])}),{clusters:m,clusterEdges:g}},di=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=Vt(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}(),Bm=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},Ii;(function(r){r.EuclideanDistance="euclideanDistance"})(Ii||(Ii={}));var fz=function(e,t,n){var i=[];t!=null&&t.length?i=t:(e.forEach(function(o){i=i.concat(Object.keys(o))}),i=gl(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]=gl(s))}),a},Fm=function(e,t,n){var i=fz(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},Mw=function(e,t,n,i){n===void 0&&(n=Ii.EuclideanDistance);var a=0;switch(n){case Ii.EuclideanDistance:a=new di(e).euclideanDistance(new di(t));break}return a},Cw=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},hg=function(e,t){e===void 0&&(e=[]);for(var n=e.length,i=new di([]),a=0;a<n;a++)i=i.add(new di(t[a]));var o=i.avg(n);o.normalize();for(var s=0,a=0;a<n;a++){var u=new di(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 di(t[a]);e[a].clusterInertial=0;for(var c=0;c<n;c++){if(a===c){l[a][c]=0;continue}var h=new di(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))},Gm=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(N,P){N.properties=N.properties||{},N.originIndex=P});var p=[];c.every(function(N){return N.hasOwnProperty("nodeType")})&&(p=Array.from(new Set(c.map(function(N){return N.nodeType}))),c.forEach(function(N){N.properties.nodeType=p.findIndex(function(P){return P===N.nodeType})}));var g=Bm(c,o);v=Fm(g,s,u)}var y=1,m={},b={};c.forEach(function(N,P){var W=String(y++);N.clusterId=W,m[W]={id:W,nodes:[N]},b[N.id]={node:N,idx:P}});var x=Ss(e,t),w=[],E={},_=0;x.forEach(function(N,P){var W=0,J=c[P].id;E[J]={},N.forEach(function(te,H){if(te){W+=te;var pe=c[H].id;E[J][pe]=te,_+=te}}),w.push(W)}),_/=2;for(var M=1/0,C=1/0,S=0,A=[],T={};;){a&&c.every(function(N){return N.hasOwnProperty("properties")})?M=Cw(c,x,w,_)+hg(c,v)*f:M=Cw(c,x,w,_),S===0&&(C=M,A=c,T=m);var k=M>0&&M>C&&M-C<i;if(M>C&&(A=c.map(function(N){return{node:N,clusterId:N.clusterId}}),T=Vt(m),C=M),k||S>100)break;S++,Object.keys(m).forEach(function(N){var P=0;d.forEach(function(W){var J=W.source,te=W.target,H=b[J].node.clusterId,pe=b[te].node.clusterId;(H===N&&pe!==N||pe===N&&H!==N)&&(P=P+(W[n]||1))}),m[N].sumTot=P}),c.forEach(function(N,P){var W=m[N.clusterId],J=0,te,H=w[P]/(2*_),pe=0,Te=W.nodes;Te.forEach(function(Yt){var dr=b[Yt.id].idx;pe+=x[P][dr]||0});var Ne=pe-W.sumTot*H,Ze=Te.filter(function(Yt){return Yt.id!==N.id});Ze.forEach(function(Yt,dr){v[Yt.originIndex]});var at=hg(Ze,v)*f,nt=E[N.id];if(Object.keys(nt).forEach(function(Yt){var dr=b[Yt].node,lr=dr.clusterId;if(lr!==N.clusterId){var jt=m[lr],ir=jt.nodes;if(!(!ir||!ir.length)){var Hr=0;ir.forEach(function(Ge){var ye=b[Ge.id].idx;Hr+=x[P][ye]||0});var tt=Hr-jt.sumTot*H,ae=ir.concat([N]);ae.forEach(function(Ge,ye){v[Ge.originIndex]});var L=hg(ae,v)*f,Se=tt-Ne;a&&(Se=tt+L-(Ne+at)),Se>J&&(J=Se,te=jt)}}}),J>0){te.nodes.push(N);var _t=N.clusterId;N.clusterId=te.id;var St=W.nodes.indexOf(N);W.nodes.splice(St,1);var fr=0,Ft=0;d.forEach(function(Yt){var dr=Yt.source,lr=Yt.target,jt=b[dr].node.clusterId,ir=b[lr].node.clusterId;(jt===te.id&&ir!==te.id||ir===te.id&&jt!==te.id)&&(fr=fr+(Yt[n]||1)),(jt===_t&&ir!==_t||ir===_t&&jt!==_t)&&(Ft=Ft+(Yt[n]||1))}),te.sumTot=fr,W.sumTot=Ft}})}var O={},F=0;Object.keys(T).forEach(function(N){var P=T[N];if(!P.nodes||!P.nodes.length){delete T[N];return}var W=String(F+1);W!==N&&(P.id=W,P.nodes=P.nodes.map(function(J){return{id:J.id,clusterId:W}}),T[W]=P,O[N]=W,delete T[N],F++)}),A.forEach(function(N){var P=N.node,W=N.clusterId;P&&(P.clusterId=W,P.clusterId&&O[P.clusterId]&&(P.clusterId=O[P.clusterId]))});var D=[],$={};d.forEach(function(N){var P=N.source,W=N.target,J=N[n]||1,te=b[P].node.clusterId,H=b[W].node.clusterId;if(!(!te||!H)){var pe="".concat(te,"---").concat(H);if($[pe])$[pe].weight+=J,$[pe].count++;else{var Te={source:te,target:H,weight:J,count:1};$[pe]=Te,D.push(Te)}}});var Y=[];return Object.keys(T).forEach(function(N){Y.push(T[N])}),{clusters:Y,clusterEdges:D}},rT=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),Gm(e,t,n,i,!0,a,o,s,u)},nT=function(e,t){var n;t===void 0&&(t=1);for(var i=Vt(e),a=i.nodes,o=a===void 0?[]:a,s=i.edges,u=s===void 0?[]:s,f=function(){var h=ja({nodes:o,edges:u}),d=Object.keys(h);d.sort(function(g,y){var m,b;return((m=h[g])===null||m===void 0?void 0:m.degree)-((b=h[y])===null||b===void 0?void 0:b.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}},Aw=function(e,t,n){var i=[];switch(e){case Ii.EuclideanDistance:i=t[n];break;default:i=[];break}return i},iT=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=Ii.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===Ii.EuclideanDistance&&!u.every(function(W){return W.hasOwnProperty(n)}))return c;var h=[],d=[];if(o===Ii.EuclideanDistance&&(h=Bm(u,n),d=Fm(h,i,a)),!d.length)return c;for(var v=gl(d.map(function(W){return W.join("")})),p=Math.min(t,u.length,v.length),g=0;g<u.length;g++)u[g].originIndex=g;for(var y=[],m=[],b=[],g=0;g<p;g++)if(g===0){var x=Math.floor(Math.random()*u.length);switch(o){case Ii.EuclideanDistance:y[g]=d[x];break;default:y[g]=[];break}m.push(x),b[g]=[u[x]],u[x].clusterId=String(g)}else{for(var w=-1/0,E=0,_=function(te){if(!m.includes(te)){for(var H=0,pe=0;pe<y.length;pe++){var Te=0;switch(o){case Ii.EuclideanDistance:Te=Mw(d[u[te].originIndex],y[pe],o);break}H+=Te}var Ne=H/y.length;Ne>w&&!y.find(function(Ze){return Mo(Ze,Aw(o,d,u[te].originIndex))})&&(w=Ne,E=te)}},M=0;M<u.length;M++)_(M);y[g]=Aw(o,d,E),m.push(E),b[g]=[u[E]],u[E].clusterId=String(g)}for(var C=0;;){for(var g=0;g<u.length;g++){var S=0,A=1/0;if(!(C===0&&m.includes(g))){for(var T=0;T<y.length;T++){var k=0;switch(o){case Ii.EuclideanDistance:k=Mw(d[g],y[T],o);break}k<A&&(A=k,S=T)}if(u[g].clusterId!==void 0)for(var O=b[Number(u[g].clusterId)].length-1;O>=0;O--)b[Number(u[g].clusterId)][O].id===u[g].id&&b[Number(u[g].clusterId)].splice(O,1);u[g].clusterId=String(S),b[S].push(u[g])}}for(var F=!1,g=0;g<b.length;g++){for(var D=b[g],$=new di([]),T=0;T<D.length;T++)$=$.add(new di(d[D[T].originIndex]));var Y=$.avg(D.length);Y.equal(new di(y[g]))||(F=!0,y[g]=Y.getArr())}if(C++,u.every(function(W){return W.clusterId!==void 0})&&F||C>=1e3)break}var N=[],P={};return l.forEach(function(W){var J,te,H=W.source,pe=W.target,Te=(J=u.find(function(nt){return nt.id===H}))===null||J===void 0?void 0:J.clusterId,Ne=(te=u.find(function(nt){return nt.id===pe}))===null||te===void 0?void 0:te.clusterId,Ze="".concat(Te,"---").concat(Ne);if(P[Ze])P[Ze].count++;else{var at={source:Te,target:Ne,count:1};P[Ze]=at,N.push(at)}}),{clusters:b,clusterEdges:N}},zm=function(e,t){var n=new di(t),i=n.norm2(),a=new di(e),o=a.norm2(),s=n.dot(a),u=i*o,f=u?s/u:0;return f},aT=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=Vt(e.filter(function(h){return h.id!==t.id})),s=e.findIndex(function(h){return h.id===t.id}),u=Bm(e,n),f=Fm(u,i,a),l=f[s],c=[];return o.forEach(function(h,d){if(h.id!==t.id){var v=f[d],p=zm(v,l);c.push(p),h.cosineSimilarity=p}}),o.sort(function(h,d){return d.cosineSimilarity-h.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},lz=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}(),cz=function(e,t){return e-t},hz=function(){function r(e){e===void 0&&(e=cz),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}(),dz=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 hz(l);for(Kh(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),Kh(d,s).forEach(function(p){c.insert(p)})),f.has(v)||(f.add(v),Kh(v,s).forEach(function(p){c.insert(p)})))}return n},Tw=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 lz(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},oT=function(e,t,n){var i={prim:dz,kruskal:Tw};return n?i[n](e,t):Tw(e,t)},sT=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=ja(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 b=Kn(y,l,"source"),x=0;x<b.length;++x){var w=b[x],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},vz=-1,Sd=-1,uT="-1",ta="-1",fT=-1,Iw=function(){function r(e,t,n,i){e===void 0&&(e=vz),t===void 0&&(t=Sd),n===void 0&&(n=Sd),i===void 0&&(i=uT),this.id=e,this.from=t,this.to=n,this.label=i}return r}(),pz=function(){function r(e,t){e===void 0&&(e=Sd),t===void 0&&(t=ta),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}(),lT=function(){function r(e,t,n){e===void 0&&(e=Sd),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 pz(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 Iw(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 Iw(e,n,t,i);this.nodeMap[n].addEdge(o),this.edgeLabelMap[i].push(o)}}},r}(),os=function(){function r(e,t,n,i,a){this.fromNode=e,this.toNode=t,this.nodeEdgeNodeLabel={nodeLabel1:n||ta,edgeLabel:i||uT,nodeLabel2:a||ta}}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}(),kw=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 os(e,t,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(e,t){e===void 0&&(e=fT),t===void 0&&(t=!1);var n=new lT(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!==ta&&n.addNode(a,u),l!==ta&&n.addNode(o,l),u!==ta&&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}(),Zc=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}(),gz=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 kw,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(fT,n),a=i.nodeMap,o=new kw,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 os(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,b=n?-1:0,x=function($){if(y)return"break";h.forEach(function(Y){var N=new Zc(Y),P=e.findBackwardEdge(i,N.edges[d[$]],N.edges[d[0]],N);P&&(g[P.label]||(g[P.label]={projected:[],edgeLabel:P.label}),g[P.label].projected.push({graphId:i.id,edge:g,preNode:Y}),m=o.dfsEdgeList[d[$]].fromNode,y=!0)})},w=d.length-1;w>b;w--){var E=x(w);if(E==="break")break}if(y){var _=e.findMinLabel(g);o.dfsEdgeList.push(new os(p,m,ta,_.edgeLabel,ta));var M=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[M]!==o.dfsEdgeList[M]?!1:c(g[_.edgeLabel].projected)}var C={};y=!1;var S=0;h.forEach(function(D){var $=new Zc(D),Y=e.findForwardPureEdges(i,$.edges[d[0]],v,$);Y.length>0&&(y=!0,S=p,Y.forEach(function(N){var P="".concat(N.label,"-").concat(a[N.to].label);C[P]||(C[P]={projected:[],edgeLabel:N.label,nodeLabel2:a[N.to].label}),C[P].projected.push({graphId:i.id,edge:N,preNode:D})}))});for(var A=d.length,T=function($){if(y)return"break";var Y=d[$];h.forEach(function(N){var P=new Zc(N),W=e.findForwardRmpathEdges(i,P.edges[Y],v,P);W.length>0&&(y=!0,S=o.dfsEdgeList[Y].fromNode,W.forEach(function(J){var te="".concat(J.label,"-").concat(a[J.to].label);C[te]||(C[te]={projected:[],edgeLabel:J.label,nodeLabel2:a[J.to].label}),C[te].projected.push({graphId:i.id,edge:J,preNode:N})}))})},w=0;w<A;w++){var k=T(w);if(k==="break")break}if(!y)return!0;var O=e.findMinLabel(C);o.dfsEdgeList.push(new os(S,p+1,ta,O.edgeLabel,O.nodeLabel2));var F=o.dfsEdgeList.length-1;return t.dfsEdgeList[F]!==o.dfsEdgeList[F]?!1:c(C["".concat(O.edgeLabel,"-").concat(O.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(Vt(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 Zc(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(b){var x="".concat(o,"-").concat(b.label,"-").concat(h[b.to].label);u[x]||(u[x]={projected:[],fromNodeId:o,edgeLabel:b.label,nodeLabel2:h[b.to].label}),u[x].projected.push({graphId:l.graphId,edge:b,preNode:l})});for(var m=function(x){var w=t.findForwardRmpathEdges(c,d.edges[a[x]],s,d);w.forEach(function(E){var _="".concat(t.dfsCode.dfsEdgeList[a[x]].fromNode,"-").concat(E.label,"-").concat(h[E.to].label);u[_]||(u[_]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[x]].fromNode,edgeLabel:E.label,nodeLabel2:h[E.to].label}),u[_].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 os(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 os(h,o+1,ta,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 b=m;m=y,y=b}var x=g.label,w="".concat(y,"-").concat(x,"-").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 os(0,1,s,u,f)),e.subGraphMining(o),e.dfsCode.dfsEdgeList.pop()})}},r}(),yz=function(e,t,n,i){var a={};return Object.keys(e).forEach(function(o,s){var u=e[o],f=new lT(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},mz=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},Lw="cluster",bz=function(e){var t=e.graphs,n=e.directed,i=n===void 0?!1:n,a=e.nodeLabelProp,o=a===void 0?Lw:a,s=e.edgeLabelProp,u=s===void 0?Lw:s,f=yz(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 gz(p);g.run();var y=mz(g.frequentSubgraphs,o,u);return y},Nw=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(cT(o,s,u,n,i))}),a},cT=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}},xz=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},Qh=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},Jh=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)},wz=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,b){return l[m]-l[b]}),h=10,d=[];c.forEach(function(m,b){d[b%h]||(d[b%h]={graphs:[],totalCount:0,aveCount:0}),d[b%h].graphs.push(m),d[b%h].totalCount+=l[m]});var v=0,p=[];d.forEach(function(m){var b=m.totalCount/m.graphs.length;m.aveCount=b,p.push(b);var x=0,w=m.length;m.graphs.forEach(function(E,_){var M=l[E];m.graphs.forEach(function(C,S){_!==S&&(x+=Math.abs(M-l[C]))})}),x/=w*(w-1)/2,v+=x}),v/=d.length;var g=0;p.forEach(function(m,b){p.forEach(function(x,w){b!==w&&(g+=Math.abs(m-x))}),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]}},Ow=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}},Dw=function(e,t,n){var i={},a={};return e.forEach(function(o,s){i["".concat(YA)]={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}},Pw=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},Ez=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=Qh(p,o,e,c),v=c[d]}return Jh(v,s,u,f)},Rw=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}},hT=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=bl(e,n),c=bl(t,n),h=Pw(e.nodes,l,n),d=Pw(t.nodes,c,n),v=Ow(e.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,y=Ow(t.nodes,o),m=y.nodeMap,b=y.nodeLabelMap;Dw(e.edges,s,p);var x=Dw(t.edges,s,m).edgeLabelMap,w=[];c==null||c.forEach(function(tt){w=w.concat(tt)}),a||(a=Math.max.apply(Math,Jn(Jn([],w,!1),[2],!1))),i||(i=a);var E=Nw(e,l,o,i),_=Nw(t,c,o,i),M=Math.min(100,f*(f-1)/2),C=xz(i,f,M,E,l),S=Qh(C,E,e),A=10,T=1,k=1,O=4,F={graphs:S,nodeLabelProp:o,edgeLabelProp:s,minSupport:T,minNodeNum:k,maxNodeNum:O,directed:n},D=bz(F).slice(0,A),$=D.length,Y=[];D.forEach(function(tt,ae){Y[ae]={},Object.keys(S).forEach(function(L){var Se=S[L],Ge=Jh(Se,tt,o,s);Y[ae][L]=Ge})});var N=wz(Y,$,D),P=N.structure,W=N.structureCountMap,J=t.nodes[0],te=[],H=(u=t.nodes[0])===null||u===void 0?void 0:u[o],pe=-1/0;t.nodes.forEach(function(tt){var ae=tt[o],L=g[ae];(L==null?void 0:L.length)>pe&&(pe=L.length,te=L,H=ae,J=tt)});var Te={},Ne={},Ze={},at={},nt={},_t={};Object.keys(b).forEach(function(tt,ae){nt[tt]=[],n&&(_t[tt]=[]);var L=b[tt],Se={};L.forEach(function(qe){var et=d["".concat(J.id,"-").concat(qe.id)];if(et&&nt[tt].push(et),Se["".concat(J.id,"-").concat(qe.id)]={start:0,end:m[qe.id].idx,distance:et},n){var gt=d["".concat(qe.id,"-").concat(J.id)];gt&&_t[tt].push(gt)}}),nt[tt]=nt[tt].sort(function(qe,et){return qe-et}),n&&(_t[tt]=_t[tt].sort(function(qe,et){return qe-et})),Ne=Qh(Se,_,t,Ne);var Ge=[];if(Object.keys(Se).forEach(function(qe){if(Ze[qe]){Ge.push(Ze[qe]);return}var et=Ne[qe];Ze[qe]=Jh(et,P,o,s),Ge.push(Ze[qe])}),Ge=Ge.sort(function(qe,et){return et-qe}),at["".concat(J.id,"-").concat(tt)]=Ge,tt!==H)for(var ye=(te==null?void 0:te.length)||0,Ye=function(et){var gt=te[et],Pt=E[p[gt.id].idx],cr=Pt.nodeLabelCountMap[tt],Rt=b[tt].length;if(!cr||cr.count<Rt)return te.splice(et,1),"continue";for(var hr=!1,ur=0;ur<Rt;ur++)if(cr.dists[ur]>nt[tt][ur]){hr=!0;break}if(hr)return te.splice(et,1),"continue";var br={};Pt.neighbors.forEach(function(ar){var $r=h["".concat(gt.id,"-").concat(ar.id)];br["".concat(gt.id,"-").concat(ar.id)]={start:p[gt.id].idx,end:p[ar.id].idx,distance:$r}}),S=Qh(br,E,e,S);var vr=[];Object.keys(br).forEach(function(ar){if(W[ar]){vr.push(W[ar]);return}var $r=S[ar];W[ar]=Jh($r,P,o,s),vr.push(W[ar])}),vr=vr.sort(function(ar,$r){return $r-ar});for(var bn=!1,ur=0;ur<Rt;ur++)if(vr[ur]<Ge[ur]){bn=!0;break}if(bn)return te.splice(et,1),"continue"},We=ye-1;We>=0;We--)Ye(We)});var St=[];te==null||te.forEach(function(tt){for(var ae=p[tt.id].idx,L=cT(e.nodes,l[ae],ae,o,a),Se=L.neighbors,Ge=Se.length,ye=!1,Ye=Ge-1;Ye>=0;Ye--){if(Se.length+1<t.nodes.length){ye=!0;return}var We=Se[Ye],qe=We[o];if(!b[qe]||!b[qe].length){Se.splice(Ye,1);continue}if(!nt[qe]||!nt[qe].length){Se.splice(Ye,1);continue}var et="".concat(tt.id,"-").concat(We.id),gt=h[et],Pt=nt[qe].length-1,cr=nt[qe][Pt];if(gt>cr){Se.splice(Ye,1);continue}if(n){var Rt="".concat(We.id,"-").concat(tt.id),hr=h[Rt];Pt=_t[qe].length-1;var ur=_t[qe][Pt];if(hr>ur){Se.splice(Ye,1);continue}}var br=W[et]?W[et]:Ez(e,tt,We,p,gt,E,P,o,s,W,S),vr="".concat(J.id,"-").concat(qe),bn=at[vr][at[vr].length-1];if(br<bn){Se.splice(Ye,1);continue}var ar=Rw(Te,qe,m,b),$r=ar.minPatternNodeLabelDegree;if(ar.minPatternNodeLabelInDegree,ar.minPatternNodeLabelOutDegree,p[We.id].degree<$r){Se.splice(Ye,1);continue}}ye||St.push({nodes:[tt].concat(Se)})});var fr=ml(t,J.id,!1).length,Ft={};n?(Object.keys(fr).forEach(function(tt){var ae=m[tt].node[o];Ft[ae]?Ft[ae].push(fr[tt]):Ft[ae]=[fr[tt]]}),Object.keys(Ft).forEach(function(tt){Ft[tt].sort(function(ae,L){return ae-L})})):Ft=nt;for(var Yt=St.length,dr=function(ae){var L=St[ae],Se=L.nodes[0],Ge={},ye={};L.nodes.forEach(function(At,pr){ye[At.id]={idx:pr,node:At,degree:0,inDegree:0,outDegree:0};var bt=At[o];Ge[bt]?Ge[bt]++:Ge[bt]=1});var Ye=[],We={};e.edges.forEach(function(At){ye[At.source]&&ye[At.target]&&(Ye.push(At),We[At[s]]?We[At[s]]++:We[At[s]]=1,ye[At.source].degree++,ye[At.target].degree++,ye[At.source].outDegree++,ye[At.target].inDegree++)});for(var qe=Object.keys(x).length,et=!1,gt=0;gt<qe;gt++){var Pt=Object.keys(x)[gt];if(!We[Pt]||We[Pt]<x[Pt].length){et=!0;break}}if(et)return St.splice(ae,1),"continue";var cr=Ye.length;if(cr<t.edges.length)return St.splice(ae,1),"break";for(var Rt=!1,hr=function(pr){var bt=Ye[pr],Ir=bt[s],xn=x[Ir];if(!xn||!xn.length)return We[Ir]--,xn&&We[Ir]<xn.length?(Rt=!0,"break"):(Ye.splice(pr,1),ye[bt.source].degree--,ye[bt.target].degree--,ye[bt.source].outDegree--,ye[bt.target].inDegree--,"continue");var Go=ye[bt.source].node[o],zo=ye[bt.target].node[o],_a=!1;if(xn.forEach(function($o){var jo=m[$o.source].node,Uo=m[$o.target].node;jo[o]===Go&&Uo[o]===zo&&(_a=!0),!n&&jo[o]===zo&&Uo[o]===Go&&(_a=!0)}),!_a)return We[Ir]--,xn&&We[Ir]<xn.length?(Rt=!0,"break"):(Ye.splice(pr,1),ye[bt.source].degree--,ye[bt.target].degree--,ye[bt.source].outDegree--,ye[bt.target].inDegree--,"continue")},gt=cr-1;gt>=0;gt--){var ur=hr(gt);if(ur==="break")break}if(Rt)return St.splice(ae,1),"continue";L.edges=Ye;var br=ml(L,L.nodes[0].id,!1).length;if(Object.keys(br).reverse().forEach(function(At){if(!(At===L.nodes[0].id||Rt)){if(br[At]===1/0){var pr=ye[At].node[o];if(Ge[pr]--,Ge[pr]<b[pr].length){Rt=!0;return}var bt=L.nodes.indexOf(ye[At].node);L.nodes.splice(bt,1),ye[At]=void 0;return}var Ir=p[At].node[o];if(!Ft[Ir]||!Ft[Ir].length||br[At]>Ft[Ir][Ft[Ir].length-1]){var pr=ye[At].node[o];if(Ge[pr]--,Ge[pr]<b[pr].length){Rt=!0;return}var bt=L.nodes.indexOf(ye[At].node);L.nodes.splice(bt,1),ye[At]=void 0}}}),Rt)return St.splice(ae,1),"continue";for(var vr=!0,bn=0;vr&&!Rt;){vr=!1;var ar=n?ye[Se.id].degree<m[J.id].degree||ye[Se.id].inDegree<m[J.id].inDegree||ye[Se.id].outDegree<m[J.id].outDegree:ye[Se.id].degree<m[J.id].degree;if(ar){Rt=!0;break}if(Ge[Se[o]]<b[Se[o]].length){Rt=!0;break}for(var $r=L.nodes.length,bi=$r-1;bi>=0;bi--){var qr=L.nodes[bi],Ka=ye[qr.id].degree,rf=ye[qr.id].inDegree,nf=ye[qr.id].outDegree,un=qr[o],Ea=Rw(Te,un,m,b),Fo=Ea.minPatternNodeLabelDegree,af=Ea.minPatternNodeLabelInDegree,of=Ea.minPatternNodeLabelOutDegree,sf=n?Ka<Fo||rf<af||nf<of:Ka<Fo;if(sf){if(Ge[qr[o]]--,Ge[qr[o]]<b[qr[o]].length){Rt=!0;break}L.nodes.splice(bi,1),ye[qr.id]=void 0,vr=!0}}if(Rt||!vr&&bn!==0)break;cr=Ye.length;for(var xi=cr-1;xi>=0;xi--){var jr=Ye[xi];if(!ye[jr.source]||!ye[jr.target]){Ye.splice(xi,1);var wi=jr[s];if(We[wi]--,ye[jr.source]&&(ye[jr.source].degree--,ye[jr.source].outDegree--),ye[jr.target]&&(ye[jr.target].degree--,ye[jr.target].inDegree--),x[wi]&&We[wi]<x[wi].length){Rt=!0;break}vr=!0}}bn++}if(Rt||Rt||L.nodes.length<t.nodes.length||Ye.length<t.edges.length)return St.splice(ae,1),"continue"},lr=Yt-1;lr>=0;lr--){var jt=dr(lr);if(jt==="break")break}for(var ir=St.length,Hr=function(ae){var L=St[ae],Se={};L.edges.forEach(function(Ye){var We="".concat(Ye.source,"-").concat(Ye.target,"-").concat(Ye.label);Se[We]?Se[We]++:Se[We]=1});for(var Ge=function(We){var qe=St[We],et={};qe.edges.forEach(function(Pt){var cr="".concat(Pt.source,"-").concat(Pt.target,"-").concat(Pt.label);et[cr]?et[cr]++:et[cr]=1});var gt=!0;Object.keys(et).length!==Object.keys(Se).length?gt=!1:Object.keys(Se).forEach(function(Pt){et[Pt]!==Se[Pt]&&(gt=!1)}),gt&&St.splice(We,1)},ye=ir-1;ye>ae;ye--)Ge(ye);ir=St.length},lr=0;lr<=ir-1;lr++)Hr(lr);return St}}},xu=function(){function r(e){e===void 0&&(e=10),this.linkedList=new XA,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}(),dT=Dm;const _z={getAdjMatrix:Ss,breadthFirstSearch:WA,connectedComponent:Nm,getDegree:ja,getInDegree:HA,getOutDegree:qA,detectCycle:Dm,detectDirectedCycle:dT,detectAllCycles:KA,detectAllDirectedCycle:Rm,detectAllUndirectedCycle:Pm,depthFirstSearch:Om,dijkstra:ml,findAllPath:eT,findShortestPath:JA,floydWarshall:bl,labelPropagation:tT,louvain:Gm,iLouvain:rT,kCore:nT,kMeans:iT,cosineSimilarity:zm,nodesCosineSimilarity:aT,minimumSpanningTree:oT,pageRank:sT,getNeighbors:Kn,Stack:xu,GADDI:hT},Sz=Object.freeze(Object.defineProperty({__proto__:null,GADDI:hT,Stack:xu,breadthFirstSearch:WA,connectedComponent:Nm,cosineSimilarity:zm,default:_z,depthFirstSearch:Om,detectAllCycles:KA,detectAllDirectedCycle:Rm,detectAllUndirectedCycle:Pm,detectCycle:Dm,detectDirectedCycle:dT,dijkstra:ml,findAllPath:eT,findShortestPath:JA,floydWarshall:bl,getAdjMatrix:Ss,getDegree:ja,getInDegree:HA,getNeighbors:Kn,getOutDegree:qA,iLouvain:rT,kCore:nT,kMeans:iT,labelPropagation:tT,louvain:Gm,minimumSpanningTree:oT,nodesCosineSimilarity:aT,pageRank:sT},Symbol.toStringTag,{value:"Module"}));var Md=yi,Mz=function(e){return function(t,n){return t[e]-n[e]}},Bw=function(e,t,n){return e>=t&&e<=n},wv=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!Bw(v,0,1)||!Bw(p,0,1)?null:{x:e.x+v*s.x,y:e.y+v*s.y}}return null},vT=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=wv(f[h-1],f[h],l,t),!c);h++);return c},pT=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)}},gT=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)}},Su=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]),bv(i,i,t),{x:i[0],y:i[1]}},yT=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=ym([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 bv(a,a,i),{x:a[0],y:a[1]}},M0=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}},Cd=function(e,t){var n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)},Cz=function(e,t){var n=[];return e.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*t)}),n.push(a)}),n},Az=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},Tz=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},mT=function(e,t){e.translate(t.x,t.y)},C0=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=Md(a,[["t",d-c,v-h]]),c=d,h=v,{matrix:a}},i)}else{var p=Md(a,[["t",s,u]]);e.setMatrix(p)}},Iz=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var i=t;pt(t)||(i=[t,t]),pt(t)&&t.length===1&&(i=[t[0],t[0]]),n=Md(n,[["s",i[0],i[1]]]),e.setMatrix(n)},kz=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=Md(n,[["r",t]]),e.setMatrix(n)},Lz=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 Nz(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 xl=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(Nz(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},bT=function(e,t){return!(t.minX>e.maxX||t.maxX<e.minX||t.minY>e.maxY||t.maxY<e.minY)},Oz=function(e,t){var n=!1;return me(e,function(i){if(wv(i.from,i.to,t.from,t.to))return n=!0,!1}),n},xT=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],b=h[v-1];d.push({from:{x:b[0],y:b[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(!bT(a,o))return!1;var s=!1;if(me(t,function(c){if(xl(e,c[0],c[1]))return s=!0,!1}),s||(me(e,function(c){if(xl(t,c[0],c[1]))return s=!0,!1}),s))return!0;var u=i(e),f=i(t),l=!1;return me(f,function(c){if(Oz(u,c))return l=!0,!1}),l},Ms=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}(),$m=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]},Dz=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},wT=function(e,t){for(var n=["top","left","bottom","right"],i=e.getBBox(),a=0,o=[],s=0;s<4;s++){var u=$m(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3];o[s]=wv({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]},jm=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=$m(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3],d=Dz(t,new Ms(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},ET=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}},Ad=function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)},_T=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},A0=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)},ST=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},Pz=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(Lm(f,[0,0]))return NaN;var l=[-f[1],f[0]];_o(l,l);var c=[s-n,u-i];return Math.abs(km(c,l))},Um=function(e,t,n){return e+(t-e)*n},T0=function(e,t,n){for(var i=Math.min(e.length,t.length),a=new Array(i),o=0;o<i;o++)a[o]=Um(e[o],t[o],n);return a};const Rz=Object.freeze(Object.defineProperty({__proto__:null,Line:Ms,applyMatrix:Su,compare:Mz,distance:Cd,floydWarshall:Az,fractionToLine:jm,getAdjMatrix:Tz,getBBoxBoundLine:$m,getCircleCenterByPoints:M0,getCircleIntersectByPoint:pT,getDegree:Lz,getEllipseIntersectByPoint:gT,getLineIntersect:wv,getPointsCenter:ET,getRectIntersectByPoint:vT,intersectBBox:bT,invertMatrix:yT,isPointInPolygon:xl,isPointsOverlap:A0,isPolygonsIntersect:xT,itemIntersectByLine:wT,lerp:Um,lerpArray:T0,move:C0,pointLineDistance:Pz,pointLineSquareDist:_T,pointRectSquareDist:ST,rotate:kz,scale:Iz,scaleMatrix:Cz,squareDist:Ad,translate:mT},Symbol.toStringTag,{value:"Module"}));var no="rgb(95, 149, 255)",Bz="rgb(255, 255, 255)",Fw="rgb(0, 0, 0)",dg="rgb(247, 250, 255)",MT="rgb(239, 244, 255)",Kc="rgb(253, 253, 253)",Gw="rgb(250, 250, 250)",Qc="rgb(224, 224, 224)",zw="rgb(234, 234, 234)",Fz="rgb(245, 245, 245)",Gz="rgb(191, 213, 255)",$w="#4572d9",zz="rgb(223, 234, 255)",rr={mainStroke:no,mainFill:MT,activeStroke:no,activeFill:dg,inactiveStroke:Gz,inactiveFill:dg,selectedStroke:no,selectedFill:Bz,highlightStroke:$w,highlightFill:zz,disableStroke:Qc,disableFill:Gw,edgeMainStroke:Qc,edgeActiveStroke:no,edgeInactiveStroke:zw,edgeSelectedStroke:no,edgeHighlightStroke:no,edgeDisableStroke:Fz,comboMainStroke:Qc,comboMainFill:Kc,comboActiveStroke:no,comboActiveFill:dg,comboInactiveStroke:Qc,comboInactiveFill:Kc,comboSelectedStroke:no,comboSelectedFill:Kc,comboHighlightStroke:$w,comboHighlightFill:Kc,comboDisableStroke:zw,comboDisableFill:Gw};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:rr.mainStroke,fill:MT},size:20,color:rr.mainStroke,linkPoints:{size:8,lineWidth:1,fill:rr.activeFill,stroke:rr.activeStroke}},nodeStateStyles:{active:{fill:rr.activeFill,stroke:rr.activeStroke,lineWidth:2,shadowColor:rr.mainStroke,shadowBlur:10},selected:{fill:rr.selectedFill,stroke:rr.selectedStroke,lineWidth:4,shadowColor:rr.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:rr.highlightFill,stroke:rr.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:rr.inactiveFill,stroke:rr.inactiveStroke,lineWidth:1},disable:{fill:rr.disableFill,stroke:rr.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:Fw,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:rr.edgeMainStroke,lineAppendWidth:2},color:rr.edgeMainStroke},edgeStateStyles:{active:{stroke:rr.edgeActiveStroke,lineWidth:1},selected:{stroke:rr.edgeSelectedStroke,lineWidth:2,shadowColor:rr.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:rr.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:rr.edgeInactiveStroke,lineWidth:1},disable:{stroke:rr.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:Fw,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:rr.comboMainFill,lineWidth:1,stroke:rr.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:rr.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:rr.comboActiveStroke,lineWidth:1,fill:rr.comboActiveFill},selected:{stroke:rr.comboSelectedStroke,lineWidth:2,fill:rr.comboSelectedFill,shadowColor:rr.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:rr.comboHighlightStroke,lineWidth:2,fill:rr.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:rr.comboInactiveStroke,fill:rr.comboInactiveFill,lineWidth:1},disable:{stroke:rr.comboDisableStroke,fill:rr.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"},$z={" ":.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 Zi=Math.PI,I0=Math.sin,k0=Math.cos,hn=I0(Zi/8),dn=k0(Zi/8),Td=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=Su(i,o),a=Su(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}},CT=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*hn,m=p*dn,b=g*hn,x=g*dn,w=a.get("type"),E=Math.min(d/2,v/2),_=Math.min(d,v),M=s!=null&&s.pointPadding?Math.min(_,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]+b,l[1]-x]):(c=[l[0]-M,l[1]-d],h=[l[0]+M,l[1]-d]);break;case"top-right":p=d,g=v,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]+y,l[1]-m],h=[l[0]+x,l[1]-b]):(c=[l[0]+v-M,l[1]-d],h=[l[0]+v,l[1]-d+M]);break;case"right":p=v,g=v,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]+m,l[1]-y],h=[l[0]+x,l[1]+b]):(c=[l[0]+v,l[1]-M],h=[l[0]+v,l[1]+M]);break;case"bottom-right":p=v,g=d,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]+m,l[1]+y],h=[l[0]+b,l[1]+x]):(c=[l[0]+v,l[1]+d-M],h=[l[0]+v-M,l[1]+d]);break;case"bottom":p=d,g=d,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]+y,l[1]+m],h=[l[0]-b,l[1]+x]):(c=[l[0]-M,l[1]+d],h=[l[0]+M,l[1]+d]);break;case"bottom-left":p=d,g=v,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]-y,l[1]+m],h=[l[0]-x,l[1]+b]):(c=[l[0]-v,l[1]+d-M],h=[l[0]-v+M,l[1]+d]);break;case"left":p=v,g=v,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]-m,l[1]+y],h=[l[0]-x,l[1]-b]):(c=[l[0]-v,l[1]-M],h=[l[0]-v,l[1]+M]);break;case"top-left":p=v,g=d,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]-m,l[1]-y],h=[l[0]-b,l[1]-x]):(c=[l[0]-v+M,l[1]-d],h=[l[0]-v,l[1]-d+M]);break;default:p=v,g=v,y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]-y,l[1]-m],h=[l[0]+b,l[1]-x]}if(s.clockwise===!1){var C=[c[0],c[1]];c=[h[0],h[1]],h=[C[0],C[1]]}}var S=[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 k=An([0,0],S,A),O=[l[0]+k[0],l[1]+k[1]],F=[h[0]-l[0],h[1]-l[1]],D=An([0,0],F,T),$=[l[0]+D[0],l[1]+D[1]];return e.startPoint={x:c[0],y:c[1]},e.endPoint={x:h[0],y:h[1]},e.controlPoints=[{x:O[0],y:O[1]},{x:$[0],y:$[1]}],e},AT=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+=Zi*2),n&&(u.x+=k0(l)*n,u.y+=I0(l)*n),i){var c=l-Zi/2;l>1/2*Zi&&l<3*1/2*Zi&&(c-=Zi),u.x+=k0(c)*i,u.y+=I0(c)*i}var h={x:u.x,y:u.y,angle:l};return a?(l>.5*Zi&&l<1.5*Zi&&(l-=Zi),B({rotate:l},h)):h},jz=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},Uz=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"&&jz(e,null,-1,t)},Ki=function(e,t){typeof t=="function"&&Uz(e,null,-1,t)},TT=function(e,t){return t*($z[e]||1)},IT=function(e,t){var n=0,i=new RegExp("[一-龥]+");return e.split("").forEach(function(a){i.test(a)?n+=t:n+=TT(a,t)}),[n,t]},kT=function(e,t){return typeof t!="number"||t<=0||t>=e.length?e:e.substring(0,t)+"..."},L0=function(e,t){var n=[],i={},a={};e.forEach(function(u){a[u.id]=u}),e.forEach(function(u,f){var l=Vt(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(Pe(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},N0=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},ed=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=pt(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 b=m.getCanvasBBox();b.x&&i.minX>b.minX&&(i.minX=b.minX),b.y&&i.minY>b.minY&&(i.minY=b.minY),b.x&&i.maxX<b.maxX&&(i.maxX=b.maxX),b.y&&i.maxY<b.maxY&&(i.maxY=b.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},Xz=function(e){var t=ht(e.x)||ht(e.y)||e.type||e.anchorPoints||e.size;return e.style&&(t=t||ht(e.style.r)||ht(e.style.width)||ht(e.style.height)||ht(e.style.rx)||ht(e.style.ry)),t},td=function(e){var t={};return Object.keys(e).forEach(function(n){var i=e[n];if(!(n==="img"&&!Pe(i)))if(yn(i)&&!pt(i)){var a={};Object.keys(i).forEach(function(o){var s=i[o];o==="img"&&!Pe(s)||(a[o]=Vt(s))}),t[n]=a}else t[n]=Vt(i)}),t},wl=function(e){var t=e.animateCfg,n=e.callback,i;if(!t)i={duration:500,callback:n};else if(i=Vt(t),t.callback){var a=t.callback;i.callback=function(){n(),a()}}else i.callback=n;return i};const Yz=Object.freeze(Object.defineProperty({__proto__:null,cloneBesidesImg:td,getAnimateCfgWithCallback:wl,getBBox:Td,getComboBBox:ed,getLabelPosition:AT,getLetterWidth:TT,getLoopCfgs:CT,getTextSize:IT,plainCombosToTrees:L0,reconstructTree:N0,shouldRefreshEdge:Xz,traverseTree:Cn,traverseTreeUp:Ki,truncateLabelByLength:kT},Symbol.toStringTag,{value:"Module"}));var jw=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 Pe(h.id)?!0:(o=!1,!1)}),o}var s=(t||[]).find(function(h){return!Pe(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=Jn(Jn([],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},Wz=function(e,t){if(e==="node"||e==="combo"){if(t.id&&!Pe(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},Vz=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;me(e,function(t){me(t,function(n,i){Pe(n)&&(t[i]={type:n})})})},r.prototype.setBehaviors=function(e){var t=this.graph,n=this.modes[e],i=[],a;me(n||[],function(o){var s=gm.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 me(t,function(n){e.indexOf(n)<0&&(Pe(n)&&(n={type:n}),e.push(n))}),e},r.filterBehaviors=function(e,t){var n=[];return e.forEach(function(i){var a="";Pe(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}),me(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(pt(e)?a=e:a=[e],pt(t))return me(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){Pe(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}(),rl=`
1
+ import{cn as va,ci as pa,aW as xe,h as M5,m as C5,A as A5,D as T5,ax as xw,H as I5,I as k5}from"./index-DJtt0fwN.js";import{$ as ww}from"./dayjs.min-D1CZc5GV.js";function L5(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 lm=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Ri},get Circle(){return V7},get Ellipse(){return H7},get Image(){return q7},get Line(){return Z7},get Marker(){return Q7},get Path(){return u1},get Polygon(){return aX},get Polyline(){return oX},get Rect(){return fX},get Text(){return lX}},Symbol.toStringTag,{value:"Module"})),cm=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return mi},get Circle(){return vX},get Dom(){return pX},get Ellipse(){return gX},get Image(){return yX},get Line(){return mX},get Marker(){return bX},get Path(){return xX},get Polygon(){return wX},get Polyline(){return EX},get Rect(){return SX},get Text(){return TX}},Symbol.toStringTag,{value:"Module"}));var _0=function(r,e){return _0=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])},_0(r,e)};function kt(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");_0(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var B=function(){return B=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},B.apply(this,arguments)};function nn(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 eC(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 tC(r,e){return function(t,n){e(t,n,r)}}function N5(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 O5(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 D5(r){return typeof r=="symbol"?r:"".concat(r)}function P5(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 rC(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Wn(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 Vn(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 dv=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 nC(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&dv(e,r,t)}function md(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 hm(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 iC(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(hm(arguments[e]));return r}function vv(){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 Jn(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 Lu(r){return this instanceof Lu?(this.v=r,this):new Lu(r)}function aC(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 Lu?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 oC(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:Lu(r[i](o)),done:!1}:a?a(o):o}:a}}function sC(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 md=="function"?md(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 uC(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}var R5=Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e};function fC(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)&&dv(e,r,t);return R5(e,r),e}function lC(r){return r&&r.__esModule?r:{default:r}}function cC(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 hC(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 dC(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 vC(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 B5=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 pC(r){function e(n){r.error=r.hasError?new B5(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 F5={__extends:kt,__assign:B,__rest:nn,__decorate:eC,__param:tC,__metadata:rC,__awaiter:Wn,__generator:Vn,__createBinding:dv,__exportStar:nC,__values:md,__read:hm,__spread:iC,__spreadArrays:vv,__spreadArray:Jn,__await:Lu,__asyncGenerator:aC,__asyncDelegator:oC,__asyncValues:sC,__makeTemplateObject:uC,__importStar:fC,__importDefault:lC,__classPrivateFieldGet:cC,__classPrivateFieldSet:hC,__classPrivateFieldIn:dC,__addDisposableResource:vC,__disposeResources:pC},G5=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:vC,get __assign(){return B},__asyncDelegator:oC,__asyncGenerator:aC,__asyncValues:sC,__await:Lu,__awaiter:Wn,__classPrivateFieldGet:cC,__classPrivateFieldIn:dC,__classPrivateFieldSet:hC,__createBinding:dv,__decorate:eC,__disposeResources:pC,__esDecorate:N5,__exportStar:nC,__extends:kt,__generator:Vn,__importDefault:lC,__importStar:fC,__makeTemplateObject:uC,__metadata:rC,__param:tC,__propKey:D5,__read:hm,__rest:nn,__runInitializers:O5,__setFunctionName:P5,__spread:iC,__spreadArray:Jn,__spreadArrays:vv,__values:md,default:F5},Symbol.toStringTag,{value:"Module"}));var Gn=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},bd=function(r,e){return Gn(r)?r.indexOf(e)>-1:!1},pv=function(r,e){if(!Gn(r))return r;for(var t=[],n=0;n<r.length;n++){var i=r[n];e(i,n)&&t.push(i)}return t},z5=function(r,e){return e===void 0&&(e=[]),pv(r,function(t){return!bd(e,t)})},$5={}.toString,Pi=function(r,e){return $5.call(r)==="[object "+e+"]"};const Mr=function(r){return Pi(r,"Function")};var ct=function(r){return r==null};const pt=function(r){return Array.isArray?Array.isArray(r):Pi(r,"Array")},yn=function(r){var e=typeof r;return r!==null&&e==="object"||e==="function"};function me(r,e){if(r){var t;if(pt(r))for(var n=0,i=r.length;n<i&&(t=e(r[n],n),t!==!1);n++);else if(yn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(t=e(r[a],a),t===!1))break}}}var gC=Object.keys?function(r){return Object.keys(r)}:function(r){var e=[];return me(r,function(t,n){Mr(r)&&n==="prototype"||e.push(n)}),e};function yC(r,e){var t=gC(e),n=t.length;if(ct(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 xd=function(r){return typeof r=="object"&&r!==null},pn=function(r){if(!xd(r)||!Pi(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 j5(r,e){if(!pt(r))return null;var t;if(Mr(e)&&(t=e),pn(e)&&(t=function(i){return yC(i,e)}),t){for(var n=0;n<r.length;n+=1)if(t(r[n]))return r[n]}return null}function U5(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 X5=function(r,e){for(var t=null,n=0;n<r.length;n++){var i=r[n],a=i[e];if(!ct(a)){pt(a)?t=a[0]:t=a;break}}return t},Y5=function(r){if(!pt(r))return[];for(var e=[],t=0;t<r.length;t++)e=e.concat(r[t]);return e},mC=function(r,e){if(e===void 0&&(e=[]),!pt(r))e.push(r);else for(var t=0;t<r.length;t+=1)mC(r[t],e);return e};const ca=function(r){if(pt(r))return r.reduce(function(e,t){return Math.max(e,t)},r[0])},ha=function(r){if(pt(r))return r.reduce(function(e,t){return Math.min(e,t)},r[0])};var bC=function(r){var e=r.filter(function(o){return!isNaN(o)});if(!e.length)return{min:0,max:0};if(pt(r[0])){for(var t=[],n=0;n<r.length;n++)t=t.concat(r[n]);e=t}var i=ca(e),a=ha(e);return{min:a,max:i}},xC=Array.prototype,W5=xC.splice,V5=xC.indexOf,H5=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=V5.call(r,i))>-1;)W5.call(r,a,1);return r},q5=Array.prototype.splice,wC=function(e,t){if(!Gn(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,q5.call(e,o,1))}return e},EC=function(r,e,t){if(!pt(r)&&!pn(r))return r;var n=t;return me(r,function(i,a){n=e(n,i,a)}),n},Z5=function(r,e){var t=[];if(!Gn(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 wC(r,i),t};const Pe=function(r){return Pi(r,"String")};function K5(r,e){var t;if(Mr(e))t=function(i,a){return e(i)-e(a)};else{var n=[];Pe(e)?n.push(e):pt(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 gl(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 Q5=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return gl([].concat.apply([],r))};const J5=function(r,e){for(var t=[],n={},i=0;i<r.length;i++){var a=r[i],o=a[e];if(!ct(o)){pt(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(Gn(r))return r[0]}function vi(r){if(Gn(r)){var e=r;return e[e.length-1]}}function eR(r,e){return pt(r)||Pe(r)?r[0]===e:!1}function tR(r,e){return pt(r)||Pe(r)?r[r.length-1]===e:!1}var rR=function(r,e){for(var t=0;t<r.length;t++)if(!e(r[t],t))return!1;return!0},nR=function(r,e){for(var t=0;t<r.length;t++)if(e(r[t],t))return!0;return!1},iR=Object.prototype.hasOwnProperty;function wd(r,e){if(!e||!pt(r))return{};for(var t={},n=Mr(e)?e:function(s){return s[e]},i,a=0;a<r.length;a++){var o=r[a];i=n(o),iR.call(t,i)?t[i].push(o):t[i]=[o]}return t}function _C(r,e){if(!e)return{0:r};if(!Mr(e)){var t=pt(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 wd(r,e)}const aR=function(r,e){if(!e)return[r];var t=_C(r,e),n=[];for(var i in t)n.push(t[i]);return n};function oR(r,e){return r["_wrap_"+e]}function cs(r,e){if(r["_wrap_"+e])return r["_wrap_"+e];var t=function(n){r[e](n)};return r["_wrap_"+e]=t,t}var Ew={};function sR(r){var e=Ew[r];if(!e){for(var t=r.toString(16),n=t.length;n<6;n++)t="0"+t;e="#"+t,Ew[r]=e}return e}function uR(r){var e=0,t=0,n=0,i=0;return pt(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 fR=function(r,e,t){return r<e?e:r>t?t:r},Vh=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))},ht=function(r){return Pi(r,"Number")},lR=function(r){return ht(r)&&r%1!==0},cR=function(r){return ht(r)&&r%2===0},hR=Number.isInteger?Number.isInteger:function(r){return ht(r)&&r%1===0},dR=function(r){return ht(r)&&r<0},vR=1e-5;function SC(r,e,t){return t===void 0&&(t=vR),Math.abs(r-e)<t}var pR=function(r){return ht(r)&&r%2!==0},gR=function(r){return ht(r)&&r>0};const yR=function(r,e){if(pt(r)){for(var t,n=-1/0,i=0;i<r.length;i++){var a=r[i],o=Mr(e)?e(a):a[e];o>n&&(t=a,n=o)}return t}},mR=function(r,e){if(pt(r)){for(var t,n=1/0,i=0;i<r.length;i++){var a=r[i],o=Mr(e)?e(a):a[e];o<n&&(t=a,n=o)}return t}};var gv=function(r,e){return(r%e+e)%e},bR=180/Math.PI,xR=function(r){return bR*r};const wR=parseInt;var ER=Math.PI/180,yv=function(r){return ER*r};const _w=function(r,e){return r.hasOwnProperty(e)};var dm=Object.values?function(r){return Object.values(r)}:function(r){var e=[];return me(r,function(t,n){Mr(r)&&n==="prototype"||e.push(t)}),e};const _R=function(r,e){return bd(dm(r),e)},Zu=function(r){return ct(r)?"":r.toString()};var SR=function(r){return Zu(r).toLowerCase()},MR=function(r){var e=Zu(r);return e.charAt(0).toLowerCase()+e.substring(1)};function CR(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 AR=function(r){return Zu(r).toUpperCase()},Nu=function(r){var e=Zu(r);return e.charAt(0).toUpperCase()+e.substring(1)},TR={}.toString,MC=function(r){return TR.call(r).replace(/^\[object /,"").replace(/]$/,"")},IR=function(r){return Pi(r,"Arguments")},$l=function(r){return Pi(r,"Boolean")},vm=function(r){return Pi(r,"Date")},kR=function(r){return Pi(r,"Error")};function LR(r){return ht(r)&&isFinite(r)}var NR=function(r){return r===null},OR=Object.prototype,CC=function(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||OR;return r===t},DR=function(r){return Pi(r,"RegExp")},PR=function(r){return r===void 0},RR=function(r){return r instanceof Element||r instanceof HTMLDocument};function AC(r){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)};return e(r)}function TC(r){var e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;e(r)}function cg(r,e){for(var t in e)e.hasOwnProperty(t)&&t!=="constructor"&&e[t]!==void 0&&(r[t]=e[t])}function yt(r,e,t,n){return e&&cg(r,e),t&&cg(r,t),n&&cg(r,n),r}var BR=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];Mr(i)&&(i=i.prototype),yt(t.prototype,i)}},Vt=function(r){if(typeof r!="object"||r===null)return r;var e;if(pt(r)){e=[];for(var t=0,n=r.length;t<n;t++)typeof r[t]=="object"&&r[t]!=null?e[t]=Vt(r[t]):e[t]=r[t]}else{e={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?e[i]=Vt(r[i]):e[i]=r[i]}return e};function jl(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 IC=function(r,e){if(!Mr(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 FR=5;function kC(r,e,t,n){t=t||0,n=n||FR;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];a!==null&&pn(a)?(pn(r[i])||(r[i]={}),t<n?kC(r[i],a,t+1,n):r[i]=e[i]):pt(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var yr=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)kC(r,e[n]);return r},GR=function(r,e,t,n){Mr(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=yt(a,r.prototype),r.superclass=i(e.prototype,e),yt(a,t),yt(r,n),r},pm=function(r,e){if(!Gn(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},zR=Object.prototype.hasOwnProperty;function LC(r){if(ct(r))return!0;if(Gn(r))return!r.length;var e=MC(r);if(e==="Map"||e==="Set")return!r.size;if(CC(r))return!Object.keys(r).length;for(var t in r)if(zR.call(r,t))return!1;return!0}var Mo=function(r,e){if(r===e)return!0;if(!r||!e||Pe(r)||Pe(e))return!1;if(Gn(r)||Gn(e)){if(r.length!==e.length)return!1;for(var t=!0,n=0;n<r.length&&(t=Mo(r[n],e[n]),!!t);n++);return t}if(xd(r)||xd(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=Mo(r[i[n]],e[i[n]]),!!t);n++);return t}return!1};const $R=function(r,e,t){return Mr(t)?!!t(r,e):Mo(r,e)};var _s=function(r,e){if(!Gn(r))return r;for(var t=[],n=0;n<r.length;n++){var i=r[n];t.push(e(i,n))}return t},jR=function(r){return r};const UR=function(r,e){e===void 0&&(e=jR);var t={};return yn(r)&&!ct(r)&&Object.keys(r).forEach(function(n){t[n]=e(r[n],n)}),t},Oa=function(r,e,t){for(var n=0,i=Pe(e)?e.split("."):e;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?t:r},XR=function(r,e,t){var n=r,i=Pe(e)?e.split("."):e;return i.forEach(function(a,o){o<i.length-1?(yn(n[a])||(n[a]=ht(i[o+1])?[]:{}),n=n[a]):n[a]=t}),r};var YR=Object.prototype.hasOwnProperty;const WR=function(r,e){if(r===null||!pn(r))return{};var t={};return me(e,function(n){YR.call(r,n)&&(t[n]=r[n])}),t},VR=function(r,e){return EC(r,function(t,n,i){return e.includes(i)||(t[i]=n),t},{})},yl=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},NC=function(r){return Gn(r)?Array.prototype.slice.call(r):[]};var Hc={};const da=function(r){return r=r||"g",Hc[r]?Hc[r]+=1:Hc[r]=1,r+Hc[r]},Uf=function(){},HR=function(r){return r};function mv(r){return ct(r)?0:Gn(r)?r.length:Object.keys(r).length}var qc;const Xf=IC(function(r,e){e===void 0&&(e={});var t=e.fontSize,n=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return qc||(qc=document.createElement("canvas").getContext("2d")),qc.font=[a,o,i,t+"px",n].join(" "),qc.measureText(Pe(r)?r:"").width},function(r,e){return e===void 0&&(e={}),vv([r],dm(e)).join("")}),qR=function(r,e,t,n){n===void 0&&(n="...");var i=16,a=Xf(n,t),o=Pe(r)?r:Zu(r),s=e,u=[],f,l;if(Xf(r,t)<=e)return r;for(;f=o.substr(0,i),l=Xf(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=Xf(f,t),!(l+a>s);)if(u.push(f),s-=l,o=o.substr(1),!o)return u.join("");return""+u.join("")+n};var ZR=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 KR=Object.freeze(Object.defineProperty({__proto__:null,Cache:ZR,assign:yt,augment:BR,clamp:fR,clearAnimationFrame:TC,clone:Vt,contains:bd,debounce:jl,deepMix:yr,difference:z5,each:me,endsWith:tR,every:rR,extend:GR,filter:pv,find:j5,findIndex:U5,firstValue:X5,fixedBase:Vh,flatten:Y5,flattenDeep:mC,forIn:me,get:Oa,getEllipsisText:qR,getRange:bC,getType:MC,getWrapBehavior:oR,group:aR,groupBy:wd,groupToMap:_C,has:_w,hasKey:_w,hasValue:_R,head:ua,identity:HR,includes:bd,indexOf:pm,isArguments:IR,isArray:pt,isArrayLike:Gn,isBoolean:$l,isDate:vm,isDecimal:lR,isElement:RR,isEmpty:LC,isEqual:Mo,isEqualWith:$R,isError:kR,isEven:cR,isFinite:LR,isFunction:Mr,isInteger:hR,isMatch:yC,isNegative:dR,isNil:ct,isNull:NR,isNumber:ht,isNumberEqual:SC,isObject:yn,isObjectLike:xd,isOdd:pR,isPlainObject:pn,isPositive:gR,isPrototype:CC,isRegExp:DR,isString:Pe,isType:Pi,isUndefined:PR,keys:gC,last:vi,lowerCase:SR,lowerFirst:MR,map:_s,mapValues:UR,max:ca,maxBy:yR,measureTextWidth:Xf,memoize:IC,min:ha,minBy:mR,mix:yt,mod:gv,noop:Uf,number2color:sR,omit:VR,parseRadius:uR,pick:WR,pull:H5,pullAt:wC,reduce:EC,remove:Z5,requestAnimationFrame:AC,set:XR,size:mv,some:nR,sortBy:K5,startsWith:eR,substitute:CR,throttle:yl,toArray:NC,toDegree:xR,toInteger:wR,toRadian:yv,toString:Zu,union:Q5,uniq:gl,uniqueId:da,upperCase:AR,upperFirst:Nu,values:dm,valuesOfKey:J5,wrapBehavior:cs},Symbol.toStringTag,{value:"Module"})),QR={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),me(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),me(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 gm=function(){function r(){}return r.registerBehavior=function(e,t){if(!t)throw new Error("please specify handler for this behavior: ".concat(e));var n=Vt(QR);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&&(me(u,function(l,c){f[c]=cs(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}(),JR="*",OC=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[JR]||[],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}(),wt=1e-6,Qt=typeof Float32Array<"u"?Float32Array:Array,Li=Math.random;function eB(r){Qt=r}var tB=Math.PI/180;function rB(r){return r*tB}function nB(r,e){return Math.abs(r-e)<=wt*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 iB=Object.freeze(Object.defineProperty({__proto__:null,get ARRAY_TYPE(){return Qt},EPSILON:wt,RANDOM:Li,equals:nB,setMatrixArrayType:eB,toRadian:rB},Symbol.toStringTag,{value:"Module"}));function aB(){var r=new Qt(4);return Qt!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r}function oB(r){var e=new Qt(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function sB(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function uB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r}function fB(r,e,t,n){var i=new Qt(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}function lB(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function cB(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 hB(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 dB(r,e){var t=e[0];return r[0]=e[3],r[1]=-e[1],r[2]=-e[2],r[3]=t,r}function vB(r){return r[0]*r[3]-r[2]*r[1]}function DC(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 pB(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 gB(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 yB(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 mB(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=e[1],r}function bB(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function xB(r){return Math.hypot(r[0],r[1],r[2],r[3])}function wB(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 EB(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 PC(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 _B(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}function SB(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)<=wt*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(n-s)<=wt*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=wt*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=wt*Math.max(1,Math.abs(a),Math.abs(f))}function MB(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 CB(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 AB=DC,TB=PC;const IB=Object.freeze(Object.defineProperty({__proto__:null,LDU:wB,add:EB,adjoint:dB,clone:oB,copy:sB,create:aB,determinant:vB,equals:SB,exactEquals:_B,frob:xB,fromRotation:yB,fromScaling:mB,fromValues:fB,identity:uB,invert:hB,mul:AB,multiply:DC,multiplyScalar:MB,multiplyScalarAndAdd:CB,rotate:pB,scale:gB,set:lB,str:bB,sub:TB,subtract:PC,transpose:cB},Symbol.toStringTag,{value:"Module"}));function kB(){var r=new Qt(6);return Qt!=Float32Array&&(r[1]=0,r[2]=0,r[4]=0,r[5]=0),r[0]=1,r[3]=1,r}function LB(r){var e=new Qt(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 NB(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 OB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function DB(r,e,t,n,i,a){var o=new Qt(6);return o[0]=r,o[1]=e,o[2]=t,o[3]=n,o[4]=i,o[5]=a,o}function PB(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 RB(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 BB(r){return r[0]*r[3]-r[1]*r[2]}function RC(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 FB(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 GB(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 zB(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 $B(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 jB(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 UB(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 XB(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")"}function YB(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],1)}function WB(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 BC(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 VB(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 HB(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 qB(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 ZB(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)<=wt*Math.max(1,Math.abs(t),Math.abs(u))&&Math.abs(n-f)<=wt*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-l)<=wt*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-c)<=wt*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-h)<=wt*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-d)<=wt*Math.max(1,Math.abs(s),Math.abs(d))}var KB=RC,QB=BC;const JB=Object.freeze(Object.defineProperty({__proto__:null,add:WB,clone:LB,copy:NB,create:kB,determinant:BB,equals:ZB,exactEquals:qB,frob:YB,fromRotation:$B,fromScaling:jB,fromTranslation:UB,fromValues:DB,identity:OB,invert:RB,mul:KB,multiply:RC,multiplyScalar:VB,multiplyScalarAndAdd:HB,rotate:FB,scale:GB,set:PB,str:XB,sub:QB,subtract:BC,translate:zB},Symbol.toStringTag,{value:"Module"}));function FC(){var r=new Qt(9);return Qt!=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 eF(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 tF(r){var e=new Qt(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 rF(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 nF(r,e,t,n,i,a,o,s,u){var f=new Qt(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 iF(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 aF(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 oF(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 ym(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 sF(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 uF(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 ga(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],b=t[7],x=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+b*o+x*f,r[7]=m*i+b*s+x*l,r[8]=m*a+b*u+x*c,r}function fF(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 lF(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 cF(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 mm(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 bm(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 xm(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 hF(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 dF(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 vF(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,b=t*u-i*o,x=t*f-a*o,w=n*u-i*s,E=n*f-a*s,_=i*f-a*u,M=l*p-c*v,C=l*g-h*v,S=l*y-d*v,A=c*g-h*p,T=c*y-d*p,k=h*y-d*g,O=m*k-b*T+x*A+w*S-E*C+_*M;return O?(O=1/O,r[0]=(s*k-u*T+f*A)*O,r[1]=(u*S-o*k-f*C)*O,r[2]=(o*T-s*S+f*M)*O,r[3]=(i*T-n*k-a*A)*O,r[4]=(t*k-i*S+a*C)*O,r[5]=(n*S-t*T-a*M)*O,r[6]=(p*_-g*E+y*w)*O,r[7]=(g*x-v*_-y*b)*O,r[8]=(v*E-p*x+y*m)*O,r):null}function pF(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 gF(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function yF(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function mF(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 GC(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 bF(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 xF(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 wF(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 EF(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],b=e[8];return Math.abs(t-c)<=wt*Math.max(1,Math.abs(t),Math.abs(c))&&Math.abs(n-h)<=wt*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=wt*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-v)<=wt*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-p)<=wt*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=wt*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=wt*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(f-m)<=wt*Math.max(1,Math.abs(f),Math.abs(m))&&Math.abs(l-b)<=wt*Math.max(1,Math.abs(l),Math.abs(b))}var _F=ga,SF=GC;const zC=Object.freeze(Object.defineProperty({__proto__:null,add:mF,adjoint:sF,clone:tF,copy:rF,create:FC,determinant:uF,equals:EF,exactEquals:wF,frob:yF,fromMat2d:hF,fromMat4:eF,fromQuat:dF,fromRotation:bm,fromScaling:xm,fromTranslation:mm,fromValues:nF,identity:aF,invert:ym,mul:_F,multiply:ga,multiplyScalar:bF,multiplyScalarAndAdd:xF,normalFromMat4:vF,projection:pF,rotate:lF,scale:cF,set:iF,str:gF,sub:SF,subtract:GC,translate:fF,transpose:oF},Symbol.toStringTag,{value:"Module"}));function MF(){var r=new Qt(16);return Qt!=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 CF(r){var e=new Qt(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 AF(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 TF(r,e,t,n,i,a,o,s,u,f,l,c,h,d,v,p){var g=new Qt(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 IF(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 $C(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 kF(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 LF(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,b=t*u-i*o,x=t*f-a*o,w=n*u-i*s,E=n*f-a*s,_=i*f-a*u,M=l*p-c*v,C=l*g-h*v,S=l*y-d*v,A=c*g-h*p,T=c*y-d*p,k=h*y-d*g,O=m*k-b*T+x*A+w*S-E*C+_*M;return O?(O=1/O,r[0]=(s*k-u*T+f*A)*O,r[1]=(i*T-n*k-a*A)*O,r[2]=(p*_-g*E+y*w)*O,r[3]=(h*E-c*_-d*w)*O,r[4]=(u*S-o*k-f*C)*O,r[5]=(t*k-i*S+a*C)*O,r[6]=(g*x-v*_-y*b)*O,r[7]=(l*_-h*x+d*b)*O,r[8]=(o*T-s*S+f*M)*O,r[9]=(n*S-t*T-a*M)*O,r[10]=(v*E-p*x+y*m)*O,r[11]=(c*x-l*E-d*m)*O,r[12]=(s*C-o*A-u*M)*O,r[13]=(t*A-n*C+i*M)*O,r[14]=(p*b-v*w-g*m)*O,r[15]=(l*w-c*b+h*m)*O,r):null}function NF(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 OF(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,b=e*u-i*a,x=t*s-n*o,w=t*u-i*o,E=n*u-i*s,_=f*v-l*d,M=f*p-c*d,C=f*g-h*d,S=l*p-c*v,A=l*g-h*v,T=c*g-h*p;return y*T-m*A+b*S+x*C-w*M+E*_}function jC(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],b=t[0],x=t[1],w=t[2],E=t[3];return r[0]=b*n+x*s+w*c+E*p,r[1]=b*i+x*u+w*h+E*g,r[2]=b*a+x*f+w*d+E*y,r[3]=b*o+x*l+w*v+E*m,b=t[4],x=t[5],w=t[6],E=t[7],r[4]=b*n+x*s+w*c+E*p,r[5]=b*i+x*u+w*h+E*g,r[6]=b*a+x*f+w*d+E*y,r[7]=b*o+x*l+w*v+E*m,b=t[8],x=t[9],w=t[10],E=t[11],r[8]=b*n+x*s+w*c+E*p,r[9]=b*i+x*u+w*h+E*g,r[10]=b*a+x*f+w*d+E*y,r[11]=b*o+x*l+w*v+E*m,b=t[12],x=t[13],w=t[14],E=t[15],r[12]=b*n+x*s+w*c+E*p,r[13]=b*i+x*u+w*h+E*g,r[14]=b*a+x*f+w*d+E*y,r[15]=b*o+x*l+w*v+E*m,r}function DF(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 PF(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 RF(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,b,x,w,E,_,M,C,S,A,T,k,O,F;return s<wt?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],b=e[8],x=e[9],w=e[10],E=e[11],_=i*i*l+f,M=a*i*l+o*u,C=o*i*l-a*u,S=i*a*l-o*u,A=a*a*l+f,T=o*a*l+i*u,k=i*o*l+a*u,O=a*o*l-i*u,F=o*o*l+f,r[0]=c*_+p*M+b*C,r[1]=h*_+g*M+x*C,r[2]=d*_+y*M+w*C,r[3]=v*_+m*M+E*C,r[4]=c*S+p*A+b*T,r[5]=h*S+g*A+x*T,r[6]=d*S+y*A+w*T,r[7]=v*S+m*A+E*T,r[8]=c*k+p*O+b*F,r[9]=h*k+g*O+x*F,r[10]=d*k+y*O+w*F,r[11]=v*k+m*O+E*F,e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r)}function BF(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 FF(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 GF(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 zF(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 $F(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 jF(r,e,t){var n=t[0],i=t[1],a=t[2],o=Math.hypot(n,i,a),s,u,f;return o<wt?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 UF(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 XF(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 YF(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 UC(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 WF(r,e){var t=new Qt(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),UC(r,e,t),r}function XC(r,e){return r[0]=e[12],r[1]=e[13],r[2]=e[14],r}function YC(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 WC(r,e){var t=new Qt(3);YC(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 VF(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,b=s*l,x=n[0],w=n[1],E=n[2];return r[0]=(1-(v+g))*x,r[1]=(h+b)*x,r[2]=(d-m)*x,r[3]=0,r[4]=(h-b)*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 HF(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,b=u*l,x=u*c,w=n[0],E=n[1],_=n[2],M=i[0],C=i[1],S=i[2],A=(1-(p+y))*w,T=(d+x)*w,k=(v-b)*w,O=(d-x)*E,F=(1-(h+y))*E,D=(g+m)*E,$=(v+b)*_,Y=(g-m)*_,N=(1-(h+p))*_;return r[0]=A,r[1]=T,r[2]=k,r[3]=0,r[4]=O,r[5]=F,r[6]=D,r[7]=0,r[8]=$,r[9]=Y,r[10]=N,r[11]=0,r[12]=t[0]+M-(A*M+O*C+$*S),r[13]=t[1]+C-(T*M+F*C+Y*S),r[14]=t[2]+S-(k*M+D*C+N*S),r[15]=1,r}function qF(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 ZF(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 VC(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 KF=VC;function QF(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 HC(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 e4=HC;function t4(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 r4(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],b=n[2],x=t[0],w=t[1],E=t[2];return Math.abs(v-x)<wt&&Math.abs(p-w)<wt&&Math.abs(g-E)<wt?$C(r):(l=v-x,c=p-w,h=g-E,d=1/Math.hypot(l,c,h),l*=d,c*=d,h*=d,i=m*h-b*c,a=b*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 n4(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 i4(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 a4(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 o4(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 qC(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 s4(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 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[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 f4(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 l4(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],b=e[1],x=e[2],w=e[3],E=e[4],_=e[5],M=e[6],C=e[7],S=e[8],A=e[9],T=e[10],k=e[11],O=e[12],F=e[13],D=e[14],$=e[15];return Math.abs(t-m)<=wt*Math.max(1,Math.abs(t),Math.abs(m))&&Math.abs(n-b)<=wt*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-x)<=wt*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=wt*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-E)<=wt*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(s-_)<=wt*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(u-M)<=wt*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(f-C)<=wt*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(l-S)<=wt*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-A)<=wt*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(h-T)<=wt*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-k)<=wt*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(v-O)<=wt*Math.max(1,Math.abs(v),Math.abs(O))&&Math.abs(p-F)<=wt*Math.max(1,Math.abs(p),Math.abs(F))&&Math.abs(g-D)<=wt*Math.max(1,Math.abs(g),Math.abs(D))&&Math.abs(y-$)<=wt*Math.max(1,Math.abs(y),Math.abs($))}var c4=jC,h4=qC;const d4=Object.freeze(Object.defineProperty({__proto__:null,add:o4,adjoint:NF,clone:CF,copy:AF,create:MF,determinant:OF,equals:l4,exactEquals:f4,frob:a4,fromQuat:qF,fromQuat2:WF,fromRotation:jF,fromRotationTranslation:UC,fromRotationTranslationScale:VF,fromRotationTranslationScaleOrigin:HF,fromScaling:$F,fromTranslation:zF,fromValues:TF,fromXRotation:UF,fromYRotation:XF,fromZRotation:YF,frustum:ZF,getRotation:WC,getScaling:YC,getTranslation:XC,identity:$C,invert:LF,lookAt:r4,mul:c4,multiply:jC,multiplyScalar:s4,multiplyScalarAndAdd:u4,ortho:e4,orthoNO:HC,orthoZO:t4,perspective:KF,perspectiveFromFieldOfView:JF,perspectiveNO:VC,perspectiveZO:QF,rotate:RF,rotateX:BF,rotateY:FF,rotateZ:GF,scale:PF,set:IF,str:i4,sub:h4,subtract:qC,targetTo:n4,translate:DF,transpose:kF},Symbol.toStringTag,{value:"Module"}));function wm(){var r=new Qt(3);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function v4(r){var e=new Qt(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function ZC(r){var e=r[0],t=r[1],n=r[2];return Math.hypot(e,t,n)}function S0(r,e,t){var n=new Qt(3);return n[0]=r,n[1]=e,n[2]=t,n}function p4(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function g4(r,e,t,n){return r[0]=e,r[1]=t,r[2]=n,r}function y4(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r}function KC(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r}function QC(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r}function JC(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r}function m4(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r}function b4(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r}function x4(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 w4(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 E4(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r}function _4(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r}function S4(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 eA(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 tA(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 rA(r){var e=r[0],t=r[1],n=r[2];return e*e+t*t+n*n}function M4(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r}function C4(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r}function nA(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 Em(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function Hh(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 A4(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 T4(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 I4(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 k4(r,e){e=e||1;var t=Li()*2*Math.PI,n=Li()*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 L4(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 bv(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 N4(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 O4(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 D4(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 P4(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 R4(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&&Em(r,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function B4(r){return r[0]=0,r[1]=0,r[2]=0,r}function F4(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function G4(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]}function z4(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)<=wt*Math.max(1,Math.abs(t),Math.abs(a))&&Math.abs(n-o)<=wt*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=wt*Math.max(1,Math.abs(i),Math.abs(s))}var $4=KC,j4=QC,U4=JC,X4=eA,Y4=tA,iA=ZC,W4=rA,V4=function(){var r=wm();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 H4=Object.freeze(Object.defineProperty({__proto__:null,add:y4,angle:R4,bezier:I4,ceil:m4,clone:v4,copy:p4,create:wm,cross:Hh,dist:X4,distance:eA,div:U4,divide:JC,dot:Em,equals:z4,exactEquals:G4,floor:b4,forEach:V4,fromValues:S0,hermite:T4,inverse:C4,len:iA,length:ZC,lerp:A4,max:w4,min:x4,mul:j4,multiply:QC,negate:M4,normalize:nA,random:k4,rotateX:O4,rotateY:D4,rotateZ:P4,round:E4,scale:_4,scaleAndAdd:S4,set:g4,sqrDist:Y4,sqrLen:W4,squaredDistance:tA,squaredLength:rA,str:F4,sub:$4,subtract:KC,transformMat3:bv,transformMat4:L4,transformQuat:N4,zero:B4},Symbol.toStringTag,{value:"Module"}));function aA(){var r=new Qt(4);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function oA(r){var e=new Qt(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function sA(r,e,t,n){var i=new Qt(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}function uA(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function fA(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function lA(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 cA(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 hA(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 dA(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 q4(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 Z4(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 K4(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 Q4(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 vA(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 eG(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 pA(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 gA(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 _m(r){var e=r[0],t=r[1],n=r[2],i=r[3];return Math.hypot(e,t,n,i)}function Sm(r){var e=r[0],t=r[1],n=r[2],i=r[3];return e*e+t*t+n*n+i*i}function tG(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r}function rG(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 yA(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 mA(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}function nG(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 bA(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 iG(r,e){e=e||1;var t,n,i,a,o,s;do t=Li()*2-1,n=Li()*2-1,o=t*t+n*n;while(o>=1);do i=Li()*2-1,a=Li()*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 aG(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 oG(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 sG(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function uG(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function xA(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}function wA(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)<=wt*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(n-s)<=wt*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=wt*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=wt*Math.max(1,Math.abs(a),Math.abs(f))}var fG=cA,lG=hA,cG=dA,hG=pA,dG=gA,vG=_m,pG=Sm,gG=function(){var r=aA();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 yG=Object.freeze(Object.defineProperty({__proto__:null,add:lA,ceil:q4,clone:oA,copy:uA,create:aA,cross:nG,dist:hG,distance:pA,div:cG,divide:dA,dot:mA,equals:wA,exactEquals:xA,floor:Z4,forEach:gG,fromValues:sA,inverse:rG,len:vG,length:_m,lerp:bA,max:Q4,min:K4,mul:lG,multiply:hA,negate:tG,normalize:yA,random:iG,round:J4,scale:vA,scaleAndAdd:eG,set:fA,sqrDist:dG,sqrLen:pG,squaredDistance:gA,squaredLength:Sm,str:uG,sub:fG,subtract:cA,transformMat4:aG,transformQuat:oG,zero:sG},Symbol.toStringTag,{value:"Module"}));function Ed(){var r=new Qt(4);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function mG(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function EA(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 bG(r,e){var t=Math.acos(e[3])*2,n=Math.sin(t/2);return n>wt?(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 xG(r,e){var t=Cm(r,e);return Math.acos(2*t*t-1)}function _A(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 SA(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 MA(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 CA(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 wG(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 AA(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 TA(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 EG(r,e,t){return TA(r,e),kA(r,r,t),AA(r,r),r}function qh(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>wt?(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 _G(r){var e=Li(),t=Li(),n=Li(),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 SG(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 MG(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r}function IA(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 CG(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 AG(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var TG=oA,IG=sA,Mm=uA,kG=fA,LG=lA,NG=_A,kA=vA,Cm=mA,OG=bA,Am=_m,DG=Am,Tm=Sm,PG=Tm,Im=yA,RG=xA,BG=wA,FG=function(){var r=wm(),e=S0(1,0,0),t=S0(0,1,0);return function(n,i,a){var o=Em(i,a);return o<-.999999?(Hh(r,e,i),iA(r)<1e-6&&Hh(r,t,i),nA(r,r),EA(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Hh(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,Im(n,n))}}(),GG=function(){var r=Ed(),e=Ed();return function(t,n,i,a,o,s){return qh(r,n,o,s),qh(e,i,a,s),qh(t,r,e,2*s*(1-s)),t}}(),zG=function(){var r=FC();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],Im(e,IA(e,r))}}();const $G=Object.freeze(Object.defineProperty({__proto__:null,add:LG,calculateW:wG,clone:TG,conjugate:MG,copy:Mm,create:Ed,dot:Cm,equals:BG,exactEquals:RG,exp:AA,fromEuler:CG,fromMat3:IA,fromValues:IG,getAngle:xG,getAxisAngle:bG,identity:mG,invert:SG,len:DG,length:Am,lerp:OG,ln:TA,mul:NG,multiply:_A,normalize:Im,pow:EG,random:_G,rotateX:SA,rotateY:MA,rotateZ:CA,rotationTo:FG,scale:kA,set:kG,setAxes:zG,setAxisAngle:EA,slerp:qh,sqlerp:GG,sqrLen:PG,squaredLength:Tm,str:AG},Symbol.toStringTag,{value:"Module"}));function jG(){var r=new Qt(8);return Qt!=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 UG(r){var e=new Qt(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 XG(r,e,t,n,i,a,o,s){var u=new Qt(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 YG(r,e,t,n,i,a,o){var s=new Qt(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 LA(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 WG(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 VG(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 HG(r,e){var t=Ed();WC(t,e);var n=new Qt(3);return XC(n,e),LA(r,t,n),r}function NA(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 qG(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 ZG(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 KG=Mm;function QG(r,e){return r[0]=e[4],r[1]=e[5],r[2]=e[6],r[3]=e[7],r}var JG=Mm;function e6(r,e){return r[4]=e[0],r[5]=e[1],r[6]=e[2],r[7]=e[3],r}function t6(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 r6(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 n6(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 SA(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 i6(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 MA(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 a6(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 CA(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 o6(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 s6(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 u6(r,e,t,n){if(Math.abs(n)<wt)return NA(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 f6(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 OA(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 l6=OA;function c6(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 DA=Cm;function h6(r,e,t,n){var i=1-n;return DA(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 d6(r,e){var t=xv(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 v6(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 PA=Am,p6=PA,xv=Tm,g6=xv;function y6(r,e){var t=xv(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 m6(r){return"quat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+")"}function b6(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 x6(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)<=wt*Math.max(1,Math.abs(t),Math.abs(l))&&Math.abs(n-c)<=wt*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-h)<=wt*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-d)<=wt*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-v)<=wt*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=wt*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(u-g)<=wt*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(f-y)<=wt*Math.max(1,Math.abs(f),Math.abs(y))}const w6=Object.freeze(Object.defineProperty({__proto__:null,add:f6,clone:UG,conjugate:v6,copy:NA,create:jG,dot:DA,equals:x6,exactEquals:b6,fromMat4:HG,fromRotation:VG,fromRotationTranslation:LA,fromRotationTranslationValues:YG,fromTranslation:WG,fromValues:XG,getDual:QG,getReal:KG,getTranslation:t6,identity:qG,invert:d6,len:p6,length:PA,lerp:h6,mul:l6,multiply:OA,normalize:y6,rotateAroundAxis:u6,rotateByQuatAppend:o6,rotateByQuatPrepend:s6,rotateX:n6,rotateY:i6,rotateZ:a6,scale:c6,set:ZG,setDual:e6,setReal:JG,sqrLen:g6,squaredLength:xv,str:m6,translate:r6},Symbol.toStringTag,{value:"Module"}));function RA(){var r=new Qt(2);return Qt!=Float32Array&&(r[0]=0,r[1]=0),r}function E6(r){var e=new Qt(2);return e[0]=r[0],e[1]=r[1],e}function _6(r,e){var t=new Qt(2);return t[0]=r,t[1]=e,t}function S6(r,e){return r[0]=e[0],r[1]=e[1],r}function M6(r,e,t){return r[0]=e,r[1]=t,r}function vn(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}function BA(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}function FA(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r}function GA(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r}function C6(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r}function A6(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r}function fo(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}function lo(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}function T6(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 I6(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r}function _d(r,e){var t=e[0]-r[0],n=e[1]-r[1];return Math.hypot(t,n)}function zA(r,e){var t=e[0]-r[0],n=e[1]-r[1];return t*t+n*n}function $A(r){var e=r[0],t=r[1];return Math.hypot(e,t)}function jA(r){var e=r[0],t=r[1];return e*e+t*t}function k6(r,e){return r[0]=-e[0],r[1]=-e[1],r}function L6(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 km(r,e){return r[0]*e[0]+r[1]*e[1]}function N6(r,e,t){var n=e[0]*t[1]-e[1]*t[0];return r[0]=r[1]=0,r[2]=n,r}function O6(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 D6(r,e){e=e||1;var t=Li()*2*Math.PI;return r[0]=Math.cos(t)*e,r[1]=Math.sin(t)*e,r}function P6(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 R6(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 B6(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 F6(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 G6(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 UA(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 z6(r){return r[0]=0,r[1]=0,r}function $6(r){return"vec2("+r[0]+", "+r[1]+")"}function Lm(r,e){return r[0]===e[0]&&r[1]===e[1]}function j6(r,e){var t=r[0],n=r[1],i=e[0],a=e[1];return Math.abs(t-i)<=wt*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(n-a)<=wt*Math.max(1,Math.abs(n),Math.abs(a))}var U6=$A,Zh=BA,X6=FA,Y6=GA,W6=_d,V6=zA,H6=jA,q6=function(){var r=RA();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 Z6=Object.freeze(Object.defineProperty({__proto__:null,add:vn,angle:UA,ceil:C6,clone:E6,copy:S6,create:RA,cross:N6,dist:W6,distance:_d,div:Y6,divide:GA,dot:km,equals:j6,exactEquals:Lm,floor:A6,forEach:q6,fromValues:_6,inverse:L6,len:U6,length:$A,lerp:O6,max:lo,min:fo,mul:X6,multiply:FA,negate:k6,normalize:_o,random:D6,rotate:G6,round:T6,scale:An,scaleAndAdd:I6,set:M6,sqrDist:V6,sqrLen:H6,squaredDistance:zA,squaredLength:jA,str:$6,sub:Zh,subtract:BA,transformMat2:P6,transformMat2d:R6,transformMat3:B6,transformMat4:F6,zero:z6},Symbol.toStringTag,{value:"Module"})),K6=Object.freeze(Object.defineProperty({__proto__:null,glMatrix:iB,mat2:IB,mat2d:JB,mat3:zC,mat4:d4,quat:$G,quat2:w6,vec2:Z6,vec3:H4,vec4:yG},Symbol.toStringTag,{value:"Module"}));function Q6(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return mm(n,t),ga(r,n,e)}function J6(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return bm(n,t),ga(r,n,e)}function ez(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return xm(n,t),ga(r,n,e)}function tz(r,e,t){return ga(r,t,e)}function yi(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":Q6(t,t,[a[1],a[2]]);break;case"s":ez(t,t,[a[1],a[2]]);break;case"r":J6(t,t,a[1]);break;case"m":tz(t,t,a[1]);break}}return t}var Ss=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},rz=function(e,t){return e===t},Sw=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}(),XA=function(){function r(e){e===void 0&&(e=rz),this.head=null,this.tail=null,this.compare=e}return r.prototype.prepend=function(e){var t=new Sw(e,this.head);return this.head=t,this.tail||(this.tail=t),this},r.prototype.append=function(e){var t=new Sw(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}(),nz=function(){function r(){this.linkedList=new XA}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)},iz=function(e,t){return t.filter(function(n){return n.source===e})},Kh=function(e,t){return t.filter(function(n){return n.source===e||n.target===e})},YA=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 az(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 WA=function(e,t,n,i){i===void 0&&(i=!0);var a=az(n),o=new nz,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()},oz=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(b){var x=p[b];if(!s[x]){var w=n.filter(function(E){return E.id===x});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},VA=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(_){return n.map(function(M){return M.id}).indexOf(_)>-1}),b=function(M){var C=m[M];if(!u[C]&&u[C]!==0){var S=n.filter(function(A){return A.id===C});S.length>0&&g(S[0]),f[y.id]=Math.min(f[y.id],f[C])}else s[C]&&(f[y.id]=Math.min(f[y.id],u[C]))},x=0;x<m.length;x++)b(x);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 Nm(r,e){return e?VA(r):oz(r)}var ja=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},HA=function(e,t){var n=ja(e);return n[t]?ja(e)[t].inDegree:0},qA=function(e,t){var n=ja(e);return n[t]?ja(e)[t].outDegree:0};function sz(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 ZA(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})&&ZA(r,s,e,n,i)}),n.leave({current:e,previous:t})}function Om(r,e,t,n){n===void 0&&(n=!0),ZA(r,e,"",sz(t),n)}var Dm=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];Om(e,l,f)}return t},Pm=function(e,t,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=Nm(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),b=function(E){var _,M=m[E],C=e.nodes.find(function(F){return F.id===M});if(M===y)o.push((_={},_[M]=g,_));else if(!(M in p))v[M]=g,d.push(C),p[M]=new Set([g]);else if(!p[y].has(C)){for(var S=!0,A=[C,g],T=v[y];p[M].size&&!p[M].has(T)&&(A.push(T),T!==v[T.id]);)T=v[T.id];if(A.push(T),t&&n?(S=!1,A.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(S=!0)):t&&!n&&A.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(S=!1),S){for(var k={},O=1;O<A.length;O+=1)k[A[O-1].id]=A[O];A.length&&(k[A[A.length-1].id]=A[0]),o.push(k)}p[M].add(g)}},x=0;x<m.length;x+=1)b(x)}return o},Rm=function(e,t,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],u={},f={},l=function(T){for(var k=[T];k.length>0;){var O=k.pop();a.has(O)&&(a.delete(O),o[O.id].forEach(function(F){k.push(F)}),o[O.id].clear())}},c=function A(T,k,O){var F=!1;if(t&&n===!1&&t.indexOf(T.id)>-1)return F;i.push(T),a.add(T);for(var D=O[T.id],$=0;$<D.length;$+=1){var Y=u[D[$]];if(Y===k){for(var N={},P=1;P<i.length;P+=1)N[i[P-1].id]=i[P];i.length&&(N[i[i.length-1].id]=i[0]),s.push(N),F=!0}else a.has(Y)||A(Y,k,O)&&(F=!0)}if(F)l(T);else for(var $=0;$<D.length;$+=1){var Y=u[D[$]];o[Y.id].has(T)||o[Y.id].add(T)}return i.pop(),F},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 k=t[T];f[d[T].id]=f[k],f[k]=0,u[0]=d.find(function(O){return O.id===k}),u[f[d[T].id]]=d[T]},v=0;v<t.length;v++)y(v);for(var m=function(T){for(var k,O,F=1/0,D=0;D<T.length;D+=1)for(var $=T[D],Y=0;Y<$.length;Y++){var N=f[$[Y].id];N<F&&(F=N,O=D)}for(var P=T[O],W=[],D=0;D<P.length;D+=1){var J=P[D];W[J.id]=[];for(var te=0,H=Kn(J.id,e.edges,"target").filter(function(Ne){return P.map(function(Ze){return Ze.id}).indexOf(Ne)>-1});te<H.length;te++){var pe=H[te];pe===J.id&&!(n===!1&&t.indexOf(J.id)>-1)?s.push((k={},k[J.id]=J,k)):W[J.id].push(f[pe])}}return{component:P,adjList:W,minIdx:F}},b=0;b<d.length;){var x=d.filter(function(A){return f[A.id]>=b}),w=VA({nodes:x,edges:e.edges}).filter(function(A){return A.length>1});if(w.length===0)break;var E=m(w),_=E.minIdx,M=E.adjList,C=E.component;if(C.length>1){C.forEach(function(A){o[A.id]=new Set});var S=u[_];if(t&&n&&t.indexOf(S.id)===-1)return s;c(S,S,M),b=_+1}else break}return s},KA=function(e,t,n,i){return i===void 0&&(i=!0),t?Rm(e,n,i):Pm(e,n,i)},uz=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},ml=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,b){var x=m.id;l[x]=1/0,x===t&&(l[x]=0)});for(var h=o.length,d=function(b){var x=uz(l,o,f),w=x.id;if(f[w]=!0,l[w]===1/0)return"continue";var E=[];n?E=iz(w,u):E=Kh(w,u),E.forEach(function(_){var M=_.target,C=_.source,S=M===w?C:M,A=i&&_[i]?_[i]:1;l[S]>l[x.id]+A?(l[S]=l[x.id]+A,c[S]=[x.id]):l[S]===l[x.id]+A&&c[S].push(x.id)})},v=0;v<h;v++)d();c[t]=[t];var p={};for(var g in l)l[g]!==1/0&&QA(t,g,c,p);var y={};for(var g in p)y[g]=p[g][0];return{length:l,path:y,allPath:p}};function QA(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=QA(r,s,t,n);if(!u)return;for(var f=0,l=u;f<l.length;f++){var c=l[f];pt(c)?i.push(Jn(Jn([],c,!0),[e],!1)):i.push([c,e])}}return n[e]=i,n[e]}var JA=function(e,t,n,i,a){var o=ml(e,t,i,a),s=o.length,u=o.path,f=o.allPath;return{length:s[n],path:u[n],allPath:f[n]}},eT=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},bl=function(e,t){for(var n=Ss(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},tT=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(b,x){var w=YA();b.clusterId=w,f[w]={id:w,nodes:[b]},l[b.id]={node:b,idx:x}});var c=Ss(e,t),h={};c.forEach(function(b,x){var w=o[x].id;h[w]={},b.forEach(function(E,_){if(E){var M=o[_].id;h[w][M]=E}})});for(var d=0,v=function(){var x=!1;if(o.forEach(function(w){var E={};Object.keys(h[w.id]).forEach(function(O){var F=h[w.id][O],D=l[O].node,$=D.clusterId;E[$]||(E[$]=0),E[$]+=F});var _=-1/0,M=[];if(Object.keys(E).forEach(function(O){_<E[O]?(_=E[O],M=[O]):_===E[O]&&M.push(O)}),!(M.length===1&&M[0]===w.clusterId)){var C=M.indexOf(w.clusterId);if(C>=0&&M.splice(C,1),M&&M.length){x=!0;var S=f[w.clusterId],A=S.nodes.indexOf(w);S.nodes.splice(A,1);var T=Math.floor(Math.random()*M.length),k=f[M[T]];k.nodes.push(w),w.clusterId=k.id}}}),!x)return"break";d++};d<i;){var p=v();if(p==="break")break}Object.keys(f).forEach(function(b){var x=f[b];(!x.nodes||!x.nodes.length)&&delete f[b]});var g=[],y={};u.forEach(function(b){var x=b.source,w=b.target,E=b[n]||1,_=l[x].node.clusterId,M=l[w].node.clusterId,C="".concat(_,"---").concat(M);if(y[C])y[C].weight+=E,y[C].count++;else{var S={source:_,target:M,weight:E,count:1};y[C]=S,g.push(S)}});var m=[];return Object.keys(f).forEach(function(b){m.push(f[b])}),{clusters:m,clusterEdges:g}},di=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=Vt(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}(),Bm=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},Ii;(function(r){r.EuclideanDistance="euclideanDistance"})(Ii||(Ii={}));var fz=function(e,t,n){var i=[];t!=null&&t.length?i=t:(e.forEach(function(o){i=i.concat(Object.keys(o))}),i=gl(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]=gl(s))}),a},Fm=function(e,t,n){var i=fz(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},Mw=function(e,t,n,i){n===void 0&&(n=Ii.EuclideanDistance);var a=0;switch(n){case Ii.EuclideanDistance:a=new di(e).euclideanDistance(new di(t));break}return a},Cw=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},hg=function(e,t){e===void 0&&(e=[]);for(var n=e.length,i=new di([]),a=0;a<n;a++)i=i.add(new di(t[a]));var o=i.avg(n);o.normalize();for(var s=0,a=0;a<n;a++){var u=new di(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 di(t[a]);e[a].clusterInertial=0;for(var c=0;c<n;c++){if(a===c){l[a][c]=0;continue}var h=new di(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))},Gm=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(N,P){N.properties=N.properties||{},N.originIndex=P});var p=[];c.every(function(N){return N.hasOwnProperty("nodeType")})&&(p=Array.from(new Set(c.map(function(N){return N.nodeType}))),c.forEach(function(N){N.properties.nodeType=p.findIndex(function(P){return P===N.nodeType})}));var g=Bm(c,o);v=Fm(g,s,u)}var y=1,m={},b={};c.forEach(function(N,P){var W=String(y++);N.clusterId=W,m[W]={id:W,nodes:[N]},b[N.id]={node:N,idx:P}});var x=Ss(e,t),w=[],E={},_=0;x.forEach(function(N,P){var W=0,J=c[P].id;E[J]={},N.forEach(function(te,H){if(te){W+=te;var pe=c[H].id;E[J][pe]=te,_+=te}}),w.push(W)}),_/=2;for(var M=1/0,C=1/0,S=0,A=[],T={};;){a&&c.every(function(N){return N.hasOwnProperty("properties")})?M=Cw(c,x,w,_)+hg(c,v)*f:M=Cw(c,x,w,_),S===0&&(C=M,A=c,T=m);var k=M>0&&M>C&&M-C<i;if(M>C&&(A=c.map(function(N){return{node:N,clusterId:N.clusterId}}),T=Vt(m),C=M),k||S>100)break;S++,Object.keys(m).forEach(function(N){var P=0;d.forEach(function(W){var J=W.source,te=W.target,H=b[J].node.clusterId,pe=b[te].node.clusterId;(H===N&&pe!==N||pe===N&&H!==N)&&(P=P+(W[n]||1))}),m[N].sumTot=P}),c.forEach(function(N,P){var W=m[N.clusterId],J=0,te,H=w[P]/(2*_),pe=0,Te=W.nodes;Te.forEach(function(Yt){var dr=b[Yt.id].idx;pe+=x[P][dr]||0});var Ne=pe-W.sumTot*H,Ze=Te.filter(function(Yt){return Yt.id!==N.id});Ze.forEach(function(Yt,dr){v[Yt.originIndex]});var at=hg(Ze,v)*f,nt=E[N.id];if(Object.keys(nt).forEach(function(Yt){var dr=b[Yt].node,lr=dr.clusterId;if(lr!==N.clusterId){var jt=m[lr],ir=jt.nodes;if(!(!ir||!ir.length)){var Hr=0;ir.forEach(function(Ge){var ye=b[Ge.id].idx;Hr+=x[P][ye]||0});var tt=Hr-jt.sumTot*H,ae=ir.concat([N]);ae.forEach(function(Ge,ye){v[Ge.originIndex]});var L=hg(ae,v)*f,Se=tt-Ne;a&&(Se=tt+L-(Ne+at)),Se>J&&(J=Se,te=jt)}}}),J>0){te.nodes.push(N);var _t=N.clusterId;N.clusterId=te.id;var St=W.nodes.indexOf(N);W.nodes.splice(St,1);var fr=0,Ft=0;d.forEach(function(Yt){var dr=Yt.source,lr=Yt.target,jt=b[dr].node.clusterId,ir=b[lr].node.clusterId;(jt===te.id&&ir!==te.id||ir===te.id&&jt!==te.id)&&(fr=fr+(Yt[n]||1)),(jt===_t&&ir!==_t||ir===_t&&jt!==_t)&&(Ft=Ft+(Yt[n]||1))}),te.sumTot=fr,W.sumTot=Ft}})}var O={},F=0;Object.keys(T).forEach(function(N){var P=T[N];if(!P.nodes||!P.nodes.length){delete T[N];return}var W=String(F+1);W!==N&&(P.id=W,P.nodes=P.nodes.map(function(J){return{id:J.id,clusterId:W}}),T[W]=P,O[N]=W,delete T[N],F++)}),A.forEach(function(N){var P=N.node,W=N.clusterId;P&&(P.clusterId=W,P.clusterId&&O[P.clusterId]&&(P.clusterId=O[P.clusterId]))});var D=[],$={};d.forEach(function(N){var P=N.source,W=N.target,J=N[n]||1,te=b[P].node.clusterId,H=b[W].node.clusterId;if(!(!te||!H)){var pe="".concat(te,"---").concat(H);if($[pe])$[pe].weight+=J,$[pe].count++;else{var Te={source:te,target:H,weight:J,count:1};$[pe]=Te,D.push(Te)}}});var Y=[];return Object.keys(T).forEach(function(N){Y.push(T[N])}),{clusters:Y,clusterEdges:D}},rT=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),Gm(e,t,n,i,!0,a,o,s,u)},nT=function(e,t){var n;t===void 0&&(t=1);for(var i=Vt(e),a=i.nodes,o=a===void 0?[]:a,s=i.edges,u=s===void 0?[]:s,f=function(){var h=ja({nodes:o,edges:u}),d=Object.keys(h);d.sort(function(g,y){var m,b;return((m=h[g])===null||m===void 0?void 0:m.degree)-((b=h[y])===null||b===void 0?void 0:b.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}},Aw=function(e,t,n){var i=[];switch(e){case Ii.EuclideanDistance:i=t[n];break;default:i=[];break}return i},iT=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=Ii.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===Ii.EuclideanDistance&&!u.every(function(W){return W.hasOwnProperty(n)}))return c;var h=[],d=[];if(o===Ii.EuclideanDistance&&(h=Bm(u,n),d=Fm(h,i,a)),!d.length)return c;for(var v=gl(d.map(function(W){return W.join("")})),p=Math.min(t,u.length,v.length),g=0;g<u.length;g++)u[g].originIndex=g;for(var y=[],m=[],b=[],g=0;g<p;g++)if(g===0){var x=Math.floor(Math.random()*u.length);switch(o){case Ii.EuclideanDistance:y[g]=d[x];break;default:y[g]=[];break}m.push(x),b[g]=[u[x]],u[x].clusterId=String(g)}else{for(var w=-1/0,E=0,_=function(te){if(!m.includes(te)){for(var H=0,pe=0;pe<y.length;pe++){var Te=0;switch(o){case Ii.EuclideanDistance:Te=Mw(d[u[te].originIndex],y[pe],o);break}H+=Te}var Ne=H/y.length;Ne>w&&!y.find(function(Ze){return Mo(Ze,Aw(o,d,u[te].originIndex))})&&(w=Ne,E=te)}},M=0;M<u.length;M++)_(M);y[g]=Aw(o,d,E),m.push(E),b[g]=[u[E]],u[E].clusterId=String(g)}for(var C=0;;){for(var g=0;g<u.length;g++){var S=0,A=1/0;if(!(C===0&&m.includes(g))){for(var T=0;T<y.length;T++){var k=0;switch(o){case Ii.EuclideanDistance:k=Mw(d[g],y[T],o);break}k<A&&(A=k,S=T)}if(u[g].clusterId!==void 0)for(var O=b[Number(u[g].clusterId)].length-1;O>=0;O--)b[Number(u[g].clusterId)][O].id===u[g].id&&b[Number(u[g].clusterId)].splice(O,1);u[g].clusterId=String(S),b[S].push(u[g])}}for(var F=!1,g=0;g<b.length;g++){for(var D=b[g],$=new di([]),T=0;T<D.length;T++)$=$.add(new di(d[D[T].originIndex]));var Y=$.avg(D.length);Y.equal(new di(y[g]))||(F=!0,y[g]=Y.getArr())}if(C++,u.every(function(W){return W.clusterId!==void 0})&&F||C>=1e3)break}var N=[],P={};return l.forEach(function(W){var J,te,H=W.source,pe=W.target,Te=(J=u.find(function(nt){return nt.id===H}))===null||J===void 0?void 0:J.clusterId,Ne=(te=u.find(function(nt){return nt.id===pe}))===null||te===void 0?void 0:te.clusterId,Ze="".concat(Te,"---").concat(Ne);if(P[Ze])P[Ze].count++;else{var at={source:Te,target:Ne,count:1};P[Ze]=at,N.push(at)}}),{clusters:b,clusterEdges:N}},zm=function(e,t){var n=new di(t),i=n.norm2(),a=new di(e),o=a.norm2(),s=n.dot(a),u=i*o,f=u?s/u:0;return f},aT=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=Vt(e.filter(function(h){return h.id!==t.id})),s=e.findIndex(function(h){return h.id===t.id}),u=Bm(e,n),f=Fm(u,i,a),l=f[s],c=[];return o.forEach(function(h,d){if(h.id!==t.id){var v=f[d],p=zm(v,l);c.push(p),h.cosineSimilarity=p}}),o.sort(function(h,d){return d.cosineSimilarity-h.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},lz=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}(),cz=function(e,t){return e-t},hz=function(){function r(e){e===void 0&&(e=cz),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}(),dz=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 hz(l);for(Kh(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),Kh(d,s).forEach(function(p){c.insert(p)})),f.has(v)||(f.add(v),Kh(v,s).forEach(function(p){c.insert(p)})))}return n},Tw=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 lz(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},oT=function(e,t,n){var i={prim:dz,kruskal:Tw};return n?i[n](e,t):Tw(e,t)},sT=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=ja(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 b=Kn(y,l,"source"),x=0;x<b.length;++x){var w=b[x],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},vz=-1,Sd=-1,uT="-1",ta="-1",fT=-1,Iw=function(){function r(e,t,n,i){e===void 0&&(e=vz),t===void 0&&(t=Sd),n===void 0&&(n=Sd),i===void 0&&(i=uT),this.id=e,this.from=t,this.to=n,this.label=i}return r}(),pz=function(){function r(e,t){e===void 0&&(e=Sd),t===void 0&&(t=ta),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}(),lT=function(){function r(e,t,n){e===void 0&&(e=Sd),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 pz(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 Iw(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 Iw(e,n,t,i);this.nodeMap[n].addEdge(o),this.edgeLabelMap[i].push(o)}}},r}(),os=function(){function r(e,t,n,i,a){this.fromNode=e,this.toNode=t,this.nodeEdgeNodeLabel={nodeLabel1:n||ta,edgeLabel:i||uT,nodeLabel2:a||ta}}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}(),kw=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 os(e,t,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(e,t){e===void 0&&(e=fT),t===void 0&&(t=!1);var n=new lT(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!==ta&&n.addNode(a,u),l!==ta&&n.addNode(o,l),u!==ta&&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}(),Zc=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}(),gz=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 kw,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(fT,n),a=i.nodeMap,o=new kw,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 os(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,b=n?-1:0,x=function($){if(y)return"break";h.forEach(function(Y){var N=new Zc(Y),P=e.findBackwardEdge(i,N.edges[d[$]],N.edges[d[0]],N);P&&(g[P.label]||(g[P.label]={projected:[],edgeLabel:P.label}),g[P.label].projected.push({graphId:i.id,edge:g,preNode:Y}),m=o.dfsEdgeList[d[$]].fromNode,y=!0)})},w=d.length-1;w>b;w--){var E=x(w);if(E==="break")break}if(y){var _=e.findMinLabel(g);o.dfsEdgeList.push(new os(p,m,ta,_.edgeLabel,ta));var M=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[M]!==o.dfsEdgeList[M]?!1:c(g[_.edgeLabel].projected)}var C={};y=!1;var S=0;h.forEach(function(D){var $=new Zc(D),Y=e.findForwardPureEdges(i,$.edges[d[0]],v,$);Y.length>0&&(y=!0,S=p,Y.forEach(function(N){var P="".concat(N.label,"-").concat(a[N.to].label);C[P]||(C[P]={projected:[],edgeLabel:N.label,nodeLabel2:a[N.to].label}),C[P].projected.push({graphId:i.id,edge:N,preNode:D})}))});for(var A=d.length,T=function($){if(y)return"break";var Y=d[$];h.forEach(function(N){var P=new Zc(N),W=e.findForwardRmpathEdges(i,P.edges[Y],v,P);W.length>0&&(y=!0,S=o.dfsEdgeList[Y].fromNode,W.forEach(function(J){var te="".concat(J.label,"-").concat(a[J.to].label);C[te]||(C[te]={projected:[],edgeLabel:J.label,nodeLabel2:a[J.to].label}),C[te].projected.push({graphId:i.id,edge:J,preNode:N})}))})},w=0;w<A;w++){var k=T(w);if(k==="break")break}if(!y)return!0;var O=e.findMinLabel(C);o.dfsEdgeList.push(new os(S,p+1,ta,O.edgeLabel,O.nodeLabel2));var F=o.dfsEdgeList.length-1;return t.dfsEdgeList[F]!==o.dfsEdgeList[F]?!1:c(C["".concat(O.edgeLabel,"-").concat(O.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(Vt(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 Zc(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(b){var x="".concat(o,"-").concat(b.label,"-").concat(h[b.to].label);u[x]||(u[x]={projected:[],fromNodeId:o,edgeLabel:b.label,nodeLabel2:h[b.to].label}),u[x].projected.push({graphId:l.graphId,edge:b,preNode:l})});for(var m=function(x){var w=t.findForwardRmpathEdges(c,d.edges[a[x]],s,d);w.forEach(function(E){var _="".concat(t.dfsCode.dfsEdgeList[a[x]].fromNode,"-").concat(E.label,"-").concat(h[E.to].label);u[_]||(u[_]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[x]].fromNode,edgeLabel:E.label,nodeLabel2:h[E.to].label}),u[_].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 os(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 os(h,o+1,ta,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 b=m;m=y,y=b}var x=g.label,w="".concat(y,"-").concat(x,"-").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 os(0,1,s,u,f)),e.subGraphMining(o),e.dfsCode.dfsEdgeList.pop()})}},r}(),yz=function(e,t,n,i){var a={};return Object.keys(e).forEach(function(o,s){var u=e[o],f=new lT(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},mz=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},Lw="cluster",bz=function(e){var t=e.graphs,n=e.directed,i=n===void 0?!1:n,a=e.nodeLabelProp,o=a===void 0?Lw:a,s=e.edgeLabelProp,u=s===void 0?Lw:s,f=yz(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 gz(p);g.run();var y=mz(g.frequentSubgraphs,o,u);return y},Nw=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(cT(o,s,u,n,i))}),a},cT=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}},xz=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},Qh=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},Jh=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)},wz=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,b){return l[m]-l[b]}),h=10,d=[];c.forEach(function(m,b){d[b%h]||(d[b%h]={graphs:[],totalCount:0,aveCount:0}),d[b%h].graphs.push(m),d[b%h].totalCount+=l[m]});var v=0,p=[];d.forEach(function(m){var b=m.totalCount/m.graphs.length;m.aveCount=b,p.push(b);var x=0,w=m.length;m.graphs.forEach(function(E,_){var M=l[E];m.graphs.forEach(function(C,S){_!==S&&(x+=Math.abs(M-l[C]))})}),x/=w*(w-1)/2,v+=x}),v/=d.length;var g=0;p.forEach(function(m,b){p.forEach(function(x,w){b!==w&&(g+=Math.abs(m-x))}),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]}},Ow=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}},Dw=function(e,t,n){var i={},a={};return e.forEach(function(o,s){i["".concat(YA)]={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}},Pw=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},Ez=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=Qh(p,o,e,c),v=c[d]}return Jh(v,s,u,f)},Rw=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}},hT=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=bl(e,n),c=bl(t,n),h=Pw(e.nodes,l,n),d=Pw(t.nodes,c,n),v=Ow(e.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,y=Ow(t.nodes,o),m=y.nodeMap,b=y.nodeLabelMap;Dw(e.edges,s,p);var x=Dw(t.edges,s,m).edgeLabelMap,w=[];c==null||c.forEach(function(tt){w=w.concat(tt)}),a||(a=Math.max.apply(Math,Jn(Jn([],w,!1),[2],!1))),i||(i=a);var E=Nw(e,l,o,i),_=Nw(t,c,o,i),M=Math.min(100,f*(f-1)/2),C=xz(i,f,M,E,l),S=Qh(C,E,e),A=10,T=1,k=1,O=4,F={graphs:S,nodeLabelProp:o,edgeLabelProp:s,minSupport:T,minNodeNum:k,maxNodeNum:O,directed:n},D=bz(F).slice(0,A),$=D.length,Y=[];D.forEach(function(tt,ae){Y[ae]={},Object.keys(S).forEach(function(L){var Se=S[L],Ge=Jh(Se,tt,o,s);Y[ae][L]=Ge})});var N=wz(Y,$,D),P=N.structure,W=N.structureCountMap,J=t.nodes[0],te=[],H=(u=t.nodes[0])===null||u===void 0?void 0:u[o],pe=-1/0;t.nodes.forEach(function(tt){var ae=tt[o],L=g[ae];(L==null?void 0:L.length)>pe&&(pe=L.length,te=L,H=ae,J=tt)});var Te={},Ne={},Ze={},at={},nt={},_t={};Object.keys(b).forEach(function(tt,ae){nt[tt]=[],n&&(_t[tt]=[]);var L=b[tt],Se={};L.forEach(function(qe){var et=d["".concat(J.id,"-").concat(qe.id)];if(et&&nt[tt].push(et),Se["".concat(J.id,"-").concat(qe.id)]={start:0,end:m[qe.id].idx,distance:et},n){var gt=d["".concat(qe.id,"-").concat(J.id)];gt&&_t[tt].push(gt)}}),nt[tt]=nt[tt].sort(function(qe,et){return qe-et}),n&&(_t[tt]=_t[tt].sort(function(qe,et){return qe-et})),Ne=Qh(Se,_,t,Ne);var Ge=[];if(Object.keys(Se).forEach(function(qe){if(Ze[qe]){Ge.push(Ze[qe]);return}var et=Ne[qe];Ze[qe]=Jh(et,P,o,s),Ge.push(Ze[qe])}),Ge=Ge.sort(function(qe,et){return et-qe}),at["".concat(J.id,"-").concat(tt)]=Ge,tt!==H)for(var ye=(te==null?void 0:te.length)||0,Ye=function(et){var gt=te[et],Pt=E[p[gt.id].idx],cr=Pt.nodeLabelCountMap[tt],Rt=b[tt].length;if(!cr||cr.count<Rt)return te.splice(et,1),"continue";for(var hr=!1,ur=0;ur<Rt;ur++)if(cr.dists[ur]>nt[tt][ur]){hr=!0;break}if(hr)return te.splice(et,1),"continue";var br={};Pt.neighbors.forEach(function(ar){var $r=h["".concat(gt.id,"-").concat(ar.id)];br["".concat(gt.id,"-").concat(ar.id)]={start:p[gt.id].idx,end:p[ar.id].idx,distance:$r}}),S=Qh(br,E,e,S);var vr=[];Object.keys(br).forEach(function(ar){if(W[ar]){vr.push(W[ar]);return}var $r=S[ar];W[ar]=Jh($r,P,o,s),vr.push(W[ar])}),vr=vr.sort(function(ar,$r){return $r-ar});for(var bn=!1,ur=0;ur<Rt;ur++)if(vr[ur]<Ge[ur]){bn=!0;break}if(bn)return te.splice(et,1),"continue"},We=ye-1;We>=0;We--)Ye(We)});var St=[];te==null||te.forEach(function(tt){for(var ae=p[tt.id].idx,L=cT(e.nodes,l[ae],ae,o,a),Se=L.neighbors,Ge=Se.length,ye=!1,Ye=Ge-1;Ye>=0;Ye--){if(Se.length+1<t.nodes.length){ye=!0;return}var We=Se[Ye],qe=We[o];if(!b[qe]||!b[qe].length){Se.splice(Ye,1);continue}if(!nt[qe]||!nt[qe].length){Se.splice(Ye,1);continue}var et="".concat(tt.id,"-").concat(We.id),gt=h[et],Pt=nt[qe].length-1,cr=nt[qe][Pt];if(gt>cr){Se.splice(Ye,1);continue}if(n){var Rt="".concat(We.id,"-").concat(tt.id),hr=h[Rt];Pt=_t[qe].length-1;var ur=_t[qe][Pt];if(hr>ur){Se.splice(Ye,1);continue}}var br=W[et]?W[et]:Ez(e,tt,We,p,gt,E,P,o,s,W,S),vr="".concat(J.id,"-").concat(qe),bn=at[vr][at[vr].length-1];if(br<bn){Se.splice(Ye,1);continue}var ar=Rw(Te,qe,m,b),$r=ar.minPatternNodeLabelDegree;if(ar.minPatternNodeLabelInDegree,ar.minPatternNodeLabelOutDegree,p[We.id].degree<$r){Se.splice(Ye,1);continue}}ye||St.push({nodes:[tt].concat(Se)})});var fr=ml(t,J.id,!1).length,Ft={};n?(Object.keys(fr).forEach(function(tt){var ae=m[tt].node[o];Ft[ae]?Ft[ae].push(fr[tt]):Ft[ae]=[fr[tt]]}),Object.keys(Ft).forEach(function(tt){Ft[tt].sort(function(ae,L){return ae-L})})):Ft=nt;for(var Yt=St.length,dr=function(ae){var L=St[ae],Se=L.nodes[0],Ge={},ye={};L.nodes.forEach(function(At,pr){ye[At.id]={idx:pr,node:At,degree:0,inDegree:0,outDegree:0};var bt=At[o];Ge[bt]?Ge[bt]++:Ge[bt]=1});var Ye=[],We={};e.edges.forEach(function(At){ye[At.source]&&ye[At.target]&&(Ye.push(At),We[At[s]]?We[At[s]]++:We[At[s]]=1,ye[At.source].degree++,ye[At.target].degree++,ye[At.source].outDegree++,ye[At.target].inDegree++)});for(var qe=Object.keys(x).length,et=!1,gt=0;gt<qe;gt++){var Pt=Object.keys(x)[gt];if(!We[Pt]||We[Pt]<x[Pt].length){et=!0;break}}if(et)return St.splice(ae,1),"continue";var cr=Ye.length;if(cr<t.edges.length)return St.splice(ae,1),"break";for(var Rt=!1,hr=function(pr){var bt=Ye[pr],Ir=bt[s],xn=x[Ir];if(!xn||!xn.length)return We[Ir]--,xn&&We[Ir]<xn.length?(Rt=!0,"break"):(Ye.splice(pr,1),ye[bt.source].degree--,ye[bt.target].degree--,ye[bt.source].outDegree--,ye[bt.target].inDegree--,"continue");var Go=ye[bt.source].node[o],zo=ye[bt.target].node[o],_a=!1;if(xn.forEach(function($o){var jo=m[$o.source].node,Uo=m[$o.target].node;jo[o]===Go&&Uo[o]===zo&&(_a=!0),!n&&jo[o]===zo&&Uo[o]===Go&&(_a=!0)}),!_a)return We[Ir]--,xn&&We[Ir]<xn.length?(Rt=!0,"break"):(Ye.splice(pr,1),ye[bt.source].degree--,ye[bt.target].degree--,ye[bt.source].outDegree--,ye[bt.target].inDegree--,"continue")},gt=cr-1;gt>=0;gt--){var ur=hr(gt);if(ur==="break")break}if(Rt)return St.splice(ae,1),"continue";L.edges=Ye;var br=ml(L,L.nodes[0].id,!1).length;if(Object.keys(br).reverse().forEach(function(At){if(!(At===L.nodes[0].id||Rt)){if(br[At]===1/0){var pr=ye[At].node[o];if(Ge[pr]--,Ge[pr]<b[pr].length){Rt=!0;return}var bt=L.nodes.indexOf(ye[At].node);L.nodes.splice(bt,1),ye[At]=void 0;return}var Ir=p[At].node[o];if(!Ft[Ir]||!Ft[Ir].length||br[At]>Ft[Ir][Ft[Ir].length-1]){var pr=ye[At].node[o];if(Ge[pr]--,Ge[pr]<b[pr].length){Rt=!0;return}var bt=L.nodes.indexOf(ye[At].node);L.nodes.splice(bt,1),ye[At]=void 0}}}),Rt)return St.splice(ae,1),"continue";for(var vr=!0,bn=0;vr&&!Rt;){vr=!1;var ar=n?ye[Se.id].degree<m[J.id].degree||ye[Se.id].inDegree<m[J.id].inDegree||ye[Se.id].outDegree<m[J.id].outDegree:ye[Se.id].degree<m[J.id].degree;if(ar){Rt=!0;break}if(Ge[Se[o]]<b[Se[o]].length){Rt=!0;break}for(var $r=L.nodes.length,bi=$r-1;bi>=0;bi--){var qr=L.nodes[bi],Ka=ye[qr.id].degree,rf=ye[qr.id].inDegree,nf=ye[qr.id].outDegree,un=qr[o],Ea=Rw(Te,un,m,b),Fo=Ea.minPatternNodeLabelDegree,af=Ea.minPatternNodeLabelInDegree,of=Ea.minPatternNodeLabelOutDegree,sf=n?Ka<Fo||rf<af||nf<of:Ka<Fo;if(sf){if(Ge[qr[o]]--,Ge[qr[o]]<b[qr[o]].length){Rt=!0;break}L.nodes.splice(bi,1),ye[qr.id]=void 0,vr=!0}}if(Rt||!vr&&bn!==0)break;cr=Ye.length;for(var xi=cr-1;xi>=0;xi--){var jr=Ye[xi];if(!ye[jr.source]||!ye[jr.target]){Ye.splice(xi,1);var wi=jr[s];if(We[wi]--,ye[jr.source]&&(ye[jr.source].degree--,ye[jr.source].outDegree--),ye[jr.target]&&(ye[jr.target].degree--,ye[jr.target].inDegree--),x[wi]&&We[wi]<x[wi].length){Rt=!0;break}vr=!0}}bn++}if(Rt||Rt||L.nodes.length<t.nodes.length||Ye.length<t.edges.length)return St.splice(ae,1),"continue"},lr=Yt-1;lr>=0;lr--){var jt=dr(lr);if(jt==="break")break}for(var ir=St.length,Hr=function(ae){var L=St[ae],Se={};L.edges.forEach(function(Ye){var We="".concat(Ye.source,"-").concat(Ye.target,"-").concat(Ye.label);Se[We]?Se[We]++:Se[We]=1});for(var Ge=function(We){var qe=St[We],et={};qe.edges.forEach(function(Pt){var cr="".concat(Pt.source,"-").concat(Pt.target,"-").concat(Pt.label);et[cr]?et[cr]++:et[cr]=1});var gt=!0;Object.keys(et).length!==Object.keys(Se).length?gt=!1:Object.keys(Se).forEach(function(Pt){et[Pt]!==Se[Pt]&&(gt=!1)}),gt&&St.splice(We,1)},ye=ir-1;ye>ae;ye--)Ge(ye);ir=St.length},lr=0;lr<=ir-1;lr++)Hr(lr);return St}}},xu=function(){function r(e){e===void 0&&(e=10),this.linkedList=new XA,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}(),dT=Dm;const _z={getAdjMatrix:Ss,breadthFirstSearch:WA,connectedComponent:Nm,getDegree:ja,getInDegree:HA,getOutDegree:qA,detectCycle:Dm,detectDirectedCycle:dT,detectAllCycles:KA,detectAllDirectedCycle:Rm,detectAllUndirectedCycle:Pm,depthFirstSearch:Om,dijkstra:ml,findAllPath:eT,findShortestPath:JA,floydWarshall:bl,labelPropagation:tT,louvain:Gm,iLouvain:rT,kCore:nT,kMeans:iT,cosineSimilarity:zm,nodesCosineSimilarity:aT,minimumSpanningTree:oT,pageRank:sT,getNeighbors:Kn,Stack:xu,GADDI:hT},Sz=Object.freeze(Object.defineProperty({__proto__:null,GADDI:hT,Stack:xu,breadthFirstSearch:WA,connectedComponent:Nm,cosineSimilarity:zm,default:_z,depthFirstSearch:Om,detectAllCycles:KA,detectAllDirectedCycle:Rm,detectAllUndirectedCycle:Pm,detectCycle:Dm,detectDirectedCycle:dT,dijkstra:ml,findAllPath:eT,findShortestPath:JA,floydWarshall:bl,getAdjMatrix:Ss,getDegree:ja,getInDegree:HA,getNeighbors:Kn,getOutDegree:qA,iLouvain:rT,kCore:nT,kMeans:iT,labelPropagation:tT,louvain:Gm,minimumSpanningTree:oT,nodesCosineSimilarity:aT,pageRank:sT},Symbol.toStringTag,{value:"Module"}));var Md=yi,Mz=function(e){return function(t,n){return t[e]-n[e]}},Bw=function(e,t,n){return e>=t&&e<=n},wv=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!Bw(v,0,1)||!Bw(p,0,1)?null:{x:e.x+v*s.x,y:e.y+v*s.y}}return null},vT=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=wv(f[h-1],f[h],l,t),!c);h++);return c},pT=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)}},gT=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)}},Su=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]),bv(i,i,t),{x:i[0],y:i[1]}},yT=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=ym([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 bv(a,a,i),{x:a[0],y:a[1]}},M0=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}},Cd=function(e,t){var n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)},Cz=function(e,t){var n=[];return e.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*t)}),n.push(a)}),n},Az=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},Tz=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},mT=function(e,t){e.translate(t.x,t.y)},C0=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=Md(a,[["t",d-c,v-h]]),c=d,h=v,{matrix:a}},i)}else{var p=Md(a,[["t",s,u]]);e.setMatrix(p)}},Iz=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var i=t;pt(t)||(i=[t,t]),pt(t)&&t.length===1&&(i=[t[0],t[0]]),n=Md(n,[["s",i[0],i[1]]]),e.setMatrix(n)},kz=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=Md(n,[["r",t]]),e.setMatrix(n)},Lz=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 Nz(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 xl=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(Nz(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},bT=function(e,t){return!(t.minX>e.maxX||t.maxX<e.minX||t.minY>e.maxY||t.maxY<e.minY)},Oz=function(e,t){var n=!1;return me(e,function(i){if(wv(i.from,i.to,t.from,t.to))return n=!0,!1}),n},xT=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],b=h[v-1];d.push({from:{x:b[0],y:b[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(!bT(a,o))return!1;var s=!1;if(me(t,function(c){if(xl(e,c[0],c[1]))return s=!0,!1}),s||(me(e,function(c){if(xl(t,c[0],c[1]))return s=!0,!1}),s))return!0;var u=i(e),f=i(t),l=!1;return me(f,function(c){if(Oz(u,c))return l=!0,!1}),l},Ms=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}(),$m=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]},Dz=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},wT=function(e,t){for(var n=["top","left","bottom","right"],i=e.getBBox(),a=0,o=[],s=0;s<4;s++){var u=$m(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3];o[s]=wv({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]},jm=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=$m(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3],d=Dz(t,new Ms(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},ET=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}},Ad=function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)},_T=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},A0=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)},ST=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},Pz=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(Lm(f,[0,0]))return NaN;var l=[-f[1],f[0]];_o(l,l);var c=[s-n,u-i];return Math.abs(km(c,l))},Um=function(e,t,n){return e+(t-e)*n},T0=function(e,t,n){for(var i=Math.min(e.length,t.length),a=new Array(i),o=0;o<i;o++)a[o]=Um(e[o],t[o],n);return a};const Rz=Object.freeze(Object.defineProperty({__proto__:null,Line:Ms,applyMatrix:Su,compare:Mz,distance:Cd,floydWarshall:Az,fractionToLine:jm,getAdjMatrix:Tz,getBBoxBoundLine:$m,getCircleCenterByPoints:M0,getCircleIntersectByPoint:pT,getDegree:Lz,getEllipseIntersectByPoint:gT,getLineIntersect:wv,getPointsCenter:ET,getRectIntersectByPoint:vT,intersectBBox:bT,invertMatrix:yT,isPointInPolygon:xl,isPointsOverlap:A0,isPolygonsIntersect:xT,itemIntersectByLine:wT,lerp:Um,lerpArray:T0,move:C0,pointLineDistance:Pz,pointLineSquareDist:_T,pointRectSquareDist:ST,rotate:kz,scale:Iz,scaleMatrix:Cz,squareDist:Ad,translate:mT},Symbol.toStringTag,{value:"Module"}));var no="rgb(95, 149, 255)",Bz="rgb(255, 255, 255)",Fw="rgb(0, 0, 0)",dg="rgb(247, 250, 255)",MT="rgb(239, 244, 255)",Kc="rgb(253, 253, 253)",Gw="rgb(250, 250, 250)",Qc="rgb(224, 224, 224)",zw="rgb(234, 234, 234)",Fz="rgb(245, 245, 245)",Gz="rgb(191, 213, 255)",$w="#4572d9",zz="rgb(223, 234, 255)",rr={mainStroke:no,mainFill:MT,activeStroke:no,activeFill:dg,inactiveStroke:Gz,inactiveFill:dg,selectedStroke:no,selectedFill:Bz,highlightStroke:$w,highlightFill:zz,disableStroke:Qc,disableFill:Gw,edgeMainStroke:Qc,edgeActiveStroke:no,edgeInactiveStroke:zw,edgeSelectedStroke:no,edgeHighlightStroke:no,edgeDisableStroke:Fz,comboMainStroke:Qc,comboMainFill:Kc,comboActiveStroke:no,comboActiveFill:dg,comboInactiveStroke:Qc,comboInactiveFill:Kc,comboSelectedStroke:no,comboSelectedFill:Kc,comboHighlightStroke:$w,comboHighlightFill:Kc,comboDisableStroke:zw,comboDisableFill:Gw};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:rr.mainStroke,fill:MT},size:20,color:rr.mainStroke,linkPoints:{size:8,lineWidth:1,fill:rr.activeFill,stroke:rr.activeStroke}},nodeStateStyles:{active:{fill:rr.activeFill,stroke:rr.activeStroke,lineWidth:2,shadowColor:rr.mainStroke,shadowBlur:10},selected:{fill:rr.selectedFill,stroke:rr.selectedStroke,lineWidth:4,shadowColor:rr.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:rr.highlightFill,stroke:rr.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:rr.inactiveFill,stroke:rr.inactiveStroke,lineWidth:1},disable:{fill:rr.disableFill,stroke:rr.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:Fw,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:rr.edgeMainStroke,lineAppendWidth:2},color:rr.edgeMainStroke},edgeStateStyles:{active:{stroke:rr.edgeActiveStroke,lineWidth:1},selected:{stroke:rr.edgeSelectedStroke,lineWidth:2,shadowColor:rr.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:rr.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:rr.edgeInactiveStroke,lineWidth:1},disable:{stroke:rr.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:Fw,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:rr.comboMainFill,lineWidth:1,stroke:rr.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:rr.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:rr.comboActiveStroke,lineWidth:1,fill:rr.comboActiveFill},selected:{stroke:rr.comboSelectedStroke,lineWidth:2,fill:rr.comboSelectedFill,shadowColor:rr.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:rr.comboHighlightStroke,lineWidth:2,fill:rr.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:rr.comboInactiveStroke,fill:rr.comboInactiveFill,lineWidth:1},disable:{stroke:rr.comboDisableStroke,fill:rr.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"},$z={" ":.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 Zi=Math.PI,I0=Math.sin,k0=Math.cos,hn=I0(Zi/8),dn=k0(Zi/8),Td=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=Su(i,o),a=Su(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}},CT=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*hn,m=p*dn,b=g*hn,x=g*dn,w=a.get("type"),E=Math.min(d/2,v/2),_=Math.min(d,v),M=s!=null&&s.pointPadding?Math.min(_,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]+b,l[1]-x]):(c=[l[0]-M,l[1]-d],h=[l[0]+M,l[1]-d]);break;case"top-right":p=d,g=v,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]+y,l[1]-m],h=[l[0]+x,l[1]-b]):(c=[l[0]+v-M,l[1]-d],h=[l[0]+v,l[1]-d+M]);break;case"right":p=v,g=v,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]+m,l[1]-y],h=[l[0]+x,l[1]+b]):(c=[l[0]+v,l[1]-M],h=[l[0]+v,l[1]+M]);break;case"bottom-right":p=v,g=d,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]+m,l[1]+y],h=[l[0]+b,l[1]+x]):(c=[l[0]+v,l[1]+d-M],h=[l[0]+v-M,l[1]+d]);break;case"bottom":p=d,g=d,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]+y,l[1]+m],h=[l[0]-b,l[1]+x]):(c=[l[0]-M,l[1]+d],h=[l[0]+M,l[1]+d]);break;case"bottom-left":p=d,g=v,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]-y,l[1]+m],h=[l[0]-x,l[1]+b]):(c=[l[0]-v,l[1]+d-M],h=[l[0]-v+M,l[1]+d]);break;case"left":p=v,g=v,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]-m,l[1]+y],h=[l[0]-x,l[1]-b]):(c=[l[0]-v,l[1]-M],h=[l[0]-v,l[1]+M]);break;case"top-left":p=v,g=d,w==="circle"?(y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]-m,l[1]-y],h=[l[0]-b,l[1]-x]):(c=[l[0]-v+M,l[1]-d],h=[l[0]-v,l[1]-d+M]);break;default:p=v,g=v,y=p*hn,m=p*dn,b=g*hn,x=g*dn,c=[l[0]-y,l[1]-m],h=[l[0]+b,l[1]-x]}if(s.clockwise===!1){var C=[c[0],c[1]];c=[h[0],h[1]],h=[C[0],C[1]]}}var S=[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 k=An([0,0],S,A),O=[l[0]+k[0],l[1]+k[1]],F=[h[0]-l[0],h[1]-l[1]],D=An([0,0],F,T),$=[l[0]+D[0],l[1]+D[1]];return e.startPoint={x:c[0],y:c[1]},e.endPoint={x:h[0],y:h[1]},e.controlPoints=[{x:O[0],y:O[1]},{x:$[0],y:$[1]}],e},AT=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+=Zi*2),n&&(u.x+=k0(l)*n,u.y+=I0(l)*n),i){var c=l-Zi/2;l>1/2*Zi&&l<3*1/2*Zi&&(c-=Zi),u.x+=k0(c)*i,u.y+=I0(c)*i}var h={x:u.x,y:u.y,angle:l};return a?(l>.5*Zi&&l<1.5*Zi&&(l-=Zi),B({rotate:l},h)):h},jz=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},Uz=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"&&jz(e,null,-1,t)},Ki=function(e,t){typeof t=="function"&&Uz(e,null,-1,t)},TT=function(e,t){return t*($z[e]||1)},IT=function(e,t){var n=0,i=new RegExp("[一-龥]+");return e.split("").forEach(function(a){i.test(a)?n+=t:n+=TT(a,t)}),[n,t]},kT=function(e,t){return typeof t!="number"||t<=0||t>=e.length?e:e.substring(0,t)+"..."},L0=function(e,t){var n=[],i={},a={};e.forEach(function(u){a[u.id]=u}),e.forEach(function(u,f){var l=Vt(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(Pe(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},N0=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},ed=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=pt(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 b=m.getCanvasBBox();b.x&&i.minX>b.minX&&(i.minX=b.minX),b.y&&i.minY>b.minY&&(i.minY=b.minY),b.x&&i.maxX<b.maxX&&(i.maxX=b.maxX),b.y&&i.maxY<b.maxY&&(i.maxY=b.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},Xz=function(e){var t=ht(e.x)||ht(e.y)||e.type||e.anchorPoints||e.size;return e.style&&(t=t||ht(e.style.r)||ht(e.style.width)||ht(e.style.height)||ht(e.style.rx)||ht(e.style.ry)),t},td=function(e){var t={};return Object.keys(e).forEach(function(n){var i=e[n];if(!(n==="img"&&!Pe(i)))if(yn(i)&&!pt(i)){var a={};Object.keys(i).forEach(function(o){var s=i[o];o==="img"&&!Pe(s)||(a[o]=Vt(s))}),t[n]=a}else t[n]=Vt(i)}),t},wl=function(e){var t=e.animateCfg,n=e.callback,i;if(!t)i={duration:500,callback:n};else if(i=Vt(t),t.callback){var a=t.callback;i.callback=function(){n(),a()}}else i.callback=n;return i};const Yz=Object.freeze(Object.defineProperty({__proto__:null,cloneBesidesImg:td,getAnimateCfgWithCallback:wl,getBBox:Td,getComboBBox:ed,getLabelPosition:AT,getLetterWidth:TT,getLoopCfgs:CT,getTextSize:IT,plainCombosToTrees:L0,reconstructTree:N0,shouldRefreshEdge:Xz,traverseTree:Cn,traverseTreeUp:Ki,truncateLabelByLength:kT},Symbol.toStringTag,{value:"Module"}));var jw=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 Pe(h.id)?!0:(o=!1,!1)}),o}var s=(t||[]).find(function(h){return!Pe(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=Jn(Jn([],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},Wz=function(e,t){if(e==="node"||e==="combo"){if(t.id&&!Pe(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},Vz=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;me(e,function(t){me(t,function(n,i){Pe(n)&&(t[i]={type:n})})})},r.prototype.setBehaviors=function(e){var t=this.graph,n=this.modes[e],i=[],a;me(n||[],function(o){var s=gm.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 me(t,function(n){e.indexOf(n)<0&&(Pe(n)&&(n={type:n}),e.push(n))}),e},r.filterBehaviors=function(e,t){var n=[];return e.forEach(function(i){var a="";Pe(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}),me(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(pt(e)?a=e:a=[e],pt(t))return me(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){Pe(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}(),rl=`
2
2
  \v\f\r   ᠎              \u2028\u2029`,Hz=new RegExp("([a-z])["+rl+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+rl+"]*,?["+rl+"]*)+)","ig"),qz=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+rl+"]*,?["+rl+"]*","ig"),wu=function(r){if(!r)return null;if(pt(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(Hz,function(n,i,a){var o=[],s=i.toLowerCase();if(a.replace(qz,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},O0=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},Jc=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},D0=function(r){if(r=wu(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(O0(u,f));break;case"O":e.pop(),u=Jc(t,n,c[1],c[2]),u.push(u[0]),e=e.concat(u);break;case"U":e.pop(),e=e.concat(Jc(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(O0(u,f)),l=["R"].concat(c.slice(-2));else if(s==="O")e.pop(),u=Jc(t,n,c[1],c[2]),u.push(u[0]),e=e.concat(u);else if(s==="U")e.pop(),e=e.concat(Jc(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},eh=function(r,e,t,n){return[r,e,t,n,t,n]},Uw=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]},LT=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(Ne,Ze,at){var nt=Ne*Math.cos(at)-Ze*Math.sin(at),_t=Ne*Math.sin(at)+Ze*Math.cos(at);return{x:nt,y:_t}};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 b=(r-s)/2,x=(e-u)/2,w=b*b/(t*t)+x*x/(n*n);w>1&&(w=Math.sqrt(w),t=w*t,n=w*n);var E=t*t,_=n*n,M=(a===o?-1:1)*Math.sqrt(Math.abs((E*_-E*x*x-_*b*b)/(E*x*x+_*b*b)));g=M*t*x/n+(r+s)/2,y=M*-n*b/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 S=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=LT(s,u,t,n,i,0,o,A,T,[p,S,g,y])}C=p-v;var k=Math.cos(v),O=Math.sin(v),F=Math.cos(p),D=Math.sin(p),$=Math.tan(C/4),Y=4/3*t*$,N=4/3*n*$,P=[r,e],W=[r+Y*O,e-N*k],J=[s+Y*D,u-N*F],te=[s,u];if(W[0]=2*P[0]-W[0],W[1]=2*P[1]-W[1],f)return[W,J,te].concat(h);h=[W,J,te].concat(h).join().split(",");for(var H=[],pe=0,Te=h.length;pe<Te;pe++)H[pe]=pe%2?m(h[pe-1],h[pe],c).y:m(h[pe],h[pe+1],c).x;return H},P0=function(r,e){var t=D0(r),n=e&&D0(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(b,x,w){var E,_;if(!b)return["C",x.x,x.y,x.x,x.y,x.x,x.y];switch(!(b[0]in{T:1,Q:1})&&(x.qx=x.qy=null),b[0]){case"M":x.X=b[1],x.Y=b[2];break;case"A":b=["C"].concat(LT.apply(0,[x.x,x.y].concat(b.slice(1))));break;case"S":w==="C"||w==="S"?(E=x.x*2-x.bx,_=x.y*2-x.by):(E=x.x,_=x.y),b=["C",E,_].concat(b.slice(1));break;case"T":w==="Q"||w==="T"?(x.qx=x.x*2-x.qx,x.qy=x.y*2-x.qy):(x.qx=x.x,x.qy=x.y),b=["C"].concat(Uw(x.x,x.y,x.qx,x.qy,b[1],b[2]));break;case"Q":x.qx=b[1],x.qy=b[2],b=["C"].concat(Uw(x.x,x.y,b[1],b[2],b[3],b[4]));break;case"L":b=["C"].concat(eh(x.x,x.y,b[1],b[2]));break;case"H":b=["C"].concat(eh(x.x,x.y,b[1],x.y));break;case"V":b=["C"].concat(eh(x.x,x.y,x.x,b[1]));break;case"Z":b=["C"].concat(eh(x.x,x.y,x.X,x.Y));break}return b},h=function(b,x){if(b[x].length>7){b[x].shift();for(var w=b[x];w.length;)o[x]="A",n&&(s[x]="A"),b.splice(x++,0,["C"].concat(w.splice(0,6)));b.splice(x,1),l=Math.max(t.length,n&&n.length||0)}},d=function(b,x,w,E,_){b&&x&&b[_][0]==="M"&&x[_][0]!=="M"&&(x.splice(_,0,["M",E.x,E.y]),w.bx=0,w.by=0,w.x=b[_][1],w.y=b[_][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},Zz=/,?([a-z]),?/gi,NT=function(r){return r.join(",").replace(Zz,"$1")},Xw=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},Yw=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=Xw(p,r,t,i,o),y=Xw(p,e,n,a,s),m=g*g+y*y;d+=h[v]*Math.sqrt(m)}return f*d},Kz=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 b=u.length,x=b,w;b--;)d=u[b],w=1-d,f[0][b]=w*w*w*r+3*w*w*d*t+3*w*d*d*i+d*d*d*o,f[1][b]=w*w*w*e+3*w*w*d*n+3*w*d*d*a+d*d*d*s;return f[0][x]=r,f[1][x]=e,f[0][x+1]=o,f[1][x+1]=s,f[0].length=f[1].length=x+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])}}},Qz=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}}}},io=function(r,e,t){return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height},OT=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=NT,a},R0=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:OT(r,e,t,n),vb:[r,e,t,n].join(" ")}},Jz=function(r,e){return r=R0(r),e=R0(e),io(e,r.x,r.y)||io(e,r.x2,r.y)||io(e,r.x,r.y2)||io(e,r.x2,r.y2)||io(r,e.x,e.y)||io(r,e.x2,e.y)||io(r,e.x,e.y2)||io(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)},Ww=function(r,e,t,n,i,a,o,s){pt(r)||(r=[r,e,t,n,i,a,o,s]);var u=Kz.apply(null,r);return R0(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},Vw=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),b=n+2*u*(a-n)+h*(s-2*a+n),x=f*r+u*t,w=f*e+u*n,E=f*i+u*o,_=f*a+u*s,M=90-Math.atan2(g-m,y-b)*180/Math.PI;return{x:v,y:p,m:{x:g,y},n:{x:m,y:b},start:{x,y:w},end:{x:E,y:_},alpha:M}},e8=function(r,e,t){var n=Ww(r),i=Ww(e);if(!Jz(n,i))return t?0:[];for(var a=Yw.apply(0,r),o=Yw.apply(0,e),s=~~(a/8),u=~~(o/8),f=[],l=[],c={},h=t?0:[],d=0;d<s+1;d++){var v=Vw.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=Vw.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],b=l[p+1],x=Math.abs(y.x-g.x)<.001?"y":"x",w=Math.abs(b.x-m.x)<.001?"y":"x",E=Qz(g.x,g.y,y.x,y.y,m.x,m.y,b.x,b.y);if(E){if(c[E.x.toFixed(4)]===E.y.toFixed(4))continue;c[E.x.toFixed(4)]=E.y.toFixed(4);var _=g.t+Math.abs((E[x]-g[x])/(y[x]-g[x]))*(y.t-g.t),M=m.t+Math.abs((E[w]-m[w])/(b[w]-m[w]))*(b.t-m.t);_>=0&&_<=1&&M>=0&&M<=1&&(t?h+=1:h.push({x:E.x,y:E.y,t1:_,t2:M}))}}return h},t8=function(r,e,t){r=P0(r),e=P0(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 b=e[y];if(b[0]==="M")a=f=b[1],o=l=b[2];else{b[0]==="C"?(h=[a,o].concat(b.slice(1)),a=h[6],o=h[7]):(h=[a,o,a,o,f,l,f,l],a=f,o=l);var x=e8(c,h,t);if(t)d+=x;else{for(var w=0,E=x.length;w<E;w++)x[w].segment1=v,x[w].segment2=y,x[w].bez1=c,x[w].bez2=h;d=d.concat(x)}}}}}return d},r8=function(r,e){return t8(r,e)};function n8(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 i8(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=n8(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 a8=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(i8(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},o8=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(a8(r[c],r[c+1],l))},[]);return u.unshift(r[0]),(e[n]==="Z"||e[n]==="z")&&u.push("Z"),u},s8=function(r,e){if(r.length!==e.length)return!1;var t=!0;return me(r,function(n,i){if(n!==e[i])return t=!1,!1}),t};function u8(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 f8=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],s8(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]=u8(l,c,h)}}return s},DT=function(r,e){var t=f8(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 vg(r,e,t){for(var n=[].concat(r),i,a=1/(t+1),o=PT(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 PT(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 B0=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=PT(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=vg(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=vg(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=vg(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 l8=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:O0,fillPath:o8,fillPathByDiff:DT,formatPath:B0,intersection:r8,parsePathArray:NT,parsePathString:wu,pathToAbsolute:D0,pathToCurve:P0,rectPath:OT},Symbol.toStringTag,{value:"Module"}));var RT=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 BT(r,e){var t=r.indexOf(e);t!==-1&&r.splice(t,1)}var Hw=typeof window<"u"&&typeof window.document<"u";function FT(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 F0(r){return r.cfg.visible&&r.cfg.capture}var c8=function(r){kt(e,r);function e(t){var n=r.call(this)||this;n.destroyed=!1;var i=n.getDefaultCfg();return n.cfg=yt(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}(OC),qw=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))},h8=function(){function r(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"}return r}(),d8=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return r}(),v8=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}(),p8=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),g8=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),y8=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,m8=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Zw=3,b8=[["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",y8]],Kw=[["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 GT(r){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new g8:typeof navigator<"u"?w8(navigator.userAgent):_8()}function x8(r){return r!==""&&b8.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 w8(r){var e=x8(r);if(!e)return null;var t=e[0],n=e[1];if(t==="searchbot")return new p8;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Zw&&(i=qw(qw([],i,!0),S8(Zw-i.length),!0)):i=[];var a=i.join("."),o=E8(r),s=m8.exec(r);return s&&s[1]?new v8(t,a,o,s[1]):new h8(t,a,o)}function E8(r){for(var e=0,t=Kw.length;e<t;e++){var n=Kw[e],i=n[0],a=n[1],o=a.exec(r);if(o)return i}return null}function _8(){var r=typeof process<"u"&&process.version;return r?new d8(process.version.slice(1)):null}function S8(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}function Qw(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],b=e[7],x=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+b*o+x*f,t[7]=m*i+b*s+x*l,t[8]=m*a+b*u+x*c,t}function hs(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 zT(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=yi,pg="matrix",M8=["zIndex","capture","visible","type"],C8=["repeat"],A8=":",T8="*";function I8(r){for(var e=[],t=0;t<r.length;t++)pt(r[t])?e.push([].concat(r[t])):e.push(r[t]);return e}function k8(r,e){var t={},n=e.attrs;for(var i in r)t[i]=n[i];return t}function L8(r,e){var t={},n=e.attr();return me(r,function(i,a){C8.indexOf(a)===-1&&!Mo(n[a],i)&&(t[a]=i)}),t}function N8(r,e){if(e.onFrame)return r;var t=e.startTime,n=e.delay,i=e.duration,a=Object.prototype.hasOwnProperty;return me(r,function(o){t+n<o.startTime+o.delay+o.duration&&i>o.delay&&me(e.toAttrs,function(s,u){a.call(o.toAttrs,u)&&(delete o.toAttrs[u],delete o.fromAttrs[u])})}),r}var $T=function(r){kt(e,r);function e(t){var n=r.call(this,t)||this;n.attrs={};var i=n.getDefaultAttrs();return yt(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(yn(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?(BT(n.getChildren(),this),n.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},e.prototype.resetMatrix=function(){this.attr(pg,this.getDefaultMatrix()),this.onCanvasChange("matrix")},e.prototype.getMatrix=function(){return this.attr(pg)},e.prototype.setMatrix=function(t){this.attr(pg,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=Qw(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=Qw(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?hs(n,t):t},e.prototype.invertFromMatrix=function(t){var n=this.attr("matrix");if(n){var i=zT(n);if(i)return hs(i,t)}return t},e.prototype.setClip=function(t){var n=this.getCanvas(),i=null;if(t){var a=this.getShapeBase(),o=Nu(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={};me(n,function(s,u){pt(n[u])?i[u]=I8(n[u]):i[u]=n[u]});var a=this.constructor,o=new a({attrs:i});return me(M8,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?Uf:l,h=t[4],d=h===void 0?0:h,v,p,g,y,m;Mr(o)?(v=o,o={}):yn(o)&&o.onFrame&&(v=o.onFrame,p=o.repeat),yn(s)?(m=s,s=m.duration,f=m.easing||"easeLinear",d=m.delay||0,p=m.repeat||p||!1,c=m.callback||Uf,g=m.pauseCallback||Uf,y=m.resumeCallback||Uf):(ht(c)&&(d=c,c=null),Mr(f)?(c=f,f="easeLinear"):f=f||"easeLinear");var b=L8(o,this),x={fromAttrs:k8(b,this),toAttrs:b,duration:s,easing:f,repeat:p,callback:c,pauseCallback:g,resumeCallback:y,delay:d,startTime:i.getTime(),id:da(),onFrame:v,pathFormatted:!1};a.length>0?a=N8(a,x):i.addAnimator(this),a.push(x),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");me(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 me(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 me(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&&FT(h,o))return"break";pt(d)?me(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+A8+i.type;(a[o]||a[T8])&&(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}(c8),Jw={},G0="_INDEX";function jT(r,e){if(r.set("canvas",e),r.isGroup()){var t=r.get("children");t.length&&t.forEach(function(n){jT(n,e)})}}function UT(r,e){if(r.set("timeline",e),r.isGroup()){var t=r.get("children");t.length&&t.forEach(function(n){UT(n,e)})}}function O8(r,e,t){e.set("parent",null),e.set("canvas",null),BT(r.getChildren(),e)}function D8(r){return function(e,t){var n=r(e,t);return n===0?e[G0]-t[G0]:n}}var XT=function(r){kt(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?me(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?me(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();me(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];yn(i)?a=i:a.type=i;var o=Jw[a.type];o||(o=Nu(a.type),Jw[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(Mr(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(!F0(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(F0(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&&O8(o,t),t.set("parent",this),n&&jT(t,n),a&&UT(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();me(t,function(n,i){return n[G0]=i,n}),t.sort(D8(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 me(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 me(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}($T),Ou=0,Yf=0,Cf=0,YT=1e3,Id,Wf,kd=0,Cs=0,Ev=0,El=typeof performance=="object"&&performance.now?performance:Date,WT=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function VT(){return Cs||(WT(P8),Cs=El.now()+Ev)}function P8(){Cs=0}function z0(){this._call=this._time=this._next=null}z0.prototype=HT.prototype={constructor:z0,restart:function(r,e,t){if(typeof r!="function")throw new TypeError("callback is not a function");t=(t==null?VT():+t)+(e==null?0:+e),!this._next&&Wf!==this&&(Wf?Wf._next=this:Id=this,Wf=this),this._call=r,this._time=t,$0()},stop:function(){this._call&&(this._call=null,this._time=1/0,$0())}};function HT(r,e,t){var n=new z0;return n.restart(r,e,t),n}function R8(){VT(),++Ou;for(var r=Id,e;r;)(e=Cs-r._time)>=0&&r._call.call(null,e),r=r._next;--Ou}function eE(){Cs=(kd=El.now())+Ev,Ou=Yf=0;try{R8()}finally{Ou=0,F8(),Cs=0}}function B8(){var r=El.now(),e=r-kd;e>YT&&(Ev-=e,kd=r)}function F8(){for(var r,e=Id,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:Id=t);Wf=r,$0(n)}function $0(r){if(!Ou){Yf&&(Yf=clearTimeout(Yf));var e=r-Cs;e>24?(r<1/0&&(Yf=setTimeout(eE,r-El.now()-Ev)),Cf&&(Cf=clearInterval(Cf))):(Cf||(kd=El.now(),Cf=setInterval(B8,YT)),Ou=1,WT(eE))}}function Xm(r,e,t){r.prototype=e.prototype=t,t.constructor=r}function qT(r,e){var t=Object.create(r.prototype);for(var n in e)t[n]=e[n];return t}function Ul(){}var _l=.7,Ld=1/_l,Mu="\\s*([+-]?\\d+)\\s*",Sl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",G8=/^#([0-9a-f]{3,8})$/,z8=new RegExp(`^rgb\\(${Mu},${Mu},${Mu}\\)$`),$8=new RegExp(`^rgb\\(${fa},${fa},${fa}\\)$`),j8=new RegExp(`^rgba\\(${Mu},${Mu},${Mu},${Sl}\\)$`),U8=new RegExp(`^rgba\\(${fa},${fa},${fa},${Sl}\\)$`),X8=new RegExp(`^hsl\\(${Sl},${fa},${fa}\\)$`),Y8=new RegExp(`^hsla\\(${Sl},${fa},${fa},${Sl}\\)$`),tE={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};Xm(Ul,Ml,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:rE,formatHex:rE,formatHex8:W8,formatHsl:V8,formatRgb:nE,toString:nE});function rE(){return this.rgb().formatHex()}function W8(){return this.rgb().formatHex8()}function V8(){return ZT(this).formatHsl()}function nE(){return this.rgb().formatRgb()}function Ml(r){var e,t;return r=(r+"").trim().toLowerCase(),(e=G8.exec(r))?(t=e[1].length,e=parseInt(e[1],16),t===6?iE(e):t===3?new Fn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?th(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?th(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=z8.exec(r))?new Fn(e[1],e[2],e[3],1):(e=$8.exec(r))?new Fn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=j8.exec(r))?th(e[1],e[2],e[3],e[4]):(e=U8.exec(r))?th(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=X8.exec(r))?sE(e[1],e[2]/100,e[3]/100,1):(e=Y8.exec(r))?sE(e[1],e[2]/100,e[3]/100,e[4]):tE.hasOwnProperty(r)?iE(tE[r]):r==="transparent"?new Fn(NaN,NaN,NaN,0):null}function iE(r){return new Fn(r>>16&255,r>>8&255,r&255,1)}function th(r,e,t,n){return n<=0&&(r=e=t=NaN),new Fn(r,e,t,n)}function H8(r){return r instanceof Ul||(r=Ml(r)),r?(r=r.rgb(),new Fn(r.r,r.g,r.b,r.opacity)):new Fn}function j0(r,e,t,n){return arguments.length===1?H8(r):new Fn(r,e,t,n==null?1:n)}function Fn(r,e,t,n){this.r=+r,this.g=+e,this.b=+t,this.opacity=+n}Xm(Fn,j0,qT(Ul,{brighter(r){return r=r==null?Ld:Math.pow(Ld,r),new Fn(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?_l:Math.pow(_l,r),new Fn(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new Fn(gs(this.r),gs(this.g),gs(this.b),Nd(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:aE,formatHex:aE,formatHex8:q8,formatRgb:oE,toString:oE}));function aE(){return`#${ds(this.r)}${ds(this.g)}${ds(this.b)}`}function q8(){return`#${ds(this.r)}${ds(this.g)}${ds(this.b)}${ds((isNaN(this.opacity)?1:this.opacity)*255)}`}function oE(){const r=Nd(this.opacity);return`${r===1?"rgb(":"rgba("}${gs(this.r)}, ${gs(this.g)}, ${gs(this.b)}${r===1?")":`, ${r})`}`}function Nd(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function gs(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function ds(r){return r=gs(r),(r<16?"0":"")+r.toString(16)}function sE(r,e,t,n){return n<=0?r=e=t=NaN:t<=0||t>=1?r=e=NaN:e<=0&&(r=NaN),new ki(r,e,t,n)}function ZT(r){if(r instanceof ki)return new ki(r.h,r.s,r.l,r.opacity);if(r instanceof Ul||(r=Ml(r)),!r)return new ki;if(r instanceof ki)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 ki(o,s,u,r.opacity)}function Z8(r,e,t,n){return arguments.length===1?ZT(r):new ki(r,e,t,n==null?1:n)}function ki(r,e,t,n){this.h=+r,this.s=+e,this.l=+t,this.opacity=+n}Xm(ki,Z8,qT(Ul,{brighter(r){return r=r==null?Ld:Math.pow(Ld,r),new ki(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?_l:Math.pow(_l,r),new ki(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 Fn(gg(r>=240?r-240:r+120,i,n),gg(r,i,n),gg(r<120?r+240:r-120,i,n),this.opacity)},clamp(){return new ki(uE(this.h),rh(this.s),rh(this.l),Nd(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=Nd(this.opacity);return`${r===1?"hsl(":"hsla("}${uE(this.h)}, ${rh(this.s)*100}%, ${rh(this.l)*100}%${r===1?")":`, ${r})`}`}}));function uE(r){return r=(r||0)%360,r<0?r+360:r}function rh(r){return Math.max(0,Math.min(1,r||0))}function gg(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 Ym=r=>()=>r;function K8(r,e){return function(t){return r+t*e}}function Q8(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?KT:function(e,t){return t-e?Q8(e,t,r):Ym(isNaN(e)?t:e)}}function KT(r,e){var t=e-r;return t?K8(r,t):Ym(isNaN(r)?e:r)}const fE=function r(e){var t=J8(e);function n(i,a){var o=t((i=j0(i)).r,(a=j0(a)).r),s=t(i.g,a.g),u=t(i.b,a.b),f=KT(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 QT(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 JT(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function e$(r,e){return(JT(e)?QT:eI)(r,e)}function eI(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]=Od(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 t$(r,e){var t=new Date;return r=+r,e=+e,function(n){return t.setTime(r*(1-n)+e*n),t}}function U0(r,e){return r=+r,e=+e,function(t){return r*(1-t)+e*t}}function r$(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]=Od(r[i],e[i]):n[i]=e[i];return function(a){for(i in t)n[i]=t[i](a);return n}}var X0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yg=new RegExp(X0.source,"g");function n$(r){return function(){return r}}function i$(r){return function(e){return r(e)+""}}function a$(r,e){var t=X0.lastIndex=yg.lastIndex=0,n,i,a,o=-1,s=[],u=[];for(r=r+"",e=e+"";(n=X0.exec(r))&&(i=yg.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:U0(n,i)})),t=yg.lastIndex;return t<e.length&&(a=e.slice(t),s[o]?s[o]+=a:s[++o]=a),s.length<2?u[0]?i$(u[0].x):n$(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 Od(r,e){var t=typeof e,n;return e==null||t==="boolean"?Ym(e):(t==="number"?U0:t==="string"?(n=Ml(e))?(e=n,fE):a$:e instanceof Ml?fE:e instanceof Date?t$:JT(e)?QT:Array.isArray(e)?eI:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?r$:U0)(r,e)}function o$(r){return+r}function s$(r){return r*r}function u$(r){return r*(2-r)}function lE(r){return((r*=2)<=1?r*r:--r*(2-r)+1)/2}function f$(r){return r*r*r}function l$(r){return--r*r*r+1}function cE(r){return((r*=2)<=1?r*r*r:(r-=2)*r*r+2)/2}var Wm=3,c$=function r(e){e=+e;function t(n){return Math.pow(n,e)}return t.exponent=r,t}(Wm),h$=function r(e){e=+e;function t(n){return 1-Math.pow(1-n,e)}return t.exponent=r,t}(Wm),hE=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}(Wm),tI=Math.PI,rI=tI/2;function d$(r){return+r==1?1:1-Math.cos(r*rI)}function v$(r){return Math.sin(r*rI)}function dE(r){return(1-Math.cos(tI*r))/2}function Co(r){return(Math.pow(2,-10*r)-.0009765625)*1.0009775171065494}function p$(r){return Co(1-+r)}function g$(r){return 1-Co(r)}function vE(r){return((r*=2)<=1?Co(1-r):2-Co(r-1))/2}function y$(r){return 1-Math.sqrt(1-r*r)}function m$(r){return Math.sqrt(1- --r*r)}function pE(r){return((r*=2)<=1?1-Math.sqrt(1-r*r):Math.sqrt(1-(r-=2)*r)+1)/2}var Y0=4/11,b$=6/11,x$=8/11,w$=3/4,E$=9/11,_$=10/11,S$=15/16,M$=21/22,C$=63/64,nh=1/Y0/Y0;function A$(r){return 1-Cl(1-r)}function Cl(r){return(r=+r)<Y0?nh*r*r:r<x$?nh*(r-=b$)*r+w$:r<_$?nh*(r-=E$)*r+S$:nh*(r-=M$)*r+C$}function T$(r){return((r*=2)<=1?1-Cl(1-r):Cl(r-1)+1)/2}var Vm=1.70158,I$=function r(e){e=+e;function t(n){return(n=+n)*n*(e*(n-1)+n)}return t.overshoot=r,t}(Vm),k$=function r(e){e=+e;function t(n){return--n*n*((n+1)*e+n)+1}return t.overshoot=r,t}(Vm),gE=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}(Vm),Du=2*Math.PI,Hm=1,qm=.3,L$=function r(e,t){var n=Math.asin(1/(e=Math.max(1,e)))*(t/=Du);function i(a){return e*Co(- --a)*Math.sin((n-a)/t)}return i.amplitude=function(a){return r(a,t*Du)},i.period=function(a){return r(e,a)},i}(Hm,qm),yE=function r(e,t){var n=Math.asin(1/(e=Math.max(1,e)))*(t/=Du);function i(a){return 1-e*Co(a=+a)*Math.sin((a+n)/t)}return i.amplitude=function(a){return r(a,t*Du)},i.period=function(a){return r(e,a)},i}(Hm,qm),N$=function r(e,t){var n=Math.asin(1/(e=Math.max(1,e)))*(t/=Du);function i(a){return((a=a*2-1)<0?e*Co(-a)*Math.sin((n-a)/t):2-e*Co(a)*Math.sin((n+a)/t))/2}return i.amplitude=function(a){return r(a,t*Du)},i.period=function(a){return r(e,a)},i}(Hm,qm);const O$=Object.freeze(Object.defineProperty({__proto__:null,easeBack:gE,easeBackIn:I$,easeBackInOut:gE,easeBackOut:k$,easeBounce:Cl,easeBounceIn:A$,easeBounceInOut:T$,easeBounceOut:Cl,easeCircle:pE,easeCircleIn:y$,easeCircleInOut:pE,easeCircleOut:m$,easeCubic:cE,easeCubicIn:f$,easeCubicInOut:cE,easeCubicOut:l$,easeElastic:yE,easeElasticIn:L$,easeElasticInOut:N$,easeElasticOut:yE,easeExp:vE,easeExpIn:p$,easeExpInOut:vE,easeExpOut:g$,easeLinear:o$,easePoly:hE,easePolyIn:c$,easePolyInOut:hE,easePolyOut:h$,easeQuad:lE,easeQuadIn:s$,easeQuadInOut:lE,easeQuadOut:u$,easeSin:dE,easeSinIn:d$,easeSinInOut:dE,easeSinOut:v$},Symbol.toStringTag,{value:"Module"}));var D$={};function P$(r){return D$[r.toLowerCase()]||O$[r]}var R$=function(r){return["fill","stroke","fillStyle","strokeStyle"].includes(r)},B$=function(r){return/^[r,R,L,l]{1}[\s]*\(/.test(r)},mE=[1,0,0,0,1,0,0,0,1];function F$(r,e,t){var n={},i=e.fromAttrs,a=e.toAttrs;if(!r.destroyed){var o;for(var s in a)if(!Mo(i[s],a[s]))if(s==="path"){var u=a[s],f=i[s];u.length>f.length?(u=wu(a[s]),f=wu(i[s]),f=DT(f,u),f=B0(f,u),e.fromAttrs.path=f,e.toAttrs.path=u):e.pathFormatted||(u=wu(a[s]),f=wu(i[s]),f=B0(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++)ht(c[v])&&h&&ht(h[v])?(o=Od(h[v],c[v]),d.push(o(t))):d.push(c[v]);n[s].push(d)}}else if(s==="matrix"){var p=e$(i[s]||mE,a[s]||mE),g=p(t);n[s]=g}else R$(s)&&B$(a[s])?n[s]=a[s]:Mr(a[s])||(o=Od(i[s],a[s]),n[s]=o(t));r.attr(n)}}function G$(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=P$(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 F$(r,e,a);return!1}var z$=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=HT(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=G$(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}(),$$=40,bE=0,xE=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function wE(r,e,t){t.name=e,t.target=r,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}function j$(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&&FT(r,n)){t.bubbles=!1;return}t.name=e,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}}var U$=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");me(xE,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");me(xE,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 RT(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===bE&&(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===bE){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>$$?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,wE(i,e,s);for(var u=i.getParent();u;)u.emitDelegation(e,s),s.propagationStopped||j$(u,e,s),s.propagationPath.push(u),u=u.getParent()}else{var f=this.canvas;wE(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}(),EE="px",_E=GT(),X$=_E&&_E.name==="firefox",nI=function(r){kt(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");Pe(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 U$({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new z$(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,n){var i=this.get("el");Hw&&(i.style.width=t+EE,i.style.height=n+EE)},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");Hw&&n&&(n.style.cursor=t)},e.prototype.getPointByEvent=function(t){var n=this.get("supportCSSTransform");if(n){if(X$&&!ct(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!ct(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}(XT),iI=function(r){kt(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}(XT),aI=function(r){kt(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=hs(n,[t.minX,t.minY]),f=hs(n,[t.maxX,t.minY]),l=hs(n,[t.minX,t.maxY]),c=hs(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,b=i-v+g,x=o+v+g,w=a-v+m,E=s+v+m;i=Math.min(i,b),o=Math.max(o,x),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}($T),oI=new Map;function ya(r,e){oI.set(r,e)}function sI(r){return oI.get(r)}function uI(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 fI(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 rd(r,e){return Math.abs(r-e)<.001}function Ku(r,e){var t=ha(r),n=ha(e),i=ca(r),a=ca(e);return{x:t,y:n,width:i-t,height:a-n}}function _v(r){return(r+Math.PI*2)%(Math.PI*2)}const gn={box:function(r,e,t,n){return Ku([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(Lm(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(km(u,s))},tangentAngle:function(r,e,t,n){return Math.atan2(n-e,t-r)}};var Y$=1e-4;function lI(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<Y$);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 b=[i.apply(null,r.concat([m])),i.apply(null,e.concat([m]))],x=Tn(u[0],u[1],b[0],b[1]);m<=1&&x<s?(o=m,s=x):c*=.5}}return{x:i.apply(null,r.concat([o])),y:i.apply(null,e.concat([o]))}}function W$(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 vo(r,e,t,n){var i=1-n;return i*i*r+2*n*i*e+n*n*t}function SE(r,e,t){var n=r+t-2*e;if(rd(n,0))return[.5];var i=(r-e)/n;return i<=1&&i>=0?[i]:[]}function ME(r,e,t,n){return 2*(1-n)*(e-r)+2*n*(t-e)}function cI(r,e,t,n,i,a,o){var s=vo(r,t,i,o),u=vo(e,n,a,o),f=gn.pointAt(r,e,t,n,o),l=gn.pointAt(t,n,i,a,o);return[[r,e,f.x,f.y,s,u],[s,u,l.x,l.y,i,a]]}function W0(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=cI(r,e,t,n,i,a,.5),u=s[0],f=s[1];return u.push(o-1),f.push(o-1),W0.apply(null,u)+W0.apply(null,f)}const hI={box:function(r,e,t,n,i,a){var o=SE(r,t,i)[0],s=SE(e,n,a)[0],u=[r,i],f=[e,a];return o!==void 0&&u.push(vo(r,t,i,o)),s!==void 0&&f.push(vo(e,n,a,s)),Ku(u,f)},length:function(r,e,t,n,i,a){return W0(r,e,t,n,i,a,3)},nearestPoint:function(r,e,t,n,i,a,o,s){return lI([r,t,i],[e,n,a],o,s,vo)},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:vo,pointAt:function(r,e,t,n,i,a,o){return{x:vo(r,t,i,o),y:vo(e,n,a,o)}},divide:function(r,e,t,n,i,a,o){return cI(r,e,t,n,i,a,o)},tangentAngle:function(r,e,t,n,i,a,o){var s=ME(r,t,i,o),u=ME(e,n,a,o),f=Math.atan2(u,s);return _v(f)}};function po(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 CE(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 mg(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(rd(i,0))rd(a,0)||(u=-o/a,u>=0&&u<=1&&s.push(u));else{var c=a*a-4*i*o;rd(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 dI(r,e,t,n,i,a,o,s,u){var f=po(r,t,i,o,u),l=po(e,n,a,s,u),c=gn.pointAt(r,e,t,n,u),h=gn.pointAt(t,n,i,a,u),d=gn.pointAt(i,a,o,s,u),v=gn.pointAt(c.x,c.y,h.x,h.y,u),p=gn.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 V0(r,e,t,n,i,a,o,s,u){if(u===0)return W$([r,t,i,o],[e,n,a,s]);var f=dI(r,e,t,n,i,a,o,s,.5),l=f[0],c=f[1];return l.push(u-1),c.push(u-1),V0.apply(null,l)+V0.apply(null,c)}const nl={extrema:mg,box:function(r,e,t,n,i,a,o,s){for(var u=[r,o],f=[e,s],l=mg(r,t,i,o),c=mg(e,n,a,s),h=0;h<l.length;h++)u.push(po(r,t,i,o,l[h]));for(var h=0;h<c.length;h++)f.push(po(e,n,a,s,c[h]));return Ku(u,f)},length:function(r,e,t,n,i,a,o,s){return V0(r,e,t,n,i,a,o,s,3)},nearestPoint:function(r,e,t,n,i,a,o,s,u,f,l){return lI([r,t,i,o],[e,n,a,s],u,f,po,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:po,pointAt:function(r,e,t,n,i,a,o,s,u){return{x:po(r,t,i,o,u),y:po(e,n,a,s,u)}},divide:function(r,e,t,n,i,a,o,s,u){return dI(r,e,t,n,i,a,o,s,u)},tangentAngle:function(r,e,t,n,i,a,o,s,u){var f=CE(r,t,i,o,u),l=CE(e,n,a,s,u);return _v(Math.atan2(l,f))}};function AE(r,e){var t=Math.abs(r);return e>0?t:t*-1}const V$={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,b=(d-h)*Math.pow(Math.sin(v),3)/s,x=p-m,w=g-b,E=l-m,_=c-b,M=Math.hypot(w,x),C=Math.hypot(_,E),S=M*Math.asin((x*_-w*E)/(M*C)),A=S/Math.sqrt(h+d-p*p-g*g);v+=A,v=Math.min(Math.PI/2,Math.max(0,v))}return{x:r+AE(p,u),y:e+AE(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 _v(o)}};function H$(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 q$(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 Z$(r,e,t){return Math.atan(-e/r*Math.tan(t))}function K$(r,e,t){return Math.atan(e/(r*Math.tan(t)))}function TE(r,e,t,n,i,a){return t*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+r}function IE(r,e,t,n,i,a){return t*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+e}function Q$(r,e,t,n){var i=Math.atan2(n*r,t*e);return(i+Math.PI*2)%(Math.PI*2)}function kE(r,e,t){return{x:r*Math.cos(t),y:e*Math.sin(t)}}function LE(r,e,t){var n=Math.cos(t),i=Math.sin(t);return[r*n-e*i,r*i+e*n]}const J$={box:function(r,e,t,n,i,a,o){for(var s=Z$(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=TE(r,e,t,n,i,l[c]);d<u&&(u=d),d>f&&(f=d)}for(var v=K$(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 b=IE(r,e,t,n,i,y[c]);b<p&&(p=b),b>g&&(g=b)}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=LE(s-r,u-e,-i),l=f[0],c=f[1],h=V$.nearestPoint(0,0,t,n,l,c),d=Q$(t,n,h.x,h.y);d<a?h=kE(t,n,a):d>o&&(h=kE(t,n,o));var v=LE(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:TE(r,e,t,n,i,u),y:IE(r,e,t,n,i,u)}},tangentAngle:function(r,e,t,n,i,a,o,s){var u=(o-a)*s+a,f=H$(r,e,t,n,i,a,o,u),l=q$(r,e,t,n,i,a,o,u);return _v(Math.atan2(l,f))}};function vI(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 ej(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 tj(r,e){if(e>1||e<0||r.length<2)return null;var t=vI(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=gn.pointAt(f[0],f[1],l[0],l[1],h);break}a+=c}return o}function rj(r,e){if(e>1||e<0||r.length<2)return 0;for(var t=vI(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 nj(r,e,t){for(var n=1/0,i=0;i<r.length-1;i++){var a=r[i],o=r[i+1],s=gn.pointDistance(a[0],a[1],o[0],o[1],e,t);s<n&&(n=s)}return n}const pI={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 Ku(e,t)},length:function(r){return ej(r)},pointAt:function(r,e){return tj(r,e)},pointDistance:function(r,e,t){return nj(r,e,t)},tangentAngle:function(r,e){return rj(r,e)}};function NE(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 Zm(r,e){var t=r.get("startArrowShape"),n=r.get("endArrowShape"),i=null,a=null;return t&&(i=t.getCanvasBBox(),e=NE(e,i)),n&&(a=n.getCanvasBBox(),e=NE(e,a)),e}function ij(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=Ku(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=Zm(r,h),{x:h.minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}}function aj(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 Ku(n,i)}var bg=null;function gI(){if(!bg){var r=document.createElement("canvas");r.width=1,r.height=1,bg=r.getContext("2d")}return bg}function yI(r,e,t){var n=1;if(Pe(r)&&(n=r.split(`
3
3
  `).length),n>1){var i=oj(e,t);return e*n+i*(n-1)}return e}function oj(r,e){return e?e-r:r*.14}function sj(r,e){var t=gI(),n=0;if(ct(r)||r==="")return n;if(t.save(),t.font=e,Pe(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 Ra({container:i,width:s.right-s.left,height:s.bottom-s.top});Xt(u.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",jl(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,b=NM(n,["position","offsetX","offsetY"]),x=n.height,w=x===void 0?"fit-content":x,E=n.width,_=E===void 0?i.getWidth():E;w==="100%"&&(w=c),_==="100%"&&(_=h);var M="unset",C="unset",S={};switch(v){case"right":M="".concat(c,"px"),S={top:0,right:0},S.right+=s+g,S.top+=f+m;break;case"bottom":C="".concat(h,"px"),S={bottom:0,left:0},S.left+=s+g,S.bottom+=f+m;break;case"top":C="".concat(h,"px");case"left":M="".concat(c,"px");default:S={top:0,left:0},S.left+=s+g,S.top+=f+m;break}Object.keys(S).forEach(function(T){S[T]="".concat(S[T],"px")});var A=Er("<div class='".concat(n.className," g6-annotation-container'></div>"));return Xt(A,fi(fi({position:"absolute",display:v==="top"||v==="bottom"?"inline-flex":"unset",width:ht(_)?"".concat(_,"px"):_,height:ht(w)?"".concat(w,"px"):w,maxHeight:M,maxWidth:C,overflow:"scroll"},S),b)),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=as(g.left),m=as(g.top),b=p.getBoundingClientRect(),x=b.width,w=b.height,E=y,_=m;y+x>h-f&&(E=h-f-x),y<0&&(E=0),m+w>d-l&&(_=d-l-w),m<0&&(_=0),Xt(p,{left:"".concat(E,"px"),top:"".concat(_,"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,b=c.y,x=c.title,w=c.content,E=c.maxTitleLength,_=c.defaultBegin,M=NM(c,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),C=o.get("linkGroup"),S=this.get("rows")||[[]],A=(i=t.isCanvas)===null||i===void 0?void 0:i.call(t),T=A?OM:t.getID(),k=s[T]||{},O=k.card,F=k.link,D=k.x,$=k.y,Y=k.title,N=k.content,P=this.get("getTitle"),W=this.get("getContent"),J=this.get("getContentPlaceholder")||function(){return""},te=this.get("getTitlePlaceHolder")||function(){return""},H=J(t),pe=te(t),Te=Er(this.getDOMContent(fi({itemId:T,collapsed:y,title:((a=Y||x||(P==null?void 0:P(t)))===null||a===void 0?void 0:a.substr(0,E))||pe,content:N||w||(W==null?void 0:W(t))||H},M))),Ne=ht(h)?"".concat(h,"px"):h;Xt(Te,{minHeight:y?"unset":Ne,minWidth:ht(d)?"".concat(d,"px"):d,height:p,width:v});var Ze=!!O;Ze?(F==null||F.remove(!0),f.replaceChild(Te,O)):f.appendChild(Te);var at;if(!l){if(at=f.getBoundingClientRect()||{},m!==void 0&&b!==void 0)D=m,$=b;else if(!Ze&&!A){var nt=at.top,_t=_||{},St=_t.left,fr=_t.right,Ft=fr===void 0?16:fr,Yt=_t.top,dr=Yt===void 0?8:Yt,lr=_t.bottom,jt=Ft,ir=dr;isNaN(St)||(jt=f.scrollWidth-St),isNaN(lr)||(ir=f.scrollHeight-lr);var Hr=ht(d)?d:100;D=f.scrollWidth-Te.scrollWidth-(S.length-1)*Hr-jt;var tt=S[S.length-1],ae=(tt[tt.length-1]||{}).bbox;$=(ae==null?void 0:ae.bottom)-nt||ir}Xt(Te,{position:"absolute",left:"".concat(D,"px"),top:"".concat($,"px"),cusor:l?"unset":"move"})}this.bindListener(Te,T);var L=Te.getBoundingClientRect();if(!A){var Se=w0(t,L,u,this.get("canvas")),Ge=this.get("linkStyle");F=C.addShape("path",{attrs:fi({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:Se},Ge)})}if(s[T]=fi(fi({},s[T]||{}),{id:T,collapsed:y,card:Te,link:F,x:D,y:$,cardBBox:L,content:N||w,title:Y||x,contentPlaceholder:H,titlePlaceholder:pe,isCanvas:A}),o.set("cardInfoMap",s),l)this.updateCardPositionsInConatainer(),this.updateLinks();else{var ye=!isNaN(m)&&!isNaN(b);if(!Ze&&!A&&!ye){var Ye=at.bottom,We=Ye===void 0?0:Ye,nt=at.top;S[S.length-1].push({id:T,bbox:L}),L.top>We-nt-L.height-16&&S.push([]),this.set("rows",S)}}this.updateCardSize(T);var qe=this.get("onAnnotationChange");qe==null||qe(s[T],Ze?"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=as(o.paddingLeft)+as(o.paddingRight);a-=s,Object.values(t).forEach(function(u){var f=u.card,l=f.getBoundingClientRect().width;switch(i){case"right":Xt(f,{marginLeft:a?"".concat(a-l,"px"):"0px"});break;case"top":case"bottom":Xt(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]=fi(fi({},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;Xt(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",b=Er("<".concat(m,' class="').concat(d,'-input" type="textarea" style="width:').concat(p,"px; height: ").concat(g,'px; min-width: 16px;"/>')),x=Er('<div class="'.concat(d,'-input-wrapper" style="width: ').concat(p,"px; height: ").concat(g,"px; min-width: 16px; margin-right: ").concat(y.marginRight,'" />'));x.appendChild(b),h.parentNode.replaceChild(x,h);var w=f[n],E=w.contentPlaceholder,_=w.titlePlaceholder,M=w.content,C=w.title,S=M;d==="g6-annotation-title"?(b.name="title",b.maxLength=c,S=C):b.name="content",S?(b.innerHTML=h.innerHTML,b.value=h.innerHTML):b.placeholder=d==="g6-annotation-title"?_:E,b.focus(),b.addEventListener("blur",function(A){b.value&&(h.innerHTML=b.value,w[b.name||"title"]=b.value),x.parentNode.replaceChild(h,x),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:as(l.left),top:as(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,b=c-v;p+=m,g+=b;var x=i.get("graph"),w=x.getPointByCanvas(0,0),E=x.getPointByCanvas(x.getWidth(),x.getHeight()),_=x.getClientByPoint(w.x,w.y),M=_.x,C=_.y,S=x.getClientByPoint(E.x,E.y),A=S.x,T=S.y,k=y.getBoundingClientRect(),O=k.right-k.left,F=k.bottom-k.top;(p>A-M-O&&m>0||p<0&&m<0)&&(p-=m),(g>T-C-F&&b>0||g<0&&b<0)&&(g-=b),Xt(y,{left:"".concat(p,"px"),top:"".concat(g,"px"),visibility:"hidden"}),d=l,v=c;var D=(f[n]||{}).link;if(D){var $=x.findById(n);D.attr("path",w0($,k,x,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,Xt(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=as(s.marginLeft),f=o.getBoundingClientRect().width;Xt(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=w0(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===OM&&(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}(jn),Wde=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=_n.getControlPoint(n,i,.5,o);return[["M",n.x,n.y],["Q",s.x,s.y,i.x,i.y]]},w0=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 S=o[C],A=S.x,T=S.y,k=n.getClientByPoint(A,T);o[C]=i.getPointByClient(k.x,k.y)});var g=t.top,y=g===void 0?0:g,m=t.left,b=m===void 0?0:m,x=t.right,w=x===void 0?0:x,E=t.bottom,_=E===void 0?0:E,M={left:i.getPointByClient(b,(y+_)/2),right:i.getPointByClient(w,(y+_)/2),top:i.getPointByClient((b+w)/2,y),bottom:i.getPointByClient((b+w)/2,_)};return Wde(o,M)},as=function(e){return Number(e.replace(/\s+|px/gi,""))||0},Hn={PluginBase:jn,Menu:Dce,Grid:Ice,Minimap:zce,Bundling:Uce,ToolBar:Hce,Tooltip:Zce,Fisheye:Yce,TimeBar:Ide,ImageMinimap:Ode,EdgeFilterLens:Rde,SnapLine:zde,Legend:Ude,Annotation:Yde};Xa("circle",{options:{size:Qe.defaultNode.size,style:{x:0,y:0,stroke:Qe.defaultNode.style.stroke,fill:Qe.defaultNode.style.fill,lineWidth:Qe.defaultNode.style.lineWidth},labelCfg:{style:{fill:Qe.nodeLabel.style.fill,fontSize:Qe.nodeLabel.style.fontSize,fontFamily:Qe.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Qe.defaultNode.linkPoints.size,lineWidth:Qe.defaultNode.linkPoints.lineWidth,fill:Qe.defaultNode.linkPoints.fill,stroke:Qe.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:B({},Qe.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=yr({},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:B({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:B({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=nn(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:B(B({},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:B(B({},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:B(B({},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:B(B({},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=yr({},t,n),a=this.getSize(e),o=a[0]/2,s=B({x:0,y:0,r:o},i);return s},update:function(e,t,n){var i=t.getContainer(),a=this.getSize(e),o=B({},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");Xa("rect",{options:{size:[100,30],style:{radius:0,stroke:Qe.defaultNode.style.stroke,fill:Qe.defaultNode.style.fill,lineWidth:Qe.defaultNode.style.lineWidth},labelCfg:{style:{fill:Qe.nodeLabel.style.fill,fontSize:Qe.nodeLabel.style.fontSize,fontFamily:Qe.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Qe.defaultNode.linkPoints.size,lineWidth:Qe.defaultNode.linkPoints.lineWidth,fill:Qe.defaultNode.linkPoints.fill,stroke:Qe.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:B({},Qe.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=nn(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:B(B({},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:B(B({},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:B(B({},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:B(B({},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=yt({},t,n),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],u=B({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=yt({},a,s.attr(),u);f=yt(f,e.style),this.updateShape(e,t,f,!1,n),this.updateLinkPoints(e,i)}},"single-node");Xa("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:Qe.defaultNode.style.stroke,fill:Qe.defaultNode.style.fill,lineWidth:Qe.defaultNode.style.lineWidth},labelCfg:{style:{fill:Qe.nodeLabel.style.fill,fontSize:Qe.nodeLabel.style.fontSize,fontFamily:Qe.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Qe.defaultNode.linkPoints.size,lineWidth:Qe.defaultNode.linkPoints.lineWidth,fill:Qe.defaultNode.linkPoints.fill,stroke:Qe.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:B({},Qe.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:B({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:B({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=nn(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:B(B({},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:B(B({},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:B(B({},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:B(B({},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=yt({},t,n),a=this.getSize(e),o=a[0]/2,s=a[1]/2,u=B({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=yt({},a,u.attr(),s);f=yt(f,e.style),this.updateShape(e,t,f,!0,n),this.updateLinkPoints(e,i)}},"single-node");Xa("diamond",{options:{size:[80,80],style:{stroke:Qe.defaultNode.style.stroke,fill:Qe.defaultNode.style.fill,lineWidth:Qe.defaultNode.style.lineWidth},labelCfg:{style:{fill:Qe.nodeLabel.style.fill,fontSize:Qe.nodeLabel.style.fontSize,fontFamily:Qe.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Qe.defaultNode.linkPoints.size,lineWidth:Qe.defaultNode.linkPoints.lineWidth,fill:Qe.defaultNode.linkPoints.fill,stroke:Qe.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:B({},Qe.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:B({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:B({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=nn(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:B(B({},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:B(B({},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:B(B({},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:B(B({},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=yt({},t,n),a=this.getPath(e),o=B({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=yt({},a,u.attr(),s);f=yt(f,e.style),this.updateShape(e,t,f,!0,n),this.updateLinkPoints(e,i)}},"single-node");Xa("triangle",{options:{size:40,direction:"up",style:{stroke:Qe.defaultNode.style.stroke,fill:Qe.defaultNode.style.fill,lineWidth:Qe.defaultNode.style.lineWidth},labelCfg:{style:{fill:Qe.nodeLabel.style.fill,fontSize:Qe.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Qe.defaultNode.linkPoints.size,lineWidth:Qe.defaultNode.linkPoints.lineWidth,fill:Qe.defaultNode.linkPoints.fill,stroke:Qe.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:B({},Qe.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:B({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:B({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=nn(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),b=g*Math.sin(1/3*Math.PI);s==="up"?y=[-b,m]:s==="down"?y=[-b,-m]:s==="left"&&(y=[-b,b-m]),y&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:B(B({},v),{x:y[0],y:y[1],r:h/2||d||5}),className:"link-point-left",name:"link-point-left"}))}if(l){var x=null,m=g*Math.sin(1/3*Math.PI),b=g*Math.sin(1/3*Math.PI);s==="up"?x=[b,m]:s==="down"?x=[b,-m]:s==="right"&&(x=[b,b-m]),x&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:B(B({},v),{x:x[0],y:x[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),b=g*Math.sin(1/3*Math.PI);s==="up"?w=[b-m,-m]:s==="left"?w=[b,-m]:s==="right"&&(w=[-b,-m]),w&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:B(B({},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),b=g*Math.sin(1/3*Math.PI);s==="down"?E=[-b+m,m]:s==="left"?E=[b,m]:s==="right"&&(E=[-b,m]),E&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:B(B({},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=yt({},t,n),a=this.getPath(e),o=B({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=yt({},a,u.attr(),s);f=yt(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(D){return D.get("className")==="link-point-left"}),u=t.shapeMap["link-point-right"]||t.find(function(D){return D.get("className")==="link-point-right"}),f=t.shapeMap["link-point-top"]||t.find(function(D){return D.get("className")==="link-point-top"}),l=t.shapeMap["link-point-bottom"]||t.find(function(D){return D.get("className")==="link-point-bottom"}),c=i,h=s||u||f||l;h&&(c=h.attr());var d=yt({},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},b=m.left,x=m.right,w=m.top,E=m.bottom,_=this.getSize(e),M=_[0],C={r:y,fill:v,stroke:p,lineWidth:g},S=null,A=M*Math.sin(1/3*Math.PI),T=M*Math.sin(1/3*Math.PI);o==="up"?S=[-T,A]:o==="down"?S=[-T,-A]:o==="left"&&(S=[-T,T-A]),S&&(s?!b&&b!==void 0?(s.remove(),delete t.shapeMap["link-point-left"]):s.attr(B(B({},C),{x:S[0],y:S[1]})):b&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:B(B({},C),{x:S[0],y:S[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var k=null;o==="up"?k=[T,A]:o==="down"?k=[T,-A]:o==="right"&&(k=[T,T-A]),k&&(u?!x&&x!==void 0?(u.remove(),delete t.shapeMap["link-point-right"]):u.attr(B(B({},C),{x:k[0],y:k[1]})):x&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:B(B({},C),{x:k[0],y:k[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var O=null;o==="up"?O=[T-A,-A]:o==="left"?O=[T,-A]:o==="right"&&(O=[-T,-A]),O&&(f?!w&&w!==void 0?(f.remove(),delete t.shapeMap["link-point-top"]):f.attr(B(B({},C),{x:O[0],y:O[1]})):w&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:B(B({},C),{x:O[0],y:O[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var F=null;o==="down"?F=[-T+A,A]:o==="left"?F=[T,A]:o==="right"&&(F=[-T,A]),F&&(l?!E&&E!==void 0?(l.remove(),delete t.shapeMap["link-point-bottom"]):l.attr(B(B({},C),{x:F[0],y:F[1]})):E&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:B(B({},C),{x:F[0],y:F[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node");Xa("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:Qe.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:Qe.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:Qe.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=nn(i,["show"]);return l&&(t.shapeMap["pre-rect"]=t.addShape("rect",{attrs:B({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=nn(i,["width","height","x","y","offset","text"]);h?t.shapeMap["rect-logo-icon"]=t.addShape("text",{attrs:B({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:B(B({},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=nn(i,["width","height","x","y","offset","text"]);h?t.shapeMap["rect-state-icon"]=t.addShape("text",{attrs:B({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:B(B({},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=nn(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:B(B({},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:B(B({},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:B(B({},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:B(B({},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 Pe(e.description)?(h=t.addShape("text",{attrs:B(B({},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:B(B({},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:B(B({},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=yt({},t,n),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],u=B({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(B(B({},a),{x:-c/2,y:-h/2,width:c,height:h}));var v=t.getContainer(),p=v.shapeMap["rect-logo-icon"]||v.find(function(Te){return Te.get("className")==="rect-logo-icon"}),g=p?p.attr():{},y=yt({},g,e.logoIcon),m=y.width;m===void 0&&(m=this.options.logoIcon.width);var b=e.logoIcon?e.logoIcon.show:void 0,x=s.offset,w=-c/2+m+x;!b&&b!==void 0&&(w=-c/2+x);var E=v.shapeMap["node-label"]||v.find(function(Te){return Te.get("className")==="node-label"}),_=v.shapeMap["rect-description"]||v.find(function(Te){return Te.get("className")==="rect-description"});if(e.label)if(!E)v.shapeMap["node-label"]=v.addShape("text",{attrs:B(B({},s.style),{x:w,y:e.description?-5:7,text:e.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});else{var M=e.labelCfg?e.labelCfg.style:{},C=yt({},E.attr(),M);e.label&&(C.text=e.label),C.x=w,Pe(e.description)&&(C.y=-5),_&&(_.resetMatrix(),_.attr({x:w})),E.resetMatrix(),E.attr(C)}if(Pe(e.description)){var S=f.paddingTop;if(!_)v.shapeMap["rect-description"]=v.addShape("text",{attrs:B(B({},f.style),{x:w,y:17+(S||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0});else{var M=e.descriptionCfg?e.descriptionCfg.style:{},A=yt({},_.attr(),M);Pe(e.description)&&(A.text=e.description),A.x=w,_.resetMatrix(),_.attr(B(B({},A),{y:17+(S||0)}))}}var T=v.shapeMap["pre-rect"]||v.find(function(Te){return Te.get("className")==="pre-rect"});if(T&&!T.destroyed){var k=yt({},T.attr(),e.preRect);T.attr(B(B({},k),{x:-c/2,y:-h/2,height:h}))}if(p&&!p.destroyed)if(!b&&b!==void 0)p.remove(),delete v.shapeMap["pre-rect"];else{var O=y.width,F=y.height,D=y.x,$=y.y,Y=y.offset,N=nn(y,["width","height","x","y","offset"]);p.attr(B(B({},N),{x:D||-c/2+O+Y,y:$||-F/2,width:O,height:F}))}else b&&this.drawLogoIcon(e,v);var P=v.shapeMap["rect-state-icon"]||v.find(function(Te){return Te.get("className")==="rect-state-icon"}),W=P?P.attr():{},J=yt({},W,e.stateIcon);if(P){!J.show&&J.show!==void 0&&(P.remove(),delete v.shapeMap["rect-state-icon"]);var te=J.width,F=J.height,D=J.x,$=J.y,H=J.offset,pe=nn(J,["width","height","x","y","offset"]);P.attr(B(B({},pe),{x:D||c/2-te+H,y:$||-F/2,width:te,height:F}))}else J.show&&this.drawStateIcon(e,v);this.updateLinkPoints(e,v)},getOptions:function(e,t){return t==="move"?e:yr({},this.options,this.getCustomConfig(e)||{},e)}},"single-node");Xa("star",{options:{size:60,style:{stroke:Qe.defaultNode.style.stroke,fill:Qe.defaultNode.style.fill,lineWidth:Qe.defaultNode.style.lineWidth},labelCfg:{style:{fill:Qe.nodeLabel.style.fill,fontSize:Qe.nodeLabel.style.fontSize,fontFamily:Qe.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Qe.defaultNode.linkPoints.size,lineWidth:Qe.defaultNode.linkPoints.lineWidth,fill:Qe.defaultNode.linkPoints.fill,stroke:Qe.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:B({},Qe.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:B({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:B({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=nn(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:B(B({},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:B(B({},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:B(B({},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:B(B({},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:B(B({},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 _n.getStarPath(n,a)},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=yt({},t,n),a=this.getPath(e),o=B({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=yt({},a,u.attr(),s);f=yt(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=yt({},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,b=g.top,x=g.leftBottom,w=g.rightBottom,E=this.getSize(e),_=E[0],M={r:p,fill:h,stroke:d,lineWidth:v},C=Math.cos((18+72*0)/180*Math.PI)*_,S=Math.sin((18+72*0)/180*Math.PI)*_;a?!m&&m!==void 0?(a.remove(),delete t.shapeMap["link-point-right"]):a.attr(B(B({},M),{x:C,y:-S})):m&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:B(B({},M),{x:C,y:-S}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),C=Math.cos((18+72*1)/180*Math.PI)*_,S=Math.sin((18+72*1)/180*Math.PI)*_,o?!b&&b!==void 0?(o.remove(),delete t.shapeMap["link-point-top"]):o.attr(B(B({},M),{x:C,y:-S})):b&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:B(B({},M),{x:C,y:-S}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),C=Math.cos((18+72*2)/180*Math.PI)*_,S=Math.sin((18+72*2)/180*Math.PI)*_,i?!y&&y!==void 0?(i.remove(),delete t.shapeMap["link-point-left"]):i.attr(B(B({},M),{x:C,y:-S})):y&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:B(B({},M),{x:C,y:-S}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),C=Math.cos((18+72*3)/180*Math.PI)*_,S=Math.sin((18+72*3)/180*Math.PI)*_,s?!x&&x!==void 0?(s.remove(),delete t.shapeMap["link-point-left-bottom"]):s.attr(B(B({},M),{x:C,y:-S})):x&&(t.shapeMap["link-point-left-bottom"]=t.addShape("circle",{attrs:B(B({},M),{x:C,y:-S}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),C=Math.cos((18+72*4)/180*Math.PI)*_,S=Math.sin((18+72*4)/180*Math.PI)*_,u?!w&&w!==void 0?(u.remove(),delete t.shapeMap["link-point-right-bottom"]):u.attr(B(B({},M),{x:C,y:-S})):w&&(t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:B(B({},M),{x:C,y:-S}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var DM=_n.defaultSubjectColors,pl="fan-shape-";Xa("donut",{options:{size:Qe.defaultNode.size,style:{x:0,y:0,stroke:Qe.defaultNode.style.stroke,fill:Qe.defaultNode.style.fill,lineWidth:Qe.defaultNode.style.lineWidth},labelCfg:{style:{fill:Qe.nodeLabel.style.fill,fontSize:Qe.nodeLabel.style.fontSize,fontFamily:Qe.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Qe.defaultNode.linkPoints.size,lineWidth:Qe.defaultNode.linkPoints.lineWidth,fill:Qe.defaultNode.linkPoints.fill,stroke:Qe.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:B({},Qe.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=yr({},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:B({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:B({x:-u/2,y:-f/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),Vde(e,t,s),this.drawLinkPoints(e,t),s},updateShape:function(e,t,n,i,a){var o=t.get("keyShape");o.attr(B({},n)),Hde(e,t,o),this.updateLabel(e,t,a),i&&this.updateIcon(e,t)}},"circle");var Vde=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=OD(a,s),l=f.configs,c=f.totalValue;if(c){var h=DD(n),d=h.lineWidth,v=h.arcR,p=[v,0],g=0;if(u===1){am(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=am(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}}}},am=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 b={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"))||DM[s%DM.length],lineWidth:u};return d?d.attr(b):e.shapeMap["".concat(pl).concat(s)]=e.addShape("path",{attrs:b,name:"".concat(pl).concat(s),draggable:!0}),{beginAngle:g,arcBegin:p,shape:e.shapeMap["".concat(pl).concat(s)],shouldEnd:c||v>.999}},Hde=function(e,t,n){var i=e.donutAttrs,a=e.donutColorMap,o=a===void 0?{}:a,s={},u=t.getContainer();if(i){var f=OD(i,o),l=f.configs,c=f.totalValue;if(c)for(var h=DD(n),d=h.lineWidth,v=h.arcR,p=[v,0],g=0,y=0;y<l.length;y++){var m="".concat(pl).concat(y),b=am(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(b.shape&&(s[m]=!0),b.shouldEnd)break;p=b.arcBegin,g=b.beginAngle}}var x=Object.keys(u.shapeMap).filter(function(w){return w.includes(pl)});x.forEach(function(w){s[w]||(u.shapeMap[w].remove(!0),delete u.shapeMap[w])})},OD=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}},DD=function(e){var t=e.attr("r"),n=.6*t,i=(t+n)/2,a=t-n;return{lineWidth:a,arcR:i}},$h=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}},qde=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}},Ib=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},PD=function(e){return Ib(e)},hv=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},Zde=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},om=function(e,t,n){var i=Zde(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}},PM=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}},sm=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}]},jh=function(e,t){var n=e.x,i=e.y;return n<t.minX||n>t.maxX||i<t.minY||i>t.maxY},Kde=function(e,t){return t<e.minX||t>e.maxX?[]:[{x:t,y:e.minY},{x:t,y:e.maxY}]},Qde=function(e,t){return t<e.minY||t>e.maxY?[]:[{x:e.minX,y:t},{x:e.maxX,y:t}]},Jde=function(e,t){return Kde(e,t.x).concat(Qde(e,t.y))},zl=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},eve=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},RM=function(e,t,n,i,a){return zl(e,t)+zl(e,n)+eve(e,[t,n,i,a])},tve=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)},Uh=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},um=function(e,t,n){if(n.width||n.height){var i=sm(n),a=i[0],o=i[1],s=i[2],u=i[3];return Uh(e,t,a,o)||Uh(e,t,a,u)||Uh(e,t,o,s)||Uh(e,t,s,u)}return!1},rve=function(e,t,n,i){var a=[];return e.forEach(function(o){if(o!==t&&(o.x===t.x||o.y===t.y)){if(um(o,t,n)||um(o,t,i))return;a.push(o)}}),Ib(a)},nve=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]=RM(t,n,t);var v=new BD;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 tve(m,p,c,n.id),m}delete l[g.id],v.remove(g.id),f.push(g);var b=rve(e,g,i,a),x=function(E){E.forEach(function(_){if(f.indexOf(_)===-1){var M=_.id;l[M]||(l[M]=_);var C=d[g.id]+zl(g,_);if(h[M]&&C>=h[M]){v.add({id:M,value:d[M]});return}c[M]=g.id,h[M]=C,d[M]=h[M]+RM(_,n,t,o,s),v.add({id:M,value:d[M]})}})};x(b)}return[t,n]},ive=function(e,t,n){return!(e.x===t.x&&t.x===n.x||e.y===t.y&&t.y===n.y)},ave=function(e,t,n,i){var a=zl(e,t),o=zl(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]},BM=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(ive(a,s,u)){var f=ave(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("")},RD=function(e,t,n,i,a){var o,s;if(!n||!n.getType())o=$h(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=$h(e)}else o=n&&n.getBBox();if(!i||!i.getType())s=$h(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=$h(t)}else s=i&&i.getBBox();var g=hv(o,a),y=hv(s,a),m=om(g,e,t),b=om(y,t,e),x=qde([m,b]),w=PM(g,x),E=PM(y,x),_=[];_=_.concat(sm(w)).concat(sm(E));var M={x:(e.x+t.x)/2,y:(e.y+t.y)/2};[x,w,E].forEach(function(S){_=_.concat(Jde(S,M).filter(function(A){return jh(A,g)&&jh(A,y)}))}),[{x:m.x,y:b.y},{x:b.x,y:m.y}].forEach(function(S){jh(S,g)&&jh(S,y)&&_.push(S)}),_.unshift(m),_.push(b),_=Ib(_);var C=nve(_,m,b,o,s,e,t);return C.unshift(e),C.push(t),PD(C)},ove=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},BD=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}(),sve=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},uve=function(e,t,n,i,a){return PD(RD(e,t,n,i,a.offset))},fve={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:sve,fallbackRoute:uve},Ga=function(e,t){var n=Math.round(Math.abs(e/t)),i=e<0?-1:1;return n<0?0:i*n},lve=function(e,t,n){var i={};return e.forEach(function(a){if(a)for(var o=hv(a.getBBox(),n),s=Ga(o.minX,t);s<=Ga(o.maxX,t);s+=1)for(var u=Ga(o.minY,t);u<=Ga(o.maxY,t);u+=1)i["".concat(s,"|||").concat(u)]=!0}),i},E0=function(e,t){var n=t.x-e.x,i=t.y-e.y;return n||i?Math.atan2(i,n):0},FM=function(e,t){var n=Math.abs(e-t);return n>Math.PI?2*Math.PI-n:n},GM=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},zM=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=hv(f,u);for(var h in c)c[h]=Ga(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=_n.getLineIntersect(e,{x:e.x+p.stepX*c.width,y:e.y+p.stepY*c.height},y[0],y[1]);m&&!um(e,m,f)&&(m.id="".concat(m.x,"|||").concat(m.y),o.push(m))}return o}var b=om(c,e,i);return b.id="".concat(b.x,"|||").concat(b.y),[b]},fm=function(e,t,n,i){var a=E0(e,t),o=n[e.id];if(!o){var s=E0(i,e);return FM(s,a)}var u=E0({x:o.x,y:o.y},e);return FM(u,a)},cve=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};fm(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=fm(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},hve=function(e,t,n,i,a){if(isNaN(e.x)||isNaN(t.x))return[];var o=yr(fve,a);o.obstacles=o.obstacles||[];var s=o.penalties,u=o.gridSize,f=lve(o.obstacles.concat([n,i]),u,o.offset),l={x:Ga(e.x,u),y:Ga(e.y,u)},c={x:Ga(t.x,u),y:Ga(t.y,u)};e.id="".concat(l.x,"|||").concat(l.y),t.id="".concat(c.x,"|||").concat(c.y);var h=zM(l,e,n,c,o),d=zM(c,t,i,l,o);h.forEach(function(N){delete f[N.id]}),d.forEach(function(N){delete f[N.id]});for(var v={},p={},g={},y={},m={},b=new BD,x=0;x<h.length;x++){var w=h[x];v[w.id]=w,y[w.id]=0,m[w.id]=GM(w,d,o.distFunc),b.add({id:w.id,value:m[w.id]})}var E=o.maximumLoops,_,M,C,S,A,T,k=1/0,O={};for(d.forEach(function(N){O["".concat(N.x,"|||").concat(N.y)]=!0}),Object.keys(v).forEach(function(N){var P=v[N].id;m[P]<=k&&(k=m[P],_=v[P])});Object.keys(v).length>0&&E>0;){var F=b.minId((E+1)%30===0);if(F)_=v[F];else break;if(O["".concat(_.x,"|||").concat(_.y)])return cve(_,g,l,t,e,c,u);delete v[_.id],b.remove(_.id),p[_.id]=!0;for(var x=0;x<o.directions.length;x++){M=o.directions[x];var D="".concat(Math.round(_.x)+M.stepX,"|||").concat(Math.round(_.y)+M.stepY);if(C={x:_.x+M.stepX,y:_.y+M.stepY,id:D},!p[D]&&(T=fm(_,C,g,l),!(T>o.maxAllowedDirectionChange)&&!f[D])){v[D]||(v[D]=C);var $=s[T];S=o.distFunc(_,C)+(isNaN($)?u:$),A=y[_.id]+S;var Y=y[D];Y&&A>=Y||(g[D]=_,y[D]=A,m[D]=A+GM(C,d,o.distFunc),b.add({id:D,value:m[D]}))}}E-=1}return o.fallbackRoute(e,t,n,i,o)};UI("polyline",{options:{color:Qe.defaultEdge.color,size:Qe.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:Qe.defaultEdge.style.stroke,lineAppendWidth:Qe.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:Qe.edgeLabel.style.fill,fontSize:Qe.edgeLabel.style.fontSize,fontFamily:Qe.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:B({},Qe.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=yt({},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=yt({},h,e.routeCfg);d.offset=i.offset;var v=this.getPath(u,f,l,c,d,!s);(pt(v)&&v.length<=1||Pe(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=yt({},Qe.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(x){return x.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=yt({},i,c,e.style),d=e.sourceNode,v=e.targetNode,p=h.radius,g=this.options.routeCfg,y=yt({},g,e.routeCfg);y.offset=h.offset;var m=this.getPath(l,d,v,p,y,!f);(pt(m)&&m.length<=1||Pe(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 b=yt(i,a.attr(),{lineWidth:o,path:m},e.style);a&&a.attr(b)}},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 BM(e,i);var l=[];return me(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?RD(e[e.length-1],e[0],n,t,s):hve(e[0],e[e.length-1],t,n,a);if(!c||!c.length)return"M0 0, L0 0";if(i){var h=BM(c,i);return h}c=ove(c);var d=_n.pointsToPolygon(c);return d}},"single-edge");var $M=Za.cloneEvent,jM=Za.isNaN,UM=Math.abs,dve=10,vve=["shift","ctrl","alt","control"];const pve={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(!(jM(n)||jM(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(b){b.set("ori-visibility",b.get("ori-visibility")||b.get("visible")),b.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(b){return m.onMouseUp(b)},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=$M(e),!!this.origin)){if(this.dragging)e.type="drag",t.emit("canvas:drag",e);else{if(UM(this.origin.x-e.clientX)+UM(this.origin.y-e.clientY)<dve)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(_){return _.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(_){var M=_.get("ori-visibility");_.set("ori-visibility",void 0),M&&_.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,b=y;m<b.length;m++){var x=b[m],w=x.get("isKeyShape");if(!w){var E=x.get("ori-visibility");x.set("ori-visibility",void 0),E&&x.show()}}}if(!this.dragging){this.origin=null;return}e=$M(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&&(vve.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($l(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if(yn(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}},gve={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(B(B({},e),this.mousedown)):(this.dragstart=!0,this.onDragStart(e)))},onDragStart:function(e){var t=this;if(this.currentShouldEnd=!0,!!this.shouldBegin(B(B({},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",Vt(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:jl(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=yr({},bs.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:B({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 Xh=null;const yve={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&&(Xh=null),this.timer=setTimeout(function(){t.throttleClearActiveState(e,t)},50)},throttleSetAllItemStates:yl(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(Xh===a&&i){e.throttleClearActiveState(r,e),Xh=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 b=u[m],x=b.getID(),w=b.hasState("selected");e.resetSelected&&w&&n.setItemState(b,"selected",!1),y[x]&&(n.setItemState(b,o,!1),delete y[x]),s&&!g[x]&&(n.setItemState(b,s,!0),g[x]=b)}for(var m=0;m<d;m++){var E=f[m],_=E.getID(),w=E.hasState("selected");e.resetSelected&&w&&n.setItemState(E,"selected",!1),y[_]&&(n.setItemState(E,o,!1),delete y[_]),s&&!g[_]&&(n.setItemState(E,s,!0),g[_]=E)}for(var m=0;m<v;m++){var M=l[m],C=M.getID();y[C]&&(n.setItemState(M,o,!1),delete y[C]),s&&!g[C]&&(n.setItemState(M,s,!0),g[C]=M)}for(var m=0;m<p;m++){var S=c[m],A=S.getID();y[A]&&(n.setItemState(S,o,!1),delete y[A]),s&&!g[A]&&(n.setItemState(S,s,!0),g[A]=S)}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(),k=T.length,m=0;m<k;m++){var M=T[m],C=M.getID(),O=void 0;M.getSource()===t?O=M.getTarget():O=M.getSource();var F=O.getID();s&&g[F]&&(n.setItemState(O,s,!1),delete g[F]),y[F]||(n.setItemState(O,o,!0),y[F]=O),g[C]&&(n.setItemState(M,s,!1),delete g[C]),y[C]||(n.setItemState(M,o,!0),y[C]=M),M.toFront()}}e.activeItems=y,e.inactiveItems=g,i&&(Xh=t.getModel().id),n.emit("afteractivaterelations",{item:r.item,action:"activate"})}},50,{trailing:!0,leading:!0}),throttleClearActiveState:yl(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 Yh=Math.min,XM=Math.max,YM=Math.abs,WM="shift",mve=["drag","shift","ctrl","alt","control"];const bve={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:WM,includeEdges:!0,includeCombos:!1,selectOnCombo:!1,selectedEdges:[],selectedNodes:[],selectedCombos:[]}},getEvents:function(){return mve.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=WM,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=Yh(f.x,l.x),h=XM(f.x,l.x),d=Yh(f.y,l.y),v=XM(f.y,l.y),p=[],g=[];i.getNodes().forEach(function(b){if(b.isVisible()&&s(b,c,h,d,v)&&o(b,"select",t)){p.push(b);var x=b.getModel();g.push(x.id),i.setItemState(b,u,!0)}});var y=[];this.includeEdges&&p.forEach(function(b){var x=b.getOutEdges();x.forEach(function(w){if(w.isVisible()){var E=w.getModel(),_=E.source,M=E.target;g.includes(_)&&g.includes(M)&&o(w,"select",t)&&(y.push(w),i.setItemState(w,t.selectedState,!0))}})});var m=[];this.includeCombos&&i.getCombos().forEach(function(b){if(b.isVisible()&&s(b,c,h,d,v)&&o(b,"select",t)){m.push(b);var x=b.getModel();g.push(x.id),i.setItemState(b,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:YM(e.canvasX-t.x),height:YM(e.canvasY-t.y),x:Yh(e.canvasX,t.x),y:Yh(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 VM="shift",xve=["shift","ctrl","alt","control"];const wve={getDefaultCfg:function(){return{multiple:!0,trigger:VM,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var e=this;return xve.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=VM,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));me(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);me(o,function(f){i.setItemState(f,t.selectedState,!1)});var s=i.findAllByState("edge",this.selectedState);me(s,function(f){i.setItemState(f,t.selectedState,!1)});var u=i.findAllByState("combo",this.selectedState);me(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 Eve=yi,Wh=.05;const _ve={getDefaultCfg:function(){return this.isFireFox=aD()==="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-Wh*u:l=1/(1-Wh*u):e.wheelDelta<0?l=1-Wh*u:l=1/(1-Wh*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(),b=y.length,x=m.length;if(!g){for(var w=0;w<b;w++){var E=y[w];if(!E.destroyed)for(var _=E.get("group").get("children"),M=_.length,C=0;C<M;C++){var S=_[C];!S.destoryed&&!S.get("isKeyShape")&&(S.set("ori-visibility",S.get("ori-visibility")||S.get("visible")),S.hide())}}for(var A=0;A<x;A++)for(var T=m[A],_=T.get("group").get("children"),M=_.length,C=0;C<M;C++){var S=_[C];S.set("ori-visibility",S.get("ori-visibility")||S.get("visible")),S.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var k=setTimeout(function(){var tt=i.getZoom(),ae=t.get("optimized");if(ae){t.set("optimized",!1);for(var L=0;L<b;L++){var Se=y[L],Ge=Se.get("group").get("children"),ye=Ge.length;if(tt<p){var Ye=Se.getKeyShape(),We=Ye.get("ori-visibility");Ye.set("ori-visibility",void 0),We&&Ye.show()}else for(var qe=0;qe<ye;qe++){var et=Ge[qe],We=et.get("ori-visibility");et.set("ori-visibility",void 0),!et.get("visible")&&We&&We&&et.show()}}for(var gt=0;gt<x;gt++){var Pt=m[gt],Ge=Pt.get("group").get("children"),ye=Ge.length;if(tt<p){var Ye=Pt.getKeyShape(),We=Ye.get("ori-visibility");Ye.set("ori-visibility",void 0),We&&Ye.show()}else for(var qe=0;qe<ye;qe++){var et=Ge[qe];if(!et.get("visible")){var We=et.get("ori-visibility");et.set("ori-visibility",void 0),We&&et.show()}}}}},100);this.set("timeout",k)}if(f<=1){var O=void 0,F=void 0;if(a.fixAll||a.fixLineWidth||a.fixLabel){O=i.findAllByState("node",a.fixState),F=i.findAllByState("edge",a.fixState);for(var D=f/c,$=O.length,Y=0;Y<$;Y++){var E=O[Y],N=E.getContainer(),P=E.getModel(),W=E.getOriginStyle(),J=E.getStateStyle(a.fixState),te=E.get("shapeFactory").getShape(P.type).getStateStyle(a.fixState,E)[a.fixState];if(a.fixAll){if(c<=1){var H=Vt(N.getMatrix());H||(H=[1,0,0,0,1,0,0,0,1]);var pe=E.getModel(),Te=pe.x,Ne=pe.y;H=Eve(H,[["t",-Te,-Ne],["s",D,D],["t",Te,Ne]]),N.setMatrix(H)}}else for(var _=N.get("children"),M=_.length,C=0;C<M;C++){var S=_[C],Ze=void 0,at=void 0;if(a.fixLabel){var nt=S.get("type");if(nt==="text"){Ze=S.attr("fontSize")||12;var _t=J[S.get("name")],St=te[S.get("name")],fr=_t?_t.fontSize:12,Ft=St?St.fontSize:12,Yt=fr||Ft||12;if(c<=1&&S.attr("fontSize",Yt/c),at)break}}if(a.fixLineWidth&&S.get("isKeyShape")){at=S.attr("lineWidth")||0;var dr=J.lineWidth||te.lineWidth||W.lineWidth||0;if(c<=1&&S.attr("lineWidth",dr/c),Ze)break}}}for(var lr=F.length,jt=0;jt<lr;jt++)for(var T=F[jt],N=T.getContainer(),_=N.get("children"),P=T.getModel(),J=T.getStateStyle(a.fixState),te=T.get("shapeFactory").getShape(P.type).getStateStyle(a.fixState,T)[a.fixState],M=_.length,C=0;C<M;C++){var S=_[C],Ze=void 0,at=void 0;if(a.fixLabel||a.fixAll){var nt=S.get("type");if(nt==="text"){Ze=S.attr("fontSize")||12;var _t=J[S.get("name")],St=te[S.get("name")],fr=_t?_t.fontSize:12,Ft=St?St.fontSize:12,Yt=fr||Ft||12;if(c<=1&&S.attr("fontSize",Yt/c),at)break}}if((a.fixLineWidth||a.fixAll)&&S.get("isKeyShape")){at=S.attr("lineWidth")||0;var dr=J.lineWidth||te.lineWidth||1;if(c<=1&&S.attr("lineWidth",dr/c),Ze)break}}}}var ir=this.get("animate"),Hr=this.get("animateCfg");i.zoomTo(c,{x:s.x,y:s.y},ir,Hr),i.emit("wheelzoom",e)}}},FD={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,Xt(this.container,{visibility:"visible"}),this.updatePosition(e)}},hideTooltip:function(){Xt(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)){Xt(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");Xt(this.container,{left:d,top:v,visibility:"visible"})},createTooltip:function(e){var t=e.get("el");t.style.position="relative";var n=Er('<div class="g6-tooltip g6-'.concat(this.item,'-tooltip"></div>'));return t.parentNode.appendChild(n),Xt(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}},Sve=B({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"}}},FD),Mve=B({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"}}},FD);var HM="click",Cve=["click","dblclick"];const Ave={getDefaultCfg:function(){return{trigger:HM,onChange:function(){}}},getEvents:function(){var e,t;return Cve.includes(this.trigger)?t=this.trigger:(t=HM,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 Tve=Za.calculationItemsBBox,Ive=function r(e,t){if(t(e)!==!1&&e){var n=e.get("combos");if(n.length===0)return!1;me(n,function(i){r(i,t)})}};const kve={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=[],Ive(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,b=2*Math.sqrt(y*y+m*m);l+g-b>.8*l?n.setItemState(h,t.activeState,!0):n.setItemState(h,t.activeState,!1)})}me(this.targets,function(h){t.updateCombo(h,e)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(e,t){var n=this;(this.enableDelegate||t)&&me(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");me(a,function(s){i.traverse(s,t,n)});var o=e.get("nodes");me(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=Tve(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=B(B({},bs.delegateStyle),this.delegateStyle);this.delegateShape=n.addShape("rect",{attrs:B({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 qM="dblclick",Lve=["click","dblclick"];const Nve={getDefaultCfg:function(){return{trigger:qM,relayout:!0}},getEvents:function(){var e,t;return Lve.includes(this.trigger)?t=this.trigger:(t=qM,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 Ove=Za.isPolygonsIntersect,Dve=Za.pathToPoints,ZM="shift",Pve=["drag","shift","ctrl","alt","control"],Rve=function(e,t){var n,i=e.getKeyShape();if(e.get("type")==="path")n=Dve(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 Ove(t,n)};const Bve={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:ZM,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return Pve.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=ZM,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()&&Rve(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:B({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 KM="click",Fve=["click","drag"],QM=void 0,Gve=["shift","ctrl","control","alt","meta",void 0];const zve={getDefaultCfg:function(){return{trigger:KM,key:QM,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var e=this;Fve.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=KM,console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),e.key&&Gve.indexOf(e.key.toLowerCase())===-1&&(e.trigger=QM,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&&Mr(o)?s=o({source:t.source,target:a.id},t):s=t.edgeConfig;var u=B({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=B(B({},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&&Mr(o)?s=o({source:a.id,target:a.id},t):s=t.edgeConfig,t.edge=i.addItem("edge",B({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 JM="ctrl",$ve=["shift","ctrl","alt","control"],jve="1";const Uve={getDefaultCfg:function(){return{trigger:JM,combinedKey:jve,functionName:"fitView",functionParams:[]}},getEvents:function(){return $ve.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=JM,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 Xve=["shift","ctrl","alt","control","meta"];const Yve={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return(!this.zoomKey||Xve.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,b=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?b<-p?l=0:b-l<-p&&(l=b+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 x=this.get("enableOptimize");if(x){var w=this.get("optimizeZoom"),E=this.get("optimized"),_=n.getNodes(),M=n.getEdges(),C=_.length,S=M.length;if(!E){for(var A=0;A<C;A++){var T=_[A];if(!T.destroyed)for(var k=T.get("group").get("children"),O=k.length,F=0;F<O;F++){var D=k[F];!D.destoryed&&!D.get("isKeyShape")&&(D.set("ori-visibility",D.get("ori-visibility")||D.get("visible")),D.hide())}}for(var $=0;$<S;$++)for(var Y=M[$],k=Y.get("group").get("children"),O=k.length,F=0;F<O;F++){var D=k[F];D.set("ori-visibility",D.get("ori-visibility")||D.get("visible")),D.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var N=setTimeout(function(){var P=n.getZoom(),W=t.get("optimized");if(W){t.set("optimized",!1);for(var J=0;J<C;J++){var te=_[J],H=te.get("group").get("children"),pe=H.length;if(P<w){var Te=te.getKeyShape(),Ne=Te.get("ori-visibility");Ne&&Te.show()}else for(var Ze=0;Ze<pe;Ze++){var at=H[Ze],Ne=at.get("ori-visibility");!at.get("visible")&&Ne&&Ne&&at.show()}}for(var nt=0;nt<S;nt++){var _t=M[nt],H=_t.get("group").get("children"),pe=H.length;if(P<w){var Te=_t.getKeyShape(),Ne=Te.get("ori-visibility");Ne&&Te.show()}else for(var Ze=0;Ze<pe;Ze++){var at=H[Ze];if(!at.get("visible")){var Ne=at.get("ori-visibility");Ne&&at.show()}}}}},100);this.set("timeout",N)}}},allowDrag:function(e){var t,n,i=e.target,a=i&&i.isCanvas&&i.isCanvas();if($l(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if(yn(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 Wve={"drag-canvas":pve,"zoom-canvas":_ve,"drag-node":gve,"activate-relations":yve,"brush-select":bve,"click-select":wve,"lasso-select":Bve,tooltip:Sve,"edge-tooltip":Mve,"collapse-expand":Ave,"drag-combo":kve,"collapse-expand-combo":Nve,"create-edge":zve,"shortcuts-call":Uve,"scroll-canvas":Yve};me(Wve,function(r,e){XI(e,r)});var Vve=B(B({},Sz),L7),Hve=Hn.Fisheye,qve=Hn.TimeBar,Zve=Hn.ImageMinimap,Kve=Hn.EdgeFilterLens,Qve=Hn.SnapLine,Jve=Hn.Annotation;const pp={version:bs.version,Graph:sD,TreeGraph:Ace,Util:Za,Layout:Ht.Layouts,TreeLayout:vce,registerLayout:pce,Global:bs,registerBehavior:XI,registerCombo:dU,registerEdge:UI,registerNode:Xa,Minimap:Hn.Minimap,Grid:Hn.Grid,Bundling:Hn.Bundling,Menu:Hn.Menu,ToolBar:Hn.ToolBar,Tooltip:Hn.Tooltip,Legend:Hn.Legend,TimeBar:qve,SnapLine:Qve,Fisheye:Hve,ImageMinimap:Zve,EdgeFilterLens:Kve,Annotation:Jve,Algorithm:Vve,Arrow:FI,Marker:GI,Shape:mr};pp.version="4.8.23";pp.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}});pp.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 rpe=M5({__name:"TrackGraph",props:{track:{}},setup(r){const e=r,t=C5(()=>{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:ww(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?ww(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=A5();let i;T5(()=>{if(!n.value)return;i==null||i.destroy();const o=n.value.scrollWidth,s=n.value.scrollHeight||o;i=new pp.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(b=>b.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,b=d.parent;for(;b;){if(b===c)return m;b=b.parent,m++}return m},"<":()=>d.children.indexOf(c),"<<":()=>{let m=0;const b=Array.from(d.children).reverse();for(;b.length>0;){const x=b.pop();if(x===c)return m;b.push(...Array.from(x.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)}),xw(()=>{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),xw(()=>{window.removeEventListener("resize",a)}),(o,s)=>(I5(),k5("div",{ref_key:"container",ref:n},null,512))}});export{rpe as default};
670
- //# sourceMappingURL=TrackGraph-DHc1kT0P.js.map
670
+ //# sourceMappingURL=TrackGraph-DcKRoN1f.js.map