@nuxt/devtools 4.0.0-alpha.1 → 4.0.0-alpha.3
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.
- package/README.md +84 -5
- package/dist/chunks/module-main.mjs +174 -220
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/__blank-hkoz1rvj.js +1 -0
- package/dist/client/_nuxt/analyze-build-kqtn42f3.js +1 -0
- package/dist/client/_nuxt/assets-pdpavuv7.js +6 -0
- package/dist/client/_nuxt/auth-required-panel-eykuzska.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/424f9fd7-bd33-4b1e-8498-929c14b6ad71.json +1 -0
- package/dist/client/_nuxt/{client-im47u3kz.js → client-coqmopwz.js} +1 -1
- package/dist/client/_nuxt/{code-diff-idsu3m0z.js → code-diff-o5b2z2ie.js} +3 -3
- package/dist/client/_nuxt/code-snippets-lje00rjy.js +1 -0
- package/dist/client/_nuxt/components-mkmd03mc.js +1 -0
- package/dist/client/_nuxt/composable-item-lw4aqry9.js +1 -0
- package/dist/client/_nuxt/custom-_name_-h2d0kmts.js +1 -0
- package/dist/client/_nuxt/data-schema-button-g6gxhvpu.js +1 -0
- package/dist/client/_nuxt/data-schema-drawer-h229qgae.js +2 -0
- package/dist/client/_nuxt/debug-ezvak7q9.js +1 -0
- package/dist/client/_nuxt/{default-jvhm51ri.js → default-f17ja76u.js} +1 -1
- package/dist/client/_nuxt/dev-auth-h6radlhi.js +1 -0
- package/dist/client/_nuxt/duration-display-lgba3ul7.js +1 -0
- package/dist/client/_nuxt/entry.css-d9crsfkn.css +1 -0
- package/dist/client/_nuxt/error-404-j6bw0i0a.js +1 -0
- package/dist/client/_nuxt/error-404.css-op0yx84h.css +1 -0
- package/dist/client/_nuxt/error-500-oozftcqy.js +1 -0
- package/dist/client/_nuxt/error-500.css-f169vd1x.css +1 -0
- package/dist/client/_nuxt/error-knm3fbzu.js +9 -0
- package/dist/client/_nuxt/filepath-item-o7vxzdbh.js +1 -0
- package/dist/client/_nuxt/full-h1zczfpi.js +1 -0
- package/dist/client/_nuxt/h9sdxxta.js +4 -0
- package/dist/client/_nuxt/help-fab-ekagn9f2.js +1 -0
- package/dist/client/_nuxt/hooks-k3agmywq.js +1 -0
- package/dist/client/_nuxt/imports-gw4s306d.js +1 -0
- package/dist/client/_nuxt/launch-page-jvtn5jef.js +1 -0
- package/dist/client/_nuxt/modules-b3ta2mlp.js +1 -0
- package/dist/client/_nuxt/nbadge-ia2sg78l.js +1 -0
- package/dist/client/_nuxt/ncard-bpchuz30.js +1 -0
- package/dist/client/_nuxt/ncheckbox-dqqmiqln.js +1 -0
- package/dist/client/_nuxt/ncode-block-lbvhz228.js +2 -0
- package/dist/client/_nuxt/ndrawer-pdhwqkg2.js +1 -0
- package/dist/client/_nuxt/ndropdown-o0hg8oi1.js +1 -0
- package/dist/client/_nuxt/nicon-o8vtl3nv.js +1 -0
- package/dist/client/_nuxt/nicon-title-f04kekaa.js +1 -0
- package/dist/client/_nuxt/nlink-flm1s7uj.js +1 -0
- package/dist/client/_nuxt/nmarkdown-cu68ujlp.js +1 -0
- package/dist/client/_nuxt/nnavbar-iwf1qrzf.js +1 -0
- package/dist/client/_nuxt/none-b8do2yyn.js +1 -0
- package/dist/client/_nuxt/nsection-block-oc6icst0.js +1 -0
- package/dist/client/_nuxt/nselect-k14i70o0.js +1 -0
- package/dist/client/_nuxt/nselect-tabs-gmel1seg.js +1 -0
- package/dist/client/_nuxt/nswitch-kprd7bwp.js +1 -0
- package/dist/client/_nuxt/ntip-erjk5wo4.js +1 -0
- package/dist/client/_nuxt/{nuxt-otp6bp04.js → nuxt-bl8ryhiw.js} +1 -1
- package/dist/client/_nuxt/{nuxt-link-bumooa9d.js → nuxt-link-h8a2u03t.js} +1 -1
- package/dist/client/_nuxt/open-graph-ipvg6gyk.js +3 -0
- package/dist/client/_nuxt/overview-fbg2mjz1.js +1 -0
- package/dist/client/_nuxt/pages-jx3r1z1o.js +1 -0
- package/dist/client/_nuxt/pages-nqnq5f5t.js +1 -0
- package/dist/client/_nuxt/payload-f7ar9blu.js +1 -0
- package/dist/client/_nuxt/pinia-in67b2ff.js +1 -0
- package/dist/client/_nuxt/plugins-foc4m9cu.js +1 -0
- package/dist/client/_nuxt/{ready-dadbdj5i.js → ready-nmtplnq5.js} +1 -1
- package/dist/client/_nuxt/render-tree-mzpnvjww.js +1 -0
- package/dist/client/_nuxt/rpc-ga26o8l5.js +1 -0
- package/dist/client/_nuxt/runtime-configs-f691dtpr.js +1 -0
- package/dist/client/_nuxt/server-discovery-fa3lq0oe.js +1 -0
- package/dist/client/_nuxt/server-route-inputs-kx5eivj6.js +1 -0
- package/dist/client/_nuxt/server-routes-ozsawrbd.js +7 -0
- package/dist/client/_nuxt/server-tasks-sykxh8ji.js +1 -0
- package/dist/client/_nuxt/settings-eufw79s0.js +1 -0
- package/dist/client/_nuxt/{splitpanes.es-bxyirks2.js → splitpanes.es-krbzt5ww.js} +1 -1
- package/dist/client/_nuxt/stacktrace-list-ilvbql3y.js +1 -0
- package/dist/client/_nuxt/state-components-pfh0w3gz.js +1 -0
- package/dist/client/_nuxt/state-editor-c9yn0k8x.js +1 -0
- package/dist/client/_nuxt/state-modules-c35cpfly.js +1 -0
- package/dist/client/_nuxt/{state-tabs-etl5jr30.js → state-tabs-0wkipn6s.js} +1 -1
- package/dist/client/_nuxt/storage-dqgie6yp.js +1 -0
- package/dist/client/_nuxt/storage-options-fmhmng6m.js +1 -0
- package/dist/client/_nuxt/terminals-o5xyk44w.js +1 -0
- package/dist/client/_nuxt/timeline-hwj8vazt.js +31 -0
- package/dist/client/_nuxt/unocss-runtime-fghua2d1.js +1 -0
- package/dist/client/_nuxt/utils-c43quyky.js +2 -0
- package/dist/client/_nuxt/vendor/{json-editor-vue-eojr4v24.js → json-editor-vue-mpqfj7dd.js} +5 -5
- package/dist/client/_nuxt/vendor/{quicktype-core-k4qx3809.js → quicktype-core-bxh3g3c2.js} +2 -2
- package/dist/client/_nuxt/vendor/{shiki-lqo1hg2n.js → shiki-ildq90cv.js} +3 -3
- package/dist/client/_nuxt/vendor/{unocss-k727ub0h.js → unocss-hiscr44j.js} +1 -1
- package/dist/client/_nuxt/vendor/{vis-id8udisj.js → vis-obscvyyi.js} +2 -2
- package/dist/client/_nuxt/vendor/{xterm-ed0pys2e.js → xterm-g6v3jqah.js} +1 -1
- package/dist/client/_nuxt/virtual-files-ld5g0ep3.js +1 -0
- package/dist/client/_nuxt/vue-devtools-mcimudqm.js +4 -0
- package/dist/client/_nuxt/{vue-router-jbnxw7nb.js → vue-router-imuzx5c1.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/shared/{devtools.COlX0Gls.mjs → devtools.DClER4Dv.mjs} +1 -2
- package/package.json +15 -15
- package/dist/client/_nuxt/__blank-cpzbm3dn.js +0 -1
- package/dist/client/_nuxt/analyze-build-e7v5vkef.js +0 -1
- package/dist/client/_nuxt/assets-b5c187l4.js +0 -6
- package/dist/client/_nuxt/builds/meta/25fc8778-785e-4df1-8047-b131fc1cd4b2.json +0 -1
- package/dist/client/_nuxt/code-snippets-k81hoi4s.js +0 -1
- package/dist/client/_nuxt/components-bmictfph.js +0 -1
- package/dist/client/_nuxt/composable-item-cza22cup.js +0 -1
- package/dist/client/_nuxt/copkoh3j.js +0 -4
- package/dist/client/_nuxt/custom-_name_-gqm5kr56.js +0 -1
- package/dist/client/_nuxt/data-schema-button-b308wyi0.js +0 -1
- package/dist/client/_nuxt/data-schema-drawer-lr34uwsh.js +0 -2
- package/dist/client/_nuxt/debug-kgc8fptp.js +0 -1
- package/dist/client/_nuxt/dev-auth-ojiqold5.js +0 -1
- package/dist/client/_nuxt/duration-display-f7ucshmo.js +0 -1
- package/dist/client/_nuxt/entry.css-me26coxn.css +0 -1
- package/dist/client/_nuxt/error-404-nggtc73s.js +0 -1
- package/dist/client/_nuxt/error-404.css-j1aav08u.css +0 -1
- package/dist/client/_nuxt/error-500-dym2gzqx.js +0 -1
- package/dist/client/_nuxt/error-500.css-eu9fz4va.css +0 -1
- package/dist/client/_nuxt/error-fqinfa1x.js +0 -9
- package/dist/client/_nuxt/filepath-item-e1s52fbh.js +0 -1
- package/dist/client/_nuxt/full-et0weok9.js +0 -1
- package/dist/client/_nuxt/help-fab-hz6r2oxa.js +0 -1
- package/dist/client/_nuxt/hooks-i7nsduqp.js +0 -1
- package/dist/client/_nuxt/imports-9o2qs53q.js +0 -1
- package/dist/client/_nuxt/launch-page-hpkkqhit.js +0 -1
- package/dist/client/_nuxt/modules-jok0opuq.js +0 -1
- package/dist/client/_nuxt/nbadge-m66xoquo.js +0 -1
- package/dist/client/_nuxt/nbutton-gygn07c2.js +0 -1
- package/dist/client/_nuxt/ncard-mqcl8pso.js +0 -1
- package/dist/client/_nuxt/ncheckbox-c0r45qtu.js +0 -1
- package/dist/client/_nuxt/ncode-block-figzf35k.js +0 -2
- package/dist/client/_nuxt/ndrawer-bgqyrlmt.js +0 -1
- package/dist/client/_nuxt/ndropdown-cip8lboe.js +0 -1
- package/dist/client/_nuxt/nicon-m1crov2l.js +0 -1
- package/dist/client/_nuxt/nicon-title-tqdvw0w0.js +0 -1
- package/dist/client/_nuxt/nlink-od4lllbl.js +0 -1
- package/dist/client/_nuxt/nmarkdown-hw0hmqw7.js +0 -1
- package/dist/client/_nuxt/nnavbar-lpozm5fj.js +0 -1
- package/dist/client/_nuxt/none-bdxkqeml.js +0 -1
- package/dist/client/_nuxt/npanel-grids-dd23ifsw.js +0 -1
- package/dist/client/_nuxt/nsection-block-lqrohs9v.js +0 -1
- package/dist/client/_nuxt/nselect-gczoit0g.js +0 -1
- package/dist/client/_nuxt/nselect-tabs-bsw5fg3d.js +0 -1
- package/dist/client/_nuxt/nswitch-ke379yjx.js +0 -1
- package/dist/client/_nuxt/ntext-input-cygthohl.js +0 -1
- package/dist/client/_nuxt/ntip-ke63ovgc.js +0 -1
- package/dist/client/_nuxt/open-graph-lumhcitx.js +0 -3
- package/dist/client/_nuxt/overview-c1ufrox9.js +0 -1
- package/dist/client/_nuxt/pages-cf1hvns3.js +0 -1
- package/dist/client/_nuxt/pages-lgihsvbt.js +0 -1
- package/dist/client/_nuxt/payload-fvgw4hh9.js +0 -1
- package/dist/client/_nuxt/pinia-lmrgyjxw.js +0 -1
- package/dist/client/_nuxt/plugins-ccaip8nh.js +0 -1
- package/dist/client/_nuxt/render-tree-corj3giw.js +0 -1
- package/dist/client/_nuxt/rpc-ez4fzlum.js +0 -1
- package/dist/client/_nuxt/runtime-configs-im0uu24n.js +0 -1
- package/dist/client/_nuxt/server-discovery-ffkkczqi.js +0 -1
- package/dist/client/_nuxt/server-route-inputs-lspeoiem.js +0 -1
- package/dist/client/_nuxt/server-routes-dhvqrowz.js +0 -7
- package/dist/client/_nuxt/server-tasks-mr9ezn8q.js +0 -1
- package/dist/client/_nuxt/settings-issronwn.js +0 -1
- package/dist/client/_nuxt/stacktrace-list-hiui24c3.js +0 -1
- package/dist/client/_nuxt/state-components-fbls8ka7.js +0 -1
- package/dist/client/_nuxt/state-editor-c7e04uj2.js +0 -1
- package/dist/client/_nuxt/state-modules-inqbwd7z.js +0 -1
- package/dist/client/_nuxt/state-routes-jln33b1m.js +0 -1
- package/dist/client/_nuxt/storage-husj5pg6.js +0 -1
- package/dist/client/_nuxt/storage-options-cth3coln.js +0 -1
- package/dist/client/_nuxt/telemetry-eqv6a0hn.js +0 -1
- package/dist/client/_nuxt/terminals-kitd8oja.js +0 -1
- package/dist/client/_nuxt/timeline-gr4tcvcz.js +0 -31
- package/dist/client/_nuxt/unocss-runtime-cpug61u1.js +0 -1
- package/dist/client/_nuxt/utils-nbkl6byi.js +0 -2
- package/dist/client/_nuxt/virtual-files-ky9cc4av.js +0 -1
- package/dist/client/_nuxt/vue-devtools-dunhx2nz.js +0 -4
- /package/dist/client/_nuxt/{color-b9xoe9j2.js → color-bh8526bd.js} +0 -0
- /package/dist/client/_nuxt/{composables-b2ccklz4.js → composables-f0oa0ya0.js} +0 -0
- /package/dist/client/_nuxt/{constants-ih922r91.js → constants-g7ujya00.js} +0 -0
- /package/dist/client/_nuxt/{dist-m49wlq01.js → dist-f16b9vaq.js} +0 -0
- /package/dist/client/_nuxt/{mitt.es-fjx0h8xe.js → mitt.es-pc7qwi6p.js} +0 -0
- /package/dist/client/_nuxt/vendor/{markdown-it-ckeo8pwp.js → markdown-it-liuu8zo7.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var n={exports:{}},r={},i,a;function o(){if(a)return i;a=1;var t=function(e){return e&&e.Math===Math&&e};return i=t(typeof globalThis==`object`&&globalThis)||t(typeof window==`object`&&window)||t(typeof self==`object`&&self)||t(typeof e==`object`&&e)||t(typeof i==`object`&&i)||(function(){return this})()||Function(`return this`)(),i}var s,c;function l(){return c?s:(c=1,s=function(e){try{return!!e()}catch{return!0}},s)}var u,d;function f(){return d?u:(d=1,u=!l()(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),u)}var p,m;function h(){if(m)return p;m=1;var e=f(),t=Function.prototype,n=t.apply,r=t.call;return p=typeof Reflect==`object`&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),p}var g,_;function v(){if(_)return g;_=1;var e=f(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return g=e?r:function(e){return function(){return n.apply(e,arguments)}},g}var y,b;function x(){if(b)return y;b=1;var e=v(),t=e({}.toString),n=e(``.slice);return y=function(e){return n(t(e),8,-1)},y}var S,C;function w(){if(C)return S;C=1;var e=x(),t=v();return S=function(n){if(e(n)===`Function`)return t(n)},S}var T,E;function D(){if(E)return T;E=1;var e=typeof document==`object`&&document.all;return T=e===void 0&&e!==void 0?function(t){return typeof t==`function`||t===e}:function(e){return typeof e==`function`},T}var ee={},te,O;function k(){return O?te:(O=1,te=!l()(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),te)}var ne,re;function A(){if(re)return ne;re=1;var e=f(),t=Function.prototype.call;return ne=e?t.bind(t):function(){return t.apply(t,arguments)},ne}var ie={},ae;function oe(){if(ae)return ie;ae=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor;return ie.f=t&&!e.call({1:2},1)?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,ie}var se,ce;function le(){return ce?se:(ce=1,se=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},se)}var ue,de;function fe(){if(de)return ue;de=1;var e=v(),t=l(),n=x(),r=Object,i=e(``.split);return ue=t(function(){return!r(`z`).propertyIsEnumerable(0)})?function(e){return n(e)===`String`?i(e,``):r(e)}:r,ue}var pe,me;function he(){return me?pe:(me=1,pe=function(e){return e==null},pe)}var ge,_e;function j(){if(_e)return ge;_e=1;var e=he(),t=TypeError;return ge=function(n){if(e(n))throw new t(`Can't call method on `+n);return n},ge}var ve,ye;function be(){if(ye)return ve;ye=1;var e=fe(),t=j();return ve=function(n){return e(t(n))},ve}var xe,Se;function Ce(){if(Se)return xe;Se=1;var e=D();return xe=function(t){return typeof t==`object`?t!==null:e(t)},xe}var we,Te;function M(){return Te?we:(Te=1,we={},we)}var Ee,De;function N(){if(De)return Ee;De=1;var e=M(),t=o(),n=D(),r=function(e){return n(e)?e:void 0};return Ee=function(n,i){return arguments.length<2?r(e[n])||r(t[n]):e[n]&&e[n][i]||t[n]&&t[n][i]},Ee}var Oe,ke;function Ae(){return ke?Oe:(ke=1,Oe=v()({}.isPrototypeOf),Oe)}var je,Me;function Ne(){if(Me)return je;Me=1;var e=o().navigator,t=e&&e.userAgent;return je=t?String(t):``,je}var Pe,Fe;function Ie(){if(Fe)return Pe;Fe=1;var e=o(),t=Ne(),n=e.process,r=e.Deno,i=n&&n.versions||r&&r.version,a=i&&i.v8,s,c;return a&&(s=a.split(`.`),c=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!c&&t&&(s=t.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=t.match(/Chrome\/(\d+)/),s&&(c=+s[1]))),Pe=c,Pe}var Le,Re;function ze(){if(Re)return Le;Re=1;var e=Ie(),t=l(),n=o().String;return Le=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol(`symbol detection`);return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}),Le}var Be,Ve;function He(){return Ve?Be:(Ve=1,Be=ze()&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,Be)}var Ue,We;function Ge(){if(We)return Ue;We=1;var e=N(),t=D(),n=Ae(),r=He(),i=Object;return Ue=r?function(e){return typeof e==`symbol`}:function(r){var a=e(`Symbol`);return t(a)&&n(a.prototype,i(r))},Ue}var Ke,qe;function Je(){if(qe)return Ke;qe=1;var e=String;return Ke=function(t){try{return e(t)}catch{return`Object`}},Ke}var Ye,Xe;function Ze(){if(Xe)return Ye;Xe=1;var e=D(),t=Je(),n=TypeError;return Ye=function(r){if(e(r))return r;throw new n(t(r)+` is not a function`)},Ye}var Qe,$e;function et(){if($e)return Qe;$e=1;var e=Ze(),t=he();return Qe=function(n,r){var i=n[r];return t(i)?void 0:e(i)},Qe}var tt,nt;function rt(){if(nt)return tt;nt=1;var e=A(),t=D(),n=Ce(),r=TypeError;return tt=function(i,a){var o,s;if(a===`string`&&t(o=i.toString)&&!n(s=e(o,i))||t(o=i.valueOf)&&!n(s=e(o,i))||a!==`string`&&t(o=i.toString)&&!n(s=e(o,i)))return s;throw new r(`Can't convert object to primitive value`)},tt}var it={exports:{}},at,ot;function st(){return ot?at:(ot=1,at=!0,at)}var ct,lt;function ut(){if(lt)return ct;lt=1;var e=o(),t=Object.defineProperty;return ct=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch{e[n]=r}return r},ct}var dt;function ft(){if(dt)return it.exports;dt=1;var e=st(),t=o(),n=ut(),r=`__core-js_shared__`,i=it.exports=t[r]||n(r,{});return(i.versions||=[]).push({version:`3.44.0`,mode:e?`pure`:`global`,copyright:`© 2014-2025 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE`,source:`https://github.com/zloirock/core-js`}),it.exports}var pt,mt;function ht(){if(mt)return pt;mt=1;var e=ft();return pt=function(t,n){return e[t]||(e[t]=n||{})},pt}var gt,_t;function vt(){if(_t)return gt;_t=1;var e=j(),t=Object;return gt=function(n){return t(e(n))},gt}var yt,bt;function xt(){if(bt)return yt;bt=1;var e=v(),t=vt(),n=e({}.hasOwnProperty);return yt=Object.hasOwn||function(e,r){return n(t(e),r)},yt}var St,Ct;function wt(){if(Ct)return St;Ct=1;var e=v(),t=0,n=Math.random(),r=e(1.1.toString);return St=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+r(++t+n,36)},St}var Tt,Et;function Dt(){if(Et)return Tt;Et=1;var e=o(),t=ht(),n=xt(),r=wt(),i=ze(),a=He(),s=e.Symbol,c=t(`wks`),l=a?s.for||s:s&&s.withoutSetter||r;return Tt=function(e){return n(c,e)||(c[e]=i&&n(s,e)?s[e]:l(`Symbol.`+e)),c[e]},Tt}var Ot,kt;function At(){if(kt)return Ot;kt=1;var e=A(),t=Ce(),n=Ge(),r=et(),i=rt(),a=Dt(),o=TypeError,s=a(`toPrimitive`);return Ot=function(a,c){if(!t(a)||n(a))return a;var l=r(a,s),u;if(l){if(c===void 0&&(c=`default`),u=e(l,a,c),!t(u)||n(u))return u;throw new o(`Can't convert object to primitive value`)}return c===void 0&&(c=`number`),i(a,c)},Ot}var jt,Mt;function Nt(){if(Mt)return jt;Mt=1;var e=At(),t=Ge();return jt=function(n){var r=e(n,`string`);return t(r)?r:r+``},jt}var Pt,Ft;function It(){if(Ft)return Pt;Ft=1;var e=o(),t=Ce(),n=e.document,r=t(n)&&t(n.createElement);return Pt=function(e){return r?n.createElement(e):{}},Pt}var Lt,Rt;function zt(){if(Rt)return Lt;Rt=1;var e=k(),t=l(),n=It();return Lt=!e&&!t(function(){return Object.defineProperty(n(`div`),`a`,{get:function(){return 7}}).a!==7}),Lt}var Bt;function Vt(){if(Bt)return ee;Bt=1;var e=k(),t=A(),n=oe(),r=le(),i=be(),a=Nt(),o=xt(),s=zt(),c=Object.getOwnPropertyDescriptor;return ee.f=e?c:function(e,l){if(e=i(e),l=a(l),s)try{return c(e,l)}catch{}if(o(e,l))return r(!t(n.f,e,l),e[l])},ee}var Ht,Ut;function Wt(){if(Ut)return Ht;Ut=1;var e=l(),t=D(),n=/#|\.prototype\./,r=function(n,r){var c=a[i(n)];return c===s?!0:c===o?!1:t(r)?e(r):!!r},i=r.normalize=function(e){return String(e).replace(n,`.`).toLowerCase()},a=r.data={},o=r.NATIVE=`N`,s=r.POLYFILL=`P`;return Ht=r,Ht}var Gt,Kt;function qt(){if(Kt)return Gt;Kt=1;var e=w(),t=Ze(),n=f(),r=e(e.bind);return Gt=function(e,i){return t(e),i===void 0?e:n?r(e,i):function(){return e.apply(i,arguments)}},Gt}var Jt={},Yt,Xt;function Zt(){return Xt?Yt:(Xt=1,Yt=k()&&l()(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Yt)}var Qt,$t;function en(){if($t)return Qt;$t=1;var e=Ce(),t=String,n=TypeError;return Qt=function(r){if(e(r))return r;throw new n(t(r)+` is not an object`)},Qt}var tn;function nn(){if(tn)return Jt;tn=1;var e=k(),t=zt(),n=Zt(),r=en(),i=Nt(),a=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=`enumerable`,l=`configurable`,u=`writable`;return Jt.f=e?n?function(e,t,n){if(r(e),t=i(t),r(n),typeof e==`function`&&t===`prototype`&&`value`in n&&u in n&&!n[u]){var a=s(e,t);a&&a[u]&&(e[t]=n.value,n={configurable:l in n?n[l]:a[l],enumerable:c in n?n[c]:a[c],writable:!1})}return o(e,t,n)}:o:function(e,n,s){if(r(e),n=i(n),r(s),t)try{return o(e,n,s)}catch{}if(`get`in s||`set`in s)throw new a(`Accessors not supported`);return`value`in s&&(e[n]=s.value),e},Jt}var rn,an;function on(){if(an)return rn;an=1;var e=k(),t=nn(),n=le();return rn=e?function(e,r,i){return t.f(e,r,n(1,i))}:function(e,t,n){return e[t]=n,e},rn}var sn,cn;function P(){if(cn)return sn;cn=1;var e=o(),t=h(),n=w(),r=D(),i=Vt().f,a=Wt(),s=M(),c=qt(),l=on(),u=xt(),d=function(e){var n=function(r,i,a){if(this instanceof n){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,i)}return new e(r,i,a)}return t(e,this,arguments)};return n.prototype=e.prototype,n};return sn=function(t,o){var f=t.target,p=t.global,m=t.stat,h=t.proto,g=p?e:m?e[f]:e[f]&&e[f].prototype,_=p?s:s[f]||l(s,f,{})[f],v=_.prototype,y,b,x,S,C,w,T,E,D;for(S in o)y=a(p?S:f+(m?`.`:`#`)+S,t.forced),b=!y&&g&&u(g,S),w=_[S],b&&(t.dontCallGetSet?(D=i(g,S),T=D&&D.value):T=g[S]),C=b&&T?T:o[S],!(!y&&!h&&typeof w==typeof C)&&(E=t.bind&&b?c(C,e):t.wrap&&b?d(C):h&&r(C)?n(C):C,(t.sham||C&&C.sham||w&&w.sham)&&l(E,`sham`,!0),l(_,S,E),h&&(x=f+`Prototype`,u(s,x)||l(s,x,{}),l(s[x],S,C),t.real&&v&&(y||!v[S])&&l(v,S,C)))},sn}var ln;function un(){if(ln)return r;ln=1;var e=P(),t=k(),n=nn().f;return e({target:`Object`,stat:!0,forced:Object.defineProperty!==n,sham:!t},{defineProperty:n}),r}var dn;function fn(){if(dn)return n.exports;dn=1,un();var e=M().Object,t=n.exports=function(t,n,r){return e.defineProperty(t,n,r)};return e.defineProperty.sham&&(t.sham=!0),n.exports}var pn,mn;function hn(){return mn?pn:(mn=1,pn=fn(),pn)}var gn,_n;function vn(){return _n?gn:(_n=1,gn=hn(),gn)}var yn,bn;function xn(){return bn?yn:(bn=1,yn=vn(),yn)}var Sn,Cn;function wn(){return Cn?Sn:(Cn=1,Sn=xn(),Sn)}var Tn=t(wn()),En={},Dn,On;function kn(){if(On)return Dn;On=1;var e=x();return Dn=Array.isArray||function(t){return e(t)===`Array`},Dn}var An,jn;function Mn(){if(jn)return An;jn=1;var e=Math.ceil,t=Math.floor;return An=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)},An}var Nn,Pn;function Fn(){if(Pn)return Nn;Pn=1;var e=Mn();return Nn=function(t){var n=+t;return n!==n||n===0?0:e(n)},Nn}var In,Ln;function Rn(){if(Ln)return In;Ln=1;var e=Fn(),t=Math.min;return In=function(n){var r=e(n);return r>0?t(r,9007199254740991):0},In}var zn,Bn;function Vn(){if(Bn)return zn;Bn=1;var e=Rn();return zn=function(t){return e(t.length)},zn}var Hn,Un;function Wn(){if(Un)return Hn;Un=1;var e=TypeError,t=9007199254740991;return Hn=function(n){if(n>t)throw e(`Maximum allowed index exceeded`);return n},Hn}var Gn,Kn;function qn(){if(Kn)return Gn;Kn=1;var e=k(),t=nn(),n=le();return Gn=function(r,i,a){e?t.f(r,i,n(0,a)):r[i]=a},Gn}var Jn,Yn;function Xn(){if(Yn)return Jn;Yn=1;var e=Dt()(`toStringTag`),t={};return t[e]=`z`,Jn=String(t)===`[object z]`,Jn}var Zn,Qn;function $n(){if(Qn)return Zn;Qn=1;var e=Xn(),t=D(),n=x(),r=Dt()(`toStringTag`),i=Object,a=n(function(){return arguments}())===`Arguments`,o=function(e,t){try{return e[t]}catch{}};return Zn=e?n:function(e){var s,c,l;return e===void 0?`Undefined`:e===null?`Null`:typeof(c=o(s=i(e),r))==`string`?c:a?n(s):(l=n(s))===`Object`&&t(s.callee)?`Arguments`:l},Zn}var er,tr;function nr(){if(tr)return er;tr=1;var e=v(),t=D(),n=ft(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),er=n.inspectSource,er}var rr,ir;function ar(){if(ir)return rr;ir=1;var e=v(),t=l(),n=D(),r=$n(),i=N(),a=nr(),o=function(){},s=i(`Reflect`,`construct`),c=/^\s*(?:class|function)\b/,u=e(c.exec),d=!c.test(o),f=function(e){if(!n(e))return!1;try{return s(o,[],e),!0}catch{return!1}},p=function(e){if(!n(e))return!1;switch(r(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return d||!!u(c,a(e))}catch{return!0}};return p.sham=!0,rr=!s||t(function(){var e;return f(f.call)||!f(Object)||!f(function(){e=!0})||e})?p:f,rr}var or,sr;function cr(){if(sr)return or;sr=1;var e=kn(),t=ar(),n=Ce(),r=Dt()(`species`),i=Array;return or=function(a){var o;return e(a)&&(o=a.constructor,t(o)&&(o===i||e(o.prototype))?o=void 0:n(o)&&(o=o[r],o===null&&(o=void 0))),o===void 0?i:o},or}var lr,ur;function dr(){if(ur)return lr;ur=1;var e=cr();return lr=function(t,n){return new(e(t))(n===0?0:n)},lr}var fr,pr;function mr(){if(pr)return fr;pr=1;var e=l(),t=Dt(),n=Ie(),r=t(`species`);return fr=function(t){return n>=51||!e(function(){var e=[],n=e.constructor={};return n[r]=function(){return{foo:1}},e[t](Boolean).foo!==1})},fr}var hr;function gr(){if(hr)return En;hr=1;var e=P(),t=l(),n=kn(),r=Ce(),i=vt(),a=Vn(),o=Wn(),s=qn(),c=dr(),u=mr(),d=Dt(),f=Ie(),p=d(`isConcatSpreadable`),m=f>=51||!t(function(){var e=[];return e[p]=!1,e.concat()[0]!==e}),h=function(e){if(!r(e))return!1;var t=e[p];return t===void 0?n(e):!!t};return e({target:`Array`,proto:!0,arity:1,forced:!m||!u(`concat`)},{concat:function(e){var t=i(this),n=c(t,0),r=0,l,u,d,f,p;for(l=-1,d=arguments.length;l<d;l++)if(p=l===-1?t:arguments[l],h(p))for(f=a(p),o(r+f),u=0;u<f;u++,r++)u in p&&s(n,r,p[u]);else o(r+1),s(n,r++,p);return n.length=r,n}}),En}var _r={},vr={},yr,br;function xr(){if(br)return yr;br=1;var e=$n(),t=String;return yr=function(n){if(e(n)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return t(n)},yr}var Sr={},Cr,wr;function Tr(){if(wr)return Cr;wr=1;var e=Fn(),t=Math.max,n=Math.min;return Cr=function(r,i){var a=e(r);return a<0?t(a+i,0):n(a,i)},Cr}var Er,Dr;function Or(){if(Dr)return Er;Dr=1;var e=be(),t=Tr(),n=Vn(),r=function(r){return function(i,a,o){var s=e(i),c=n(s);if(c===0)return!r&&-1;var l=t(o,c),u;if(r&&a!==a){for(;c>l;)if(u=s[l++],u!==u)return!0}else for(;c>l;l++)if((r||l in s)&&s[l]===a)return r||l||0;return!r&&-1}};return Er={includes:r(!0),indexOf:r(!1)},Er}var kr,Ar;function jr(){return Ar?kr:(Ar=1,kr={},kr)}var Mr,Nr;function Pr(){if(Nr)return Mr;Nr=1;var e=v(),t=xt(),n=be(),r=Or().indexOf,i=jr(),a=e([].push);return Mr=function(e,o){var s=n(e),c=0,l=[],u;for(u in s)!t(i,u)&&t(s,u)&&a(l,u);for(;o.length>c;)t(s,u=o[c++])&&(~r(l,u)||a(l,u));return l},Mr}var Fr,Ir;function Lr(){return Ir?Fr:(Ir=1,Fr=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],Fr)}var Rr,zr;function Br(){if(zr)return Rr;zr=1;var e=Pr(),t=Lr();return Rr=Object.keys||function(n){return e(n,t)},Rr}var Vr;function Hr(){if(Vr)return Sr;Vr=1;var e=k(),t=Zt(),n=nn(),r=en(),i=be(),a=Br();return Sr.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var o=i(t),s=a(t),c=s.length,l=0,u;c>l;)n.f(e,u=s[l++],o[u]);return e},Sr}var Ur,Wr;function Gr(){return Wr?Ur:(Wr=1,Ur=N()(`document`,`documentElement`),Ur)}var Kr,qr;function Jr(){if(qr)return Kr;qr=1;var e=ht(),t=wt(),n=e(`keys`);return Kr=function(e){return n[e]||(n[e]=t(e))},Kr}var Yr,Xr;function Zr(){if(Xr)return Yr;Xr=1;var e=en(),t=Hr(),n=Lr(),r=jr(),i=Gr(),a=It(),o=Jr(),s=`>`,c=`<`,l=`prototype`,u=`script`,d=o(`IE_PROTO`),f=function(){},p=function(e){return c+u+s+e+c+`/`+u+s},m=function(e){e.write(p(``)),e.close();var t=e.parentWindow.Object;return e=null,t},h=function(){var e=a(`iframe`),t=`java`+u+`:`,n;return e.style.display=`none`,i.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(p(`document.F=Object`)),n.close(),n.F},g,_=function(){try{g=new ActiveXObject(`htmlfile`)}catch{}_=typeof document<`u`?document.domain&&g?m(g):h():m(g);for(var e=n.length;e--;)delete _[l][n[e]];return _()};return r[d]=!0,Yr=Object.create||function(n,r){var i;return n===null?i=_():(f[l]=e(n),i=new f,f[l]=null,i[d]=n),r===void 0?i:t.f(i,r)},Yr}var Qr={},$r;function ei(){if($r)return Qr;$r=1;var e=Pr(),t=Lr().concat(`length`,`prototype`);return Qr.f=Object.getOwnPropertyNames||function(n){return e(n,t)},Qr}var ti={},ni,ri;function ii(){return ri?ni:(ri=1,ni=v()([].slice),ni)}var ai;function oi(){if(ai)return ti;ai=1;var e=x(),t=be(),n=ei().f,r=ii(),i=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return n(e)}catch{return r(i)}};return ti.f=function(r){return i&&e(r)===`Window`?a(r):n(t(r))},ti}var si={},ci;function li(){return ci?si:(ci=1,si.f=Object.getOwnPropertySymbols,si)}var ui,di;function fi(){if(di)return ui;di=1;var e=on();return ui=function(t,n,r,i){return i&&i.enumerable?t[n]=r:e(t,n,r),t},ui}var pi,mi;function hi(){if(mi)return pi;mi=1;var e=nn();return pi=function(t,n,r){return e.f(t,n,r)},pi}var gi={},_i;function vi(){return _i?gi:(_i=1,gi.f=Dt(),gi)}var yi,bi;function xi(){if(bi)return yi;bi=1;var e=M(),t=xt(),n=vi(),r=nn().f;return yi=function(i){var a=e.Symbol||={};t(a,i)||r(a,i,{value:n.f(i)})},yi}var Si,Ci;function wi(){if(Ci)return Si;Ci=1;var e=A(),t=N(),n=Dt(),r=fi();return Si=function(){var i=t(`Symbol`),a=i&&i.prototype,o=a&&a.valueOf,s=n(`toPrimitive`);a&&!a[s]&&r(a,s,function(t){return e(o,this)},{arity:1})},Si}var Ti,Ei;function Di(){if(Ei)return Ti;Ei=1;var e=Xn(),t=$n();return Ti=e?{}.toString:function(){return`[object `+t(this)+`]`},Ti}var Oi,ki;function Ai(){if(ki)return Oi;ki=1;var e=Xn(),t=nn().f,n=on(),r=xt(),i=Di(),a=Dt()(`toStringTag`);return Oi=function(o,s,c,l){var u=c?o:o&&o.prototype;u&&(r(u,a)||t(u,a,{configurable:!0,value:s}),l&&!e&&n(u,`toString`,i))},Oi}var ji,Mi;function Ni(){if(Mi)return ji;Mi=1;var e=o(),t=D(),n=e.WeakMap;return ji=t(n)&&/native code/.test(String(n)),ji}var Pi,Fi;function Ii(){if(Fi)return Pi;Fi=1;var e=Ni(),t=o(),n=Ce(),r=on(),i=xt(),a=ft(),s=Jr(),c=jr(),l=`Object already initialized`,u=t.TypeError,d=t.WeakMap,f,p,m,h=function(e){return m(e)?p(e):f(e,{})},g=function(e){return function(t){var r;if(!n(t)||(r=p(t)).type!==e)throw new u(`Incompatible receiver, `+e+` required`);return r}};if(e||a.state){var _=a.state||=new d;_.get=_.get,_.has=_.has,_.set=_.set,f=function(e,t){if(_.has(e))throw new u(l);return t.facade=e,_.set(e,t),t},p=function(e){return _.get(e)||{}},m=function(e){return _.has(e)}}else{var v=s(`state`);c[v]=!0,f=function(e,t){if(i(e,v))throw new u(l);return t.facade=e,r(e,v,t),t},p=function(e){return i(e,v)?e[v]:{}},m=function(e){return i(e,v)}}return Pi={set:f,get:p,has:m,enforce:h,getterFor:g},Pi}var Li,Ri;function zi(){if(Ri)return Li;Ri=1;var e=qt(),t=v(),n=fe(),r=vt(),i=Vn(),a=dr(),o=t([].push),s=function(t){var s=t===1,c=t===2,l=t===3,u=t===4,d=t===6,f=t===7,p=t===5||d;return function(m,h,g,_){for(var v=r(m),y=n(v),b=i(y),x=e(h,g),S=0,C=_||a,w=s?C(m,b):c||f?C(m,0):void 0,T,E;b>S;S++)if((p||S in y)&&(T=y[S],E=x(T,S,v),t))if(s)w[S]=E;else if(E)switch(t){case 3:return!0;case 5:return T;case 6:return S;case 2:o(w,T)}else switch(t){case 4:return!1;case 7:o(w,T)}return d?-1:l||u?u:w}};return Li={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)},Li}var Bi;function Vi(){if(Bi)return vr;Bi=1;var e=P(),t=o(),n=A(),r=v(),i=st(),a=k(),s=ze(),c=l(),u=xt(),d=Ae(),f=en(),p=be(),m=Nt(),h=xr(),g=le(),_=Zr(),y=Br(),b=ei(),x=oi(),S=li(),C=Vt(),w=nn(),T=Hr(),E=oe(),D=fi(),ee=hi(),te=ht(),O=Jr(),ne=jr(),re=wt(),ie=Dt(),ae=vi(),se=xi(),ce=wi(),ue=Ai(),de=Ii(),fe=zi().forEach,pe=O(`hidden`),me=`Symbol`,he=`prototype`,ge=de.set,_e=de.getterFor(me),j=Object[he],ve=t.Symbol,ye=ve&&ve[he],xe=t.RangeError,Se=t.TypeError,Ce=t.QObject,we=C.f,Te=w.f,M=x.f,Ee=E.f,De=r([].push),N=te(`symbols`),Oe=te(`op-symbols`),ke=te(`wks`),je=!Ce||!Ce[he]||!Ce[he].findChild,Me=function(e,t,n){var r=we(j,t);r&&delete j[t],Te(e,t,n),r&&e!==j&&Te(j,t,r)},Ne=a&&c(function(){return _(Te({},`a`,{get:function(){return Te(this,`a`,{value:7}).a}})).a!==7})?Me:Te,Pe=function(e,t){var n=N[e]=_(ye);return ge(n,{type:me,tag:e,description:t}),a||(n.description=t),n},Fe=function(e,t,n){e===j&&Fe(Oe,t,n),f(e);var r=m(t);return f(n),u(N,r)?(n.enumerable?(u(e,pe)&&e[pe][r]&&(e[pe][r]=!1),n=_(n,{enumerable:g(0,!1)})):(u(e,pe)||Te(e,pe,g(1,_(null))),e[pe][r]=!0),Ne(e,r,n)):Te(e,r,n)},Ie=function(e,t){f(e);var r=p(t);return fe(y(r).concat(He(r)),function(t){(!a||n(Re,r,t))&&Fe(e,t,r[t])}),e},Le=function(e,t){return t===void 0?_(e):Ie(_(e),t)},Re=function(e){var t=m(e),r=n(Ee,this,t);return this===j&&u(N,t)&&!u(Oe,t)?!1:r||!u(this,t)||!u(N,t)||u(this,pe)&&this[pe][t]?r:!0},Be=function(e,t){var n=p(e),r=m(t);if(!(n===j&&u(N,r)&&!u(Oe,r))){var i=we(n,r);return i&&u(N,r)&&!(u(n,pe)&&n[pe][r])&&(i.enumerable=!0),i}},Ve=function(e){var t=M(p(e)),n=[];return fe(t,function(e){!u(N,e)&&!u(ne,e)&&De(n,e)}),n},He=function(e){var t=e===j,n=M(t?Oe:p(e)),r=[];return fe(n,function(e){u(N,e)&&(!t||u(j,e))&&De(r,N[e])}),r};return s||(ve=function(){if(d(ye,this))throw new Se(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:h(arguments[0]),r=re(e),i=function(e){var a=this===void 0?t:this;a===j&&n(i,Oe,e),u(a,pe)&&u(a[pe],r)&&(a[pe][r]=!1);var o=g(1,e);try{Ne(a,r,o)}catch(e){if(!(e instanceof xe))throw e;Me(a,r,o)}};return a&&je&&Ne(j,r,{configurable:!0,set:i}),Pe(r,e)},ye=ve[he],D(ye,`toString`,function(){return _e(this).tag}),D(ve,`withoutSetter`,function(e){return Pe(re(e),e)}),E.f=Re,w.f=Fe,T.f=Ie,C.f=Be,b.f=x.f=Ve,S.f=He,ae.f=function(e){return Pe(ie(e),e)},a&&(ee(ye,`description`,{configurable:!0,get:function(){return _e(this).description}}),i||D(j,`propertyIsEnumerable`,Re,{unsafe:!0}))),e({global:!0,constructor:!0,wrap:!0,forced:!s,sham:!s},{Symbol:ve}),fe(y(ke),function(e){se(e)}),e({target:me,stat:!0,forced:!s},{useSetter:function(){je=!0},useSimple:function(){je=!1}}),e({target:`Object`,stat:!0,forced:!s,sham:!a},{create:Le,defineProperty:Fe,defineProperties:Ie,getOwnPropertyDescriptor:Be}),e({target:`Object`,stat:!0,forced:!s},{getOwnPropertyNames:Ve}),ce(),ue(ve,me),ne[pe]=!0,vr}var Hi={},Ui,Wi;function Gi(){return Wi?Ui:(Wi=1,Ui=ze()&&!!Symbol.for&&!!Symbol.keyFor,Ui)}var Ki;function qi(){if(Ki)return Hi;Ki=1;var e=P(),t=N(),n=xt(),r=xr(),i=ht(),a=Gi(),o=i(`string-to-symbol-registry`),s=i(`symbol-to-string-registry`);return e({target:`Symbol`,stat:!0,forced:!a},{for:function(e){var i=r(e);if(n(o,i))return o[i];var a=t(`Symbol`)(i);return o[i]=a,s[a]=i,a}}),Hi}var Ji={},Yi;function Xi(){if(Yi)return Ji;Yi=1;var e=P(),t=xt(),n=Ge(),r=Je(),i=ht(),a=Gi(),o=i(`symbol-to-string-registry`);return e({target:`Symbol`,stat:!0,forced:!a},{keyFor:function(e){if(!n(e))throw TypeError(r(e)+` is not a symbol`);if(t(o,e))return o[e]}}),Ji}var Zi={},Qi,$i;function ea(){if($i)return Qi;$i=1;var e=v(),t=kn(),n=D(),r=x(),i=xr(),a=e([].push);return Qi=function(e){if(n(e))return e;if(t(e)){for(var o=e.length,s=[],c=0;c<o;c++){var l=e[c];typeof l==`string`?a(s,l):(typeof l==`number`||r(l)===`Number`||r(l)===`String`)&&a(s,i(l))}var u=s.length,d=!0;return function(e,n){if(d)return d=!1,n;if(t(this))return n;for(var r=0;r<u;r++)if(s[r]===e)return n}}},Qi}var ta;function na(){if(ta)return Zi;ta=1;var e=P(),t=N(),n=h(),r=A(),i=v(),a=l(),o=D(),s=Ge(),c=ii(),u=ea(),d=ze(),f=String,p=t(`JSON`,`stringify`),m=i(/./.exec),g=i(``.charAt),_=i(``.charCodeAt),y=i(``.replace),b=i(1.1.toString),x=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,C=/^[\uDC00-\uDFFF]$/,w=!d||a(function(){var e=t(`Symbol`)(`stringify detection`);return p([e])!==`[null]`||p({a:e})!==`{}`||p(Object(e))!==`{}`}),T=a(function(){return p(`\udf06\ud834`)!==`"\\udf06\\ud834"`||p(`\udead`)!==`"\\udead"`}),E=function(e,t){var i=c(arguments),a=u(t);if(!(!o(a)&&(e===void 0||s(e))))return i[1]=function(e,t){if(o(a)&&(t=r(a,this,f(e),t)),!s(t))return t},n(p,null,i)},ee=function(e,t,n){var r=g(n,t-1),i=g(n,t+1);return m(S,e)&&!m(C,i)||m(C,e)&&!m(S,r)?`\\u`+b(_(e,0),16):e};return p&&e({target:`JSON`,stat:!0,arity:3,forced:w||T},{stringify:function(e,t,r){var i=c(arguments),a=n(w?E:p,null,i);return T&&typeof a==`string`?y(a,x,ee):a}}),Zi}var ra={},ia;function aa(){if(ia)return ra;ia=1;var e=P(),t=ze(),n=l(),r=li(),i=vt();return e({target:`Object`,stat:!0,forced:!t||n(function(){r.f(1)})},{getOwnPropertySymbols:function(e){var t=r.f;return t?t(i(e)):[]}}),ra}var oa;function sa(){return oa?_r:(oa=1,Vi(),qi(),Xi(),na(),aa(),_r)}var ca={},la;function ua(){return la?ca:(la=1,xi()(`asyncDispose`),ca)}var da={},fa;function pa(){return fa?da:(fa=1,xi()(`asyncIterator`),da)}var ma={},ha;function ga(){return ha?ma:(ha=1,xi()(`dispose`),ma)}var _a={},va;function ya(){return va?_a:(va=1,xi()(`hasInstance`),_a)}var ba={},xa;function Sa(){return xa?ba:(xa=1,xi()(`isConcatSpreadable`),ba)}var Ca={},wa;function Ta(){return wa?Ca:(wa=1,xi()(`iterator`),Ca)}var Ea={},Da;function Oa(){return Da?Ea:(Da=1,xi()(`match`),Ea)}var ka={},Aa;function ja(){return Aa?ka:(Aa=1,xi()(`matchAll`),ka)}var Ma={},Na;function Pa(){return Na?Ma:(Na=1,xi()(`replace`),Ma)}var Fa={},Ia;function La(){return Ia?Fa:(Ia=1,xi()(`search`),Fa)}var Ra={},za;function Ba(){return za?Ra:(za=1,xi()(`species`),Ra)}var Va={},Ha;function Ua(){return Ha?Va:(Ha=1,xi()(`split`),Va)}var Wa={},Ga;function Ka(){if(Ga)return Wa;Ga=1;var e=xi(),t=wi();return e(`toPrimitive`),t(),Wa}var qa={},Ja;function Ya(){if(Ja)return qa;Ja=1;var e=N(),t=xi(),n=Ai();return t(`toStringTag`),n(e(`Symbol`),`Symbol`),qa}var Xa={},Za;function Qa(){return Za?Xa:(Za=1,xi()(`unscopables`),Xa)}var $a={},eo;function to(){return eo?$a:(eo=1,Ai()(o().JSON,`JSON`,!0),$a)}var no,ro;function io(){return ro?no:(ro=1,gr(),sa(),ua(),pa(),ga(),ya(),Sa(),Ta(),Oa(),ja(),Pa(),La(),Ba(),Ua(),Ka(),Ya(),Qa(),to(),no=M().Symbol,no)}var ao={},oo,so;function co(){return so?oo:(so=1,oo=function(){},oo)}var lo,uo;function fo(){return uo?lo:(uo=1,lo={},lo)}var po,mo;function ho(){if(mo)return po;mo=1;var e=k(),t=xt(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,i=t(n,`name`);return po={EXISTS:i,PROPER:i&&(function(){}).name===`something`,CONFIGURABLE:i&&(!e||e&&r(n,`name`).configurable)},po}var go,_o;function vo(){return _o?go:(_o=1,go=!l()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),go)}var yo,bo;function xo(){if(bo)return yo;bo=1;var e=xt(),t=D(),n=vt(),r=Jr(),i=vo(),a=r(`IE_PROTO`),o=Object,s=o.prototype;return yo=i?o.getPrototypeOf:function(r){var i=n(r);if(e(i,a))return i[a];var c=i.constructor;return t(c)&&i instanceof c?c.prototype:i instanceof o?s:null},yo}var So,Co;function wo(){if(Co)return So;Co=1;var e=l(),t=D(),n=Ce(),r=Zr(),i=xo(),a=fi(),o=Dt(),s=st(),c=o(`iterator`),u=!1,d,f,p;return[].keys&&(p=[].keys(),`next`in p?(f=i(i(p)),f!==Object.prototype&&(d=f)):u=!0),!n(d)||e(function(){var e={};return d[c].call(e)!==e})?d={}:s&&(d=r(d)),t(d[c])||a(d,c,function(){return this}),So={IteratorPrototype:d,BUGGY_SAFARI_ITERATORS:u},So}var To,Eo;function Do(){if(Eo)return To;Eo=1;var e=wo().IteratorPrototype,t=Zr(),n=le(),r=Ai(),i=fo(),a=function(){return this};return To=function(o,s,c,l){var u=s+` Iterator`;return o.prototype=t(e,{next:n(+!l,c)}),r(o,u,!1,!0),i[u]=a,o},To}var Oo,ko;function Ao(){if(ko)return Oo;ko=1;var e=v(),t=Ze();return Oo=function(n,r,i){try{return e(t(Object.getOwnPropertyDescriptor(n,r)[i]))}catch{}},Oo}var jo,Mo;function No(){if(Mo)return jo;Mo=1;var e=Ce();return jo=function(t){return e(t)||t===null},jo}var Po,Fo;function Io(){if(Fo)return Po;Fo=1;var e=No(),t=String,n=TypeError;return Po=function(r){if(e(r))return r;throw new n(`Can't set `+t(r)+` as a prototype`)},Po}var Lo,Ro;function zo(){if(Ro)return Lo;Ro=1;var e=Ao(),t=Ce(),n=j(),r=Io();return Lo=Object.setPrototypeOf||(`__proto__`in{}?function(){var i=!1,a={},o;try{o=e(Object.prototype,`__proto__`,`set`),o(a,[]),i=a instanceof Array}catch{}return function(e,a){return n(e),r(a),t(e)&&(i?o(e,a):e.__proto__=a),e}}():void 0),Lo}var Bo,Vo;function Ho(){if(Vo)return Bo;Vo=1;var e=P(),t=A(),n=st(),r=ho(),i=D(),a=Do(),o=xo(),s=zo(),c=Ai(),l=on(),u=fi(),d=Dt(),f=fo(),p=wo(),m=r.PROPER,h=r.CONFIGURABLE,g=p.IteratorPrototype,_=p.BUGGY_SAFARI_ITERATORS,v=d(`iterator`),y=`keys`,b=`values`,x=`entries`,S=function(){return this};return Bo=function(r,d,p,C,w,T,E){a(p,d,C);var D=function(e){if(e===w&&ne)return ne;if(!_&&e&&e in O)return O[e];switch(e){case y:return function(){return new p(this,e)};case b:return function(){return new p(this,e)};case x:return function(){return new p(this,e)}}return function(){return new p(this)}},ee=d+` Iterator`,te=!1,O=r.prototype,k=O[v]||O[`@@iterator`]||w&&O[w],ne=!_&&k||D(w),re=d===`Array`&&O.entries||k,A,ie,ae;if(re&&(A=o(re.call(new r)),A!==Object.prototype&&A.next&&(!n&&o(A)!==g&&(s?s(A,g):i(A[v])||u(A,v,S)),c(A,ee,!0,!0),n&&(f[ee]=S))),m&&w===b&&k&&k.name!==b&&(!n&&h?l(O,`name`,b):(te=!0,ne=function(){return t(k,this)})),w)if(ie={values:D(b),keys:T?ne:D(y),entries:D(x)},E)for(ae in ie)(_||te||!(ae in O))&&u(O,ae,ie[ae]);else e({target:d,proto:!0,forced:_||te},ie);return(!n||E)&&O[v]!==ne&&u(O,v,ne,{name:w}),f[d]=ne,ie},Bo}var Uo,Wo;function Go(){return Wo?Uo:(Wo=1,Uo=function(e,t){return{value:e,done:t}},Uo)}var Ko,qo;function Jo(){if(qo)return Ko;qo=1;var e=be(),t=co(),n=fo(),r=Ii(),i=nn().f,a=Ho(),o=Go(),s=st(),c=k(),l=`Array Iterator`,u=r.set,d=r.getterFor(l);Ko=a(Array,`Array`,function(t,n){u(this,{type:l,target:e(t),index:0,kind:n})},function(){var e=d(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,o(void 0,!0);switch(e.kind){case`keys`:return o(n,!1);case`values`:return o(t[n],!1)}return o([n,t[n]],!1)},`values`);var f=n.Arguments=n.Array;if(t(`keys`),t(`values`),t(`entries`),!s&&c&&f.name!==`values`)try{i(f,`name`,{value:`values`})}catch{}return Ko}var Yo,Xo;function Zo(){return Xo?Yo:(Xo=1,Yo={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Yo)}var Qo;function $o(){if(Qo)return ao;Qo=1,Jo();var e=Zo(),t=o(),n=Ai(),r=fo();for(var i in e)n(t[i],i),r[i]=r.Array;return ao}var es,ts;function ns(){if(ts)return es;ts=1;var e=io();return $o(),es=e,es}var rs={},is;function as(){if(is)return rs;is=1;var e=Dt(),t=nn().f,n=e(`metadata`),r=Function.prototype;return r[n]===void 0&&t(r,n,{value:null}),rs}var os={},ss;function cs(){return ss?os:(ss=1,ua(),os)}var ls={},us;function ds(){return us?ls:(us=1,ga(),ls)}var fs={},ps;function ms(){return ps?fs:(ps=1,xi()(`metadata`),fs)}var hs,gs;function _s(){if(gs)return hs;gs=1;var e=ns();return as(),cs(),ds(),ms(),hs=e,hs}var vs={},ys,bs;function xs(){if(bs)return ys;bs=1;var e=N(),t=v(),n=e(`Symbol`),r=n.keyFor,i=t(n.prototype.valueOf);return ys=n.isRegisteredSymbol||function(e){try{return r(i(e))!==void 0}catch{return!1}},ys}var Ss;function Cs(){return Ss?vs:(Ss=1,P()({target:`Symbol`,stat:!0},{isRegisteredSymbol:xs()}),vs)}var ws={},Ts,Es;function Ds(){if(Es)return Ts;Es=1;for(var e=ht(),t=N(),n=v(),r=Ge(),i=Dt(),a=t(`Symbol`),o=a.isWellKnownSymbol,s=t(`Object`,`getOwnPropertyNames`),c=n(a.prototype.valueOf),l=e(`wks`),u=0,d=s(a),f=d.length;u<f;u++)try{var p=d[u];r(a[p])&&i(p)}catch{}return Ts=function(e){if(o&&o(e))return!0;try{for(var t=c(e),n=0,r=s(l),i=r.length;n<i;n++)if(l[r[n]]==t)return!0}catch{}return!1},Ts}var Os;function ks(){return Os?ws:(Os=1,P()({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:Ds()}),ws)}var As={},js;function Ms(){return js?As:(js=1,xi()(`customMatcher`),As)}var Ns={},Ps;function Fs(){return Ps?Ns:(Ps=1,xi()(`observable`),Ns)}var Is={},Ls;function Rs(){return Ls?Is:(Ls=1,P()({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:xs()}),Is)}var zs={},Bs;function Vs(){return Bs?zs:(Bs=1,P()({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:Ds()}),zs)}var Hs={},Us;function Ws(){return Us?Hs:(Us=1,xi()(`matcher`),Hs)}var Gs={},Ks;function qs(){return Ks?Gs:(Ks=1,xi()(`metadataKey`),Gs)}var Js={},Ys;function Xs(){return Ys?Js:(Ys=1,xi()(`patternMatch`),Js)}var Zs={},Qs;function $s(){return Qs?Zs:(Qs=1,xi()(`replaceAll`),Zs)}var ec,tc;function nc(){if(tc)return ec;tc=1;var e=_s();return Cs(),ks(),Ms(),Fs(),Rs(),Vs(),Ws(),qs(),Xs(),$s(),ec=e,ec}var rc,ic;function ac(){return ic?rc:(ic=1,rc=nc(),rc)}var oc=t(ac()),sc={},cc,lc;function uc(){if(lc)return cc;lc=1;var e=v(),t=Fn(),n=xr(),r=j(),i=e(``.charAt),a=e(``.charCodeAt),o=e(``.slice),s=function(e){return function(s,c){var l=n(r(s)),u=t(c),d=l.length,f,p;return u<0||u>=d?e?``:void 0:(f=a(l,u),f<55296||f>56319||u+1===d||(p=a(l,u+1))<56320||p>57343?e?i(l,u):f:e?o(l,u,u+2):(f-55296<<10)+(p-56320)+65536)}};return cc={codeAt:s(!1),charAt:s(!0)},cc}var dc;function fc(){if(dc)return sc;dc=1;var e=uc().charAt,t=xr(),n=Ii(),r=Ho(),i=Go(),a=`String Iterator`,o=n.set,s=n.getterFor(a);return r(String,`String`,function(e){o(this,{type:a,string:t(e),index:0})},function(){var t=s(this),n=t.string,r=t.index,a;return r>=n.length?i(void 0,!0):(a=e(n,r),t.index+=a.length,i(a,!1))}),sc}var pc,mc;function hc(){return mc?pc:(mc=1,Jo(),fc(),Ta(),pc=vi().f(`iterator`),pc)}var gc,_c;function vc(){if(_c)return gc;_c=1;var e=hc();return $o(),gc=e,gc}var yc,bc;function xc(){return bc?yc:(bc=1,yc=vc(),yc)}var Sc,Cc;function wc(){return Cc?Sc:(Cc=1,Sc=xc(),Sc)}var Tc,Ec;function Dc(){return Ec?Tc:(Ec=1,Tc=wc(),Tc)}var Oc=t(Dc());function kc(e){"@babel/helpers - typeof";return kc=typeof oc==`function`&&typeof Oc==`symbol`?function(e){return typeof e}:function(e){return e&&typeof oc==`function`&&e.constructor===oc&&e!==oc.prototype?`symbol`:typeof e},kc(e)}var Ac,jc;function Mc(){return jc?Ac:(jc=1,Ka(),Ac=vi().f(`toPrimitive`),Ac)}var Nc,Pc;function Fc(){return Pc?Nc:(Pc=1,Nc=Mc(),Nc)}var Ic,Lc;function Rc(){return Lc?Ic:(Lc=1,Ic=Fc(),Ic)}var zc,Bc;function Vc(){return Bc?zc:(Bc=1,zc=Rc(),zc)}var Hc,Uc;function Wc(){return Uc?Hc:(Uc=1,Hc=Vc(),Hc)}var Gc=t(Wc());function Kc(e,t){if(kc(e)!=`object`||!e)return e;var n=e[Gc];if(n!==void 0){var r=n.call(e,t);if(kc(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qc(e){var t=Kc(e,`string`);return kc(t)==`symbol`?t:t+``}function Jc(e,t,n){return(t=qc(t))in e?Tn(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yc={},Xc,Zc;function Qc(){if(Zc)return Xc;Zc=1;var e=v(),t=Ze(),n=Ce(),r=xt(),i=ii(),a=f(),o=Function,s=e([].concat),c=e([].join),l={},u=function(e,t,n){if(!r(l,t)){for(var i=[],a=0;a<t;a++)i[a]=`a[`+a+`]`;l[t]=o(`C,a`,`return new C(`+c(i,`,`)+`)`)}return l[t](e,n)};return Xc=a?o.bind:function(e){var r=t(this),a=r.prototype,o=i(arguments,1),c=function(){var t=s(o,i(arguments));return this instanceof c?u(r,t.length,t):r.apply(e,t)};return n(a)&&(c.prototype=a),c},Xc}var $c;function el(){if($c)return Yc;$c=1;var e=P(),t=Qc();return e({target:`Function`,proto:!0,forced:Function.bind!==t},{bind:t}),Yc}var tl,nl;function rl(){if(nl)return tl;nl=1;var e=o(),t=M();return tl=function(n,r){var i=t[n+`Prototype`],a=i&&i[r];if(a)return a;var o=e[n],s=o&&o.prototype;return s&&s[r]},tl}var il,al;function ol(){return al?il:(al=1,el(),il=rl()(`Function`,`bind`),il)}var sl,cl;function ll(){if(cl)return sl;cl=1;var e=Ae(),t=ol(),n=Function.prototype;return sl=function(r){var i=r.bind;return r===n||e(n,r)&&i===n.bind?t:i},sl}var ul,dl;function fl(){return dl?ul:(dl=1,ul=ll(),ul)}var pl,ml;function hl(){return ml?pl:(ml=1,pl=fl(),pl)}var gl=t(hl()),_l={},vl,yl;function bl(){if(yl)return vl;yl=1;var e=Ze(),t=vt(),n=fe(),r=Vn(),i=TypeError,a=`Reduce of empty array with no initial value`,o=function(o){return function(s,c,l,u){var d=t(s),f=n(d),p=r(d);if(e(c),p===0&&l<2)throw new i(a);var m=o?p-1:0,h=o?-1:1;if(l<2)for(;;){if(m in f){u=f[m],m+=h;break}if(m+=h,o?m<0:p<=m)throw new i(a)}for(;o?m>=0:p>m;m+=h)m in f&&(u=c(u,f[m],m,d));return u}};return vl={left:o(!1),right:o(!0)},vl}var xl,Sl;function Cl(){if(Sl)return xl;Sl=1;var e=l();return xl=function(t,n){var r=[][t];return!!r&&e(function(){r.call(null,n||function(){return 1},1)})},xl}var wl,Tl;function El(){if(Tl)return wl;Tl=1;var e=o(),t=Ne(),n=x(),r=function(e){return t.slice(0,e.length)===e};return wl=(function(){return r(`Bun/`)?`BUN`:r(`Cloudflare-Workers`)?`CLOUDFLARE`:r(`Deno/`)?`DENO`:r(`Node.js/`)?`NODE`:e.Bun&&typeof Bun.version==`string`?`BUN`:e.Deno&&typeof Deno.version==`object`?`DENO`:n(e.process)===`process`?`NODE`:e.window&&e.document?`BROWSER`:`REST`})(),wl}var Dl,Ol;function kl(){return Ol?Dl:(Ol=1,Dl=El()===`NODE`,Dl)}var Al;function jl(){if(Al)return _l;Al=1;var e=P(),t=bl().left,n=Cl(),r=Ie();return e({target:`Array`,proto:!0,forced:!kl()&&r>79&&r<83||!n(`reduce`)},{reduce:function(e){var n=arguments.length;return t(this,e,n,n>1?arguments[1]:void 0)}}),_l}var Ml,Nl;function Pl(){return Nl?Ml:(Nl=1,jl(),Ml=rl()(`Array`,`reduce`),Ml)}var Fl,Il;function Ll(){if(Il)return Fl;Il=1;var e=Ae(),t=Pl(),n=Array.prototype;return Fl=function(r){var i=r.reduce;return r===n||e(n,r)&&i===n.reduce?t:i},Fl}var Rl,zl;function Bl(){return zl?Rl:(zl=1,Rl=Ll(),Rl)}var Vl,Hl;function Ul(){return Hl?Vl:(Hl=1,Vl=Bl(),Vl)}var Wl=t(Ul()),Gl={},Kl;function ql(){if(Kl)return Gl;Kl=1;var e=P(),t=zi().filter;return e({target:`Array`,proto:!0,forced:!mr()(`filter`)},{filter:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),Gl}var Jl,Yl;function Xl(){return Yl?Jl:(Yl=1,ql(),Jl=rl()(`Array`,`filter`),Jl)}var Zl,Ql;function $l(){if(Ql)return Zl;Ql=1;var e=Ae(),t=Xl(),n=Array.prototype;return Zl=function(r){var i=r.filter;return r===n||e(n,r)&&i===n.filter?t:i},Zl}var eu,tu;function nu(){return tu?eu:(tu=1,eu=$l(),eu)}var ru,iu;function au(){return iu?ru:(iu=1,ru=nu(),ru)}var ou=t(au()),su={},cu;function lu(){if(cu)return su;cu=1;var e=P(),t=zi().map;return e({target:`Array`,proto:!0,forced:!mr()(`map`)},{map:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),su}var uu,du;function fu(){return du?uu:(du=1,lu(),uu=rl()(`Array`,`map`),uu)}var pu,mu;function hu(){if(mu)return pu;mu=1;var e=Ae(),t=fu(),n=Array.prototype;return pu=function(r){var i=r.map;return r===n||e(n,r)&&i===n.map?t:i},pu}var gu,_u;function vu(){return _u?gu:(_u=1,gu=hu(),gu)}var yu,bu;function xu(){return bu?yu:(bu=1,yu=vu(),yu)}var Su=t(xu()),Cu={},wu,Tu;function Eu(){if(Tu)return wu;Tu=1;var e=kn(),t=Vn(),n=Wn(),r=qt(),i=function(a,o,s,c,l,u,d,f){for(var p=l,m=0,h=d?r(d,f):!1,g,_;m<c;)m in s&&(g=h?h(s[m],m,o):s[m],u>0&&e(g)?(_=t(g),p=i(a,o,g,_,p,u-1)-1):(n(p+1),a[p]=g),p++),m++;return p};return wu=i,wu}var Du;function Ou(){if(Du)return Cu;Du=1;var e=P(),t=Eu(),n=Ze(),r=vt(),i=Vn(),a=dr();return e({target:`Array`,proto:!0},{flatMap:function(e){var o=r(this),s=i(o),c;return n(e),c=a(o,0),c.length=t(c,o,o,s,0,1,e,arguments.length>1?arguments[1]:void 0),c}}),Cu}var ku={},Au;function ju(){return Au?ku:(Au=1,co()(`flatMap`),ku)}var Mu,Nu;function Pu(){return Nu?Mu:(Nu=1,Ou(),ju(),Mu=rl()(`Array`,`flatMap`),Mu)}var Fu,Iu;function Lu(){if(Iu)return Fu;Iu=1;var e=Ae(),t=Pu(),n=Array.prototype;return Fu=function(r){var i=r.flatMap;return r===n||e(n,r)&&i===n.flatMap?t:i},Fu}var Ru,zu;function Bu(){return zu?Ru:(zu=1,Ru=Lu(),Ru)}var Vu,Hu;function Uu(){return Hu?Vu:(Hu=1,Vu=Bu(),Vu)}t(Uu());var Wu,Gu;function Ku(){return Gu?Wu:(Gu=1,Wu=ns(),Wu)}var qu=t(Ku()),Ju={},Yu;function Xu(){if(Yu)return Ju;Yu=1;var e=P(),t=kn(),n=ar(),r=Ce(),i=Tr(),a=Vn(),o=be(),s=qn(),c=Dt(),l=mr(),u=ii(),d=l(`slice`),f=c(`species`),p=Array,m=Math.max;return e({target:`Array`,proto:!0,forced:!d},{slice:function(e,c){var l=o(this),d=a(l),h=i(e,d),g=i(c===void 0?d:c,d),_,v,y;if(t(l)&&(_=l.constructor,n(_)&&(_===p||t(_.prototype))?_=void 0:r(_)&&(_=_[f],_===null&&(_=void 0)),_===p||_===void 0))return u(l,h,g);for(v=new(_===void 0?p:_)(m(g-h,0)),y=0;h<g;h++,y++)h in l&&s(v,y,l[h]);return v.length=y,v}}),Ju}var Zu,Qu;function $u(){return Qu?Zu:(Qu=1,Xu(),Zu=rl()(`Array`,`slice`),Zu)}var ed,td;function nd(){if(td)return ed;td=1;var e=Ae(),t=$u(),n=Array.prototype;return ed=function(r){var i=r.slice;return r===n||e(n,r)&&i===n.slice?t:i},ed}var rd,id;function ad(){return id?rd:(id=1,rd=nd(),rd)}var od,sd;function cd(){return sd?od:(sd=1,od=ad(),od)}var ld=t(cd()),ud={},dd,fd;function pd(){if(fd)return dd;fd=1;var e=N(),t=v(),n=ei(),r=li(),i=en(),a=t([].concat);return dd=e(`Reflect`,`ownKeys`)||function(e){var t=n.f(i(e)),o=r.f;return o?a(t,o(e)):t},dd}var md;function hd(){return md?ud:(md=1,P()({target:`Reflect`,stat:!0},{ownKeys:pd()}),ud)}var gd,_d;function vd(){return _d?gd:(_d=1,hd(),gd=M().Reflect.ownKeys,gd)}var yd,bd;function xd(){return bd?yd:(bd=1,yd=vd(),yd)}var Sd,Cd;function wd(){return Cd?Sd:(Cd=1,Sd=xd(),Sd)}var Td=t(wd()),Ed={},Dd;function Od(){return Dd?Ed:(Dd=1,P()({target:`Array`,stat:!0},{isArray:kn()}),Ed)}var kd,Ad;function jd(){return Ad?kd:(Ad=1,Od(),kd=M().Array.isArray,kd)}var Md,Nd;function Pd(){return Nd?Md:(Nd=1,Md=jd(),Md)}var Fd,Id;function Ld(){return Id?Fd:(Id=1,Fd=Pd(),Fd)}var Rd=t(Ld()),zd={},Bd;function Vd(){if(Bd)return zd;Bd=1;var e=P(),t=vt(),n=Br();return e({target:`Object`,stat:!0,forced:l()(function(){n(1)})},{keys:function(e){return n(t(e))}}),zd}var Hd,Ud;function Wd(){return Ud?Hd:(Ud=1,Vd(),Hd=M().Object.keys,Hd)}var Gd,Kd;function qd(){return Kd?Gd:(Kd=1,Gd=Wd(),Gd)}var Jd,Yd;function Xd(){return Yd?Jd:(Yd=1,Jd=qd(),Jd)}var Zd=t(Xd()),Qd={},$d,ef;function tf(){if(ef)return $d;ef=1;var e=zi().forEach;return $d=Cl()(`forEach`)?[].forEach:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)},$d}var nf;function rf(){if(nf)return Qd;nf=1;var e=P(),t=tf();return e({target:`Array`,proto:!0,forced:[].forEach!==t},{forEach:t}),Qd}var af,of;function sf(){return of?af:(of=1,rf(),af=rl()(`Array`,`forEach`),af)}var cf,lf;function uf(){return lf?cf:(lf=1,cf=sf(),cf)}var df,ff;function pf(){if(ff)return df;ff=1;var e=$n(),t=xt(),n=Ae(),r=uf(),i=Array.prototype,a={DOMTokenList:!0,NodeList:!0};return df=function(o){var s=o.forEach;return o===i||n(i,o)&&s===i.forEach||t(a,e(o))?r:s},df}var mf,hf;function gf(){return hf?mf:(hf=1,mf=pf(),mf)}var _f=t(gf()),vf={},yf;function bf(){if(yf)return vf;yf=1;var e=P(),t=v(),n=kn(),r=t([].reverse),i=[1,2];return e({target:`Array`,proto:!0,forced:String(i)===String(i.reverse())},{reverse:function(){return n(this)&&(this.length=this.length),r(this)}}),vf}var xf,Sf;function Cf(){return Sf?xf:(Sf=1,bf(),xf=rl()(`Array`,`reverse`),xf)}var wf,Tf;function Ef(){if(Tf)return wf;Tf=1;var e=Ae(),t=Cf(),n=Array.prototype;return wf=function(r){var i=r.reverse;return r===n||e(n,r)&&i===n.reverse?t:i},wf}var Df,Of;function kf(){return Of?Df:(Of=1,Df=Ef(),Df)}var Af,jf;function Mf(){return jf?Af:(jf=1,Af=kf(),Af)}var Nf=t(Mf()),Pf={},Ff,If;function Lf(){if(If)return Ff;If=1;var e=k(),t=kn(),n=TypeError,r=Object.getOwnPropertyDescriptor;return Ff=e&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,i){if(t(e)&&!r(e,`length`).writable)throw new n(`Cannot set read only .length`);return e.length=i}:function(e,t){return e.length=t},Ff}var Rf,zf;function Bf(){if(zf)return Rf;zf=1;var e=Je(),t=TypeError;return Rf=function(n,r){if(!delete n[r])throw new t(`Cannot delete property `+e(r)+` of `+e(n))},Rf}var Vf;function Hf(){if(Vf)return Pf;Vf=1;var e=P(),t=vt(),n=Tr(),r=Fn(),i=Vn(),a=Lf(),o=Wn(),s=dr(),c=qn(),l=Bf(),u=mr()(`splice`),d=Math.max,f=Math.min;return e({target:`Array`,proto:!0,forced:!u},{splice:function(e,u){var p=t(this),m=i(p),h=n(e,m),g=arguments.length,_,v,y,b,x,S;for(g===0?_=v=0:g===1?(_=0,v=m-h):(_=g-2,v=f(d(r(u),0),m-h)),o(m+_-v),y=s(p,v),b=0;b<v;b++)x=h+b,x in p&&c(y,b,p[x]);if(y.length=v,_<v){for(b=h;b<m-v;b++)x=b+v,S=b+_,x in p?p[S]=p[x]:l(p,S);for(b=m;b>m-v+_;b--)l(p,b-1)}else if(_>v)for(b=m-v;b>h;b--)x=b+v-1,S=b+_-1,x in p?p[S]=p[x]:l(p,S);for(b=0;b<_;b++)p[b+h]=arguments[b+2];return a(p,m-v+_),y}}),Pf}var Uf,Wf;function Gf(){return Wf?Uf:(Wf=1,Hf(),Uf=rl()(`Array`,`splice`),Uf)}var Kf,qf;function Jf(){if(qf)return Kf;qf=1;var e=Ae(),t=Gf(),n=Array.prototype;return Kf=function(r){var i=r.splice;return r===n||e(n,r)&&i===n.splice?t:i},Kf}var Yf,Xf;function Zf(){return Xf?Yf:(Xf=1,Yf=Jf(),Yf)}var Qf,$f;function ep(){return $f?Qf:($f=1,Qf=Zf(),Qf)}var tp=t(ep()),np={},rp,ip;function ap(){if(ip)return rp;ip=1;var e=k(),t=v(),n=A(),r=l(),i=Br(),a=li(),o=oe(),s=vt(),c=fe(),u=Object.assign,d=Object.defineProperty,f=t([].concat);return rp=!u||r(function(){if(e&&u({b:1},u(d({},`a`,{enumerable:!0,get:function(){d(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var t={},n={},r=Symbol(`assign detection`),a=`abcdefghijklmnopqrst`;return t[r]=7,a.split(``).forEach(function(e){n[e]=e}),u({},t)[r]!==7||i(u({},n)).join(``)!==a})?function(t,r){for(var l=s(t),u=arguments.length,d=1,p=a.f,m=o.f;u>d;)for(var h=c(arguments[d++]),g=p?f(i(h),p(h)):i(h),_=g.length,v=0,y;_>v;)y=g[v++],(!e||n(m,h,y))&&(l[y]=h[y]);return l}:u,rp}var op;function sp(){if(op)return np;op=1;var e=P(),t=ap();return e({target:`Object`,stat:!0,arity:2,forced:Object.assign!==t},{assign:t}),np}var cp,lp;function up(){return lp?cp:(lp=1,sp(),cp=M().Object.assign,cp)}var dp,fp;function pp(){return fp?dp:(fp=1,dp=up(),dp)}var mp,hp;function gp(){return hp?mp:(hp=1,mp=pp(),mp)}var _p=t(gp()),vp,yp;function bp(){return yp?vp:(yp=1,gr(),vp=rl()(`Array`,`concat`),vp)}var xp,Sp;function Cp(){if(Sp)return xp;Sp=1;var e=Ae(),t=bp(),n=Array.prototype;return xp=function(r){var i=r.concat;return r===n||e(n,r)&&i===n.concat?t:i},xp}var wp,Tp;function Ep(){return Tp?wp:(Tp=1,wp=Cp(),wp)}var Dp,Op;function kp(){return Op?Dp:(Op=1,Dp=Ep(),Dp)}var Ap=t(kp()),jp={},Mp;function Np(){return Mp?jp:(Mp=1,P()({target:`Object`,stat:!0,sham:!k()},{create:Zr()}),jp)}var Pp,Fp;function Ip(){if(Fp)return Pp;Fp=1,Np();var e=M().Object;return Pp=function(t,n){return e.create(t,n)},Pp}var Lp,Rp;function zp(){return Rp?Lp:(Rp=1,Lp=Ip(),Lp)}var Bp,Vp;function Hp(){return Vp?Bp:(Vp=1,Bp=zp(),Bp)}var Up=t(Hp()),Wp={},Gp,Kp;function qp(){if(Kp)return Gp;Kp=1;var e=Fn(),t=xr(),n=j(),r=RangeError;return Gp=function(i){var a=t(n(this)),o=``,s=e(i);if(s<0||s===1/0)throw new r(`Wrong number of repetitions`);for(;s>0;(s>>>=1)&&(a+=a))s&1&&(o+=a);return o},Gp}var Jp,Yp;function Xp(){if(Yp)return Jp;Yp=1;var e=v(),t=Rn(),n=xr(),r=qp(),i=j(),a=e(r),o=e(``.slice),s=Math.ceil,c=function(e){return function(r,c,l){var u=n(i(r)),d=t(c),f=u.length,p=l===void 0?` `:n(l),m,h;return d<=f||p===``?u:(m=d-f,h=a(p,s(m/p.length)),h.length>m&&(h=o(h,0,m)),e?u+h:h+u)}};return Jp={start:c(!1),end:c(!0)},Jp}var Zp,Qp;function $p(){if(Qp)return Zp;Qp=1;var e=v(),t=l(),n=Xp().start,r=RangeError,i=isFinite,a=Math.abs,o=Date.prototype,s=o.toISOString,c=e(o.getTime),u=e(o.getUTCDate),d=e(o.getUTCFullYear),f=e(o.getUTCHours),p=e(o.getUTCMilliseconds),m=e(o.getUTCMinutes),h=e(o.getUTCMonth),g=e(o.getUTCSeconds);return Zp=t(function(){return s.call(new Date(-50000000000001))!==`0385-07-25T07:06:39.999Z`})||!t(function(){s.call(new Date(NaN))})?function(){if(!i(c(this)))throw new r(`Invalid time value`);var e=this,t=d(e),o=p(e),s=t<0?`-`:t>9999?`+`:``;return s+n(a(t),s?6:4,0)+`-`+n(h(e)+1,2,0)+`-`+n(u(e),2,0)+`T`+n(f(e),2,0)+`:`+n(m(e),2,0)+`:`+n(g(e),2,0)+`.`+n(o,3,0)+`Z`}:s,Zp}var em;function tm(){if(em)return Wp;em=1;var e=P(),t=A(),n=vt(),r=At(),i=$p(),a=x();return e({target:`Date`,proto:!0,forced:l()(function(){return new Date(NaN).toJSON()!==null||t(Date.prototype.toJSON,{toISOString:function(){return 1}})!==1})},{toJSON:function(e){var o=n(this),s=r(o,`number`);return typeof s==`number`&&!isFinite(s)?null:!(`toISOString`in o)&&a(o)===`Date`?t(i,o):o.toISOString()}}),Wp}var nm,rm;function im(){if(rm)return nm;rm=1,tm(),na();var e=M(),t=h();return e.JSON||={stringify:JSON.stringify},nm=function(n,r,i){return t(e.JSON.stringify,null,arguments)},nm}var am,om;function sm(){return om?am:(om=1,am=im(),am)}var cm,lm;function um(){return lm?cm:(lm=1,cm=sm(),cm)}var dm=t(um()),fm={},pm={},mm,hm;function gm(){if(hm)return mm;hm=1;var e=TypeError;return mm=function(t,n){if(t<n)throw new e(`Not enough arguments`);return t},mm}var _m,vm;function ym(){if(vm)return _m;vm=1;var e=o(),t=h(),n=D(),r=El(),i=Ne(),a=ii(),s=gm(),c=e.Function,l=/MSIE .\./.test(i)||r===`BUN`&&(function(){var t=e.Bun.version.split(`.`);return t.length<3||t[0]===`0`&&(t[1]<3||t[1]===`3`&&t[2]===`0`)})();return _m=function(e,r){var i=r?2:1;return l?function(o,l){var u=s(arguments.length,1)>i,d=n(o)?o:c(o),f=u?a(arguments,i):[],p=u?function(){t(d,this,f)}:d;return r?e(p,l):e(p)}:e},_m}var bm;function xm(){if(bm)return pm;bm=1;var e=P(),t=o(),n=ym()(t.setInterval,!0);return e({global:!0,bind:!0,forced:t.setInterval!==n},{setInterval:n}),pm}var Sm={},Cm;function wm(){if(Cm)return Sm;Cm=1;var e=P(),t=o(),n=ym()(t.setTimeout,!0);return e({global:!0,bind:!0,forced:t.setTimeout!==n},{setTimeout:n}),Sm}var Tm;function Em(){return Tm?fm:(Tm=1,xm(),wm(),fm)}var Dm,Om;function km(){return Om?Dm:(Om=1,Em(),Dm=M().setTimeout,Dm)}var Am,jm;function Mm(){return jm?Am:(jm=1,Am=km(),Am)}var Nm=t(Mm()),Pm={exports:{}},Fm;function Im(){return Fm?Pm.exports:(Fm=1,(function(e){function t(e){if(e)return n(e);this._callbacks=new Map}function n(e){return Object.assign(e,t.prototype),e._callbacks=new Map,e}t.prototype.on=function(e,t){let n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},t.prototype.once=function(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},t.prototype.off=function(e,t){if(e===void 0&&t===void 0)return this._callbacks.clear(),this;if(t===void 0)return this._callbacks.delete(e),this;let n=this._callbacks.get(e);if(n){for(let[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}n.length===0?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},t.prototype.emit=function(e,...t){let n=this._callbacks.get(e);if(n){let e=[...n];for(let n of e)n.apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks.get(e)??[]},t.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(let e of this._callbacks.values())t+=e.length;return t},t.prototype.hasListeners=function(e){return this.listenerCount(e)>0},t.prototype.addEventListener=t.prototype.on,t.prototype.removeListener=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,e.exports=t})(Pm),Pm.exports)}var Lm=t(Im());function Rm(){return Rm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rm.apply(this,arguments)}function zm(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Bm(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var Vm=typeof Object.assign==`function`?Object.assign:function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t},Hm=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],Um=typeof document>`u`?{style:{}}:document.createElement(`div`),Wm=`function`,Gm=Math.round,Km=Math.abs,qm=Date.now;function Jm(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<Hm.length;){if(n=Hm[a],r=n?n+i:t,r in e)return r;a++}}var Ym=typeof window>`u`?{}:window,Xm=Jm(Um.style,`touchAction`),Zm=Xm!==void 0;function Qm(){if(!Zm)return!1;var e={},t=Ym.CSS&&Ym.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(n){return e[n]=t?Ym.CSS.supports(`touch-action`,n):!0}),e}var $m=`compute`,eh=`auto`,th=`manipulation`,nh=`none`,rh=`pan-x`,ih=`pan-y`,ah=Qm(),oh=/mobile|tablet|ip(ad|hone|od)|android/i,sh=`ontouchstart`in Ym,ch=Jm(Ym,`PointerEvent`)!==void 0,lh=sh&&oh.test(navigator.userAgent),uh=`touch`,dh=`pen`,fh=`mouse`,ph=`kinect`,mh=25,hh=1,gh=2,_h=4,vh=8,yh=1,bh=2,xh=4,Sh=8,Ch=16,wh=bh|xh,Th=Sh|Ch,Eh=wh|Th,Dh=[`x`,`y`],Oh=[`clientX`,`clientY`];function kh(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==void 0)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function Ah(e,t){return typeof e===Wm?e.apply(t&&t[0]||void 0,t):e}function jh(e,t){return e.indexOf(t)>-1}function Mh(e){if(jh(e,nh))return nh;var t=jh(e,rh),n=jh(e,ih);return t&&n?nh:t||n?t?rh:ih:jh(e,th)?th:eh}var Nh=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===$m&&(e=this.compute()),Zm&&this.manager.element.style&&ah[e]&&(this.manager.element.style[Xm]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return kh(this.manager.recognizers,function(t){Ah(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),Mh(e.join(` `))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=jh(r,nh)&&!ah[nh],a=jh(r,ih)&&!ah[ih],o=jh(r,rh)&&!ah[rh];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&wh||o&&n&Th))return this.preventSrc(t)},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function Ph(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function Fh(e){var t=e.length;if(t===1)return{x:Gm(e[0].clientX),y:Gm(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:Gm(n/t),y:Gm(r/t)}}function Ih(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:Gm(e.pointers[n].clientX),clientY:Gm(e.pointers[n].clientY)},n++;return{timeStamp:qm(),pointers:t,center:Fh(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Lh(e,t,n){n||=Dh;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Rh(e,t,n){n||=Dh;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function zh(e,t){return e===t?yh:Km(e)>=Km(t)?e<0?bh:xh:t<0?Sh:Ch}function Bh(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===hh||a.eventType===_h)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function Vh(e,t,n){return{x:t/e||0,y:n/e||0}}function Hh(e,t){return Lh(t[0],t[1],Oh)/Lh(e[0],e[1],Oh)}function Uh(e,t){return Rh(t[1],t[0],Oh)+Rh(e[1],e[0],Oh)}function Wh(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,i,a,o,s;if(t.eventType!==vh&&(r>mh||n.velocity===void 0)){var c=t.deltaX-n.deltaX,l=t.deltaY-n.deltaY,u=Vh(r,c,l);a=u.x,o=u.y,i=Km(u.x)>Km(u.y)?u.x:u.y,s=zh(c,l),e.lastInterval=t}else i=n.velocity,a=n.velocityX,o=n.velocityY,s=n.direction;t.velocity=i,t.velocityX=a,t.velocityY=o,t.direction=s}function Gh(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=Ih(t),i>1&&!n.firstMultiple?n.firstMultiple=Ih(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=Fh(r);t.timeStamp=qm(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Rh(s,c),t.distance=Lh(s,c),Bh(n,t),t.offsetDirection=zh(t.deltaX,t.deltaY);var l=Vh(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=Km(l.x)>Km(l.y)?l.x:l.y,t.scale=o?Hh(o.pointers,r):1,t.rotation=o?Uh(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,Wh(n,t);var u=e.element,d=t.srcEvent,f=d.composedPath?d.composedPath()[0]:d.path?d.path[0]:d.target;Ph(f,u)&&(u=f),t.target=u}function Kh(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&hh&&r-i===0,o=t&(_h|vh)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,Gh(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function qh(e){return e.trim().split(/\s+/g)}function Jh(e,t,n){kh(qh(t),function(t){e.addEventListener(t,n,!1)})}function Yh(e,t,n){kh(qh(t),function(t){e.removeEventListener(t,n,!1)})}function Xh(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var Zh=function(){function e(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){Ah(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&Jh(this.element,this.evEl,this.domHandler),this.evTarget&&Jh(this.target,this.evTarget,this.domHandler),this.evWin&&Jh(Xh(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&Yh(this.element,this.evEl,this.domHandler),this.evTarget&&Yh(this.target,this.evTarget,this.domHandler),this.evWin&&Yh(Xh(this.element),this.evWin,this.domHandler)},e}();function Qh(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}var $h={pointerdown:hh,pointermove:gh,pointerup:_h,pointercancel:vh,pointerout:vh},eg={2:uh,3:dh,4:fh,5:ph},tg=`pointerdown`,ng=`pointermove pointerup pointercancel`;Ym.MSPointerEvent&&!Ym.PointerEvent&&(tg=`MSPointerDown`,ng=`MSPointerMove MSPointerUp MSPointerCancel`);var rg=function(e){zm(t,e);function t(){var n,r=t.prototype;return r.evEl=tg,r.evWin=ng,n=e.apply(this,arguments)||this,n.store=n.manager.session.pointerEvents=[],n}var n=t.prototype;return n.handler=function(e){var t=this.store,n=!1,r=$h[e.type.toLowerCase().replace(`ms`,``)],i=eg[e.pointerType]||e.pointerType,a=i===uh,o=Qh(t,e.pointerId,`pointerId`);r&hh&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(_h|vh)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))},t}(Zh);function ig(e){return Array.prototype.slice.call(e,0)}function ag(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];Qh(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}var og={touchstart:hh,touchmove:gh,touchend:_h,touchcancel:vh},sg=`touchstart touchmove touchend touchcancel`,cg=function(e){zm(t,e);function t(){var n;return t.prototype.evTarget=sg,n=e.apply(this,arguments)||this,n.targetIds={},n}var n=t.prototype;return n.handler=function(e){var t=og[e.type],n=lg.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:uh,srcEvent:e})},t}(Zh);function lg(e,t){var n=ig(e.touches),r=this.targetIds;if(t&(hh|gh)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=ig(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return Ph(e.target,c)}),t===hh)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&(_h|vh)&&delete r[o[i].identifier],i++;if(s.length)return[ag(a.concat(s),`identifier`,!0),s]}var ug={mousedown:hh,mousemove:gh,mouseup:_h},dg=`mousedown`,fg=`mousemove mouseup`,pg=function(e){zm(t,e);function t(){var n,r=t.prototype;return r.evEl=dg,r.evWin=fg,n=e.apply(this,arguments)||this,n.pressed=!1,n}var n=t.prototype;return n.handler=function(e){var t=ug[e.type];t&hh&&e.button===0&&(this.pressed=!0),t&gh&&e.which!==1&&(t=_h),this.pressed&&(t&_h&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:fh,srcEvent:e}))},t}(Zh),mg=2500,hg=25;function gg(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(n),setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},mg)}}function _g(e,t){e&hh?(this.primaryTouch=t.changedPointers[0].identifier,gg.call(this,t)):e&(_h|vh)&&gg.call(this,t)}function vg(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=hg&&o<=hg)return!0}return!1}var yg=function(){return function(e){zm(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.handler=function(e,t,n){var i=n.pointerType===uh,a=n.pointerType===fh;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)_g.call(Bm(Bm(r)),t,n);else if(a&&vg.call(Bm(Bm(r)),n))return;r.callback(e,t,n)}},r.touch=new cg(r.manager,r.handler),r.mouse=new pg(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}var n=t.prototype;return n.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Zh)}();function bg(e){var t;return t=e.options.inputClass||(ch?rg:lh?cg:sh?yg:pg),new t(e,Kh)}function xg(e,t,n){return Array.isArray(e)?(kh(e,n[t],n),!0):!1}var Sg=1,Cg=2,wg=4,Tg=8,Eg=Tg,Dg=16,Og=32,kg=1;function Ag(){return kg++}function jg(e,t){var n=t.manager;return n?n.get(e):e}function Mg(e){return e&Dg?`cancel`:e&Tg?`end`:e&wg?`move`:e&Cg?`start`:``}var Ng=function(){function e(e){e===void 0&&(e={}),this.options=Rm({enable:!0},e),this.id=Ag(),this.manager=null,this.state=Sg,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return Vm(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(xg(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=jg(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return xg(e,`dropRecognizeWith`,this)?this:(e=jg(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(xg(e,`requireFailure`,this))return this;var t=this.requireFail;return e=jg(e,this),Qh(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(xg(e,`dropRequireFailure`,this))return this;e=jg(e,this);var t=Qh(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<Tg&&r(t.options.event+Mg(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=Tg&&r(t.options.event+Mg(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=Og},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(Og|Sg)))return!1;e++}return!0},t.recognize=function(e){var t=Vm({},e);if(!Ah(this.options.enable,[this,t])){this.reset(),this.state=Og;return}this.state&(Eg|Dg|Og)&&(this.state=Sg),this.state=this.process(t),this.state&(Cg|wg|Tg|Dg)&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),Pg=function(e){zm(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,Rm({event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var n=t.prototype;return n.getTouchAction=function(){return[th]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&hh&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==_h)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<n.interval:!0,s=!this.pCenter||Lh(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!s||!o?this.count=1:this.count+=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=Eg,t.tryEmit()},n.interval),Cg):Eg}return Og},n.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=Og},this.options.interval),Og},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===Eg&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(Ng),Fg=function(e){zm(t,e);function t(t){return t===void 0&&(t={}),e.call(this,Rm({pointers:1},t))||this}var n=t.prototype;return n.attrTest=function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,r=t&(Cg|wg),i=this.attrTest(e);return r&&(n&vh||!i)?t|Dg:r||i?n&_h?t|Tg:t&Cg?t|wg:Cg:Og},t}(Ng);function Ig(e){return e===Ch?`down`:e===Sh?`up`:e===bh?`left`:e===xh?`right`:``}var Lg=function(e){zm(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,Rm({event:`pan`,threshold:10,pointers:1,direction:Eh},t))||this,n.pX=null,n.pY=null,n}var n=t.prototype;return n.getTouchAction=function(){var e=this.options.direction,t=[];return e&wh&&t.push(ih),e&Th&&t.push(rh),t},n.directionTest=function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&wh?(i=a===0?yh:a<0?bh:xh,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?yh:o<0?Sh:Ch,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return Fg.prototype.attrTest.call(this,e)&&(this.state&Cg||!(this.state&Cg)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=Ig(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(Fg),Rg=function(e){zm(t,e);function t(t){return t===void 0&&(t={}),e.call(this,Rm({event:`swipe`,threshold:10,velocity:.3,direction:wh|Th,pointers:1},t))||this}var n=t.prototype;return n.getTouchAction=function(){return Lg.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n=this.options.direction,r;return n&(wh|Th)?r=t.overallVelocity:n&wh?r=t.overallVelocityX:n&Th&&(r=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&Km(r)>this.options.velocity&&t.eventType&_h},n.emit=function(e){var t=Ig(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(Fg),zg=function(e){zm(t,e);function t(t){return t===void 0&&(t={}),e.call(this,Rm({event:`pinch`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[nh]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&Cg)},n.emit=function(t){if(t.scale!==1){var n=t.scale<1?`in`:`out`;t.additionalEvent=this.options.event+n}e.prototype.emit.call(this,t)},t}(Fg),Bg=function(e){zm(t,e);function t(t){return t===void 0&&(t={}),e.call(this,Rm({event:`rotate`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[nh]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&Cg)},t}(Fg),Vg=function(e){zm(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,Rm({event:`press`,pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var n=t.prototype;return n.getTouchAction=function(){return[eh]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime>n.time;if(this._input=e,!i||!r||e.eventType&(_h|vh)&&!a)this.reset();else if(e.eventType&hh)this.reset(),this._timer=setTimeout(function(){t.state=Eg,t.tryEmit()},n.time);else if(e.eventType&_h)return Eg;return Og},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===Eg&&(e&&e.eventType&_h?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=qm(),this.manager.emit(this.options.event,this._input)))},t}(Ng),Hg={domEvents:!1,touchAction:$m,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},Ug=[[Bg,{enable:!1}],[zg,{enable:!1},[`rotate`]],[Rg,{direction:wh}],[Lg,{direction:wh},[`swipe`]],[Pg],[Pg,{event:`doubletap`,taps:2},[`tap`]],[Vg]],Wg=1,Gg=2;function Kg(e,t){var n=e.element;if(n.style){var r;kh(e.options.cssProps,function(i,a){r=Jm(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function qg(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var Jg=function(){function e(e,t){var n=this;this.options=Vm({},Hg,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=bg(this),this.touchAction=new Nh(this,this.options.touchAction),Kg(this,!0),kh(this.options.recognizers,function(e){var t=n.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return Vm(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?Gg:Wg},t.recognize=function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&Eg)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==Gg&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(Cg|wg|Tg)&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof Ng)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(xg(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(xg(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=Qh(n,t);r!==-1&&(n.splice(r,1),this.touchAction.update())}return this},t.on=function(e,t){if(e===void 0||t===void 0)return this;var n=this.handlers;return kh(qh(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},t.off=function(e,t){if(e===void 0)return this;var n=this.handlers;return kh(qh(e),function(e){t?n[e]&&n[e].splice(Qh(n[e],t),1):delete n[e]}),this},t.emit=function(e,t){this.options.domEvents&&qg(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(!(!n||!n.length)){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},t.destroy=function(){this.element&&Kg(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),Yg={touchstart:hh,touchmove:gh,touchend:_h,touchcancel:vh},Xg=`touchstart`,Zg=`touchstart touchmove touchend touchcancel`,Qg=function(e){zm(t,e);function t(){var n,r=t.prototype;return r.evTarget=Xg,r.evWin=Zg,n=e.apply(this,arguments)||this,n.started=!1,n}var n=t.prototype;return n.handler=function(e){var t=Yg[e.type];if(t===hh&&(this.started=!0),this.started){var n=$g.call(this,e,t);t&(_h|vh)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:uh,srcEvent:e})}},t}(Zh);function $g(e,t){var n=ig(e.touches),r=ig(e.changedTouches);return t&(_h|vh)&&(n=ag(n.concat(r),`identifier`,!0)),[n,r]}function e_(e,t,n){var r=`DEPRECATED METHOD: `+t+`
|
|
1
|
+
var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var n={exports:{}},r={},i,a;function o(){if(a)return i;a=1;var t=function(e){return e&&e.Math===Math&&e};return i=t(typeof globalThis==`object`&&globalThis)||t(typeof window==`object`&&window)||t(typeof self==`object`&&self)||t(typeof e==`object`&&e)||t(typeof i==`object`&&i)||(function(){return this})()||Function(`return this`)(),i}var s,c;function l(){return c?s:(c=1,s=function(e){try{return!!e()}catch{return!0}},s)}var u,d;function f(){return d?u:(d=1,u=!l()(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),u)}var p,m;function h(){if(m)return p;m=1;var e=f(),t=Function.prototype,n=t.apply,r=t.call;return p=typeof Reflect==`object`&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),p}var g,_;function v(){if(_)return g;_=1;var e=f(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return g=e?r:function(e){return function(){return n.apply(e,arguments)}},g}var y,b;function x(){if(b)return y;b=1;var e=v(),t=e({}.toString),n=e(``.slice);return y=function(e){return n(t(e),8,-1)},y}var S,C;function w(){if(C)return S;C=1;var e=x(),t=v();return S=function(n){if(e(n)===`Function`)return t(n)},S}var T,E;function D(){if(E)return T;E=1;var e=typeof document==`object`&&document.all;return T=e===void 0&&e!==void 0?function(t){return typeof t==`function`||t===e}:function(e){return typeof e==`function`},T}var ee={},te,O;function k(){return O?te:(O=1,te=!l()(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),te)}var ne,re;function A(){if(re)return ne;re=1;var e=f(),t=Function.prototype.call;return ne=e?t.bind(t):function(){return t.apply(t,arguments)},ne}var ie={},ae;function oe(){if(ae)return ie;ae=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor;return ie.f=t&&!e.call({1:2},1)?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,ie}var se,ce;function le(){return ce?se:(ce=1,se=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},se)}var ue,de;function fe(){if(de)return ue;de=1;var e=v(),t=l(),n=x(),r=Object,i=e(``.split);return ue=t(function(){return!r(`z`).propertyIsEnumerable(0)})?function(e){return n(e)===`String`?i(e,``):r(e)}:r,ue}var pe,me;function he(){return me?pe:(me=1,pe=function(e){return e==null},pe)}var ge,_e;function j(){if(_e)return ge;_e=1;var e=he(),t=TypeError;return ge=function(n){if(e(n))throw new t(`Can't call method on `+n);return n},ge}var ve,ye;function be(){if(ye)return ve;ye=1;var e=fe(),t=j();return ve=function(n){return e(t(n))},ve}var xe,Se;function Ce(){if(Se)return xe;Se=1;var e=D();return xe=function(t){return typeof t==`object`?t!==null:e(t)},xe}var we,Te;function M(){return Te?we:(Te=1,we={},we)}var Ee,De;function N(){if(De)return Ee;De=1;var e=M(),t=o(),n=D(),r=function(e){return n(e)?e:void 0};return Ee=function(n,i){return arguments.length<2?r(e[n])||r(t[n]):e[n]&&e[n][i]||t[n]&&t[n][i]},Ee}var Oe,ke;function Ae(){return ke?Oe:(ke=1,Oe=v()({}.isPrototypeOf),Oe)}var je,Me;function Ne(){if(Me)return je;Me=1;var e=o().navigator,t=e&&e.userAgent;return je=t?String(t):``,je}var Pe,Fe;function Ie(){if(Fe)return Pe;Fe=1;var e=o(),t=Ne(),n=e.process,r=e.Deno,i=n&&n.versions||r&&r.version,a=i&&i.v8,s,c;return a&&(s=a.split(`.`),c=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!c&&t&&(s=t.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=t.match(/Chrome\/(\d+)/),s&&(c=+s[1]))),Pe=c,Pe}var Le,Re;function ze(){if(Re)return Le;Re=1;var e=Ie(),t=l(),n=o().String;return Le=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol(`symbol detection`);return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}),Le}var Be,Ve;function He(){return Ve?Be:(Ve=1,Be=ze()&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,Be)}var Ue,We;function Ge(){if(We)return Ue;We=1;var e=N(),t=D(),n=Ae(),r=He(),i=Object;return Ue=r?function(e){return typeof e==`symbol`}:function(r){var a=e(`Symbol`);return t(a)&&n(a.prototype,i(r))},Ue}var Ke,qe;function Je(){if(qe)return Ke;qe=1;var e=String;return Ke=function(t){try{return e(t)}catch{return`Object`}},Ke}var Ye,Xe;function Ze(){if(Xe)return Ye;Xe=1;var e=D(),t=Je(),n=TypeError;return Ye=function(r){if(e(r))return r;throw new n(t(r)+` is not a function`)},Ye}var Qe,$e;function et(){if($e)return Qe;$e=1;var e=Ze(),t=he();return Qe=function(n,r){var i=n[r];return t(i)?void 0:e(i)},Qe}var tt,nt;function rt(){if(nt)return tt;nt=1;var e=A(),t=D(),n=Ce(),r=TypeError;return tt=function(i,a){var o,s;if(a===`string`&&t(o=i.toString)&&!n(s=e(o,i))||t(o=i.valueOf)&&!n(s=e(o,i))||a!==`string`&&t(o=i.toString)&&!n(s=e(o,i)))return s;throw new r(`Can't convert object to primitive value`)},tt}var it={exports:{}},at,ot;function st(){return ot?at:(ot=1,at=!0,at)}var ct,lt;function ut(){if(lt)return ct;lt=1;var e=o(),t=Object.defineProperty;return ct=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch{e[n]=r}return r},ct}var dt;function ft(){if(dt)return it.exports;dt=1;var e=st(),t=o(),n=ut(),r=`__core-js_shared__`,i=it.exports=t[r]||n(r,{});return(i.versions||=[]).push({version:`3.44.0`,mode:e?`pure`:`global`,copyright:`© 2014-2025 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE`,source:`https://github.com/zloirock/core-js`}),it.exports}var pt,mt;function ht(){if(mt)return pt;mt=1;var e=ft();return pt=function(t,n){return e[t]||(e[t]=n||{})},pt}var gt,_t;function vt(){if(_t)return gt;_t=1;var e=j(),t=Object;return gt=function(n){return t(e(n))},gt}var yt,bt;function xt(){if(bt)return yt;bt=1;var e=v(),t=vt(),n=e({}.hasOwnProperty);return yt=Object.hasOwn||function(e,r){return n(t(e),r)},yt}var St,Ct;function wt(){if(Ct)return St;Ct=1;var e=v(),t=0,n=Math.random(),r=e(1.1.toString);return St=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+r(++t+n,36)},St}var Tt,Et;function Dt(){if(Et)return Tt;Et=1;var e=o(),t=ht(),n=xt(),r=wt(),i=ze(),a=He(),s=e.Symbol,c=t(`wks`),l=a?s.for||s:s&&s.withoutSetter||r;return Tt=function(e){return n(c,e)||(c[e]=i&&n(s,e)?s[e]:l(`Symbol.`+e)),c[e]},Tt}var Ot,kt;function At(){if(kt)return Ot;kt=1;var e=A(),t=Ce(),n=Ge(),r=et(),i=rt(),a=Dt(),o=TypeError,s=a(`toPrimitive`);return Ot=function(a,c){if(!t(a)||n(a))return a;var l=r(a,s),u;if(l){if(c===void 0&&(c=`default`),u=e(l,a,c),!t(u)||n(u))return u;throw new o(`Can't convert object to primitive value`)}return c===void 0&&(c=`number`),i(a,c)},Ot}var jt,Mt;function Nt(){if(Mt)return jt;Mt=1;var e=At(),t=Ge();return jt=function(n){var r=e(n,`string`);return t(r)?r:r+``},jt}var Pt,Ft;function It(){if(Ft)return Pt;Ft=1;var e=o(),t=Ce(),n=e.document,r=t(n)&&t(n.createElement);return Pt=function(e){return r?n.createElement(e):{}},Pt}var Lt,Rt;function zt(){if(Rt)return Lt;Rt=1;var e=k(),t=l(),n=It();return Lt=!e&&!t(function(){return Object.defineProperty(n(`div`),`a`,{get:function(){return 7}}).a!==7}),Lt}var Bt;function Vt(){if(Bt)return ee;Bt=1;var e=k(),t=A(),n=oe(),r=le(),i=be(),a=Nt(),o=xt(),s=zt(),c=Object.getOwnPropertyDescriptor;return ee.f=e?c:function(e,l){if(e=i(e),l=a(l),s)try{return c(e,l)}catch{}if(o(e,l))return r(!t(n.f,e,l),e[l])},ee}var Ht,Ut;function Wt(){if(Ut)return Ht;Ut=1;var e=l(),t=D(),n=/#|\.prototype\./,r=function(n,r){var c=a[i(n)];return c===s?!0:c===o?!1:t(r)?e(r):!!r},i=r.normalize=function(e){return String(e).replace(n,`.`).toLowerCase()},a=r.data={},o=r.NATIVE=`N`,s=r.POLYFILL=`P`;return Ht=r,Ht}var Gt,Kt;function qt(){if(Kt)return Gt;Kt=1;var e=w(),t=Ze(),n=f(),r=e(e.bind);return Gt=function(e,i){return t(e),i===void 0?e:n?r(e,i):function(){return e.apply(i,arguments)}},Gt}var Jt={},Yt,Xt;function Zt(){return Xt?Yt:(Xt=1,Yt=k()&&l()(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Yt)}var Qt,$t;function en(){if($t)return Qt;$t=1;var e=Ce(),t=String,n=TypeError;return Qt=function(r){if(e(r))return r;throw new n(t(r)+` is not an object`)},Qt}var tn;function nn(){if(tn)return Jt;tn=1;var e=k(),t=zt(),n=Zt(),r=en(),i=Nt(),a=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=`enumerable`,l=`configurable`,u=`writable`;return Jt.f=e?n?function(e,t,n){if(r(e),t=i(t),r(n),typeof e==`function`&&t===`prototype`&&`value`in n&&u in n&&!n[u]){var a=s(e,t);a&&a[u]&&(e[t]=n.value,n={configurable:l in n?n[l]:a[l],enumerable:c in n?n[c]:a[c],writable:!1})}return o(e,t,n)}:o:function(e,n,s){if(r(e),n=i(n),r(s),t)try{return o(e,n,s)}catch{}if(`get`in s||`set`in s)throw new a(`Accessors not supported`);return`value`in s&&(e[n]=s.value),e},Jt}var rn,an;function on(){if(an)return rn;an=1;var e=k(),t=nn(),n=le();return rn=e?function(e,r,i){return t.f(e,r,n(1,i))}:function(e,t,n){return e[t]=n,e},rn}var sn,cn;function P(){if(cn)return sn;cn=1;var e=o(),t=h(),n=w(),r=D(),i=Vt().f,a=Wt(),s=M(),c=qt(),l=on(),u=xt(),d=function(e){var n=function(r,i,a){if(this instanceof n){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,i)}return new e(r,i,a)}return t(e,this,arguments)};return n.prototype=e.prototype,n};return sn=function(t,o){var f=t.target,p=t.global,m=t.stat,h=t.proto,g=p?e:m?e[f]:e[f]&&e[f].prototype,_=p?s:s[f]||l(s,f,{})[f],v=_.prototype,y,b,x,S,C,w,T,E,D;for(S in o)y=a(p?S:f+(m?`.`:`#`)+S,t.forced),b=!y&&g&&u(g,S),w=_[S],b&&(t.dontCallGetSet?(D=i(g,S),T=D&&D.value):T=g[S]),C=b&&T?T:o[S],!(!y&&!h&&typeof w==typeof C)&&(E=t.bind&&b?c(C,e):t.wrap&&b?d(C):h&&r(C)?n(C):C,(t.sham||C&&C.sham||w&&w.sham)&&l(E,`sham`,!0),l(_,S,E),h&&(x=f+`Prototype`,u(s,x)||l(s,x,{}),l(s[x],S,C),t.real&&v&&(y||!v[S])&&l(v,S,C)))},sn}var ln;function un(){if(ln)return r;ln=1;var e=P(),t=k(),n=nn().f;return e({target:`Object`,stat:!0,forced:Object.defineProperty!==n,sham:!t},{defineProperty:n}),r}var dn;function fn(){if(dn)return n.exports;dn=1,un();var e=M().Object,t=n.exports=function(t,n,r){return e.defineProperty(t,n,r)};return e.defineProperty.sham&&(t.sham=!0),n.exports}var pn,mn;function hn(){return mn?pn:(mn=1,pn=fn(),pn)}var gn,_n;function vn(){return _n?gn:(_n=1,gn=hn(),gn)}var yn,bn;function xn(){return bn?yn:(bn=1,yn=vn(),yn)}var Sn,Cn;function wn(){return Cn?Sn:(Cn=1,Sn=xn(),Sn)}var Tn=t(wn()),En={},Dn,On;function kn(){if(On)return Dn;On=1;var e=x();return Dn=Array.isArray||function(t){return e(t)===`Array`},Dn}var An,jn;function Mn(){if(jn)return An;jn=1;var e=Math.ceil,t=Math.floor;return An=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)},An}var Nn,Pn;function Fn(){if(Pn)return Nn;Pn=1;var e=Mn();return Nn=function(t){var n=+t;return n!==n||n===0?0:e(n)},Nn}var In,Ln;function Rn(){if(Ln)return In;Ln=1;var e=Fn(),t=Math.min;return In=function(n){var r=e(n);return r>0?t(r,9007199254740991):0},In}var zn,Bn;function Vn(){if(Bn)return zn;Bn=1;var e=Rn();return zn=function(t){return e(t.length)},zn}var Hn,Un;function Wn(){if(Un)return Hn;Un=1;var e=TypeError,t=9007199254740991;return Hn=function(n){if(n>t)throw e(`Maximum allowed index exceeded`);return n},Hn}var Gn,Kn;function qn(){if(Kn)return Gn;Kn=1;var e=k(),t=nn(),n=le();return Gn=function(r,i,a){e?t.f(r,i,n(0,a)):r[i]=a},Gn}var Jn,Yn;function Xn(){if(Yn)return Jn;Yn=1;var e=Dt()(`toStringTag`),t={};return t[e]=`z`,Jn=String(t)===`[object z]`,Jn}var Zn,Qn;function $n(){if(Qn)return Zn;Qn=1;var e=Xn(),t=D(),n=x(),r=Dt()(`toStringTag`),i=Object,a=n(function(){return arguments}())===`Arguments`,o=function(e,t){try{return e[t]}catch{}};return Zn=e?n:function(e){var s,c,l;return e===void 0?`Undefined`:e===null?`Null`:typeof(c=o(s=i(e),r))==`string`?c:a?n(s):(l=n(s))===`Object`&&t(s.callee)?`Arguments`:l},Zn}var er,tr;function nr(){if(tr)return er;tr=1;var e=v(),t=D(),n=ft(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),er=n.inspectSource,er}var rr,ir;function ar(){if(ir)return rr;ir=1;var e=v(),t=l(),n=D(),r=$n(),i=N(),a=nr(),o=function(){},s=i(`Reflect`,`construct`),c=/^\s*(?:class|function)\b/,u=e(c.exec),d=!c.test(o),f=function(e){if(!n(e))return!1;try{return s(o,[],e),!0}catch{return!1}},p=function(e){if(!n(e))return!1;switch(r(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return d||!!u(c,a(e))}catch{return!0}};return p.sham=!0,rr=!s||t(function(){var e;return f(f.call)||!f(Object)||!f(function(){e=!0})||e})?p:f,rr}var or,sr;function cr(){if(sr)return or;sr=1;var e=kn(),t=ar(),n=Ce(),r=Dt()(`species`),i=Array;return or=function(a){var o;return e(a)&&(o=a.constructor,t(o)&&(o===i||e(o.prototype))?o=void 0:n(o)&&(o=o[r],o===null&&(o=void 0))),o===void 0?i:o},or}var lr,ur;function dr(){if(ur)return lr;ur=1;var e=cr();return lr=function(t,n){return new(e(t))(n===0?0:n)},lr}var fr,pr;function mr(){if(pr)return fr;pr=1;var e=l(),t=Dt(),n=Ie(),r=t(`species`);return fr=function(t){return n>=51||!e(function(){var e=[],n=e.constructor={};return n[r]=function(){return{foo:1}},e[t](Boolean).foo!==1})},fr}var hr;function gr(){if(hr)return En;hr=1;var e=P(),t=l(),n=kn(),r=Ce(),i=vt(),a=Vn(),o=Wn(),s=qn(),c=dr(),u=mr(),d=Dt(),f=Ie(),p=d(`isConcatSpreadable`),m=f>=51||!t(function(){var e=[];return e[p]=!1,e.concat()[0]!==e}),h=function(e){if(!r(e))return!1;var t=e[p];return t===void 0?n(e):!!t};return e({target:`Array`,proto:!0,arity:1,forced:!m||!u(`concat`)},{concat:function(e){var t=i(this),n=c(t,0),r=0,l,u,d,f,p;for(l=-1,d=arguments.length;l<d;l++)if(p=l===-1?t:arguments[l],h(p))for(f=a(p),o(r+f),u=0;u<f;u++,r++)u in p&&s(n,r,p[u]);else o(r+1),s(n,r++,p);return n.length=r,n}}),En}var _r={},vr={},yr,br;function xr(){if(br)return yr;br=1;var e=$n(),t=String;return yr=function(n){if(e(n)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return t(n)},yr}var Sr={},Cr,wr;function Tr(){if(wr)return Cr;wr=1;var e=Fn(),t=Math.max,n=Math.min;return Cr=function(r,i){var a=e(r);return a<0?t(a+i,0):n(a,i)},Cr}var Er,Dr;function Or(){if(Dr)return Er;Dr=1;var e=be(),t=Tr(),n=Vn(),r=function(r){return function(i,a,o){var s=e(i),c=n(s);if(c===0)return!r&&-1;var l=t(o,c),u;if(r&&a!==a){for(;c>l;)if(u=s[l++],u!==u)return!0}else for(;c>l;l++)if((r||l in s)&&s[l]===a)return r||l||0;return!r&&-1}};return Er={includes:r(!0),indexOf:r(!1)},Er}var kr,Ar;function jr(){return Ar?kr:(Ar=1,kr={},kr)}var Mr,Nr;function Pr(){if(Nr)return Mr;Nr=1;var e=v(),t=xt(),n=be(),r=Or().indexOf,i=jr(),a=e([].push);return Mr=function(e,o){var s=n(e),c=0,l=[],u;for(u in s)!t(i,u)&&t(s,u)&&a(l,u);for(;o.length>c;)t(s,u=o[c++])&&(~r(l,u)||a(l,u));return l},Mr}var Fr,Ir;function Lr(){return Ir?Fr:(Ir=1,Fr=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],Fr)}var Rr,zr;function Br(){if(zr)return Rr;zr=1;var e=Pr(),t=Lr();return Rr=Object.keys||function(n){return e(n,t)},Rr}var Vr;function Hr(){if(Vr)return Sr;Vr=1;var e=k(),t=Zt(),n=nn(),r=en(),i=be(),a=Br();return Sr.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var o=i(t),s=a(t),c=s.length,l=0,u;c>l;)n.f(e,u=s[l++],o[u]);return e},Sr}var Ur,Wr;function Gr(){return Wr?Ur:(Wr=1,Ur=N()(`document`,`documentElement`),Ur)}var Kr,qr;function Jr(){if(qr)return Kr;qr=1;var e=ht(),t=wt(),n=e(`keys`);return Kr=function(e){return n[e]||(n[e]=t(e))},Kr}var Yr,Xr;function Zr(){if(Xr)return Yr;Xr=1;var e=en(),t=Hr(),n=Lr(),r=jr(),i=Gr(),a=It(),o=Jr(),s=`>`,c=`<`,l=`prototype`,u=`script`,d=o(`IE_PROTO`),f=function(){},p=function(e){return c+u+s+e+c+`/`+u+s},m=function(e){e.write(p(``)),e.close();var t=e.parentWindow.Object;return e=null,t},h=function(){var e=a(`iframe`),t=`java`+u+`:`,n;return e.style.display=`none`,i.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(p(`document.F=Object`)),n.close(),n.F},g,_=function(){try{g=new ActiveXObject(`htmlfile`)}catch{}_=typeof document<`u`?document.domain&&g?m(g):h():m(g);for(var e=n.length;e--;)delete _[l][n[e]];return _()};return r[d]=!0,Yr=Object.create||function(n,r){var i;return n===null?i=_():(f[l]=e(n),i=new f,f[l]=null,i[d]=n),r===void 0?i:t.f(i,r)},Yr}var Qr={},$r;function ei(){if($r)return Qr;$r=1;var e=Pr(),t=Lr().concat(`length`,`prototype`);return Qr.f=Object.getOwnPropertyNames||function(n){return e(n,t)},Qr}var ti={},ni,ri;function ii(){return ri?ni:(ri=1,ni=v()([].slice),ni)}var ai;function oi(){if(ai)return ti;ai=1;var e=x(),t=be(),n=ei().f,r=ii(),i=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return n(e)}catch{return r(i)}};return ti.f=function(r){return i&&e(r)===`Window`?a(r):n(t(r))},ti}var si={},ci;function li(){return ci?si:(ci=1,si.f=Object.getOwnPropertySymbols,si)}var ui,di;function fi(){if(di)return ui;di=1;var e=on();return ui=function(t,n,r,i){return i&&i.enumerable?t[n]=r:e(t,n,r),t},ui}var pi,mi;function hi(){if(mi)return pi;mi=1;var e=nn();return pi=function(t,n,r){return e.f(t,n,r)},pi}var gi={},_i;function vi(){return _i?gi:(_i=1,gi.f=Dt(),gi)}var yi,bi;function xi(){if(bi)return yi;bi=1;var e=M(),t=xt(),n=vi(),r=nn().f;return yi=function(i){var a=e.Symbol||={};t(a,i)||r(a,i,{value:n.f(i)})},yi}var Si,Ci;function wi(){if(Ci)return Si;Ci=1;var e=A(),t=N(),n=Dt(),r=fi();return Si=function(){var i=t(`Symbol`),a=i&&i.prototype,o=a&&a.valueOf,s=n(`toPrimitive`);a&&!a[s]&&r(a,s,function(t){return e(o,this)},{arity:1})},Si}var Ti,Ei;function Di(){if(Ei)return Ti;Ei=1;var e=Xn(),t=$n();return Ti=e?{}.toString:function(){return`[object `+t(this)+`]`},Ti}var Oi,ki;function Ai(){if(ki)return Oi;ki=1;var e=Xn(),t=nn().f,n=on(),r=xt(),i=Di(),a=Dt()(`toStringTag`);return Oi=function(o,s,c,l){var u=c?o:o&&o.prototype;u&&(r(u,a)||t(u,a,{configurable:!0,value:s}),l&&!e&&n(u,`toString`,i))},Oi}var ji,Mi;function Ni(){if(Mi)return ji;Mi=1;var e=o(),t=D(),n=e.WeakMap;return ji=t(n)&&/native code/.test(String(n)),ji}var Pi,Fi;function Ii(){if(Fi)return Pi;Fi=1;var e=Ni(),t=o(),n=Ce(),r=on(),i=xt(),a=ft(),s=Jr(),c=jr(),l=`Object already initialized`,u=t.TypeError,d=t.WeakMap,f,p,m,h=function(e){return m(e)?p(e):f(e,{})},g=function(e){return function(t){var r;if(!n(t)||(r=p(t)).type!==e)throw new u(`Incompatible receiver, `+e+` required`);return r}};if(e||a.state){var _=a.state||=new d;_.get=_.get,_.has=_.has,_.set=_.set,f=function(e,t){if(_.has(e))throw new u(l);return t.facade=e,_.set(e,t),t},p=function(e){return _.get(e)||{}},m=function(e){return _.has(e)}}else{var v=s(`state`);c[v]=!0,f=function(e,t){if(i(e,v))throw new u(l);return t.facade=e,r(e,v,t),t},p=function(e){return i(e,v)?e[v]:{}},m=function(e){return i(e,v)}}return Pi={set:f,get:p,has:m,enforce:h,getterFor:g},Pi}var Li,Ri;function zi(){if(Ri)return Li;Ri=1;var e=qt(),t=v(),n=fe(),r=vt(),i=Vn(),a=dr(),o=t([].push),s=function(t){var s=t===1,c=t===2,l=t===3,u=t===4,d=t===6,f=t===7,p=t===5||d;return function(m,h,g,_){for(var v=r(m),y=n(v),b=i(y),x=e(h,g),S=0,C=_||a,w=s?C(m,b):c||f?C(m,0):void 0,T,E;b>S;S++)if((p||S in y)&&(T=y[S],E=x(T,S,v),t))if(s)w[S]=E;else if(E)switch(t){case 3:return!0;case 5:return T;case 6:return S;case 2:o(w,T)}else switch(t){case 4:return!1;case 7:o(w,T)}return d?-1:l||u?u:w}};return Li={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)},Li}var Bi;function Vi(){if(Bi)return vr;Bi=1;var e=P(),t=o(),n=A(),r=v(),i=st(),a=k(),s=ze(),c=l(),u=xt(),d=Ae(),f=en(),p=be(),m=Nt(),h=xr(),g=le(),_=Zr(),y=Br(),b=ei(),x=oi(),S=li(),C=Vt(),w=nn(),T=Hr(),E=oe(),D=fi(),ee=hi(),te=ht(),O=Jr(),ne=jr(),re=wt(),ie=Dt(),ae=vi(),se=xi(),ce=wi(),ue=Ai(),de=Ii(),fe=zi().forEach,pe=O(`hidden`),me=`Symbol`,he=`prototype`,ge=de.set,_e=de.getterFor(me),j=Object[he],ve=t.Symbol,ye=ve&&ve[he],xe=t.RangeError,Se=t.TypeError,Ce=t.QObject,we=C.f,Te=w.f,M=x.f,Ee=E.f,De=r([].push),N=te(`symbols`),Oe=te(`op-symbols`),ke=te(`wks`),je=!Ce||!Ce[he]||!Ce[he].findChild,Me=function(e,t,n){var r=we(j,t);r&&delete j[t],Te(e,t,n),r&&e!==j&&Te(j,t,r)},Ne=a&&c(function(){return _(Te({},`a`,{get:function(){return Te(this,`a`,{value:7}).a}})).a!==7})?Me:Te,Pe=function(e,t){var n=N[e]=_(ye);return ge(n,{type:me,tag:e,description:t}),a||(n.description=t),n},Fe=function(e,t,n){e===j&&Fe(Oe,t,n),f(e);var r=m(t);return f(n),u(N,r)?(n.enumerable?(u(e,pe)&&e[pe][r]&&(e[pe][r]=!1),n=_(n,{enumerable:g(0,!1)})):(u(e,pe)||Te(e,pe,g(1,_(null))),e[pe][r]=!0),Ne(e,r,n)):Te(e,r,n)},Ie=function(e,t){f(e);var r=p(t);return fe(y(r).concat(He(r)),function(t){(!a||n(Re,r,t))&&Fe(e,t,r[t])}),e},Le=function(e,t){return t===void 0?_(e):Ie(_(e),t)},Re=function(e){var t=m(e),r=n(Ee,this,t);return this===j&&u(N,t)&&!u(Oe,t)?!1:r||!u(this,t)||!u(N,t)||u(this,pe)&&this[pe][t]?r:!0},Be=function(e,t){var n=p(e),r=m(t);if(!(n===j&&u(N,r)&&!u(Oe,r))){var i=we(n,r);return i&&u(N,r)&&!(u(n,pe)&&n[pe][r])&&(i.enumerable=!0),i}},Ve=function(e){var t=M(p(e)),n=[];return fe(t,function(e){!u(N,e)&&!u(ne,e)&&De(n,e)}),n},He=function(e){var t=e===j,n=M(t?Oe:p(e)),r=[];return fe(n,function(e){u(N,e)&&(!t||u(j,e))&&De(r,N[e])}),r};return s||(ve=function(){if(d(ye,this))throw new Se(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:h(arguments[0]),r=re(e),i=function(e){var a=this===void 0?t:this;a===j&&n(i,Oe,e),u(a,pe)&&u(a[pe],r)&&(a[pe][r]=!1);var o=g(1,e);try{Ne(a,r,o)}catch(e){if(!(e instanceof xe))throw e;Me(a,r,o)}};return a&&je&&Ne(j,r,{configurable:!0,set:i}),Pe(r,e)},ye=ve[he],D(ye,`toString`,function(){return _e(this).tag}),D(ve,`withoutSetter`,function(e){return Pe(re(e),e)}),E.f=Re,w.f=Fe,T.f=Ie,C.f=Be,b.f=x.f=Ve,S.f=He,ae.f=function(e){return Pe(ie(e),e)},a&&(ee(ye,`description`,{configurable:!0,get:function(){return _e(this).description}}),i||D(j,`propertyIsEnumerable`,Re,{unsafe:!0}))),e({global:!0,constructor:!0,wrap:!0,forced:!s,sham:!s},{Symbol:ve}),fe(y(ke),function(e){se(e)}),e({target:me,stat:!0,forced:!s},{useSetter:function(){je=!0},useSimple:function(){je=!1}}),e({target:`Object`,stat:!0,forced:!s,sham:!a},{create:Le,defineProperty:Fe,defineProperties:Ie,getOwnPropertyDescriptor:Be}),e({target:`Object`,stat:!0,forced:!s},{getOwnPropertyNames:Ve}),ce(),ue(ve,me),ne[pe]=!0,vr}var Hi={},Ui,Wi;function Gi(){return Wi?Ui:(Wi=1,Ui=ze()&&!!Symbol.for&&!!Symbol.keyFor,Ui)}var Ki;function qi(){if(Ki)return Hi;Ki=1;var e=P(),t=N(),n=xt(),r=xr(),i=ht(),a=Gi(),o=i(`string-to-symbol-registry`),s=i(`symbol-to-string-registry`);return e({target:`Symbol`,stat:!0,forced:!a},{for:function(e){var i=r(e);if(n(o,i))return o[i];var a=t(`Symbol`)(i);return o[i]=a,s[a]=i,a}}),Hi}var Ji={},Yi;function Xi(){if(Yi)return Ji;Yi=1;var e=P(),t=xt(),n=Ge(),r=Je(),i=ht(),a=Gi(),o=i(`symbol-to-string-registry`);return e({target:`Symbol`,stat:!0,forced:!a},{keyFor:function(e){if(!n(e))throw TypeError(r(e)+` is not a symbol`);if(t(o,e))return o[e]}}),Ji}var Zi={},Qi,$i;function ea(){if($i)return Qi;$i=1;var e=v(),t=kn(),n=D(),r=x(),i=xr(),a=e([].push);return Qi=function(e){if(n(e))return e;if(t(e)){for(var o=e.length,s=[],c=0;c<o;c++){var l=e[c];typeof l==`string`?a(s,l):(typeof l==`number`||r(l)===`Number`||r(l)===`String`)&&a(s,i(l))}var u=s.length,d=!0;return function(e,n){if(d)return d=!1,n;if(t(this))return n;for(var r=0;r<u;r++)if(s[r]===e)return n}}},Qi}var ta;function na(){if(ta)return Zi;ta=1;var e=P(),t=N(),n=h(),r=A(),i=v(),a=l(),o=D(),s=Ge(),c=ii(),u=ea(),d=ze(),f=String,p=t(`JSON`,`stringify`),m=i(/./.exec),g=i(``.charAt),_=i(``.charCodeAt),y=i(``.replace),b=i(1.1.toString),x=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,C=/^[\uDC00-\uDFFF]$/,w=!d||a(function(){var e=t(`Symbol`)(`stringify detection`);return p([e])!==`[null]`||p({a:e})!==`{}`||p(Object(e))!==`{}`}),T=a(function(){return p(`\udf06\ud834`)!==`"\\udf06\\ud834"`||p(`\udead`)!==`"\\udead"`}),E=function(e,t){var i=c(arguments),a=u(t);if(!(!o(a)&&(e===void 0||s(e))))return i[1]=function(e,t){if(o(a)&&(t=r(a,this,f(e),t)),!s(t))return t},n(p,null,i)},ee=function(e,t,n){var r=g(n,t-1),i=g(n,t+1);return m(S,e)&&!m(C,i)||m(C,e)&&!m(S,r)?`\\u`+b(_(e,0),16):e};return p&&e({target:`JSON`,stat:!0,arity:3,forced:w||T},{stringify:function(e,t,r){var i=c(arguments),a=n(w?E:p,null,i);return T&&typeof a==`string`?y(a,x,ee):a}}),Zi}var ra={},ia;function aa(){if(ia)return ra;ia=1;var e=P(),t=ze(),n=l(),r=li(),i=vt();return e({target:`Object`,stat:!0,forced:!t||n(function(){r.f(1)})},{getOwnPropertySymbols:function(e){var t=r.f;return t?t(i(e)):[]}}),ra}var oa;function sa(){return oa?_r:(oa=1,Vi(),qi(),Xi(),na(),aa(),_r)}var ca={},la;function ua(){return la?ca:(la=1,xi()(`asyncDispose`),ca)}var da={},fa;function pa(){return fa?da:(fa=1,xi()(`asyncIterator`),da)}var ma={},ha;function ga(){return ha?ma:(ha=1,xi()(`dispose`),ma)}var _a={},va;function ya(){return va?_a:(va=1,xi()(`hasInstance`),_a)}var ba={},xa;function Sa(){return xa?ba:(xa=1,xi()(`isConcatSpreadable`),ba)}var Ca={},wa;function Ta(){return wa?Ca:(wa=1,xi()(`iterator`),Ca)}var Ea={},Da;function Oa(){return Da?Ea:(Da=1,xi()(`match`),Ea)}var ka={},Aa;function ja(){return Aa?ka:(Aa=1,xi()(`matchAll`),ka)}var Ma={},Na;function Pa(){return Na?Ma:(Na=1,xi()(`replace`),Ma)}var Fa={},Ia;function La(){return Ia?Fa:(Ia=1,xi()(`search`),Fa)}var Ra={},za;function Ba(){return za?Ra:(za=1,xi()(`species`),Ra)}var Va={},Ha;function Ua(){return Ha?Va:(Ha=1,xi()(`split`),Va)}var Wa={},Ga;function Ka(){if(Ga)return Wa;Ga=1;var e=xi(),t=wi();return e(`toPrimitive`),t(),Wa}var qa={},Ja;function Ya(){if(Ja)return qa;Ja=1;var e=N(),t=xi(),n=Ai();return t(`toStringTag`),n(e(`Symbol`),`Symbol`),qa}var Xa={},Za;function Qa(){return Za?Xa:(Za=1,xi()(`unscopables`),Xa)}var $a={},eo;function to(){return eo?$a:(eo=1,Ai()(o().JSON,`JSON`,!0),$a)}var no,ro;function io(){return ro?no:(ro=1,gr(),sa(),ua(),pa(),ga(),ya(),Sa(),Ta(),Oa(),ja(),Pa(),La(),Ba(),Ua(),Ka(),Ya(),Qa(),to(),no=M().Symbol,no)}var ao={},oo,so;function co(){return so?oo:(so=1,oo=function(){},oo)}var lo,uo;function fo(){return uo?lo:(uo=1,lo={},lo)}var po,mo;function ho(){if(mo)return po;mo=1;var e=k(),t=xt(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,i=t(n,`name`);return po={EXISTS:i,PROPER:i&&(function(){}).name===`something`,CONFIGURABLE:i&&(!e||e&&r(n,`name`).configurable)},po}var go,_o;function vo(){return _o?go:(_o=1,go=!l()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),go)}var yo,bo;function xo(){if(bo)return yo;bo=1;var e=xt(),t=D(),n=vt(),r=Jr(),i=vo(),a=r(`IE_PROTO`),o=Object,s=o.prototype;return yo=i?o.getPrototypeOf:function(r){var i=n(r);if(e(i,a))return i[a];var c=i.constructor;return t(c)&&i instanceof c?c.prototype:i instanceof o?s:null},yo}var So,Co;function wo(){if(Co)return So;Co=1;var e=l(),t=D(),n=Ce(),r=Zr(),i=xo(),a=fi(),o=Dt(),s=st(),c=o(`iterator`),u=!1,d,f,p;return[].keys&&(p=[].keys(),`next`in p?(f=i(i(p)),f!==Object.prototype&&(d=f)):u=!0),!n(d)||e(function(){var e={};return d[c].call(e)!==e})?d={}:s&&(d=r(d)),t(d[c])||a(d,c,function(){return this}),So={IteratorPrototype:d,BUGGY_SAFARI_ITERATORS:u},So}var To,Eo;function Do(){if(Eo)return To;Eo=1;var e=wo().IteratorPrototype,t=Zr(),n=le(),r=Ai(),i=fo(),a=function(){return this};return To=function(o,s,c,l){var u=s+` Iterator`;return o.prototype=t(e,{next:n(+!l,c)}),r(o,u,!1,!0),i[u]=a,o},To}var Oo,ko;function Ao(){if(ko)return Oo;ko=1;var e=v(),t=Ze();return Oo=function(n,r,i){try{return e(t(Object.getOwnPropertyDescriptor(n,r)[i]))}catch{}},Oo}var jo,Mo;function No(){if(Mo)return jo;Mo=1;var e=Ce();return jo=function(t){return e(t)||t===null},jo}var Po,Fo;function Io(){if(Fo)return Po;Fo=1;var e=No(),t=String,n=TypeError;return Po=function(r){if(e(r))return r;throw new n(`Can't set `+t(r)+` as a prototype`)},Po}var Lo,Ro;function zo(){if(Ro)return Lo;Ro=1;var e=Ao(),t=Ce(),n=j(),r=Io();return Lo=Object.setPrototypeOf||(`__proto__`in{}?function(){var i=!1,a={},o;try{o=e(Object.prototype,`__proto__`,`set`),o(a,[]),i=a instanceof Array}catch{}return function(e,a){return n(e),r(a),t(e)&&(i?o(e,a):e.__proto__=a),e}}():void 0),Lo}var Bo,Vo;function Ho(){if(Vo)return Bo;Vo=1;var e=P(),t=A(),n=st(),r=ho(),i=D(),a=Do(),o=xo(),s=zo(),c=Ai(),l=on(),u=fi(),d=Dt(),f=fo(),p=wo(),m=r.PROPER,h=r.CONFIGURABLE,g=p.IteratorPrototype,_=p.BUGGY_SAFARI_ITERATORS,v=d(`iterator`),y=`keys`,b=`values`,x=`entries`,S=function(){return this};return Bo=function(r,d,p,C,w,T,E){a(p,d,C);var D=function(e){if(e===w&&ne)return ne;if(!_&&e&&e in O)return O[e];switch(e){case y:return function(){return new p(this,e)};case b:return function(){return new p(this,e)};case x:return function(){return new p(this,e)}}return function(){return new p(this)}},ee=d+` Iterator`,te=!1,O=r.prototype,k=O[v]||O[`@@iterator`]||w&&O[w],ne=!_&&k||D(w),re=d===`Array`&&O.entries||k,A,ie,ae;if(re&&(A=o(re.call(new r)),A!==Object.prototype&&A.next&&(!n&&o(A)!==g&&(s?s(A,g):i(A[v])||u(A,v,S)),c(A,ee,!0,!0),n&&(f[ee]=S))),m&&w===b&&k&&k.name!==b&&(!n&&h?l(O,`name`,b):(te=!0,ne=function(){return t(k,this)})),w)if(ie={values:D(b),keys:T?ne:D(y),entries:D(x)},E)for(ae in ie)(_||te||!(ae in O))&&u(O,ae,ie[ae]);else e({target:d,proto:!0,forced:_||te},ie);return(!n||E)&&O[v]!==ne&&u(O,v,ne,{name:w}),f[d]=ne,ie},Bo}var Uo,Wo;function Go(){return Wo?Uo:(Wo=1,Uo=function(e,t){return{value:e,done:t}},Uo)}var Ko,qo;function Jo(){if(qo)return Ko;qo=1;var e=be(),t=co(),n=fo(),r=Ii(),i=nn().f,a=Ho(),o=Go(),s=st(),c=k(),l=`Array Iterator`,u=r.set,d=r.getterFor(l);Ko=a(Array,`Array`,function(t,n){u(this,{type:l,target:e(t),index:0,kind:n})},function(){var e=d(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,o(void 0,!0);switch(e.kind){case`keys`:return o(n,!1);case`values`:return o(t[n],!1)}return o([n,t[n]],!1)},`values`);var f=n.Arguments=n.Array;if(t(`keys`),t(`values`),t(`entries`),!s&&c&&f.name!==`values`)try{i(f,`name`,{value:`values`})}catch{}return Ko}var Yo,Xo;function Zo(){return Xo?Yo:(Xo=1,Yo={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Yo)}var Qo;function $o(){if(Qo)return ao;Qo=1,Jo();var e=Zo(),t=o(),n=Ai(),r=fo();for(var i in e)n(t[i],i),r[i]=r.Array;return ao}var es,ts;function ns(){if(ts)return es;ts=1;var e=io();return $o(),es=e,es}var rs={},is;function as(){if(is)return rs;is=1;var e=Dt(),t=nn().f,n=e(`metadata`),r=Function.prototype;return r[n]===void 0&&t(r,n,{value:null}),rs}var os={},ss;function cs(){return ss?os:(ss=1,ua(),os)}var ls={},us;function ds(){return us?ls:(us=1,ga(),ls)}var fs={},ps;function ms(){return ps?fs:(ps=1,xi()(`metadata`),fs)}var hs,gs;function _s(){if(gs)return hs;gs=1;var e=ns();return as(),cs(),ds(),ms(),hs=e,hs}var vs={},ys,bs;function xs(){if(bs)return ys;bs=1;var e=N(),t=v(),n=e(`Symbol`),r=n.keyFor,i=t(n.prototype.valueOf);return ys=n.isRegisteredSymbol||function(e){try{return r(i(e))!==void 0}catch{return!1}},ys}var Ss;function Cs(){return Ss?vs:(Ss=1,P()({target:`Symbol`,stat:!0},{isRegisteredSymbol:xs()}),vs)}var ws={},Ts,Es;function Ds(){if(Es)return Ts;Es=1;for(var e=ht(),t=N(),n=v(),r=Ge(),i=Dt(),a=t(`Symbol`),o=a.isWellKnownSymbol,s=t(`Object`,`getOwnPropertyNames`),c=n(a.prototype.valueOf),l=e(`wks`),u=0,d=s(a),f=d.length;u<f;u++)try{var p=d[u];r(a[p])&&i(p)}catch{}return Ts=function(e){if(o&&o(e))return!0;try{for(var t=c(e),n=0,r=s(l),i=r.length;n<i;n++)if(l[r[n]]==t)return!0}catch{}return!1},Ts}var Os;function ks(){return Os?ws:(Os=1,P()({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:Ds()}),ws)}var As={},js;function Ms(){return js?As:(js=1,xi()(`customMatcher`),As)}var Ns={},Ps;function Fs(){return Ps?Ns:(Ps=1,xi()(`observable`),Ns)}var Is={},Ls;function Rs(){return Ls?Is:(Ls=1,P()({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:xs()}),Is)}var zs={},Bs;function Vs(){return Bs?zs:(Bs=1,P()({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:Ds()}),zs)}var Hs={},Us;function Ws(){return Us?Hs:(Us=1,xi()(`matcher`),Hs)}var Gs={},Ks;function qs(){return Ks?Gs:(Ks=1,xi()(`metadataKey`),Gs)}var Js={},Ys;function Xs(){return Ys?Js:(Ys=1,xi()(`patternMatch`),Js)}var Zs={},Qs;function $s(){return Qs?Zs:(Qs=1,xi()(`replaceAll`),Zs)}var ec,tc;function nc(){if(tc)return ec;tc=1;var e=_s();return Cs(),ks(),Ms(),Fs(),Rs(),Vs(),Ws(),qs(),Xs(),$s(),ec=e,ec}var rc,ic;function ac(){return ic?rc:(ic=1,rc=nc(),rc)}var oc=t(ac()),sc={},cc,lc;function uc(){if(lc)return cc;lc=1;var e=v(),t=Fn(),n=xr(),r=j(),i=e(``.charAt),a=e(``.charCodeAt),o=e(``.slice),s=function(e){return function(s,c){var l=n(r(s)),u=t(c),d=l.length,f,p;return u<0||u>=d?e?``:void 0:(f=a(l,u),f<55296||f>56319||u+1===d||(p=a(l,u+1))<56320||p>57343?e?i(l,u):f:e?o(l,u,u+2):(f-55296<<10)+(p-56320)+65536)}};return cc={codeAt:s(!1),charAt:s(!0)},cc}var dc;function fc(){if(dc)return sc;dc=1;var e=uc().charAt,t=xr(),n=Ii(),r=Ho(),i=Go(),a=`String Iterator`,o=n.set,s=n.getterFor(a);return r(String,`String`,function(e){o(this,{type:a,string:t(e),index:0})},function(){var t=s(this),n=t.string,r=t.index,a;return r>=n.length?i(void 0,!0):(a=e(n,r),t.index+=a.length,i(a,!1))}),sc}var pc,mc;function hc(){return mc?pc:(mc=1,Jo(),fc(),Ta(),pc=vi().f(`iterator`),pc)}var gc,_c;function vc(){if(_c)return gc;_c=1;var e=hc();return $o(),gc=e,gc}var yc,bc;function xc(){return bc?yc:(bc=1,yc=vc(),yc)}var Sc,Cc;function wc(){return Cc?Sc:(Cc=1,Sc=xc(),Sc)}var Tc,Ec;function Dc(){return Ec?Tc:(Ec=1,Tc=wc(),Tc)}var Oc=t(Dc());function kc(e){"@babel/helpers - typeof";return kc=typeof oc==`function`&&typeof Oc==`symbol`?function(e){return typeof e}:function(e){return e&&typeof oc==`function`&&e.constructor===oc&&e!==oc.prototype?`symbol`:typeof e},kc(e)}var Ac,jc;function Mc(){return jc?Ac:(jc=1,Ka(),Ac=vi().f(`toPrimitive`),Ac)}var Nc,Pc;function Fc(){return Pc?Nc:(Pc=1,Nc=Mc(),Nc)}var Ic,Lc;function Rc(){return Lc?Ic:(Lc=1,Ic=Fc(),Ic)}var zc,Bc;function Vc(){return Bc?zc:(Bc=1,zc=Rc(),zc)}var Hc,Uc;function Wc(){return Uc?Hc:(Uc=1,Hc=Vc(),Hc)}var Gc=t(Wc());function Kc(e,t){if(kc(e)!=`object`||!e)return e;var n=e[Gc];if(n!==void 0){var r=n.call(e,t);if(kc(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qc(e){var t=Kc(e,`string`);return kc(t)==`symbol`?t:t+``}function Jc(e,t,n){return(t=qc(t))in e?Tn(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yc={},Xc,Zc;function Qc(){if(Zc)return Xc;Zc=1;var e=v(),t=Ze(),n=Ce(),r=xt(),i=ii(),a=f(),o=Function,s=e([].concat),c=e([].join),l={},u=function(e,t,n){if(!r(l,t)){for(var i=[],a=0;a<t;a++)i[a]=`a[`+a+`]`;l[t]=o(`C,a`,`return new C(`+c(i,`,`)+`)`)}return l[t](e,n)};return Xc=a?o.bind:function(e){var r=t(this),a=r.prototype,o=i(arguments,1),c=function(){var t=s(o,i(arguments));return this instanceof c?u(r,t.length,t):r.apply(e,t)};return n(a)&&(c.prototype=a),c},Xc}var $c;function el(){if($c)return Yc;$c=1;var e=P(),t=Qc();return e({target:`Function`,proto:!0,forced:Function.bind!==t},{bind:t}),Yc}var tl,nl;function rl(){if(nl)return tl;nl=1;var e=o(),t=M();return tl=function(n,r){var i=t[n+`Prototype`],a=i&&i[r];if(a)return a;var o=e[n],s=o&&o.prototype;return s&&s[r]},tl}var il,al;function ol(){return al?il:(al=1,el(),il=rl()(`Function`,`bind`),il)}var sl,cl;function ll(){if(cl)return sl;cl=1;var e=Ae(),t=ol(),n=Function.prototype;return sl=function(r){var i=r.bind;return r===n||e(n,r)&&i===n.bind?t:i},sl}var ul,dl;function fl(){return dl?ul:(dl=1,ul=ll(),ul)}var pl,ml;function hl(){return ml?pl:(ml=1,pl=fl(),pl)}var gl=t(hl()),_l={},vl,yl;function bl(){if(yl)return vl;yl=1;var e=Ze(),t=vt(),n=fe(),r=Vn(),i=TypeError,a=`Reduce of empty array with no initial value`,o=function(o){return function(s,c,l,u){var d=t(s),f=n(d),p=r(d);if(e(c),p===0&&l<2)throw new i(a);var m=o?p-1:0,h=o?-1:1;if(l<2)for(;;){if(m in f){u=f[m],m+=h;break}if(m+=h,o?m<0:p<=m)throw new i(a)}for(;o?m>=0:p>m;m+=h)m in f&&(u=c(u,f[m],m,d));return u}};return vl={left:o(!1),right:o(!0)},vl}var xl,Sl;function Cl(){if(Sl)return xl;Sl=1;var e=l();return xl=function(t,n){var r=[][t];return!!r&&e(function(){r.call(null,n||function(){return 1},1)})},xl}var wl,Tl;function El(){if(Tl)return wl;Tl=1;var e=o(),t=Ne(),n=x(),r=function(e){return t.slice(0,e.length)===e};return wl=(function(){return r(`Bun/`)?`BUN`:r(`Cloudflare-Workers`)?`CLOUDFLARE`:r(`Deno/`)?`DENO`:r(`Node.js/`)?`NODE`:e.Bun&&typeof Bun.version==`string`?`BUN`:e.Deno&&typeof Deno.version==`object`?`DENO`:n(e.process)===`process`?`NODE`:e.window&&e.document?`BROWSER`:`REST`})(),wl}var Dl,Ol;function kl(){return Ol?Dl:(Ol=1,Dl=El()===`NODE`,Dl)}var Al;function jl(){if(Al)return _l;Al=1;var e=P(),t=bl().left,n=Cl(),r=Ie();return e({target:`Array`,proto:!0,forced:!kl()&&r>79&&r<83||!n(`reduce`)},{reduce:function(e){var n=arguments.length;return t(this,e,n,n>1?arguments[1]:void 0)}}),_l}var Ml,Nl;function Pl(){return Nl?Ml:(Nl=1,jl(),Ml=rl()(`Array`,`reduce`),Ml)}var Fl,Il;function Ll(){if(Il)return Fl;Il=1;var e=Ae(),t=Pl(),n=Array.prototype;return Fl=function(r){var i=r.reduce;return r===n||e(n,r)&&i===n.reduce?t:i},Fl}var Rl,zl;function Bl(){return zl?Rl:(zl=1,Rl=Ll(),Rl)}var Vl,Hl;function Ul(){return Hl?Vl:(Hl=1,Vl=Bl(),Vl)}var Wl=t(Ul()),Gl={},Kl;function ql(){if(Kl)return Gl;Kl=1;var e=P(),t=zi().filter;return e({target:`Array`,proto:!0,forced:!mr()(`filter`)},{filter:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),Gl}var Jl,Yl;function Xl(){return Yl?Jl:(Yl=1,ql(),Jl=rl()(`Array`,`filter`),Jl)}var Zl,Ql;function $l(){if(Ql)return Zl;Ql=1;var e=Ae(),t=Xl(),n=Array.prototype;return Zl=function(r){var i=r.filter;return r===n||e(n,r)&&i===n.filter?t:i},Zl}var eu,tu;function nu(){return tu?eu:(tu=1,eu=$l(),eu)}var ru,iu;function au(){return iu?ru:(iu=1,ru=nu(),ru)}var ou=t(au()),su={},cu;function lu(){if(cu)return su;cu=1;var e=P(),t=zi().map;return e({target:`Array`,proto:!0,forced:!mr()(`map`)},{map:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),su}var uu,du;function fu(){return du?uu:(du=1,lu(),uu=rl()(`Array`,`map`),uu)}var pu,mu;function hu(){if(mu)return pu;mu=1;var e=Ae(),t=fu(),n=Array.prototype;return pu=function(r){var i=r.map;return r===n||e(n,r)&&i===n.map?t:i},pu}var gu,_u;function vu(){return _u?gu:(_u=1,gu=hu(),gu)}var yu,bu;function xu(){return bu?yu:(bu=1,yu=vu(),yu)}var Su=t(xu()),Cu={},wu,Tu;function Eu(){if(Tu)return wu;Tu=1;var e=kn(),t=Vn(),n=Wn(),r=qt(),i=function(a,o,s,c,l,u,d,f){for(var p=l,m=0,h=d?r(d,f):!1,g,_;m<c;)m in s&&(g=h?h(s[m],m,o):s[m],u>0&&e(g)?(_=t(g),p=i(a,o,g,_,p,u-1)-1):(n(p+1),a[p]=g),p++),m++;return p};return wu=i,wu}var Du;function Ou(){if(Du)return Cu;Du=1;var e=P(),t=Eu(),n=Ze(),r=vt(),i=Vn(),a=dr();return e({target:`Array`,proto:!0},{flatMap:function(e){var o=r(this),s=i(o),c;return n(e),c=a(o,0),c.length=t(c,o,o,s,0,1,e,arguments.length>1?arguments[1]:void 0),c}}),Cu}var ku={},Au;function ju(){return Au?ku:(Au=1,co()(`flatMap`),ku)}var Mu,Nu;function Pu(){return Nu?Mu:(Nu=1,Ou(),ju(),Mu=rl()(`Array`,`flatMap`),Mu)}var Fu,Iu;function Lu(){if(Iu)return Fu;Iu=1;var e=Ae(),t=Pu(),n=Array.prototype;return Fu=function(r){var i=r.flatMap;return r===n||e(n,r)&&i===n.flatMap?t:i},Fu}var Ru,zu;function Bu(){return zu?Ru:(zu=1,Ru=Lu(),Ru)}var Vu,Hu;function Uu(){return Hu?Vu:(Hu=1,Vu=Bu(),Vu)}Uu();var Wu,Gu;function Ku(){return Gu?Wu:(Gu=1,Wu=ns(),Wu)}var qu=t(Ku()),Ju={},Yu;function Xu(){if(Yu)return Ju;Yu=1;var e=P(),t=kn(),n=ar(),r=Ce(),i=Tr(),a=Vn(),o=be(),s=qn(),c=Dt(),l=mr(),u=ii(),d=l(`slice`),f=c(`species`),p=Array,m=Math.max;return e({target:`Array`,proto:!0,forced:!d},{slice:function(e,c){var l=o(this),d=a(l),h=i(e,d),g=i(c===void 0?d:c,d),_,v,y;if(t(l)&&(_=l.constructor,n(_)&&(_===p||t(_.prototype))?_=void 0:r(_)&&(_=_[f],_===null&&(_=void 0)),_===p||_===void 0))return u(l,h,g);for(v=new(_===void 0?p:_)(m(g-h,0)),y=0;h<g;h++,y++)h in l&&s(v,y,l[h]);return v.length=y,v}}),Ju}var Zu,Qu;function $u(){return Qu?Zu:(Qu=1,Xu(),Zu=rl()(`Array`,`slice`),Zu)}var ed,td;function nd(){if(td)return ed;td=1;var e=Ae(),t=$u(),n=Array.prototype;return ed=function(r){var i=r.slice;return r===n||e(n,r)&&i===n.slice?t:i},ed}var rd,id;function ad(){return id?rd:(id=1,rd=nd(),rd)}var od,sd;function cd(){return sd?od:(sd=1,od=ad(),od)}var ld=t(cd()),ud={},dd,fd;function pd(){if(fd)return dd;fd=1;var e=N(),t=v(),n=ei(),r=li(),i=en(),a=t([].concat);return dd=e(`Reflect`,`ownKeys`)||function(e){var t=n.f(i(e)),o=r.f;return o?a(t,o(e)):t},dd}var md;function hd(){return md?ud:(md=1,P()({target:`Reflect`,stat:!0},{ownKeys:pd()}),ud)}var gd,_d;function vd(){return _d?gd:(_d=1,hd(),gd=M().Reflect.ownKeys,gd)}var yd,bd;function xd(){return bd?yd:(bd=1,yd=vd(),yd)}var Sd,Cd;function wd(){return Cd?Sd:(Cd=1,Sd=xd(),Sd)}var Td=t(wd()),Ed={},Dd;function Od(){return Dd?Ed:(Dd=1,P()({target:`Array`,stat:!0},{isArray:kn()}),Ed)}var kd,Ad;function jd(){return Ad?kd:(Ad=1,Od(),kd=M().Array.isArray,kd)}var Md,Nd;function Pd(){return Nd?Md:(Nd=1,Md=jd(),Md)}var Fd,Id;function Ld(){return Id?Fd:(Id=1,Fd=Pd(),Fd)}var Rd=t(Ld()),zd={},Bd;function Vd(){if(Bd)return zd;Bd=1;var e=P(),t=vt(),n=Br();return e({target:`Object`,stat:!0,forced:l()(function(){n(1)})},{keys:function(e){return n(t(e))}}),zd}var Hd,Ud;function Wd(){return Ud?Hd:(Ud=1,Vd(),Hd=M().Object.keys,Hd)}var Gd,Kd;function qd(){return Kd?Gd:(Kd=1,Gd=Wd(),Gd)}var Jd,Yd;function Xd(){return Yd?Jd:(Yd=1,Jd=qd(),Jd)}var Zd=t(Xd()),Qd={},$d,ef;function tf(){if(ef)return $d;ef=1;var e=zi().forEach;return $d=Cl()(`forEach`)?[].forEach:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)},$d}var nf;function rf(){if(nf)return Qd;nf=1;var e=P(),t=tf();return e({target:`Array`,proto:!0,forced:[].forEach!==t},{forEach:t}),Qd}var af,of;function sf(){return of?af:(of=1,rf(),af=rl()(`Array`,`forEach`),af)}var cf,lf;function uf(){return lf?cf:(lf=1,cf=sf(),cf)}var df,ff;function pf(){if(ff)return df;ff=1;var e=$n(),t=xt(),n=Ae(),r=uf(),i=Array.prototype,a={DOMTokenList:!0,NodeList:!0};return df=function(o){var s=o.forEach;return o===i||n(i,o)&&s===i.forEach||t(a,e(o))?r:s},df}var mf,hf;function gf(){return hf?mf:(hf=1,mf=pf(),mf)}var _f=t(gf()),vf={},yf;function bf(){if(yf)return vf;yf=1;var e=P(),t=v(),n=kn(),r=t([].reverse),i=[1,2];return e({target:`Array`,proto:!0,forced:String(i)===String(i.reverse())},{reverse:function(){return n(this)&&(this.length=this.length),r(this)}}),vf}var xf,Sf;function Cf(){return Sf?xf:(Sf=1,bf(),xf=rl()(`Array`,`reverse`),xf)}var wf,Tf;function Ef(){if(Tf)return wf;Tf=1;var e=Ae(),t=Cf(),n=Array.prototype;return wf=function(r){var i=r.reverse;return r===n||e(n,r)&&i===n.reverse?t:i},wf}var Df,Of;function kf(){return Of?Df:(Of=1,Df=Ef(),Df)}var Af,jf;function Mf(){return jf?Af:(jf=1,Af=kf(),Af)}var Nf=t(Mf()),Pf={},Ff,If;function Lf(){if(If)return Ff;If=1;var e=k(),t=kn(),n=TypeError,r=Object.getOwnPropertyDescriptor;return Ff=e&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,i){if(t(e)&&!r(e,`length`).writable)throw new n(`Cannot set read only .length`);return e.length=i}:function(e,t){return e.length=t},Ff}var Rf,zf;function Bf(){if(zf)return Rf;zf=1;var e=Je(),t=TypeError;return Rf=function(n,r){if(!delete n[r])throw new t(`Cannot delete property `+e(r)+` of `+e(n))},Rf}var Vf;function Hf(){if(Vf)return Pf;Vf=1;var e=P(),t=vt(),n=Tr(),r=Fn(),i=Vn(),a=Lf(),o=Wn(),s=dr(),c=qn(),l=Bf(),u=mr()(`splice`),d=Math.max,f=Math.min;return e({target:`Array`,proto:!0,forced:!u},{splice:function(e,u){var p=t(this),m=i(p),h=n(e,m),g=arguments.length,_,v,y,b,x,S;for(g===0?_=v=0:g===1?(_=0,v=m-h):(_=g-2,v=f(d(r(u),0),m-h)),o(m+_-v),y=s(p,v),b=0;b<v;b++)x=h+b,x in p&&c(y,b,p[x]);if(y.length=v,_<v){for(b=h;b<m-v;b++)x=b+v,S=b+_,x in p?p[S]=p[x]:l(p,S);for(b=m;b>m-v+_;b--)l(p,b-1)}else if(_>v)for(b=m-v;b>h;b--)x=b+v-1,S=b+_-1,x in p?p[S]=p[x]:l(p,S);for(b=0;b<_;b++)p[b+h]=arguments[b+2];return a(p,m-v+_),y}}),Pf}var Uf,Wf;function Gf(){return Wf?Uf:(Wf=1,Hf(),Uf=rl()(`Array`,`splice`),Uf)}var Kf,qf;function Jf(){if(qf)return Kf;qf=1;var e=Ae(),t=Gf(),n=Array.prototype;return Kf=function(r){var i=r.splice;return r===n||e(n,r)&&i===n.splice?t:i},Kf}var Yf,Xf;function Zf(){return Xf?Yf:(Xf=1,Yf=Jf(),Yf)}var Qf,$f;function ep(){return $f?Qf:($f=1,Qf=Zf(),Qf)}var tp=t(ep()),np={},rp,ip;function ap(){if(ip)return rp;ip=1;var e=k(),t=v(),n=A(),r=l(),i=Br(),a=li(),o=oe(),s=vt(),c=fe(),u=Object.assign,d=Object.defineProperty,f=t([].concat);return rp=!u||r(function(){if(e&&u({b:1},u(d({},`a`,{enumerable:!0,get:function(){d(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var t={},n={},r=Symbol(`assign detection`),a=`abcdefghijklmnopqrst`;return t[r]=7,a.split(``).forEach(function(e){n[e]=e}),u({},t)[r]!==7||i(u({},n)).join(``)!==a})?function(t,r){for(var l=s(t),u=arguments.length,d=1,p=a.f,m=o.f;u>d;)for(var h=c(arguments[d++]),g=p?f(i(h),p(h)):i(h),_=g.length,v=0,y;_>v;)y=g[v++],(!e||n(m,h,y))&&(l[y]=h[y]);return l}:u,rp}var op;function sp(){if(op)return np;op=1;var e=P(),t=ap();return e({target:`Object`,stat:!0,arity:2,forced:Object.assign!==t},{assign:t}),np}var cp,lp;function up(){return lp?cp:(lp=1,sp(),cp=M().Object.assign,cp)}var dp,fp;function pp(){return fp?dp:(fp=1,dp=up(),dp)}var mp,hp;function gp(){return hp?mp:(hp=1,mp=pp(),mp)}var _p=t(gp()),vp,yp;function bp(){return yp?vp:(yp=1,gr(),vp=rl()(`Array`,`concat`),vp)}var xp,Sp;function Cp(){if(Sp)return xp;Sp=1;var e=Ae(),t=bp(),n=Array.prototype;return xp=function(r){var i=r.concat;return r===n||e(n,r)&&i===n.concat?t:i},xp}var wp,Tp;function Ep(){return Tp?wp:(Tp=1,wp=Cp(),wp)}var Dp,Op;function kp(){return Op?Dp:(Op=1,Dp=Ep(),Dp)}var Ap=t(kp()),jp={},Mp;function Np(){return Mp?jp:(Mp=1,P()({target:`Object`,stat:!0,sham:!k()},{create:Zr()}),jp)}var Pp,Fp;function Ip(){if(Fp)return Pp;Fp=1,Np();var e=M().Object;return Pp=function(t,n){return e.create(t,n)},Pp}var Lp,Rp;function zp(){return Rp?Lp:(Rp=1,Lp=Ip(),Lp)}var Bp,Vp;function Hp(){return Vp?Bp:(Vp=1,Bp=zp(),Bp)}var Up=t(Hp()),Wp={},Gp,Kp;function qp(){if(Kp)return Gp;Kp=1;var e=Fn(),t=xr(),n=j(),r=RangeError;return Gp=function(i){var a=t(n(this)),o=``,s=e(i);if(s<0||s===1/0)throw new r(`Wrong number of repetitions`);for(;s>0;(s>>>=1)&&(a+=a))s&1&&(o+=a);return o},Gp}var Jp,Yp;function Xp(){if(Yp)return Jp;Yp=1;var e=v(),t=Rn(),n=xr(),r=qp(),i=j(),a=e(r),o=e(``.slice),s=Math.ceil,c=function(e){return function(r,c,l){var u=n(i(r)),d=t(c),f=u.length,p=l===void 0?` `:n(l),m,h;return d<=f||p===``?u:(m=d-f,h=a(p,s(m/p.length)),h.length>m&&(h=o(h,0,m)),e?u+h:h+u)}};return Jp={start:c(!1),end:c(!0)},Jp}var Zp,Qp;function $p(){if(Qp)return Zp;Qp=1;var e=v(),t=l(),n=Xp().start,r=RangeError,i=isFinite,a=Math.abs,o=Date.prototype,s=o.toISOString,c=e(o.getTime),u=e(o.getUTCDate),d=e(o.getUTCFullYear),f=e(o.getUTCHours),p=e(o.getUTCMilliseconds),m=e(o.getUTCMinutes),h=e(o.getUTCMonth),g=e(o.getUTCSeconds);return Zp=t(function(){return s.call(new Date(-50000000000001))!==`0385-07-25T07:06:39.999Z`})||!t(function(){s.call(new Date(NaN))})?function(){if(!i(c(this)))throw new r(`Invalid time value`);var e=this,t=d(e),o=p(e),s=t<0?`-`:t>9999?`+`:``;return s+n(a(t),s?6:4,0)+`-`+n(h(e)+1,2,0)+`-`+n(u(e),2,0)+`T`+n(f(e),2,0)+`:`+n(m(e),2,0)+`:`+n(g(e),2,0)+`.`+n(o,3,0)+`Z`}:s,Zp}var em;function tm(){if(em)return Wp;em=1;var e=P(),t=A(),n=vt(),r=At(),i=$p(),a=x();return e({target:`Date`,proto:!0,forced:l()(function(){return new Date(NaN).toJSON()!==null||t(Date.prototype.toJSON,{toISOString:function(){return 1}})!==1})},{toJSON:function(e){var o=n(this),s=r(o,`number`);return typeof s==`number`&&!isFinite(s)?null:!(`toISOString`in o)&&a(o)===`Date`?t(i,o):o.toISOString()}}),Wp}var nm,rm;function im(){if(rm)return nm;rm=1,tm(),na();var e=M(),t=h();return e.JSON||={stringify:JSON.stringify},nm=function(n,r,i){return t(e.JSON.stringify,null,arguments)},nm}var am,om;function sm(){return om?am:(om=1,am=im(),am)}var cm,lm;function um(){return lm?cm:(lm=1,cm=sm(),cm)}var dm=t(um()),fm={},pm={},mm,hm;function gm(){if(hm)return mm;hm=1;var e=TypeError;return mm=function(t,n){if(t<n)throw new e(`Not enough arguments`);return t},mm}var _m,vm;function ym(){if(vm)return _m;vm=1;var e=o(),t=h(),n=D(),r=El(),i=Ne(),a=ii(),s=gm(),c=e.Function,l=/MSIE .\./.test(i)||r===`BUN`&&(function(){var t=e.Bun.version.split(`.`);return t.length<3||t[0]===`0`&&(t[1]<3||t[1]===`3`&&t[2]===`0`)})();return _m=function(e,r){var i=r?2:1;return l?function(o,l){var u=s(arguments.length,1)>i,d=n(o)?o:c(o),f=u?a(arguments,i):[],p=u?function(){t(d,this,f)}:d;return r?e(p,l):e(p)}:e},_m}var bm;function xm(){if(bm)return pm;bm=1;var e=P(),t=o(),n=ym()(t.setInterval,!0);return e({global:!0,bind:!0,forced:t.setInterval!==n},{setInterval:n}),pm}var Sm={},Cm;function wm(){if(Cm)return Sm;Cm=1;var e=P(),t=o(),n=ym()(t.setTimeout,!0);return e({global:!0,bind:!0,forced:t.setTimeout!==n},{setTimeout:n}),Sm}var Tm;function Em(){return Tm?fm:(Tm=1,xm(),wm(),fm)}var Dm,Om;function km(){return Om?Dm:(Om=1,Em(),Dm=M().setTimeout,Dm)}var Am,jm;function Mm(){return jm?Am:(jm=1,Am=km(),Am)}var Nm=t(Mm()),Pm={exports:{}},Fm;function Im(){return Fm?Pm.exports:(Fm=1,(function(e){function t(e){if(e)return n(e);this._callbacks=new Map}function n(e){return Object.assign(e,t.prototype),e._callbacks=new Map,e}t.prototype.on=function(e,t){let n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},t.prototype.once=function(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},t.prototype.off=function(e,t){if(e===void 0&&t===void 0)return this._callbacks.clear(),this;if(t===void 0)return this._callbacks.delete(e),this;let n=this._callbacks.get(e);if(n){for(let[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}n.length===0?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},t.prototype.emit=function(e,...t){let n=this._callbacks.get(e);if(n){let e=[...n];for(let n of e)n.apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks.get(e)??[]},t.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(let e of this._callbacks.values())t+=e.length;return t},t.prototype.hasListeners=function(e){return this.listenerCount(e)>0},t.prototype.addEventListener=t.prototype.on,t.prototype.removeListener=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,e.exports=t})(Pm),Pm.exports)}var Lm=t(Im());function Rm(){return Rm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rm.apply(this,arguments)}function zm(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Bm(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var Vm=typeof Object.assign==`function`?Object.assign:function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t},Hm=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],Um=typeof document>`u`?{style:{}}:document.createElement(`div`),Wm=`function`,Gm=Math.round,Km=Math.abs,qm=Date.now;function Jm(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<Hm.length;){if(n=Hm[a],r=n?n+i:t,r in e)return r;a++}}var Ym=typeof window>`u`?{}:window,Xm=Jm(Um.style,`touchAction`),Zm=Xm!==void 0;function Qm(){if(!Zm)return!1;var e={},t=Ym.CSS&&Ym.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(n){return e[n]=t?Ym.CSS.supports(`touch-action`,n):!0}),e}var $m=`compute`,eh=`auto`,th=`manipulation`,nh=`none`,rh=`pan-x`,ih=`pan-y`,ah=Qm(),oh=/mobile|tablet|ip(ad|hone|od)|android/i,sh=`ontouchstart`in Ym,ch=Jm(Ym,`PointerEvent`)!==void 0,lh=sh&&oh.test(navigator.userAgent),uh=`touch`,dh=`pen`,fh=`mouse`,ph=`kinect`,mh=25,hh=1,gh=2,_h=4,vh=8,yh=1,bh=2,xh=4,Sh=8,Ch=16,wh=bh|xh,Th=Sh|Ch,Eh=wh|Th,Dh=[`x`,`y`],Oh=[`clientX`,`clientY`];function kh(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==void 0)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function Ah(e,t){return typeof e===Wm?e.apply(t&&t[0]||void 0,t):e}function jh(e,t){return e.indexOf(t)>-1}function Mh(e){if(jh(e,nh))return nh;var t=jh(e,rh),n=jh(e,ih);return t&&n?nh:t||n?t?rh:ih:jh(e,th)?th:eh}var Nh=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===$m&&(e=this.compute()),Zm&&this.manager.element.style&&ah[e]&&(this.manager.element.style[Xm]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return kh(this.manager.recognizers,function(t){Ah(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),Mh(e.join(` `))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=jh(r,nh)&&!ah[nh],a=jh(r,ih)&&!ah[ih],o=jh(r,rh)&&!ah[rh];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&wh||o&&n&Th))return this.preventSrc(t)},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function Ph(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function Fh(e){var t=e.length;if(t===1)return{x:Gm(e[0].clientX),y:Gm(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:Gm(n/t),y:Gm(r/t)}}function Ih(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:Gm(e.pointers[n].clientX),clientY:Gm(e.pointers[n].clientY)},n++;return{timeStamp:qm(),pointers:t,center:Fh(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Lh(e,t,n){n||=Dh;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Rh(e,t,n){n||=Dh;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function zh(e,t){return e===t?yh:Km(e)>=Km(t)?e<0?bh:xh:t<0?Sh:Ch}function Bh(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===hh||a.eventType===_h)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function Vh(e,t,n){return{x:t/e||0,y:n/e||0}}function Hh(e,t){return Lh(t[0],t[1],Oh)/Lh(e[0],e[1],Oh)}function Uh(e,t){return Rh(t[1],t[0],Oh)+Rh(e[1],e[0],Oh)}function Wh(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,i,a,o,s;if(t.eventType!==vh&&(r>mh||n.velocity===void 0)){var c=t.deltaX-n.deltaX,l=t.deltaY-n.deltaY,u=Vh(r,c,l);a=u.x,o=u.y,i=Km(u.x)>Km(u.y)?u.x:u.y,s=zh(c,l),e.lastInterval=t}else i=n.velocity,a=n.velocityX,o=n.velocityY,s=n.direction;t.velocity=i,t.velocityX=a,t.velocityY=o,t.direction=s}function Gh(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=Ih(t),i>1&&!n.firstMultiple?n.firstMultiple=Ih(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=Fh(r);t.timeStamp=qm(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Rh(s,c),t.distance=Lh(s,c),Bh(n,t),t.offsetDirection=zh(t.deltaX,t.deltaY);var l=Vh(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=Km(l.x)>Km(l.y)?l.x:l.y,t.scale=o?Hh(o.pointers,r):1,t.rotation=o?Uh(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,Wh(n,t);var u=e.element,d=t.srcEvent,f=d.composedPath?d.composedPath()[0]:d.path?d.path[0]:d.target;Ph(f,u)&&(u=f),t.target=u}function Kh(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&hh&&r-i===0,o=t&(_h|vh)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,Gh(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function qh(e){return e.trim().split(/\s+/g)}function Jh(e,t,n){kh(qh(t),function(t){e.addEventListener(t,n,!1)})}function Yh(e,t,n){kh(qh(t),function(t){e.removeEventListener(t,n,!1)})}function Xh(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var Zh=function(){function e(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){Ah(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&Jh(this.element,this.evEl,this.domHandler),this.evTarget&&Jh(this.target,this.evTarget,this.domHandler),this.evWin&&Jh(Xh(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&Yh(this.element,this.evEl,this.domHandler),this.evTarget&&Yh(this.target,this.evTarget,this.domHandler),this.evWin&&Yh(Xh(this.element),this.evWin,this.domHandler)},e}();function Qh(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}var $h={pointerdown:hh,pointermove:gh,pointerup:_h,pointercancel:vh,pointerout:vh},eg={2:uh,3:dh,4:fh,5:ph},tg=`pointerdown`,ng=`pointermove pointerup pointercancel`;Ym.MSPointerEvent&&!Ym.PointerEvent&&(tg=`MSPointerDown`,ng=`MSPointerMove MSPointerUp MSPointerCancel`);var rg=function(e){zm(t,e);function t(){var n,r=t.prototype;return r.evEl=tg,r.evWin=ng,n=e.apply(this,arguments)||this,n.store=n.manager.session.pointerEvents=[],n}var n=t.prototype;return n.handler=function(e){var t=this.store,n=!1,r=$h[e.type.toLowerCase().replace(`ms`,``)],i=eg[e.pointerType]||e.pointerType,a=i===uh,o=Qh(t,e.pointerId,`pointerId`);r&hh&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(_h|vh)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))},t}(Zh);function ig(e){return Array.prototype.slice.call(e,0)}function ag(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];Qh(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}var og={touchstart:hh,touchmove:gh,touchend:_h,touchcancel:vh},sg=`touchstart touchmove touchend touchcancel`,cg=function(e){zm(t,e);function t(){var n;return t.prototype.evTarget=sg,n=e.apply(this,arguments)||this,n.targetIds={},n}var n=t.prototype;return n.handler=function(e){var t=og[e.type],n=lg.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:uh,srcEvent:e})},t}(Zh);function lg(e,t){var n=ig(e.touches),r=this.targetIds;if(t&(hh|gh)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=ig(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return Ph(e.target,c)}),t===hh)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&(_h|vh)&&delete r[o[i].identifier],i++;if(s.length)return[ag(a.concat(s),`identifier`,!0),s]}var ug={mousedown:hh,mousemove:gh,mouseup:_h},dg=`mousedown`,fg=`mousemove mouseup`,pg=function(e){zm(t,e);function t(){var n,r=t.prototype;return r.evEl=dg,r.evWin=fg,n=e.apply(this,arguments)||this,n.pressed=!1,n}var n=t.prototype;return n.handler=function(e){var t=ug[e.type];t&hh&&e.button===0&&(this.pressed=!0),t&gh&&e.which!==1&&(t=_h),this.pressed&&(t&_h&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:fh,srcEvent:e}))},t}(Zh),mg=2500,hg=25;function gg(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(n),setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},mg)}}function _g(e,t){e&hh?(this.primaryTouch=t.changedPointers[0].identifier,gg.call(this,t)):e&(_h|vh)&&gg.call(this,t)}function vg(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=hg&&o<=hg)return!0}return!1}var yg=function(){return function(e){zm(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.handler=function(e,t,n){var i=n.pointerType===uh,a=n.pointerType===fh;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)_g.call(Bm(Bm(r)),t,n);else if(a&&vg.call(Bm(Bm(r)),n))return;r.callback(e,t,n)}},r.touch=new cg(r.manager,r.handler),r.mouse=new pg(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}var n=t.prototype;return n.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Zh)}();function bg(e){var t;return t=e.options.inputClass||(ch?rg:lh?cg:sh?yg:pg),new t(e,Kh)}function xg(e,t,n){return Array.isArray(e)?(kh(e,n[t],n),!0):!1}var Sg=1,Cg=2,wg=4,Tg=8,Eg=Tg,Dg=16,Og=32,kg=1;function Ag(){return kg++}function jg(e,t){var n=t.manager;return n?n.get(e):e}function Mg(e){return e&Dg?`cancel`:e&Tg?`end`:e&wg?`move`:e&Cg?`start`:``}var Ng=function(){function e(e){e===void 0&&(e={}),this.options=Rm({enable:!0},e),this.id=Ag(),this.manager=null,this.state=Sg,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return Vm(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(xg(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=jg(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return xg(e,`dropRecognizeWith`,this)?this:(e=jg(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(xg(e,`requireFailure`,this))return this;var t=this.requireFail;return e=jg(e,this),Qh(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(xg(e,`dropRequireFailure`,this))return this;e=jg(e,this);var t=Qh(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<Tg&&r(t.options.event+Mg(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=Tg&&r(t.options.event+Mg(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=Og},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(Og|Sg)))return!1;e++}return!0},t.recognize=function(e){var t=Vm({},e);if(!Ah(this.options.enable,[this,t])){this.reset(),this.state=Og;return}this.state&(Eg|Dg|Og)&&(this.state=Sg),this.state=this.process(t),this.state&(Cg|wg|Tg|Dg)&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),Pg=function(e){zm(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,Rm({event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var n=t.prototype;return n.getTouchAction=function(){return[th]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&hh&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==_h)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<n.interval:!0,s=!this.pCenter||Lh(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!s||!o?this.count=1:this.count+=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=Eg,t.tryEmit()},n.interval),Cg):Eg}return Og},n.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=Og},this.options.interval),Og},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===Eg&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(Ng),Fg=function(e){zm(t,e);function t(t){return t===void 0&&(t={}),e.call(this,Rm({pointers:1},t))||this}var n=t.prototype;return n.attrTest=function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,r=t&(Cg|wg),i=this.attrTest(e);return r&&(n&vh||!i)?t|Dg:r||i?n&_h?t|Tg:t&Cg?t|wg:Cg:Og},t}(Ng);function Ig(e){return e===Ch?`down`:e===Sh?`up`:e===bh?`left`:e===xh?`right`:``}var Lg=function(e){zm(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,Rm({event:`pan`,threshold:10,pointers:1,direction:Eh},t))||this,n.pX=null,n.pY=null,n}var n=t.prototype;return n.getTouchAction=function(){var e=this.options.direction,t=[];return e&wh&&t.push(ih),e&Th&&t.push(rh),t},n.directionTest=function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&wh?(i=a===0?yh:a<0?bh:xh,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?yh:o<0?Sh:Ch,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return Fg.prototype.attrTest.call(this,e)&&(this.state&Cg||!(this.state&Cg)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=Ig(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(Fg),Rg=function(e){zm(t,e);function t(t){return t===void 0&&(t={}),e.call(this,Rm({event:`swipe`,threshold:10,velocity:.3,direction:wh|Th,pointers:1},t))||this}var n=t.prototype;return n.getTouchAction=function(){return Lg.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n=this.options.direction,r;return n&(wh|Th)?r=t.overallVelocity:n&wh?r=t.overallVelocityX:n&Th&&(r=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&Km(r)>this.options.velocity&&t.eventType&_h},n.emit=function(e){var t=Ig(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(Fg),zg=function(e){zm(t,e);function t(t){return t===void 0&&(t={}),e.call(this,Rm({event:`pinch`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[nh]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&Cg)},n.emit=function(t){if(t.scale!==1){var n=t.scale<1?`in`:`out`;t.additionalEvent=this.options.event+n}e.prototype.emit.call(this,t)},t}(Fg),Bg=function(e){zm(t,e);function t(t){return t===void 0&&(t={}),e.call(this,Rm({event:`rotate`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[nh]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&Cg)},t}(Fg),Vg=function(e){zm(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,Rm({event:`press`,pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var n=t.prototype;return n.getTouchAction=function(){return[eh]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime>n.time;if(this._input=e,!i||!r||e.eventType&(_h|vh)&&!a)this.reset();else if(e.eventType&hh)this.reset(),this._timer=setTimeout(function(){t.state=Eg,t.tryEmit()},n.time);else if(e.eventType&_h)return Eg;return Og},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===Eg&&(e&&e.eventType&_h?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=qm(),this.manager.emit(this.options.event,this._input)))},t}(Ng),Hg={domEvents:!1,touchAction:$m,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},Ug=[[Bg,{enable:!1}],[zg,{enable:!1},[`rotate`]],[Rg,{direction:wh}],[Lg,{direction:wh},[`swipe`]],[Pg],[Pg,{event:`doubletap`,taps:2},[`tap`]],[Vg]],Wg=1,Gg=2;function Kg(e,t){var n=e.element;if(n.style){var r;kh(e.options.cssProps,function(i,a){r=Jm(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function qg(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var Jg=function(){function e(e,t){var n=this;this.options=Vm({},Hg,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=bg(this),this.touchAction=new Nh(this,this.options.touchAction),Kg(this,!0),kh(this.options.recognizers,function(e){var t=n.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return Vm(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?Gg:Wg},t.recognize=function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&Eg)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==Gg&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(Cg|wg|Tg)&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof Ng)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(xg(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(xg(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=Qh(n,t);r!==-1&&(n.splice(r,1),this.touchAction.update())}return this},t.on=function(e,t){if(e===void 0||t===void 0)return this;var n=this.handlers;return kh(qh(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},t.off=function(e,t){if(e===void 0)return this;var n=this.handlers;return kh(qh(e),function(e){t?n[e]&&n[e].splice(Qh(n[e],t),1):delete n[e]}),this},t.emit=function(e,t){this.options.domEvents&&qg(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(!(!n||!n.length)){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},t.destroy=function(){this.element&&Kg(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),Yg={touchstart:hh,touchmove:gh,touchend:_h,touchcancel:vh},Xg=`touchstart`,Zg=`touchstart touchmove touchend touchcancel`,Qg=function(e){zm(t,e);function t(){var n,r=t.prototype;return r.evTarget=Xg,r.evWin=Zg,n=e.apply(this,arguments)||this,n.started=!1,n}var n=t.prototype;return n.handler=function(e){var t=Yg[e.type];if(t===hh&&(this.started=!0),this.started){var n=$g.call(this,e,t);t&(_h|vh)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:uh,srcEvent:e})}},t}(Zh);function $g(e,t){var n=ig(e.touches),r=ig(e.changedTouches);return t&(_h|vh)&&(n=ag(n.concat(r),`identifier`,!0)),[n,r]}function e_(e,t,n){var r=`DEPRECATED METHOD: `+t+`
|
|
2
2
|
`+n+` AT
|
|
3
3
|
`;return function(){var t=Error(`get-stack-trace`),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,``).replace(/^\s+at\s+/gm,``).replace(/^Object.<anonymous>\s*\(/gm,`{anonymous}()@`):`Unknown Stack Trace`,i=window.console&&(window.console.warn||window.console.log);return i&&i.call(window.console,r,n),e.apply(this,arguments)}}var t_=e_(function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&e[r[i]]===void 0)&&(e[r[i]]=t[r[i]]),i++;return e},`extend`,"Use `assign`."),n_=e_(function(e,t){return t_(e,t,!0)},`merge`,"Use `assign`.");function r_(e,t,n){var r=t.prototype,i=e.prototype=Object.create(r);i.constructor=e,i._super=r,n&&Vm(i,n)}function i_(e,t){return function(){return e.apply(t,arguments)}}var a_=function(){var e=function(e,t){return t===void 0&&(t={}),new Jg(e,Rm({recognizers:Ug.concat()},t))};return e.VERSION=`2.0.17-rc`,e.DIRECTION_ALL=Eh,e.DIRECTION_DOWN=Ch,e.DIRECTION_LEFT=bh,e.DIRECTION_RIGHT=xh,e.DIRECTION_UP=Sh,e.DIRECTION_HORIZONTAL=wh,e.DIRECTION_VERTICAL=Th,e.DIRECTION_NONE=yh,e.DIRECTION_DOWN=Ch,e.INPUT_START=hh,e.INPUT_MOVE=gh,e.INPUT_END=_h,e.INPUT_CANCEL=vh,e.STATE_POSSIBLE=Sg,e.STATE_BEGAN=Cg,e.STATE_CHANGED=wg,e.STATE_ENDED=Tg,e.STATE_RECOGNIZED=Eg,e.STATE_CANCELLED=Dg,e.STATE_FAILED=Og,e.Manager=Jg,e.Input=Zh,e.TouchAction=Nh,e.TouchInput=cg,e.MouseInput=pg,e.PointerEventInput=rg,e.TouchMouseInput=yg,e.SingleTouchInput=Qg,e.Recognizer=Ng,e.AttrRecognizer=Fg,e.Tap=Pg,e.Pan=Lg,e.Swipe=Rg,e.Pinch=zg,e.Rotate=Bg,e.Press=Vg,e.on=Jh,e.off=Yh,e.each=kh,e.merge=n_,e.extend=t_,e.bindFn=i_,e.assign=Vm,e.inherit=r_,e.bindFn=i_,e.prefixed=Jm,e.toArray=ig,e.inArray=Qh,e.uniqueArray=ag,e.splitStr=qh,e.boolOrFn=Ah,e.hasParent=Ph,e.addEventListeners=Jh,e.removeEventListeners=Yh,e.defaults=Vm({},Hg,{preset:Ug}),e}(),o_=qu(`DELETE`);function s_(e){return c_({},e,...[...arguments].slice(1))}function c_(){let e=l_(...arguments);return d_(e),e}function l_(){var e=[...arguments];if(e.length<2)return e[0];if(e.length>2)return l_(c_(e[0],e[1]),...ld(e).call(e,2));let t=e[0],n=e[1];if(t instanceof Date&&n instanceof Date)return t.setTime(n.getTime()),t;for(let e of Td(n))Object.prototype.propertyIsEnumerable.call(n,e)&&(n[e]===o_?delete t[e]:t[e]!==null&&n[e]!==null&&typeof t[e]==`object`&&typeof n[e]==`object`&&!Rd(t[e])&&!Rd(n[e])?t[e]=l_(t[e],n[e]):t[e]=u_(n[e]));return t}function u_(e){return Rd(e)?Su(e).call(e,e=>u_(e)):typeof e==`object`&&e?e instanceof Date?new Date(e.getTime()):l_({},e):e}function d_(e){for(let t of Zd(e))e[t]===o_?delete e[t]:typeof e[t]==`object`&&e[t]!==null&&d_(e[t])}function f_(){let e=()=>{};return{on:e,off:e,destroy:e,emit:e,get(){return{set:e}}}}var p_=typeof window<`u`?window.Hammer||a_:function(){return f_()};function m_(e){var t;this._cleanupQueue=[],this.active=!1,this._dom={container:e,overlay:document.createElement(`div`)},this._dom.overlay.classList.add(`vis-overlay`),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});let n=p_(this._dom.overlay);n.on(`tap`,gl(t=this._onTapOverlay).call(t,this)),this._cleanupQueue.push(()=>{n.destroy()});let r=[`tap`,`doubletap`,`press`,`pinch`,`pan`,`panstart`,`panmove`,`panend`];_f(r).call(r,e=>{n.on(e,e=>{e.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=t=>{h_(t.target,e)||this.deactivate()},document.body.addEventListener(`click`,this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener(`click`,this._onClick)})),this._escListener=e=>{(`key`in e?e.key===`Escape`:e.keyCode===27)&&this.deactivate()}}Lm(m_.prototype),m_.current=null,m_.prototype.destroy=function(){this.deactivate();for(let n of Nf(e=tp(t=this._cleanupQueue).call(t,0)).call(e)){var e,t;n()}},m_.prototype.activate=function(){m_.current&&m_.current.deactivate(),m_.current=this,this.active=!0,this._dom.overlay.style.display=`none`,this._dom.container.classList.add(`vis-active`),this.emit(`change`),this.emit(`activate`),document.body.addEventListener(`keydown`,this._escListener)},m_.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display=`block`,this._dom.container.classList.remove(`vis-active`),document.body.removeEventListener(`keydown`,this._escListener),this.emit(`change`),this.emit(`deactivate`)},m_.prototype._onTapOverlay=function(e){this.activate(),e.srcEvent.stopPropagation()};function h_(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}var g_,__;function v_(){return __?g_:(__=1,sa(),g_=M().Object.getOwnPropertySymbols,g_)}var y_,b_;function x_(){return b_?y_:(b_=1,y_=v_(),y_)}var S_,C_;function w_(){return C_?S_:(C_=1,S_=x_(),S_)}var T_=t(w_()),E_={exports:{}},D_={},O_;function k_(){if(O_)return D_;O_=1;var e=P(),t=l(),n=be(),r=Vt().f,i=k();return e({target:`Object`,stat:!0,forced:!i||t(function(){r(1)}),sham:!i},{getOwnPropertyDescriptor:function(e,t){return r(n(e),t)}}),D_}var A_;function j_(){if(A_)return E_.exports;A_=1,k_();var e=M().Object,t=E_.exports=function(t,n){return e.getOwnPropertyDescriptor(t,n)};return e.getOwnPropertyDescriptor.sham&&(t.sham=!0),E_.exports}var M_,N_;function P_(){return N_?M_:(N_=1,M_=j_(),M_)}var F_,I_;function L_(){return I_?F_:(I_=1,F_=P_(),F_)}var R_=t(L_()),z_={},B_;function V_(){if(B_)return z_;B_=1;var e=P(),t=k(),n=pd(),r=be(),i=Vt(),a=qn();return e({target:`Object`,stat:!0,sham:!t},{getOwnPropertyDescriptors:function(e){for(var t=r(e),o=i.f,s=n(t),c={},l=0,u,d;s.length>l;)d=o(t,u=s[l++]),d!==void 0&&a(c,u,d);return c}}),z_}var H_,U_;function W_(){return U_?H_:(U_=1,V_(),H_=M().Object.getOwnPropertyDescriptors,H_)}var G_,K_;function q_(){return K_?G_:(K_=1,G_=W_(),G_)}var J_,Y_;function X_(){return Y_?J_:(Y_=1,J_=q_(),J_)}var Z_=t(X_()),Q_={exports:{}},$_={},ev;function tv(){if(ev)return $_;ev=1;var e=P(),t=k(),n=Hr().f;return e({target:`Object`,stat:!0,forced:Object.defineProperties!==n,sham:!t},{defineProperties:n}),$_}var nv;function rv(){if(nv)return Q_.exports;nv=1,tv();var e=M().Object,t=Q_.exports=function(t,n){return e.defineProperties(t,n)};return e.defineProperties.sham&&(t.sham=!0),Q_.exports}var iv,av;function ov(){return av?iv:(av=1,iv=rv(),iv)}var sv,cv;function lv(){return cv?sv:(cv=1,sv=ov(),sv)}var uv=t(lv()),dv,fv;function pv(){return fv?dv:(fv=1,dv=hn(),dv)}var mv=t(pv()),hv={},gv={},_v={exports:{}},vv,yv;function bv(){return yv?vv:(yv=1,vv=l()(function(){if(typeof ArrayBuffer==`function`){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,`a`,{value:8})}}),vv)}var xv,Sv;function Cv(){if(Sv)return xv;Sv=1;var e=l(),t=Ce(),n=x(),r=bv(),i=Object.isExtensible;return xv=e(function(){})||r?function(e){return!t(e)||r&&n(e)===`ArrayBuffer`?!1:i?i(e):!0}:i,xv}var wv,Tv;function Ev(){return Tv?wv:(Tv=1,wv=!l()(function(){return Object.isExtensible(Object.preventExtensions({}))}),wv)}var Dv;function Ov(){if(Dv)return _v.exports;Dv=1;var e=P(),t=v(),n=jr(),r=Ce(),i=xt(),a=nn().f,o=ei(),s=oi(),c=Cv(),l=wt(),u=Ev(),d=!1,f=l(`meta`),p=0,m=function(e){a(e,f,{value:{objectID:`O`+ p++,weakData:{}}})},h=_v.exports={enable:function(){h.enable=function(){},d=!0;var n=o.f,r=t([].splice),i={};i[f]=1,n(i).length&&(o.f=function(e){for(var t=n(e),i=0,a=t.length;i<a;i++)if(t[i]===f){r(t,i,1);break}return t},e({target:`Object`,stat:!0,forced:!0},{getOwnPropertyNames:s.f}))},fastKey:function(e,t){if(!r(e))return typeof e==`symbol`?e:(typeof e==`string`?`S`:`P`)+e;if(!i(e,f)){if(!c(e))return`F`;if(!t)return`E`;m(e)}return e[f].objectID},getWeakData:function(e,t){if(!i(e,f)){if(!c(e))return!0;if(!t)return!1;m(e)}return e[f].weakData},onFreeze:function(e){return u&&d&&c(e)&&!i(e,f)&&m(e),e}};return n[f]=!0,_v.exports}var kv,Av;function jv(){if(Av)return kv;Av=1;var e=Dt(),t=fo(),n=e(`iterator`),r=Array.prototype;return kv=function(e){return e!==void 0&&(t.Array===e||r[n]===e)},kv}var Mv,Nv;function Pv(){if(Nv)return Mv;Nv=1;var e=$n(),t=et(),n=he(),r=fo(),i=Dt()(`iterator`);return Mv=function(a){if(!n(a))return t(a,i)||t(a,`@@iterator`)||r[e(a)]},Mv}var Fv,Iv;function Lv(){if(Iv)return Fv;Iv=1;var e=A(),t=Ze(),n=en(),r=Je(),i=Pv(),a=TypeError;return Fv=function(o,s){var c=arguments.length<2?i(o):s;if(t(c))return n(e(c,o));throw new a(r(o)+` is not iterable`)},Fv}var Rv,zv;function Bv(){if(zv)return Rv;zv=1;var e=A(),t=en(),n=et();return Rv=function(r,i,a){var o,s;t(r);try{if(o=n(r,`return`),!o){if(i===`throw`)throw a;return a}o=e(o,r)}catch(e){s=!0,o=e}if(i===`throw`)throw a;if(s)throw o;return t(o),a},Rv}var Vv,Hv;function Uv(){if(Hv)return Vv;Hv=1;var e=qt(),t=A(),n=en(),r=Je(),i=jv(),a=Vn(),o=Ae(),s=Lv(),c=Pv(),l=Bv(),u=TypeError,d=function(e,t){this.stopped=e,this.result=t},f=d.prototype;return Vv=function(p,m,h){var g=h&&h.that,_=!!(h&&h.AS_ENTRIES),v=!!(h&&h.IS_RECORD),y=!!(h&&h.IS_ITERATOR),b=!!(h&&h.INTERRUPTED),x=e(m,g),S,C,w,T,E,D,ee,te=function(e){return S&&l(S,`normal`),new d(!0,e)},O=function(e){return _?(n(e),b?x(e[0],e[1],te):x(e[0],e[1])):b?x(e,te):x(e)};if(v)S=p.iterator;else if(y)S=p;else{if(C=c(p),!C)throw new u(r(p)+` is not iterable`);if(i(C)){for(w=0,T=a(p);T>w;w++)if(E=O(p[w]),E&&o(f,E))return E;return new d(!1)}S=s(p,C)}for(D=v?p.next:S.next;!(ee=t(D,S)).done;){try{E=O(ee.value)}catch(e){l(S,`throw`,e)}if(typeof E==`object`&&E&&o(f,E))return E}return new d(!1)},Vv}var Wv,Gv;function Kv(){if(Gv)return Wv;Gv=1;var e=Ae(),t=TypeError;return Wv=function(n,r){if(e(r,n))return n;throw new t(`Incorrect invocation`)},Wv}var qv,Jv;function Yv(){if(Jv)return qv;Jv=1;var e=P(),t=o(),n=Ov(),r=l(),i=on(),a=Uv(),s=Kv(),c=D(),u=Ce(),d=he(),f=Ai(),p=nn().f,m=zi().forEach,h=k(),g=Ii(),_=g.set,v=g.getterFor;return qv=function(o,l,g){var y=o.indexOf(`Map`)!==-1,b=o.indexOf(`Weak`)!==-1,x=y?`set`:`add`,S=t[o],C=S&&S.prototype,w={},T;if(!h||!c(S)||!(b||C.forEach&&!r(function(){new S().entries().next()})))T=g.getConstructor(l,o,y,x),n.enable();else{T=l(function(e,t){_(s(e,E),{type:o,collection:new S}),d(t)||a(t,e[x],{that:e,AS_ENTRIES:y})});var E=T.prototype,D=v(o);m([`add`,`clear`,`delete`,`forEach`,`get`,`has`,`set`,`keys`,`values`,`entries`],function(e){var t=e===`add`||e===`set`;e in C&&!(b&&e===`clear`)&&i(E,e,function(n,r){var i=D(this).collection;if(!t&&b&&!u(n))return e===`get`?void 0:!1;var a=i[e](n===0?0:n,r);return t?this:a})}),b||p(E,`size`,{configurable:!0,get:function(){return D(this).collection.size}})}return f(T,o,!1,!0),w[o]=T,e({global:!0,forced:!0},w),b||g.setStrong(T,o,y),T},qv}var Xv,Zv;function Qv(){if(Zv)return Xv;Zv=1;var e=fi();return Xv=function(t,n,r){for(var i in n)r&&r.unsafe&&t[i]?t[i]=n[i]:e(t,i,n[i],r);return t},Xv}var $v,ey;function ty(){if(ey)return $v;ey=1;var e=N(),t=hi(),n=Dt(),r=k(),i=n(`species`);return $v=function(n){var a=e(n);r&&a&&!a[i]&&t(a,i,{configurable:!0,get:function(){return this}})},$v}var ny,ry;function iy(){if(ry)return ny;ry=1;var e=Zr(),t=hi(),n=Qv(),r=qt(),i=Kv(),a=he(),o=Uv(),s=Ho(),c=Go(),l=ty(),u=k(),d=Ov().fastKey,f=Ii(),p=f.set,m=f.getterFor;return ny={getConstructor:function(s,c,l,f){var h=s(function(t,n){i(t,g),p(t,{type:c,index:e(null),first:null,last:null,size:0}),u||(t.size=0),a(n)||o(n,t[f],{that:t,AS_ENTRIES:l})}),g=h.prototype,_=m(c),v=function(e,t,n){var r=_(e),i=y(e,t),a,o;return i?i.value=n:(r.last=i={index:o=d(t,!0),key:t,value:n,previous:a=r.last,next:null,removed:!1},r.first||=i,a&&(a.next=i),u?r.size++:e.size++,o!==`F`&&(r.index[o]=i)),e},y=function(e,t){var n=_(e),r=d(t),i;if(r!==`F`)return n.index[r];for(i=n.first;i;i=i.next)if(i.key===t)return i};return n(g,{clear:function(){for(var t=this,n=_(t),r=n.first;r;)r.removed=!0,r.previous&&=r.previous.next=null,r=r.next;n.first=n.last=null,n.index=e(null),u?n.size=0:t.size=0},delete:function(e){var t=this,n=_(t),r=y(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),u?n.size--:t.size--}return!!r},forEach:function(e){for(var t=_(this),n=r(e,arguments.length>1?arguments[1]:void 0),i;i=i?i.next:t.first;)for(n(i.value,i.key,this);i&&i.removed;)i=i.previous},has:function(e){return!!y(this,e)}}),n(g,l?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return v(this,e===0?0:e,t)}}:{add:function(e){return v(this,e=e===0?0:e,e)}}),u&&t(g,`size`,{configurable:!0,get:function(){return _(this).size}}),h},setStrong:function(e,t,n){var r=t+` Iterator`,i=m(t),a=m(r);s(e,t,function(e,t){p(this,{type:r,target:e,state:i(e),kind:t,last:null})},function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return!e.target||!(e.last=n=n?n.next:e.state.first)?(e.target=null,c(void 0,!0)):c(t===`keys`?n.key:t===`values`?n.value:[n.key,n.value],!1)},n?`entries`:`values`,!n,!0),l(t)}},ny}var ay;function oy(){return ay?gv:(ay=1,Yv()(`Map`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},iy()),gv)}var sy;function cy(){return sy?hv:(sy=1,oy(),hv)}var ly={},uy,dy;function fy(){return dy?uy:(dy=1,uy=function(e,t){return t===1?function(t,n){return t[e](n)}:function(t,n,r){return t[e](n,r)}},uy)}var py,my;function hy(){if(my)return py;my=1;var e=N(),t=fy(),n=e(`Map`);return py={Map:n,set:t(`set`,2),get:t(`get`,1),has:t(`has`,1),remove:t(`delete`,1),proto:n.prototype},py}var gy;function _y(){if(gy)return ly;gy=1;var e=P(),t=v(),n=Ze(),r=j(),i=Uv(),a=hy(),o=st(),s=l(),c=a.Map,u=a.has,d=a.get,f=a.set,p=t([].push),m=o||s(function(){return c.groupBy(`ab`,function(e){return e}).get(`a`).length!==1});return e({target:`Map`,stat:!0,forced:o||m},{groupBy:function(e,t){r(e),n(t);var a=new c,o=0;return i(e,function(e){var n=t(e,o++);u(a,n)?p(d(a,n),e):f(a,n,[e])}),a}}),ly}var vy,yy;function by(){return yy?vy:(yy=1,Jo(),cy(),_y(),fc(),vy=M().Map,vy)}var xy,Sy;function Cy(){if(Sy)return xy;Sy=1;var e=by();return $o(),xy=e,xy}var wy,Ty;function Ey(){return Ty?wy:(Ty=1,wy=Cy(),wy)}var Dy=t(Ey()),Oy={},ky;function Ay(){if(ky)return Oy;ky=1;var e=P(),t=zi().some;return e({target:`Array`,proto:!0,forced:!Cl()(`some`)},{some:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),Oy}var jy,My;function Ny(){return My?jy:(My=1,Ay(),jy=rl()(`Array`,`some`),jy)}var Py,Fy;function Iy(){if(Fy)return Py;Fy=1;var e=Ae(),t=Ny(),n=Array.prototype;return Py=function(r){var i=r.some;return r===n||e(n,r)&&i===n.some?t:i},Py}var Ly,Ry;function zy(){return Ry?Ly:(Ry=1,Ly=Iy(),Ly)}var By,Vy;function Hy(){return Vy?By:(Vy=1,By=zy(),By)}var Uy=t(Hy()),Wy,Gy;function Ky(){return Gy?Wy:(Gy=1,Jo(),Wy=rl()(`Array`,`keys`),Wy)}var qy,Jy;function Yy(){return Jy?qy:(Jy=1,qy=Ky(),qy)}var Xy,Zy;function Qy(){if(Zy)return Xy;Zy=1,$o();var e=$n(),t=xt(),n=Ae(),r=Yy(),i=Array.prototype,a={DOMTokenList:!0,NodeList:!0};return Xy=function(o){var s=o.keys;return o===i||n(i,o)&&s===i.keys||t(a,e(o))?r:s},Xy}var $y,eb;function tb(){return eb?$y:(eb=1,$y=Qy(),$y)}var nb=t(tb()),rb={},ib,ab;function ob(){if(ab)return ib;ab=1;var e=ii(),t=Math.floor,n=function(r,i){var a=r.length;if(a<8)for(var o=1,s,c;o<a;){for(c=o,s=r[o];c&&i(r[c-1],s)>0;)r[c]=r[--c];c!==o++&&(r[c]=s)}else for(var l=t(a/2),u=n(e(r,0,l),i),d=n(e(r,l),i),f=u.length,p=d.length,m=0,h=0;m<f||h<p;)r[m+h]=m<f&&h<p?i(u[m],d[h])<=0?u[m++]:d[h++]:m<f?u[m++]:d[h++];return r};return ib=n,ib}var sb,cb;function lb(){if(cb)return sb;cb=1;var e=Ne().match(/firefox\/(\d+)/i);return sb=!!e&&+e[1],sb}var ub,db;function fb(){if(db)return ub;db=1;var e=Ne();return ub=/MSIE|Trident/.test(e),ub}var pb,mb;function hb(){if(mb)return pb;mb=1;var e=Ne().match(/AppleWebKit\/(\d+)\./);return pb=!!e&&+e[1],pb}var gb;function _b(){if(gb)return rb;gb=1;var e=P(),t=v(),n=Ze(),r=vt(),i=Vn(),a=Bf(),o=xr(),s=l(),c=ob(),u=Cl(),d=lb(),f=fb(),p=Ie(),m=hb(),h=[],g=t(h.sort),_=t(h.push),y=s(function(){h.sort(void 0)}),b=s(function(){h.sort(null)}),x=u(`sort`),S=!s(function(){if(p)return p<70;if(!(d&&d>3)){if(f)return!0;if(m)return m<603;var e=``,t,n,r,i;for(t=65;t<76;t++){switch(n=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(i=0;i<47;i++)h.push({k:n+i,v:r})}for(h.sort(function(e,t){return t.v-e.v}),i=0;i<h.length;i++)n=h[i].k.charAt(0),e.charAt(e.length-1)!==n&&(e+=n);return e!==`DGBEFHACIJK`}}),C=y||!b||!x||!S,w=function(e){return function(t,n){return n===void 0?-1:t===void 0?1:e===void 0?o(t)>o(n)?1:-1:+e(t,n)||0}};return e({target:`Array`,proto:!0,forced:C},{sort:function(e){e!==void 0&&n(e);var t=r(this);if(S)return e===void 0?g(t):g(t,e);var o=[],s=i(t),l,u;for(u=0;u<s;u++)u in t&&_(o,t[u]);for(c(o,w(e)),l=i(o),u=0;u<l;)t[u]=o[u++];for(;u<s;)a(t,u++);return t}}),rb}var vb,yb;function bb(){return yb?vb:(yb=1,_b(),vb=rl()(`Array`,`sort`),vb)}var xb,Sb;function Cb(){if(Sb)return xb;Sb=1;var e=Ae(),t=bb(),n=Array.prototype;return xb=function(r){var i=r.sort;return r===n||e(n,r)&&i===n.sort?t:i},xb}var wb,Tb;function Eb(){return Tb?wb:(Tb=1,wb=Cb(),wb)}var Db,Ob;function kb(){return Ob?Db:(Ob=1,Db=Eb(),Db)}var Ab=t(kb()),jb,Mb;function Nb(){return Mb?jb:(Mb=1,Jo(),jb=rl()(`Array`,`values`),jb)}var Pb,Fb;function Ib(){return Fb?Pb:(Fb=1,Pb=Nb(),Pb)}var Lb,Rb;function zb(){if(Rb)return Lb;Rb=1,$o();var e=$n(),t=xt(),n=Ae(),r=Ib(),i=Array.prototype,a={DOMTokenList:!0,NodeList:!0};return Lb=function(o){var s=o.values;return o===i||n(i,o)&&s===i.values||t(a,e(o))?r:s},Lb}var Bb,Vb;function Hb(){return Vb?Bb:(Vb=1,Bb=zb(),Bb)}var Ub=t(Hb()),Wb,Gb;function Kb(){return Gb?Wb:(Gb=1,Wb=vc(),Wb)}var qb=t(Kb()),Jb,Yb;function Xb(){return Yb?Jb:(Yb=1,Jo(),Jb=rl()(`Array`,`entries`),Jb)}var Zb,Qb;function $b(){return Qb?Zb:(Qb=1,Zb=Xb(),Zb)}var ex,tx;function nx(){if(tx)return ex;tx=1,$o();var e=$n(),t=xt(),n=Ae(),r=$b(),i=Array.prototype,a={DOMTokenList:!0,NodeList:!0};return ex=function(o){var s=o.entries;return o===i||n(i,o)&&s===i.entries||t(a,e(o))?r:s},ex}var rx,ix;function ax(){return ix?rx:(ix=1,rx=nx(),rx)}var ox=t(ax()),sx=[];for(let e=0;e<256;++e)sx.push((e+256).toString(16).slice(1));function cx(e,t=0){return(sx[e[t+0]]+sx[e[t+1]]+sx[e[t+2]]+sx[e[t+3]]+`-`+sx[e[t+4]]+sx[e[t+5]]+`-`+sx[e[t+6]]+sx[e[t+7]]+`-`+sx[e[t+8]]+sx[e[t+9]]+`-`+sx[e[t+10]]+sx[e[t+11]]+sx[e[t+12]]+sx[e[t+13]]+sx[e[t+14]]+sx[e[t+15]]).toLowerCase()}var lx,ux=new Uint8Array(16);function dx(){if(!lx){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);lx=crypto.getRandomValues.bind(crypto)}return lx(ux)}var fx={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function px(e,t,n){e||={};let r=e.random??e.rng?.()??dx();if(r.length<16)throw Error(`Random bytes length must be >= 16`);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,cx(r)}function mx(e,t,n){return fx.randomUUID&&!e?fx.randomUUID():px(e)}function hx(e){return typeof e==`string`||typeof e==`number`}var gx=class e{constructor(e){Jc(this,`_queue`,[]),Jc(this,`_timeout`,null),Jc(this,`_extended`,null),this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&e.delay!==void 0&&(this.delay=e.delay),e&&e.max!==void 0&&(this.max=e.max),this._flushIfNeeded()}static extend(t,n){let r=new e(n);if(t.flush!==void 0)throw Error(`Target object already has a property flush`);t.flush=()=>{r.flush()};let i=[{name:`flush`,original:void 0}];if(n&&n.replace)for(let e=0;e<n.replace.length;e++){let a=n.replace[e];i.push({name:a,original:t[a]}),r.replace(t,a)}return r._extended={object:t,methods:i},r}destroy(){if(this.flush(),this._extended){let e=this._extended.object,t=this._extended.methods;for(let n=0;n<t.length;n++){let r=t[n];r.original?e[r.name]=r.original:delete e[r.name]}this._extended=null}}replace(e,t){let n=this,r=e[t];if(!r)throw Error(`Method `+t+` undefined`);e[t]=function(){var e=[...arguments];n.queue({args:e,fn:r,context:this})}}queue(e){typeof e==`function`?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay==`number`&&(this._timeout=Nm(()=>{this.flush()},this.delay))}flush(){var e,t;_f(e=tp(t=this._queue).call(t,0)).call(e,e=>{e.fn.apply(e.context||e.fn,e.args||[])})}},_x=class e{constructor(){Jc(this,`_subscribers`,{"*":[],add:[],remove:[],update:[]}),Jc(this,`subscribe`,e.prototype.on),Jc(this,`unsubscribe`,e.prototype.off)}_trigger(e,t,n){var r;if(e===`*`)throw Error(`Cannot trigger event *`);_f(r=[...this._subscribers[e],...this._subscribers[`*`]]).call(r,r=>{r(e,t,n??null)})}on(e,t){typeof t==`function`&&this._subscribers[e].push(t)}off(e,t){var n;this._subscribers[e]=ou(n=this._subscribers[e]).call(n,e=>e!==t)}},vx={},yx={},bx;function xx(){return bx?yx:(bx=1,Yv()(`Set`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},iy()),yx)}var Sx;function Cx(){return Sx?vx:(Sx=1,xx(),vx)}var wx={},Tx,Ex;function Dx(){if(Ex)return Tx;Ex=1;var e=Je(),t=TypeError;return Tx=function(n){if(typeof n==`object`&&`size`in n&&`has`in n&&`add`in n&&`delete`in n&&`keys`in n)return n;throw new t(e(n)+` is not a set`)},Tx}var Ox,kx;function Ax(){if(kx)return Ox;kx=1;var e=N(),t=fy(),n=e(`Set`),r=n.prototype;return Ox={Set:n,add:t(`add`,1),has:t(`has`,1),remove:t(`delete`,1),proto:r},Ox}var jx,Mx;function Nx(){if(Mx)return jx;Mx=1;var e=A();return jx=function(t,n,r){for(var i=r?t:t.iterator,a=t.next,o,s;!(o=e(a,i)).done;)if(s=n(o.value),s!==void 0)return s},jx}var Px,Fx;function Ix(){if(Fx)return Px;Fx=1;var e=Nx();return Px=function(t,n,r){return r?e(t.keys(),n,!0):t.forEach(n)},Px}var Lx,Rx;function zx(){if(Rx)return Lx;Rx=1;var e=Ax(),t=Ix(),n=e.Set,r=e.add;return Lx=function(e){var i=new n;return t(e,function(e){r(i,e)}),i},Lx}var Bx,Vx;function Hx(){return Vx?Bx:(Vx=1,Bx=function(e){return e.size},Bx)}var Ux,Wx;function Gx(){return Wx?Ux:(Wx=1,Ux=function(e){return{iterator:e,next:e.next,done:!1}},Ux)}var Kx,qx;function Jx(){if(qx)return Kx;qx=1;var e=Ze(),t=en(),n=A(),r=Fn(),i=Gx(),a=`Invalid size`,o=RangeError,s=TypeError,c=Math.max,l=function(t,n){this.set=t,this.size=c(n,0),this.has=e(t.has),this.keys=e(t.keys)};return l.prototype={getIterator:function(){return i(t(n(this.keys,this.set)))},includes:function(e){return n(this.has,this.set,e)}},Kx=function(e){t(e);var n=+e.size;if(n!==n)throw new s(a);var i=r(n);if(i<0)throw new o(a);return new l(e,i)},Kx}var Yx,Xx;function Zx(){if(Xx)return Yx;Xx=1;var e=Dx(),t=Ax(),n=zx(),r=Hx(),i=Jx(),a=Ix(),o=Nx(),s=t.has,c=t.remove;return Yx=function(t){var l=e(this),u=i(t),d=n(l);return r(l)<=u.size?a(l,function(e){u.includes(e)&&c(d,e)}):o(u.getIterator(),function(e){s(d,e)&&c(d,e)}),d},Yx}var Qx,$x;function eS(){return $x?Qx:($x=1,Qx=function(){return!1},Qx)}var tS;function nS(){if(tS)return wx;tS=1;var e=P(),t=Zx(),n=l();return e({target:`Set`,proto:!0,real:!0,forced:!eS()(`difference`,function(e){return e.size===0})||n(function(){var e={size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var n=e++>1;return t.has(1)&&t.clear(),{done:n,value:2}}}}},t=new Set([1,2,3,4]);return t.difference(e).size!==3})},{difference:t}),wx}var rS={},iS,aS;function oS(){if(aS)return iS;aS=1;var e=Dx(),t=Ax(),n=Hx(),r=Jx(),i=Ix(),a=Nx(),o=t.Set,s=t.add,c=t.has;return iS=function(t){var l=e(this),u=r(t),d=new o;return n(l)>u.size?a(u.getIterator(),function(e){c(l,e)&&s(d,e)}):i(l,function(e){u.includes(e)&&s(d,e)}),d},iS}var sS;function cS(){if(sS)return rS;sS=1;var e=P(),t=l(),n=oS();return e({target:`Set`,proto:!0,real:!0,forced:!eS()(`intersection`,function(e){return e.size===2&&e.has(1)&&e.has(2)})||t(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!==`3,2`})},{intersection:n}),rS}var lS={},uS,dS;function fS(){if(dS)return uS;dS=1;var e=Dx(),t=Ax().has,n=Hx(),r=Jx(),i=Ix(),a=Nx(),o=Bv();return uS=function(s){var c=e(this),l=r(s);if(n(c)<=l.size)return i(c,function(e){if(l.includes(e))return!1},!0)!==!1;var u=l.getIterator();return a(u,function(e){if(t(c,e))return o(u,`normal`,!1)})!==!1},uS}var pS;function mS(){if(pS)return lS;pS=1;var e=P(),t=fS();return e({target:`Set`,proto:!0,real:!0,forced:!eS()(`isDisjointFrom`,function(e){return!e})},{isDisjointFrom:t}),lS}var hS={},gS,_S;function vS(){if(_S)return gS;_S=1;var e=Dx(),t=Hx(),n=Ix(),r=Jx();return gS=function(i){var a=e(this),o=r(i);return t(a)>o.size?!1:n(a,function(e){if(!o.includes(e))return!1},!0)!==!1},gS}var yS;function bS(){if(yS)return hS;yS=1;var e=P(),t=vS();return e({target:`Set`,proto:!0,real:!0,forced:!eS()(`isSubsetOf`,function(e){return e})},{isSubsetOf:t}),hS}var xS={},SS,CS;function wS(){if(CS)return SS;CS=1;var e=Dx(),t=Ax().has,n=Hx(),r=Jx(),i=Nx(),a=Bv();return SS=function(o){var s=e(this),c=r(o);if(n(s)<c.size)return!1;var l=c.getIterator();return i(l,function(e){if(!t(s,e))return a(l,`normal`,!1)})!==!1},SS}var TS;function ES(){if(TS)return xS;TS=1;var e=P(),t=wS();return e({target:`Set`,proto:!0,real:!0,forced:!eS()(`isSupersetOf`,function(e){return!e})},{isSupersetOf:t}),xS}var DS={},OS,kS;function AS(){if(kS)return OS;kS=1;var e=Dx(),t=Ax(),n=zx(),r=Jx(),i=Nx(),a=t.add,o=t.has,s=t.remove;return OS=function(t){var c=e(this),l=r(t).getIterator(),u=n(c);return i(l,function(e){o(c,e)?s(u,e):a(u,e)}),u},OS}var jS,MS;function NS(){return MS?jS:(MS=1,jS=function(e){try{var t=new Set,n=t[e]({size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},`next`,{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}});return n.size===1&&n.values().next().value===4}catch{return!1}},jS)}var PS;function FS(){if(PS)return DS;PS=1;var e=P(),t=AS(),n=NS();return e({target:`Set`,proto:!0,real:!0,forced:!eS()(`symmetricDifference`)||!n(`symmetricDifference`)},{symmetricDifference:t}),DS}var IS={},LS,RS;function zS(){if(RS)return LS;RS=1;var e=Dx(),t=Ax().add,n=zx(),r=Jx(),i=Nx();return LS=function(a){var o=e(this),s=r(a).getIterator(),c=n(o);return i(s,function(e){t(c,e)}),c},LS}var BS;function VS(){if(BS)return IS;BS=1;var e=P(),t=zS(),n=NS();return e({target:`Set`,proto:!0,real:!0,forced:!eS()(`union`)||!n(`union`)},{union:t}),IS}var HS,US;function WS(){return US?HS:(US=1,Jo(),Cx(),nS(),cS(),mS(),bS(),ES(),FS(),VS(),fc(),HS=M().Set,HS)}var GS,KS;function qS(){if(KS)return GS;KS=1;var e=WS();return $o(),GS=e,GS}var JS,YS;function XS(){return YS?JS:(YS=1,JS=qS(),JS)}var ZS=t(XS()),QS,$S;function eC(){return $S?QS:($S=1,Jo(),fc(),QS=Lv(),QS)}var tC,nC;function rC(){if(nC)return tC;nC=1;var e=eC();return $o(),tC=e,tC}var iC,aC;function oC(){return aC?iC:(aC=1,iC=rC(),iC)}var sC,cC;function lC(){return cC?sC:(cC=1,sC=oC(),sC)}var uC,dC;function fC(){return dC?uC:(dC=1,uC=lC(),uC)}var pC,mC;function hC(){return mC?pC:(mC=1,pC=fC(),pC)}var gC=t(hC()),_C=class e{constructor(e){this._pairs=e}*[qb](){for(let[e,t]of this._pairs)yield[e,t]}*entries(){for(let[e,t]of this._pairs)yield[e,t]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){var e;return Su(e=[...this._pairs]).call(e,e=>e[0])}toItemArray(){var e;return Su(e=[...this._pairs]).call(e,e=>e[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Up(null);for(let[t,n]of this._pairs)e[t]=n;return e}toMap(){return new Dy(this._pairs)}toIdSet(){return new ZS(this.toIdArray())}toItemSet(){return new ZS(this.toItemArray())}cache(){return new e([...this._pairs])}distinct(e){let t=new ZS;for(let[n,r]of this._pairs)t.add(e(r,n));return t}filter(t){let n=this._pairs;return new e({*[qb](){for(let[e,r]of n)t(r,e)&&(yield[e,r])}})}forEach(e){for(let[t,n]of this._pairs)e(n,t)}map(t){let n=this._pairs;return new e({*[qb](){for(let[e,r]of n)yield[e,t(r,e)]}})}max(e){let t=gC(this._pairs),n=t.next();if(n.done)return null;let r=n.value[1],i=e(n.value[1],n.value[0]);for(;!(n=t.next()).done;){let[t,a]=n.value,o=e(a,t);o>i&&(i=o,r=a)}return r}min(e){let t=gC(this._pairs),n=t.next();if(n.done)return null;let r=n.value[1],i=e(n.value[1],n.value[0]);for(;!(n=t.next()).done;){let[t,a]=n.value,o=e(a,t);o<i&&(i=o,r=a)}return r}reduce(e,t){for(let[n,r]of this._pairs)t=e(t,r,n);return t}sort(t){return new e({[qb]:()=>{var e;return gC(Ab(e=[...this._pairs]).call(e,(e,n)=>{let[r,i]=e,[a,o]=n;return t(i,o,r,a)}))}})}};function vC(e,t){var n=Zd(e);if(T_){var r=T_(e);t&&(r=ou(r).call(r,function(t){return R_(e,t).enumerable})),n.push.apply(n,r)}return n}function yC(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?_f(n=vC(Object(i),!0)).call(n,function(t){Jc(e,t,i[t])}):Z_?uv(e,Z_(i)):_f(r=vC(Object(i))).call(r,function(t){mv(e,t,R_(i,t))})}return e}function bC(e,t){return e[t]??(e[t]=mx()),e}var xC=class extends _x{get idProp(){return this._idProp}constructor(e,t){super(),Jc(this,`_queue`,null),e&&!Rd(e)&&(t=e,e=[]),this._options=t||{},this._data=new Dy,this.length=0,this._idProp=this._options.fieldId||`id`,e&&e.length&&this.add(e),this.setOptions(t)}setOptions(e){e&&e.queue!==void 0&&(e.queue===!1?this._queue&&=(this._queue.destroy(),null):(this._queue||=gx.extend(this,{replace:[`add`,`update`,`remove`]}),e.queue&&typeof e.queue==`object`&&this._queue.setOptions(e.queue)))}add(e,t){let n=[],r;if(Rd(e)){let t=Su(e).call(e,e=>e[this._idProp]);if(Uy(t).call(t,e=>this._data.has(e)))throw Error(`A duplicate id was found in the parameter array.`);for(let t=0,i=e.length;t<i;t++)r=this._addItem(e[t]),n.push(r)}else if(e&&typeof e==`object`)r=this._addItem(e),n.push(r);else throw Error(`Unknown dataType`);return n.length&&this._trigger(`add`,{items:n},t),n}update(e,t){let n=[],r=[],i=[],a=[],o=this._idProp,s=e=>{let t=e[o];if(t!=null&&this._data.has(t)){let n=e,o=_p({},this._data.get(t)),s=this._updateItem(n);r.push(s),a.push(n),i.push(o)}else{let t=this._addItem(e);n.push(t)}};if(Rd(e))for(let t=0,n=e.length;t<n;t++)e[t]&&typeof e[t]==`object`?s(e[t]):console.warn(`Ignoring input item, which is not an object at index `+t);else if(e&&typeof e==`object`)s(e);else throw Error(`Unknown dataType`);if(n.length&&this._trigger(`add`,{items:n},t),r.length){let e={items:r,oldData:i,data:a};this._trigger(`update`,e,t)}return Ap(n).call(n,r)}updateOnly(e,t){var n;Rd(e)||(e=[e]);let r=Su(n=Su(e).call(e,e=>{let t=this._data.get(e[this._idProp]);if(t==null)throw Error(`Updating non-existent items is not allowed.`);return{oldData:t,update:e}})).call(n,e=>{let{oldData:t,update:n}=e,r=t[this._idProp],i=s_(t,n);return this._data.set(r,i),{id:r,oldData:t,updatedData:i}});if(r.length){let e={items:Su(r).call(r,e=>e.id),oldData:Su(r).call(r,e=>e.oldData),data:Su(r).call(r,e=>e.updatedData)};return this._trigger(`update`,e,t),e.items}else return[]}get(e,t){let n,r,i;hx(e)?(n=e,i=t):Rd(e)?(r=e,i=t):i=e;let a=i&&i.returnType===`Object`?`Object`:`Array`,o=i&&ou(i),s=[],c,l,u;if(n!=null)c=this._data.get(n),c&&o&&!o(c)&&(c=void 0);else if(r!=null)for(let e=0,t=r.length;e<t;e++)c=this._data.get(r[e]),c!=null&&(!o||o(c))&&s.push(c);else{var d;l=[...nb(d=this._data).call(d)];for(let e=0,t=l.length;e<t;e++)u=l[e],c=this._data.get(u),c!=null&&(!o||o(c))&&s.push(c)}if(i&&i.order&&n==null&&this._sort(s,i.order),i&&i.fields){let e=i.fields;if(n!=null&&c!=null)c=this._filterFields(c,e);else for(let t=0,n=s.length;t<n;t++)s[t]=this._filterFields(s[t],e)}if(a==`Object`){let e={};for(let t=0,n=s.length;t<n;t++){let n=s[t],r=n[this._idProp];e[r]=n}return e}else if(n!=null)return c??null;else return s}getIds(e){let t=this._data,n=e&&ou(e),r=e&&e.order,i=[...nb(t).call(t)],a=[];if(n)if(r){let e=[];for(let t=0,r=i.length;t<r;t++){let r=i[t],a=this._data.get(r);a!=null&&n(a)&&e.push(a)}this._sort(e,r);for(let t=0,n=e.length;t<n;t++)a.push(e[t][this._idProp])}else for(let e=0,t=i.length;e<t;e++){let t=i[e],r=this._data.get(t);r!=null&&n(r)&&a.push(r[this._idProp])}else if(r){let e=[];for(let n=0,r=i.length;n<r;n++){let r=i[n];e.push(t.get(r))}this._sort(e,r);for(let t=0,n=e.length;t<n;t++)a.push(e[t][this._idProp])}else for(let e=0,n=i.length;e<n;e++){let n=i[e],r=t.get(n);r!=null&&a.push(r[this._idProp])}return a}getDataSet(){return this}forEach(e,t){let n=t&&ou(t),r=this._data,i=[...nb(r).call(r)];if(t&&t.order){let n=this.get(t);for(let t=0,r=n.length;t<r;t++){let r=n[t],i=r[this._idProp];e(r,i)}}else for(let t=0,r=i.length;t<r;t++){let r=i[t],a=this._data.get(r);a!=null&&(!n||n(a))&&e(a,r)}}map(e,t){let n=t&&ou(t),r=[],i=this._data,a=[...nb(i).call(i)];for(let t=0,i=a.length;t<i;t++){let i=a[t],o=this._data.get(i);o!=null&&(!n||n(o))&&r.push(e(o,i))}return t&&t.order&&this._sort(r,t.order),r}_filterFields(e,t){var n;return e&&Wl(n=Rd(t)?t:Zd(t)).call(n,(t,n)=>(t[n]=e[n],t),{})}_sort(e,t){if(typeof t==`string`){let n=t;Ab(e).call(e,(e,t)=>{let r=e[n],i=t[n];return r>i?1:r<i?-1:0})}else if(typeof t==`function`)Ab(e).call(e,t);else throw TypeError(`Order must be a function or a string`)}remove(e,t){let n=[],r=[],i=Rd(e)?e:[e];for(let e=0,t=i.length;e<t;e++){let t=this._remove(i[e]);if(t){let e=t[this._idProp];e!=null&&(n.push(e),r.push(t))}}return n.length&&this._trigger(`remove`,{items:n,oldData:r},t),n}_remove(e){let t;if(hx(e)?t=e:e&&typeof e==`object`&&(t=e[this._idProp]),t!=null&&this._data.has(t)){let e=this._data.get(t)||null;return this._data.delete(t),--this.length,e}return null}clear(e){var t;let n=[...nb(t=this._data).call(t)],r=[];for(let e=0,t=n.length;e<t;e++)r.push(this._data.get(n[e]));return this._data.clear(),this.length=0,this._trigger(`remove`,{items:n,oldData:r},e),n}max(e){let t=null,n=null;for(let i of Ub(r=this._data).call(r)){var r;let a=i[e];typeof a==`number`&&(n==null||a>n)&&(t=i,n=a)}return t||null}min(e){let t=null,n=null;for(let i of Ub(r=this._data).call(r)){var r;let a=i[e];typeof a==`number`&&(n==null||a<n)&&(t=i,n=a)}return t||null}distinct(e){let t=this._data,n=[...nb(t).call(t)],r=[],i=0;for(let a=0,o=n.length;a<o;a++){let o=n[a],s=t.get(o)[e],c=!1;for(let e=0;e<i;e++)if(r[e]==s){c=!0;break}!c&&s!==void 0&&(r[i]=s,i++)}return r}_addItem(e){let t=bC(e,this._idProp),n=t[this._idProp];if(this._data.has(n))throw Error(`Cannot add item: item with id `+n+` already exists`);return this._data.set(n,t),++this.length,n}_updateItem(e){let t=e[this._idProp];if(t==null)throw Error(`Cannot update item: item has no id (item: `+dm(e)+`)`);let n=this._data.get(t);if(!n)throw Error(`Cannot update item: no item with id `+t+` found`);return this._data.set(t,yC(yC({},n),e)),t}stream(e){if(e){let t=this._data;return new _C({*[qb](){for(let n of e){let e=t.get(n);e!=null&&(yield[n,e])}}})}else{var t;return new _C({[qb]:gl(t=ox(this._data)).call(t,this._data)})}}};function SC(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof t.add==`function`&&typeof t.clear==`function`&&typeof t.distinct==`function`&&typeof _f(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Su(t)==`function`&&typeof t.max==`function`&&typeof t.min==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.remove==`function`&&typeof t.setOptions==`function`&&typeof t.stream==`function`&&typeof t.update==`function`&&typeof t.updateOnly==`function`}function CC(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof _f(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Su(t)==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.stream==`function`&&SC(e,t.getDataSet())}var wC=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function F(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var TC={},EC,DC;function OC(){if(DC)return EC;DC=1;var e=function(e){return e&&e.Math===Math&&e};return EC=e(typeof globalThis==`object`&&globalThis)||e(typeof window==`object`&&window)||e(typeof self==`object`&&self)||e(typeof wC==`object`&&wC)||e(typeof EC==`object`&&EC)||(function(){return this})()||Function(`return this`)(),EC}var kC,AC;function I(){return AC?kC:(AC=1,kC=function(e){try{return!!e()}catch{return!0}},kC)}var jC,MC;function NC(){return MC?jC:(MC=1,jC=!I()(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),jC)}var PC,FC;function IC(){if(FC)return PC;FC=1;var e=NC(),t=Function.prototype,n=t.apply,r=t.call;return PC=typeof Reflect==`object`&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),PC}var LC,RC;function L(){if(RC)return LC;RC=1;var e=NC(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return LC=e?r:function(e){return function(){return n.apply(e,arguments)}},LC}var zC,BC;function VC(){if(BC)return zC;BC=1;var e=L(),t=e({}.toString),n=e(``.slice);return zC=function(e){return n(t(e),8,-1)},zC}var HC,UC;function WC(){if(UC)return HC;UC=1;var e=VC(),t=L();return HC=function(n){if(e(n)===`Function`)return t(n)},HC}var GC,KC;function qC(){if(KC)return GC;KC=1;var e=typeof document==`object`&&document.all;return GC=e===void 0&&e!==void 0?function(t){return typeof t==`function`||t===e}:function(e){return typeof e==`function`},GC}var JC={},YC,XC;function ZC(){return XC?YC:(XC=1,YC=!I()(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),YC)}var QC,$C;function ew(){if($C)return QC;$C=1;var e=NC(),t=Function.prototype.call;return QC=e?t.bind(t):function(){return t.apply(t,arguments)},QC}var tw={},nw;function rw(){if(nw)return tw;nw=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor;return tw.f=t&&!e.call({1:2},1)?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,tw}var iw,aw;function ow(){return aw?iw:(aw=1,iw=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},iw)}var sw,cw;function lw(){if(cw)return sw;cw=1;var e=L(),t=I(),n=VC(),r=Object,i=e(``.split);return sw=t(function(){return!r(`z`).propertyIsEnumerable(0)})?function(e){return n(e)===`String`?i(e,``):r(e)}:r,sw}var uw,dw;function fw(){return dw?uw:(dw=1,uw=function(e){return e==null},uw)}var pw,mw;function hw(){if(mw)return pw;mw=1;var e=fw(),t=TypeError;return pw=function(n){if(e(n))throw new t(`Can't call method on `+n);return n},pw}var gw,_w;function vw(){if(_w)return gw;_w=1;var e=lw(),t=hw();return gw=function(n){return e(t(n))},gw}var yw,bw;function xw(){if(bw)return yw;bw=1;var e=qC();return yw=function(t){return typeof t==`object`?t!==null:e(t)},yw}var Sw,Cw;function R(){return Cw?Sw:(Cw=1,Sw={},Sw)}var ww,Tw;function Ew(){if(Tw)return ww;Tw=1;var e=R(),t=OC(),n=qC(),r=function(e){return n(e)?e:void 0};return ww=function(n,i){return arguments.length<2?r(e[n])||r(t[n]):e[n]&&e[n][i]||t[n]&&t[n][i]},ww}var Dw,Ow;function kw(){return Ow?Dw:(Ow=1,Dw=L()({}.isPrototypeOf),Dw)}var Aw,jw;function Mw(){if(jw)return Aw;jw=1;var e=OC().navigator,t=e&&e.userAgent;return Aw=t?String(t):``,Aw}var Nw,Pw;function Fw(){if(Pw)return Nw;Pw=1;var e=OC(),t=Mw(),n=e.process,r=e.Deno,i=n&&n.versions||r&&r.version,a=i&&i.v8,o,s;return a&&(o=a.split(`.`),s=o[0]>0&&o[0]<4?1:+(o[0]+o[1])),!s&&t&&(o=t.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=t.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),Nw=s,Nw}var Iw,Lw;function Rw(){if(Lw)return Iw;Lw=1;var e=Fw(),t=I(),n=OC().String;return Iw=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol(`symbol detection`);return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}),Iw}var zw,Bw;function Vw(){return Bw?zw:(Bw=1,zw=Rw()&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,zw)}var Hw,Uw;function Ww(){if(Uw)return Hw;Uw=1;var e=Ew(),t=qC(),n=kw(),r=Vw(),i=Object;return Hw=r?function(e){return typeof e==`symbol`}:function(r){var a=e(`Symbol`);return t(a)&&n(a.prototype,i(r))},Hw}var Gw,Kw;function qw(){if(Kw)return Gw;Kw=1;var e=String;return Gw=function(t){try{return e(t)}catch{return`Object`}},Gw}var Jw,Yw;function Xw(){if(Yw)return Jw;Yw=1;var e=qC(),t=qw(),n=TypeError;return Jw=function(r){if(e(r))return r;throw new n(t(r)+` is not a function`)},Jw}var Zw,Qw;function $w(){if(Qw)return Zw;Qw=1;var e=Xw(),t=fw();return Zw=function(n,r){var i=n[r];return t(i)?void 0:e(i)},Zw}var eT,tT;function nT(){if(tT)return eT;tT=1;var e=ew(),t=qC(),n=xw(),r=TypeError;return eT=function(i,a){var o,s;if(a===`string`&&t(o=i.toString)&&!n(s=e(o,i))||t(o=i.valueOf)&&!n(s=e(o,i))||a!==`string`&&t(o=i.toString)&&!n(s=e(o,i)))return s;throw new r(`Can't convert object to primitive value`)},eT}var rT={exports:{}},iT,aT;function oT(){return aT?iT:(aT=1,iT=!0,iT)}var sT,cT;function lT(){if(cT)return sT;cT=1;var e=OC(),t=Object.defineProperty;return sT=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch{e[n]=r}return r},sT}var uT;function dT(){if(uT)return rT.exports;uT=1;var e=oT(),t=OC(),n=lT(),r=`__core-js_shared__`,i=rT.exports=t[r]||n(r,{});return(i.versions||=[]).push({version:`3.44.0`,mode:e?`pure`:`global`,copyright:`© 2014-2025 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE`,source:`https://github.com/zloirock/core-js`}),rT.exports}var fT,pT;function mT(){if(pT)return fT;pT=1;var e=dT();return fT=function(t,n){return e[t]||(e[t]=n||{})},fT}var hT,gT;function _T(){if(gT)return hT;gT=1;var e=hw(),t=Object;return hT=function(n){return t(e(n))},hT}var vT,yT;function bT(){if(yT)return vT;yT=1;var e=L(),t=_T(),n=e({}.hasOwnProperty);return vT=Object.hasOwn||function(e,r){return n(t(e),r)},vT}var xT,ST;function CT(){if(ST)return xT;ST=1;var e=L(),t=0,n=Math.random(),r=e(1.1.toString);return xT=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+r(++t+n,36)},xT}var wT,TT;function ET(){if(TT)return wT;TT=1;var e=OC(),t=mT(),n=bT(),r=CT(),i=Rw(),a=Vw(),o=e.Symbol,s=t(`wks`),c=a?o.for||o:o&&o.withoutSetter||r;return wT=function(e){return n(s,e)||(s[e]=i&&n(o,e)?o[e]:c(`Symbol.`+e)),s[e]},wT}var DT,OT;function kT(){if(OT)return DT;OT=1;var e=ew(),t=xw(),n=Ww(),r=$w(),i=nT(),a=ET(),o=TypeError,s=a(`toPrimitive`);return DT=function(a,c){if(!t(a)||n(a))return a;var l=r(a,s),u;if(l){if(c===void 0&&(c=`default`),u=e(l,a,c),!t(u)||n(u))return u;throw new o(`Can't convert object to primitive value`)}return c===void 0&&(c=`number`),i(a,c)},DT}var AT,jT;function MT(){if(jT)return AT;jT=1;var e=kT(),t=Ww();return AT=function(n){var r=e(n,`string`);return t(r)?r:r+``},AT}var NT,PT;function FT(){if(PT)return NT;PT=1;var e=OC(),t=xw(),n=e.document,r=t(n)&&t(n.createElement);return NT=function(e){return r?n.createElement(e):{}},NT}var IT,LT;function RT(){if(LT)return IT;LT=1;var e=ZC(),t=I(),n=FT();return IT=!e&&!t(function(){return Object.defineProperty(n(`div`),`a`,{get:function(){return 7}}).a!==7}),IT}var zT;function BT(){if(zT)return JC;zT=1;var e=ZC(),t=ew(),n=rw(),r=ow(),i=vw(),a=MT(),o=bT(),s=RT(),c=Object.getOwnPropertyDescriptor;return JC.f=e?c:function(e,l){if(e=i(e),l=a(l),s)try{return c(e,l)}catch{}if(o(e,l))return r(!t(n.f,e,l),e[l])},JC}var VT,HT;function UT(){if(HT)return VT;HT=1;var e=I(),t=qC(),n=/#|\.prototype\./,r=function(n,r){var c=a[i(n)];return c===s?!0:c===o?!1:t(r)?e(r):!!r},i=r.normalize=function(e){return String(e).replace(n,`.`).toLowerCase()},a=r.data={},o=r.NATIVE=`N`,s=r.POLYFILL=`P`;return VT=r,VT}var WT,GT;function KT(){if(GT)return WT;GT=1;var e=WC(),t=Xw(),n=NC(),r=e(e.bind);return WT=function(e,i){return t(e),i===void 0?e:n?r(e,i):function(){return e.apply(i,arguments)}},WT}var qT={},JT,YT;function XT(){return YT?JT:(YT=1,JT=ZC()&&I()(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),JT)}var ZT,QT;function $T(){if(QT)return ZT;QT=1;var e=xw(),t=String,n=TypeError;return ZT=function(r){if(e(r))return r;throw new n(t(r)+` is not an object`)},ZT}var eE;function tE(){if(eE)return qT;eE=1;var e=ZC(),t=RT(),n=XT(),r=$T(),i=MT(),a=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=`enumerable`,l=`configurable`,u=`writable`;return qT.f=e?n?function(e,t,n){if(r(e),t=i(t),r(n),typeof e==`function`&&t===`prototype`&&`value`in n&&u in n&&!n[u]){var a=s(e,t);a&&a[u]&&(e[t]=n.value,n={configurable:l in n?n[l]:a[l],enumerable:c in n?n[c]:a[c],writable:!1})}return o(e,t,n)}:o:function(e,n,s){if(r(e),n=i(n),r(s),t)try{return o(e,n,s)}catch{}if(`get`in s||`set`in s)throw new a(`Accessors not supported`);return`value`in s&&(e[n]=s.value),e},qT}var nE,rE;function iE(){if(rE)return nE;rE=1;var e=ZC(),t=tE(),n=ow();return nE=e?function(e,r,i){return t.f(e,r,n(1,i))}:function(e,t,n){return e[t]=n,e},nE}var aE,oE;function z(){if(oE)return aE;oE=1;var e=OC(),t=IC(),n=WC(),r=qC(),i=BT().f,a=UT(),o=R(),s=KT(),c=iE(),l=bT(),u=function(e){var n=function(r,i,a){if(this instanceof n){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,i)}return new e(r,i,a)}return t(e,this,arguments)};return n.prototype=e.prototype,n};return aE=function(t,d){var f=t.target,p=t.global,m=t.stat,h=t.proto,g=p?e:m?e[f]:e[f]&&e[f].prototype,_=p?o:o[f]||c(o,f,{})[f],v=_.prototype,y,b,x,S,C,w,T,E,D;for(S in d)y=a(p?S:f+(m?`.`:`#`)+S,t.forced),b=!y&&g&&l(g,S),w=_[S],b&&(t.dontCallGetSet?(D=i(g,S),T=D&&D.value):T=g[S]),C=b&&T?T:d[S],!(!y&&!h&&typeof w==typeof C)&&(E=t.bind&&b?s(C,e):t.wrap&&b?u(C):h&&r(C)?n(C):C,(t.sham||C&&C.sham||w&&w.sham)&&c(E,`sham`,!0),c(_,S,E),h&&(x=f+`Prototype`,l(o,x)||c(o,x,{}),c(o[x],S,C),t.real&&v&&(y||!v[S])&&c(v,S,C)))},aE}var sE,cE;function lE(){if(cE)return sE;cE=1;var e=Math.ceil,t=Math.floor;return sE=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)},sE}var uE,dE;function fE(){if(dE)return uE;dE=1;var e=lE();return uE=function(t){var n=+t;return n!==n||n===0?0:e(n)},uE}var pE,mE;function hE(){if(mE)return pE;mE=1;var e=fE(),t=Math.max,n=Math.min;return pE=function(r,i){var a=e(r);return a<0?t(a+i,0):n(a,i)},pE}var gE,_E;function vE(){if(_E)return gE;_E=1;var e=fE(),t=Math.min;return gE=function(n){var r=e(n);return r>0?t(r,9007199254740991):0},gE}var yE,bE;function xE(){if(bE)return yE;bE=1;var e=vE();return yE=function(t){return e(t.length)},yE}var SE,CE;function wE(){if(CE)return SE;CE=1;var e=vw(),t=hE(),n=xE(),r=function(r){return function(i,a,o){var s=e(i),c=n(s);if(c===0)return!r&&-1;var l=t(o,c),u;if(r&&a!==a){for(;c>l;)if(u=s[l++],u!==u)return!0}else for(;c>l;l++)if((r||l in s)&&s[l]===a)return r||l||0;return!r&&-1}};return SE={includes:r(!0),indexOf:r(!1)},SE}var TE,EE;function DE(){return EE?TE:(EE=1,TE={},TE)}var OE,kE;function AE(){if(kE)return OE;kE=1;var e=L(),t=bT(),n=vw(),r=wE().indexOf,i=DE(),a=e([].push);return OE=function(e,o){var s=n(e),c=0,l=[],u;for(u in s)!t(i,u)&&t(s,u)&&a(l,u);for(;o.length>c;)t(s,u=o[c++])&&(~r(l,u)||a(l,u));return l},OE}var jE,ME;function NE(){return ME?jE:(ME=1,jE=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],jE)}var PE,FE;function IE(){if(FE)return PE;FE=1;var e=AE(),t=NE();return PE=Object.keys||function(n){return e(n,t)},PE}var LE={},RE;function zE(){return RE?LE:(RE=1,LE.f=Object.getOwnPropertySymbols,LE)}var BE,VE;function HE(){if(VE)return BE;VE=1;var e=ZC(),t=L(),n=ew(),r=I(),i=IE(),a=zE(),o=rw(),s=_T(),c=lw(),l=Object.assign,u=Object.defineProperty,d=t([].concat);return BE=!l||r(function(){if(e&&l({b:1},l(u({},`a`,{enumerable:!0,get:function(){u(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var t={},n={},r=Symbol(`assign detection`),a=`abcdefghijklmnopqrst`;return t[r]=7,a.split(``).forEach(function(e){n[e]=e}),l({},t)[r]!==7||i(l({},n)).join(``)!==a})?function(t,r){for(var l=s(t),u=arguments.length,f=1,p=a.f,m=o.f;u>f;)for(var h=c(arguments[f++]),g=p?d(i(h),p(h)):i(h),_=g.length,v=0,y;_>v;)y=g[v++],(!e||n(m,h,y))&&(l[y]=h[y]);return l}:l,BE}var UE;function WE(){if(UE)return TC;UE=1;var e=z(),t=HE();return e({target:`Object`,stat:!0,arity:2,forced:Object.assign!==t},{assign:t}),TC}var GE,KE;function qE(){return KE?GE:(KE=1,WE(),GE=R().Object.assign,GE)}var JE,YE;function XE(){return YE?JE:(YE=1,JE=qE(),JE)}var ZE,QE;function $E(){return QE?ZE:(QE=1,ZE=XE(),ZE)}var eD=F($E()),tD={},nD,rD;function iD(){return rD?nD:(rD=1,nD=L()([].slice),nD)}var aD,oD;function sD(){if(oD)return aD;oD=1;var e=L(),t=Xw(),n=xw(),r=bT(),i=iD(),a=NC(),o=Function,s=e([].concat),c=e([].join),l={},u=function(e,t,n){if(!r(l,t)){for(var i=[],a=0;a<t;a++)i[a]=`a[`+a+`]`;l[t]=o(`C,a`,`return new C(`+c(i,`,`)+`)`)}return l[t](e,n)};return aD=a?o.bind:function(e){var r=t(this),a=r.prototype,o=i(arguments,1),c=function(){var t=s(o,i(arguments));return this instanceof c?u(r,t.length,t):r.apply(e,t)};return n(a)&&(c.prototype=a),c},aD}var cD;function lD(){if(cD)return tD;cD=1;var e=z(),t=sD();return e({target:`Function`,proto:!0,forced:Function.bind!==t},{bind:t}),tD}var uD,dD;function fD(){if(dD)return uD;dD=1;var e=OC(),t=R();return uD=function(n,r){var i=t[n+`Prototype`],a=i&&i[r];if(a)return a;var o=e[n],s=o&&o.prototype;return s&&s[r]},uD}var pD,mD;function hD(){return mD?pD:(mD=1,lD(),pD=fD()(`Function`,`bind`),pD)}var gD,_D;function vD(){if(_D)return gD;_D=1;var e=kw(),t=hD(),n=Function.prototype;return gD=function(r){var i=r.bind;return r===n||e(n,r)&&i===n.bind?t:i},gD}var yD,bD;function xD(){return bD?yD:(bD=1,yD=vD(),yD)}var SD,CD;function wD(){return CD?SD:(CD=1,SD=xD(),SD)}var B=F(wD());function TD(e,t,n,r){e.beginPath(),e.arc(t,n,r,0,2*Math.PI,!1),e.closePath()}function ED(e,t,n,r){e.beginPath(),e.rect(t-r,n-r,r*2,r*2),e.closePath()}function DD(e,t,n,r){e.beginPath(),r*=1.15,n+=.275*r;let i=r*2,a=i/2,o=Math.sqrt(3)/6*i,s=Math.sqrt(i*i-a*a);e.moveTo(t,n-(s-o)),e.lineTo(t+a,n+o),e.lineTo(t-a,n+o),e.lineTo(t,n-(s-o)),e.closePath()}function OD(e,t,n,r){e.beginPath(),r*=1.15,n-=.275*r;let i=r*2,a=i/2,o=Math.sqrt(3)/6*i,s=Math.sqrt(i*i-a*a);e.moveTo(t,n+(s-o)),e.lineTo(t+a,n-o),e.lineTo(t-a,n-o),e.lineTo(t,n+(s-o)),e.closePath()}function kD(e,t,n,r){e.beginPath(),r*=.82,n+=.1*r;for(let i=0;i<10;i++){let a=i%2==0?r*1.3:r*.5;e.lineTo(t+a*Math.sin(i*2*Math.PI/10),n-a*Math.cos(i*2*Math.PI/10))}e.closePath()}function AD(e,t,n,r){e.beginPath(),e.lineTo(t,n+r),e.lineTo(t+r,n),e.lineTo(t,n-r),e.lineTo(t-r,n),e.closePath()}function jD(e,t,n,r,i,a){let o=Math.PI/180;r-2*a<0&&(a=r/2),i-2*a<0&&(a=i/2),e.beginPath(),e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.arc(t+r-a,n+a,a,o*270,o*360,!1),e.lineTo(t+r,n+i-a),e.arc(t+r-a,n+i-a,a,0,o*90,!1),e.lineTo(t+a,n+i),e.arc(t+a,n+i-a,a,o*90,o*180,!1),e.lineTo(t,n+a),e.arc(t+a,n+a,a,o*180,o*270,!1),e.closePath()}function MD(e,t,n,r,i){let a=.5522848,o=r/2*a,s=i/2*a,c=t+r,l=n+i,u=t+r/2,d=n+i/2;e.beginPath(),e.moveTo(t,d),e.bezierCurveTo(t,d-s,u-o,n,u,n),e.bezierCurveTo(u+o,n,c,d-s,c,d),e.bezierCurveTo(c,d+s,u+o,l,u,l),e.bezierCurveTo(u-o,l,t,d+s,t,d),e.closePath()}function ND(e,t,n,r,i){let a=r,o=i*.3333333333333333,s=.5522848,c=a/2*s,l=o/2*s,u=t+a,d=n+o,f=t+a/2,p=n+o/2,m=n+(i-o/2),h=n+i;e.beginPath(),e.moveTo(u,p),e.bezierCurveTo(u,p+l,f+c,d,f,d),e.bezierCurveTo(f-c,d,t,p+l,t,p),e.bezierCurveTo(t,p-l,f-c,n,f,n),e.bezierCurveTo(f+c,n,u,p-l,u,p),e.lineTo(u,m),e.bezierCurveTo(u,m+l,f+c,h,f,h),e.bezierCurveTo(f-c,h,t,m+l,t,m),e.lineTo(t,p)}function PD(e,t,n,r,i,a){e.beginPath(),e.moveTo(t,n);let o=a.length,s=r-t,c=i-n,l=c/s,u=Math.sqrt(s*s+c*c),d=0,f=!0,p=0,m=+a[0];for(;u>=.1;)m=+a[d++%o],m>u&&(m=u),p=Math.sqrt(m*m/(1+l*l)),p=s<0?-p:p,t+=p,n+=l*p,f===!0?e.lineTo(t,n):e.moveTo(t,n),u-=m,f=!f}function FD(e,t,n,r){e.beginPath();let i=Math.PI*2/6;e.moveTo(t+r,n);for(let a=1;a<6;a++)e.lineTo(t+r*Math.cos(i*a),n+r*Math.sin(i*a));e.closePath()}var ID={circle:TD,dashedLine:PD,database:ND,diamond:AD,ellipse:MD,ellipse_vis:MD,hexagon:FD,roundRect:jD,square:ED,star:kD,triangle:DD,triangleDown:OD};function LD(e){return Object.prototype.hasOwnProperty.call(ID,e)?ID[e]:function(t){var n=[...arguments].slice(1);CanvasRenderingContext2D.prototype[e].call(t,n)}}var RD={exports:{}},zD;function BD(){return zD?RD.exports:(zD=1,(function(e){e.exports=t;function t(e){if(e)return n(e)}function n(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}})(RD),RD.exports)}var VD=F(BD()),HD={},UD,WD;function GD(){if(WD)return UD;WD=1;var e=VC();return UD=Array.isArray||function(t){return e(t)===`Array`},UD}var KD,qD;function JD(){if(qD)return KD;qD=1;var e=TypeError,t=9007199254740991;return KD=function(n){if(n>t)throw e(`Maximum allowed index exceeded`);return n},KD}var YD,XD;function ZD(){if(XD)return YD;XD=1;var e=ZC(),t=tE(),n=ow();return YD=function(r,i,a){e?t.f(r,i,n(0,a)):r[i]=a},YD}var QD,$D;function eO(){if($D)return QD;$D=1;var e=ET()(`toStringTag`),t={};return t[e]=`z`,QD=String(t)===`[object z]`,QD}var tO,nO;function rO(){if(nO)return tO;nO=1;var e=eO(),t=qC(),n=VC(),r=ET()(`toStringTag`),i=Object,a=n(function(){return arguments}())===`Arguments`,o=function(e,t){try{return e[t]}catch{}};return tO=e?n:function(e){var s,c,l;return e===void 0?`Undefined`:e===null?`Null`:typeof(c=o(s=i(e),r))==`string`?c:a?n(s):(l=n(s))===`Object`&&t(s.callee)?`Arguments`:l},tO}var iO,aO;function oO(){if(aO)return iO;aO=1;var e=L(),t=qC(),n=dT(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),iO=n.inspectSource,iO}var sO,cO;function lO(){if(cO)return sO;cO=1;var e=L(),t=I(),n=qC(),r=rO(),i=Ew(),a=oO(),o=function(){},s=i(`Reflect`,`construct`),c=/^\s*(?:class|function)\b/,l=e(c.exec),u=!c.test(o),d=function(e){if(!n(e))return!1;try{return s(o,[],e),!0}catch{return!1}},f=function(e){if(!n(e))return!1;switch(r(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return u||!!l(c,a(e))}catch{return!0}};return f.sham=!0,sO=!s||t(function(){var e;return d(d.call)||!d(Object)||!d(function(){e=!0})||e})?f:d,sO}var uO,dO;function fO(){if(dO)return uO;dO=1;var e=GD(),t=lO(),n=xw(),r=ET()(`species`),i=Array;return uO=function(a){var o;return e(a)&&(o=a.constructor,t(o)&&(o===i||e(o.prototype))?o=void 0:n(o)&&(o=o[r],o===null&&(o=void 0))),o===void 0?i:o},uO}var pO,mO;function hO(){if(mO)return pO;mO=1;var e=fO();return pO=function(t,n){return new(e(t))(n===0?0:n)},pO}var gO,_O;function vO(){if(_O)return gO;_O=1;var e=I(),t=ET(),n=Fw(),r=t(`species`);return gO=function(t){return n>=51||!e(function(){var e=[],n=e.constructor={};return n[r]=function(){return{foo:1}},e[t](Boolean).foo!==1})},gO}var yO;function bO(){if(yO)return HD;yO=1;var e=z(),t=I(),n=GD(),r=xw(),i=_T(),a=xE(),o=JD(),s=ZD(),c=hO(),l=vO(),u=ET(),d=Fw(),f=u(`isConcatSpreadable`),p=d>=51||!t(function(){var e=[];return e[f]=!1,e.concat()[0]!==e}),m=function(e){if(!r(e))return!1;var t=e[f];return t===void 0?n(e):!!t};return e({target:`Array`,proto:!0,arity:1,forced:!p||!l(`concat`)},{concat:function(e){var t=i(this),n=c(t,0),r=0,l,u,d,f,p;for(l=-1,d=arguments.length;l<d;l++)if(p=l===-1?t:arguments[l],m(p))for(f=a(p),o(r+f),u=0;u<f;u++,r++)u in p&&s(n,r,p[u]);else o(r+1),s(n,r++,p);return n.length=r,n}}),HD}var xO={},SO={},CO,wO;function TO(){if(wO)return CO;wO=1;var e=rO(),t=String;return CO=function(n){if(e(n)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return t(n)},CO}var EO={},DO;function OO(){if(DO)return EO;DO=1;var e=ZC(),t=XT(),n=tE(),r=$T(),i=vw(),a=IE();return EO.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var o=i(t),s=a(t),c=s.length,l=0,u;c>l;)n.f(e,u=s[l++],o[u]);return e},EO}var kO,AO;function jO(){return AO?kO:(AO=1,kO=Ew()(`document`,`documentElement`),kO)}var MO,NO;function PO(){if(NO)return MO;NO=1;var e=mT(),t=CT(),n=e(`keys`);return MO=function(e){return n[e]||(n[e]=t(e))},MO}var FO,IO;function LO(){if(IO)return FO;IO=1;var e=$T(),t=OO(),n=NE(),r=DE(),i=jO(),a=FT(),o=PO(),s=`>`,c=`<`,l=`prototype`,u=`script`,d=o(`IE_PROTO`),f=function(){},p=function(e){return c+u+s+e+c+`/`+u+s},m=function(e){e.write(p(``)),e.close();var t=e.parentWindow.Object;return e=null,t},h=function(){var e=a(`iframe`),t=`java`+u+`:`,n;return e.style.display=`none`,i.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(p(`document.F=Object`)),n.close(),n.F},g,_=function(){try{g=new ActiveXObject(`htmlfile`)}catch{}_=typeof document<`u`?document.domain&&g?m(g):h():m(g);for(var e=n.length;e--;)delete _[l][n[e]];return _()};return r[d]=!0,FO=Object.create||function(n,r){var i;return n===null?i=_():(f[l]=e(n),i=new f,f[l]=null,i[d]=n),r===void 0?i:t.f(i,r)},FO}var RO={},zO;function BO(){if(zO)return RO;zO=1;var e=AE(),t=NE().concat(`length`,`prototype`);return RO.f=Object.getOwnPropertyNames||function(n){return e(n,t)},RO}var VO={},HO;function UO(){if(HO)return VO;HO=1;var e=VC(),t=vw(),n=BO().f,r=iD(),i=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return n(e)}catch{return r(i)}};return VO.f=function(r){return i&&e(r)===`Window`?a(r):n(t(r))},VO}var WO,GO;function KO(){if(GO)return WO;GO=1;var e=iE();return WO=function(t,n,r,i){return i&&i.enumerable?t[n]=r:e(t,n,r),t},WO}var qO,JO;function YO(){if(JO)return qO;JO=1;var e=tE();return qO=function(t,n,r){return e.f(t,n,r)},qO}var XO={},ZO;function QO(){return ZO?XO:(ZO=1,XO.f=ET(),XO)}var $O,ek;function tk(){if(ek)return $O;ek=1;var e=R(),t=bT(),n=QO(),r=tE().f;return $O=function(i){var a=e.Symbol||={};t(a,i)||r(a,i,{value:n.f(i)})},$O}var nk,rk;function ik(){if(rk)return nk;rk=1;var e=ew(),t=Ew(),n=ET(),r=KO();return nk=function(){var i=t(`Symbol`),a=i&&i.prototype,o=a&&a.valueOf,s=n(`toPrimitive`);a&&!a[s]&&r(a,s,function(t){return e(o,this)},{arity:1})},nk}var ak,ok;function sk(){if(ok)return ak;ok=1;var e=eO(),t=rO();return ak=e?{}.toString:function(){return`[object `+t(this)+`]`},ak}var ck,lk;function uk(){if(lk)return ck;lk=1;var e=eO(),t=tE().f,n=iE(),r=bT(),i=sk(),a=ET()(`toStringTag`);return ck=function(o,s,c,l){var u=c?o:o&&o.prototype;u&&(r(u,a)||t(u,a,{configurable:!0,value:s}),l&&!e&&n(u,`toString`,i))},ck}var dk,fk;function pk(){if(fk)return dk;fk=1;var e=OC(),t=qC(),n=e.WeakMap;return dk=t(n)&&/native code/.test(String(n)),dk}var mk,hk;function gk(){if(hk)return mk;hk=1;var e=pk(),t=OC(),n=xw(),r=iE(),i=bT(),a=dT(),o=PO(),s=DE(),c=`Object already initialized`,l=t.TypeError,u=t.WeakMap,d,f,p,m=function(e){return p(e)?f(e):d(e,{})},h=function(e){return function(t){var r;if(!n(t)||(r=f(t)).type!==e)throw new l(`Incompatible receiver, `+e+` required`);return r}};if(e||a.state){var g=a.state||=new u;g.get=g.get,g.has=g.has,g.set=g.set,d=function(e,t){if(g.has(e))throw new l(c);return t.facade=e,g.set(e,t),t},f=function(e){return g.get(e)||{}},p=function(e){return g.has(e)}}else{var _=o(`state`);s[_]=!0,d=function(e,t){if(i(e,_))throw new l(c);return t.facade=e,r(e,_,t),t},f=function(e){return i(e,_)?e[_]:{}},p=function(e){return i(e,_)}}return mk={set:d,get:f,has:p,enforce:m,getterFor:h},mk}var _k,vk;function yk(){if(vk)return _k;vk=1;var e=KT(),t=L(),n=lw(),r=_T(),i=xE(),a=hO(),o=t([].push),s=function(t){var s=t===1,c=t===2,l=t===3,u=t===4,d=t===6,f=t===7,p=t===5||d;return function(m,h,g,_){for(var v=r(m),y=n(v),b=i(y),x=e(h,g),S=0,C=_||a,w=s?C(m,b):c||f?C(m,0):void 0,T,E;b>S;S++)if((p||S in y)&&(T=y[S],E=x(T,S,v),t))if(s)w[S]=E;else if(E)switch(t){case 3:return!0;case 5:return T;case 6:return S;case 2:o(w,T)}else switch(t){case 4:return!1;case 7:o(w,T)}return d?-1:l||u?u:w}};return _k={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)},_k}var bk;function xk(){if(bk)return SO;bk=1;var e=z(),t=OC(),n=ew(),r=L(),i=oT(),a=ZC(),o=Rw(),s=I(),c=bT(),l=kw(),u=$T(),d=vw(),f=MT(),p=TO(),m=ow(),h=LO(),g=IE(),_=BO(),v=UO(),y=zE(),b=BT(),x=tE(),S=OO(),C=rw(),w=KO(),T=YO(),E=mT(),D=PO(),ee=DE(),te=CT(),O=ET(),k=QO(),ne=tk(),re=ik(),A=uk(),ie=gk(),ae=yk().forEach,oe=D(`hidden`),se=`Symbol`,ce=`prototype`,le=ie.set,ue=ie.getterFor(se),de=Object[ce],fe=t.Symbol,pe=fe&&fe[ce],me=t.RangeError,he=t.TypeError,ge=t.QObject,_e=b.f,j=x.f,ve=v.f,ye=C.f,be=r([].push),xe=E(`symbols`),Se=E(`op-symbols`),Ce=E(`wks`),we=!ge||!ge[ce]||!ge[ce].findChild,Te=function(e,t,n){var r=_e(de,t);r&&delete de[t],j(e,t,n),r&&e!==de&&j(de,t,r)},M=a&&s(function(){return h(j({},`a`,{get:function(){return j(this,`a`,{value:7}).a}})).a!==7})?Te:j,Ee=function(e,t){var n=xe[e]=h(pe);return le(n,{type:se,tag:e,description:t}),a||(n.description=t),n},De=function(e,t,n){e===de&&De(Se,t,n),u(e);var r=f(t);return u(n),c(xe,r)?(n.enumerable?(c(e,oe)&&e[oe][r]&&(e[oe][r]=!1),n=h(n,{enumerable:m(0,!1)})):(c(e,oe)||j(e,oe,m(1,h(null))),e[oe][r]=!0),M(e,r,n)):j(e,r,n)},N=function(e,t){u(e);var r=d(t);return ae(g(r).concat(Me(r)),function(t){(!a||n(ke,r,t))&&De(e,t,r[t])}),e},Oe=function(e,t){return t===void 0?h(e):N(h(e),t)},ke=function(e){var t=f(e),r=n(ye,this,t);return this===de&&c(xe,t)&&!c(Se,t)?!1:r||!c(this,t)||!c(xe,t)||c(this,oe)&&this[oe][t]?r:!0},Ae=function(e,t){var n=d(e),r=f(t);if(!(n===de&&c(xe,r)&&!c(Se,r))){var i=_e(n,r);return i&&c(xe,r)&&!(c(n,oe)&&n[oe][r])&&(i.enumerable=!0),i}},je=function(e){var t=ve(d(e)),n=[];return ae(t,function(e){!c(xe,e)&&!c(ee,e)&&be(n,e)}),n},Me=function(e){var t=e===de,n=ve(t?Se:d(e)),r=[];return ae(n,function(e){c(xe,e)&&(!t||c(de,e))&&be(r,xe[e])}),r};return o||(fe=function(){if(l(pe,this))throw new he(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:p(arguments[0]),r=te(e),i=function(e){var a=this===void 0?t:this;a===de&&n(i,Se,e),c(a,oe)&&c(a[oe],r)&&(a[oe][r]=!1);var o=m(1,e);try{M(a,r,o)}catch(e){if(!(e instanceof me))throw e;Te(a,r,o)}};return a&&we&&M(de,r,{configurable:!0,set:i}),Ee(r,e)},pe=fe[ce],w(pe,`toString`,function(){return ue(this).tag}),w(fe,`withoutSetter`,function(e){return Ee(te(e),e)}),C.f=ke,x.f=De,S.f=N,b.f=Ae,_.f=v.f=je,y.f=Me,k.f=function(e){return Ee(O(e),e)},a&&(T(pe,`description`,{configurable:!0,get:function(){return ue(this).description}}),i||w(de,`propertyIsEnumerable`,ke,{unsafe:!0}))),e({global:!0,constructor:!0,wrap:!0,forced:!o,sham:!o},{Symbol:fe}),ae(g(Ce),function(e){ne(e)}),e({target:se,stat:!0,forced:!o},{useSetter:function(){we=!0},useSimple:function(){we=!1}}),e({target:`Object`,stat:!0,forced:!o,sham:!a},{create:Oe,defineProperty:De,defineProperties:N,getOwnPropertyDescriptor:Ae}),e({target:`Object`,stat:!0,forced:!o},{getOwnPropertyNames:je}),re(),A(fe,se),ee[oe]=!0,SO}var Sk={},Ck,wk;function Tk(){return wk?Ck:(wk=1,Ck=Rw()&&!!Symbol.for&&!!Symbol.keyFor,Ck)}var Ek;function Dk(){if(Ek)return Sk;Ek=1;var e=z(),t=Ew(),n=bT(),r=TO(),i=mT(),a=Tk(),o=i(`string-to-symbol-registry`),s=i(`symbol-to-string-registry`);return e({target:`Symbol`,stat:!0,forced:!a},{for:function(e){var i=r(e);if(n(o,i))return o[i];var a=t(`Symbol`)(i);return o[i]=a,s[a]=i,a}}),Sk}var Ok={},kk;function Ak(){if(kk)return Ok;kk=1;var e=z(),t=bT(),n=Ww(),r=qw(),i=mT(),a=Tk(),o=i(`symbol-to-string-registry`);return e({target:`Symbol`,stat:!0,forced:!a},{keyFor:function(e){if(!n(e))throw TypeError(r(e)+` is not a symbol`);if(t(o,e))return o[e]}}),Ok}var jk={},Mk,Nk;function Pk(){if(Nk)return Mk;Nk=1;var e=L(),t=GD(),n=qC(),r=VC(),i=TO(),a=e([].push);return Mk=function(e){if(n(e))return e;if(t(e)){for(var o=e.length,s=[],c=0;c<o;c++){var l=e[c];typeof l==`string`?a(s,l):(typeof l==`number`||r(l)===`Number`||r(l)===`String`)&&a(s,i(l))}var u=s.length,d=!0;return function(e,n){if(d)return d=!1,n;if(t(this))return n;for(var r=0;r<u;r++)if(s[r]===e)return n}}},Mk}var Fk;function Ik(){if(Fk)return jk;Fk=1;var e=z(),t=Ew(),n=IC(),r=ew(),i=L(),a=I(),o=qC(),s=Ww(),c=iD(),l=Pk(),u=Rw(),d=String,f=t(`JSON`,`stringify`),p=i(/./.exec),m=i(``.charAt),h=i(``.charCodeAt),g=i(``.replace),_=i(1.1.toString),v=/[\uD800-\uDFFF]/g,y=/^[\uD800-\uDBFF]$/,b=/^[\uDC00-\uDFFF]$/,x=!u||a(function(){var e=t(`Symbol`)(`stringify detection`);return f([e])!==`[null]`||f({a:e})!==`{}`||f(Object(e))!==`{}`}),S=a(function(){return f(`\udf06\ud834`)!==`"\\udf06\\ud834"`||f(`\udead`)!==`"\\udead"`}),C=function(e,t){var i=c(arguments),a=l(t);if(!(!o(a)&&(e===void 0||s(e))))return i[1]=function(e,t){if(o(a)&&(t=r(a,this,d(e),t)),!s(t))return t},n(f,null,i)},w=function(e,t,n){var r=m(n,t-1),i=m(n,t+1);return p(y,e)&&!p(b,i)||p(b,e)&&!p(y,r)?`\\u`+_(h(e,0),16):e};return f&&e({target:`JSON`,stat:!0,arity:3,forced:x||S},{stringify:function(e,t,r){var i=c(arguments),a=n(x?C:f,null,i);return S&&typeof a==`string`?g(a,v,w):a}}),jk}var Lk={},Rk;function zk(){if(Rk)return Lk;Rk=1;var e=z(),t=Rw(),n=I(),r=zE(),i=_T();return e({target:`Object`,stat:!0,forced:!t||n(function(){r.f(1)})},{getOwnPropertySymbols:function(e){var t=r.f;return t?t(i(e)):[]}}),Lk}var Bk;function Vk(){return Bk?xO:(Bk=1,xk(),Dk(),Ak(),Ik(),zk(),xO)}var Hk={},Uk;function Wk(){return Uk?Hk:(Uk=1,tk()(`asyncDispose`),Hk)}var Gk={},Kk;function qk(){return Kk?Gk:(Kk=1,tk()(`asyncIterator`),Gk)}var Jk={},Yk;function Xk(){return Yk?Jk:(Yk=1,tk()(`dispose`),Jk)}var Zk={},Qk;function $k(){return Qk?Zk:(Qk=1,tk()(`hasInstance`),Zk)}var eA={},tA;function nA(){return tA?eA:(tA=1,tk()(`isConcatSpreadable`),eA)}var rA={},iA;function aA(){return iA?rA:(iA=1,tk()(`iterator`),rA)}var oA={},sA;function cA(){return sA?oA:(sA=1,tk()(`match`),oA)}var lA={},uA;function dA(){return uA?lA:(uA=1,tk()(`matchAll`),lA)}var fA={},pA;function mA(){return pA?fA:(pA=1,tk()(`replace`),fA)}var hA={},gA;function _A(){return gA?hA:(gA=1,tk()(`search`),hA)}var vA={},yA;function bA(){return yA?vA:(yA=1,tk()(`species`),vA)}var xA={},SA;function CA(){return SA?xA:(SA=1,tk()(`split`),xA)}var wA={},TA;function EA(){if(TA)return wA;TA=1;var e=tk(),t=ik();return e(`toPrimitive`),t(),wA}var DA={},OA;function kA(){if(OA)return DA;OA=1;var e=Ew(),t=tk(),n=uk();return t(`toStringTag`),n(e(`Symbol`),`Symbol`),DA}var AA={},jA;function MA(){return jA?AA:(jA=1,tk()(`unscopables`),AA)}var NA={},PA;function FA(){return PA?NA:(PA=1,uk()(OC().JSON,`JSON`,!0),NA)}var IA,LA;function RA(){return LA?IA:(LA=1,bO(),Vk(),Wk(),qk(),Xk(),$k(),nA(),aA(),cA(),dA(),mA(),_A(),bA(),CA(),EA(),kA(),MA(),FA(),IA=R().Symbol,IA)}var zA={},BA,VA;function HA(){return VA?BA:(VA=1,BA=function(){},BA)}var UA,WA;function GA(){return WA?UA:(WA=1,UA={},UA)}var KA,qA;function JA(){if(qA)return KA;qA=1;var e=ZC(),t=bT(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,i=t(n,`name`);return KA={EXISTS:i,PROPER:i&&(function(){}).name===`something`,CONFIGURABLE:i&&(!e||e&&r(n,`name`).configurable)},KA}var YA,XA;function ZA(){return XA?YA:(XA=1,YA=!I()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),YA)}var QA,$A;function ej(){if($A)return QA;$A=1;var e=bT(),t=qC(),n=_T(),r=PO(),i=ZA(),a=r(`IE_PROTO`),o=Object,s=o.prototype;return QA=i?o.getPrototypeOf:function(r){var i=n(r);if(e(i,a))return i[a];var c=i.constructor;return t(c)&&i instanceof c?c.prototype:i instanceof o?s:null},QA}var tj,nj;function rj(){if(nj)return tj;nj=1;var e=I(),t=qC(),n=xw(),r=LO(),i=ej(),a=KO(),o=ET(),s=oT(),c=o(`iterator`),l=!1,u,d,f;return[].keys&&(f=[].keys(),`next`in f?(d=i(i(f)),d!==Object.prototype&&(u=d)):l=!0),!n(u)||e(function(){var e={};return u[c].call(e)!==e})?u={}:s&&(u=r(u)),t(u[c])||a(u,c,function(){return this}),tj={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:l},tj}var ij,aj;function oj(){if(aj)return ij;aj=1;var e=rj().IteratorPrototype,t=LO(),n=ow(),r=uk(),i=GA(),a=function(){return this};return ij=function(o,s,c,l){var u=s+` Iterator`;return o.prototype=t(e,{next:n(+!l,c)}),r(o,u,!1,!0),i[u]=a,o},ij}var sj,cj;function lj(){if(cj)return sj;cj=1;var e=L(),t=Xw();return sj=function(n,r,i){try{return e(t(Object.getOwnPropertyDescriptor(n,r)[i]))}catch{}},sj}var uj,dj;function fj(){if(dj)return uj;dj=1;var e=xw();return uj=function(t){return e(t)||t===null},uj}var pj,mj;function hj(){if(mj)return pj;mj=1;var e=fj(),t=String,n=TypeError;return pj=function(r){if(e(r))return r;throw new n(`Can't set `+t(r)+` as a prototype`)},pj}var gj,_j;function vj(){if(_j)return gj;_j=1;var e=lj(),t=xw(),n=hw(),r=hj();return gj=Object.setPrototypeOf||(`__proto__`in{}?function(){var i=!1,a={},o;try{o=e(Object.prototype,`__proto__`,`set`),o(a,[]),i=a instanceof Array}catch{}return function(e,a){return n(e),r(a),t(e)&&(i?o(e,a):e.__proto__=a),e}}():void 0),gj}var yj,bj;function xj(){if(bj)return yj;bj=1;var e=z(),t=ew(),n=oT(),r=JA(),i=qC(),a=oj(),o=ej(),s=vj(),c=uk(),l=iE(),u=KO(),d=ET(),f=GA(),p=rj(),m=r.PROPER,h=r.CONFIGURABLE,g=p.IteratorPrototype,_=p.BUGGY_SAFARI_ITERATORS,v=d(`iterator`),y=`keys`,b=`values`,x=`entries`,S=function(){return this};return yj=function(r,d,p,C,w,T,E){a(p,d,C);var D=function(e){if(e===w&&ne)return ne;if(!_&&e&&e in O)return O[e];switch(e){case y:return function(){return new p(this,e)};case b:return function(){return new p(this,e)};case x:return function(){return new p(this,e)}}return function(){return new p(this)}},ee=d+` Iterator`,te=!1,O=r.prototype,k=O[v]||O[`@@iterator`]||w&&O[w],ne=!_&&k||D(w),re=d===`Array`&&O.entries||k,A,ie,ae;if(re&&(A=o(re.call(new r)),A!==Object.prototype&&A.next&&(!n&&o(A)!==g&&(s?s(A,g):i(A[v])||u(A,v,S)),c(A,ee,!0,!0),n&&(f[ee]=S))),m&&w===b&&k&&k.name!==b&&(!n&&h?l(O,`name`,b):(te=!0,ne=function(){return t(k,this)})),w)if(ie={values:D(b),keys:T?ne:D(y),entries:D(x)},E)for(ae in ie)(_||te||!(ae in O))&&u(O,ae,ie[ae]);else e({target:d,proto:!0,forced:_||te},ie);return(!n||E)&&O[v]!==ne&&u(O,v,ne,{name:w}),f[d]=ne,ie},yj}var Sj,Cj;function wj(){return Cj?Sj:(Cj=1,Sj=function(e,t){return{value:e,done:t}},Sj)}var Tj,Ej;function Dj(){if(Ej)return Tj;Ej=1;var e=vw(),t=HA(),n=GA(),r=gk(),i=tE().f,a=xj(),o=wj(),s=oT(),c=ZC(),l=`Array Iterator`,u=r.set,d=r.getterFor(l);Tj=a(Array,`Array`,function(t,n){u(this,{type:l,target:e(t),index:0,kind:n})},function(){var e=d(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,o(void 0,!0);switch(e.kind){case`keys`:return o(n,!1);case`values`:return o(t[n],!1)}return o([n,t[n]],!1)},`values`);var f=n.Arguments=n.Array;if(t(`keys`),t(`values`),t(`entries`),!s&&c&&f.name!==`values`)try{i(f,`name`,{value:`values`})}catch{}return Tj}var Oj,kj;function Aj(){return kj?Oj:(kj=1,Oj={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Oj)}var jj;function Mj(){if(jj)return zA;jj=1,Dj();var e=Aj(),t=OC(),n=uk(),r=GA();for(var i in e)n(t[i],i),r[i]=r.Array;return zA}var Nj,Pj;function Fj(){if(Pj)return Nj;Pj=1;var e=RA();return Mj(),Nj=e,Nj}var Ij,Lj;function Rj(){return Lj?Ij:(Lj=1,Ij=Fj(),Ij)}var zj=F(Rj()),Bj={},Vj;function Hj(){if(Vj)return Bj;Vj=1;var e=z(),t=GD(),n=lO(),r=xw(),i=hE(),a=xE(),o=vw(),s=ZD(),c=ET(),l=vO(),u=iD(),d=l(`slice`),f=c(`species`),p=Array,m=Math.max;return e({target:`Array`,proto:!0,forced:!d},{slice:function(e,c){var l=o(this),d=a(l),h=i(e,d),g=i(c===void 0?d:c,d),_,v,y;if(t(l)&&(_=l.constructor,n(_)&&(_===p||t(_.prototype))?_=void 0:r(_)&&(_=_[f],_===null&&(_=void 0)),_===p||_===void 0))return u(l,h,g);for(v=new(_===void 0?p:_)(m(g-h,0)),y=0;h<g;h++,y++)h in l&&s(v,y,l[h]);return v.length=y,v}}),Bj}var Uj,Wj;function Gj(){return Wj?Uj:(Wj=1,Hj(),Uj=fD()(`Array`,`slice`),Uj)}var Kj,qj;function Jj(){if(qj)return Kj;qj=1;var e=kw(),t=Gj(),n=Array.prototype;return Kj=function(r){var i=r.slice;return r===n||e(n,r)&&i===n.slice?t:i},Kj}var Yj,Xj;function Zj(){return Xj?Yj:(Xj=1,Yj=Jj(),Yj)}var Qj,$j;function eM(){return $j?Qj:($j=1,Qj=Zj(),Qj)}var tM=F(eM()),nM,rM;function iM(){if(rM)return nM;rM=1;var e=Ew(),t=L(),n=BO(),r=zE(),i=$T(),a=t([].concat);return nM=e(`Reflect`,`ownKeys`)||function(e){var t=n.f(i(e)),o=r.f;return o?a(t,o(e)):t},nM}var aM={},oM;function sM(){return oM?aM:(oM=1,z()({target:`Array`,stat:!0},{isArray:GD()}),aM)}var cM,lM;function uM(){return lM?cM:(lM=1,sM(),cM=R().Array.isArray,cM)}var dM,fM;function pM(){return fM?dM:(fM=1,dM=uM(),dM)}var mM,hM;function gM(){return hM?mM:(hM=1,mM=pM(),mM)}var _M=F(gM()),vM={},yM;function bM(){if(yM)return vM;yM=1;var e=z(),t=yk().map;return e({target:`Array`,proto:!0,forced:!vO()(`map`)},{map:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),vM}var xM,SM;function CM(){return SM?xM:(SM=1,bM(),xM=fD()(`Array`,`map`),xM)}var wM,TM;function EM(){if(TM)return wM;TM=1;var e=kw(),t=CM(),n=Array.prototype;return wM=function(r){var i=r.map;return r===n||e(n,r)&&i===n.map?t:i},wM}var DM,OM;function kM(){return OM?DM:(OM=1,DM=EM(),DM)}var AM,jM;function MM(){return jM?AM:(jM=1,AM=kM(),AM)}var NM=F(MM()),PM={},FM;function IM(){if(FM)return PM;FM=1;var e=z(),t=_T(),n=IE();return e({target:`Object`,stat:!0,forced:I()(function(){n(1)})},{keys:function(e){return n(t(e))}}),PM}var LM,RM;function zM(){return RM?LM:(RM=1,IM(),LM=R().Object.keys,LM)}var BM,VM;function HM(){return VM?BM:(VM=1,BM=zM(),BM)}var UM,WM;function GM(){return WM?UM:(WM=1,UM=HM(),UM)}var KM=F(GM()),qM={},JM;function YM(){if(JM)return qM;JM=1;var e=z(),t=L(),n=Date,r=t(n.prototype.getTime);return e({target:`Date`,stat:!0},{now:function(){return r(new n)}}),qM}var XM,ZM;function QM(){return ZM?XM:(ZM=1,YM(),XM=R().Date.now,XM)}var $M,eN;function tN(){return eN?$M:(eN=1,$M=QM(),$M)}var nN,rN;function iN(){return rN?nN:(rN=1,nN=tN(),nN)}var aN=F(iN()),oN={},sN,cN;function lN(){if(cN)return sN;cN=1;var e=I();return sN=function(t,n){var r=[][t];return!!r&&e(function(){r.call(null,n||function(){return 1},1)})},sN}var uN,dN;function fN(){if(dN)return uN;dN=1;var e=yk().forEach;return uN=lN()(`forEach`)?[].forEach:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)},uN}var pN;function mN(){if(pN)return oN;pN=1;var e=z(),t=fN();return e({target:`Array`,proto:!0,forced:[].forEach!==t},{forEach:t}),oN}var hN,gN;function _N(){return gN?hN:(gN=1,mN(),hN=fD()(`Array`,`forEach`),hN)}var vN,yN;function bN(){return yN?vN:(yN=1,vN=_N(),vN)}var xN,SN;function CN(){if(SN)return xN;SN=1;var e=rO(),t=bT(),n=kw(),r=bN(),i=Array.prototype,a={DOMTokenList:!0,NodeList:!0};return xN=function(o){var s=o.forEach;return o===i||n(i,o)&&s===i.forEach||t(a,e(o))?r:s},xN}var wN,TN;function EN(){return TN?wN:(TN=1,wN=CN(),wN)}var V=F(EN()),DN={},ON;function kN(){if(ON)return DN;ON=1;var e=z(),t=L(),n=GD(),r=t([].reverse),i=[1,2];return e({target:`Array`,proto:!0,forced:String(i)===String(i.reverse())},{reverse:function(){return n(this)&&(this.length=this.length),r(this)}}),DN}var AN,jN;function MN(){return jN?AN:(jN=1,kN(),AN=fD()(`Array`,`reverse`),AN)}var NN,PN;function FN(){if(PN)return NN;PN=1;var e=kw(),t=MN(),n=Array.prototype;return NN=function(r){var i=r.reverse;return r===n||e(n,r)&&i===n.reverse?t:i},NN}var IN,LN;function RN(){return LN?IN:(LN=1,IN=FN(),IN)}var zN,BN;function VN(){return BN?zN:(BN=1,zN=RN(),zN)}var HN=F(VN()),UN={},WN,GN;function KN(){if(GN)return WN;GN=1;var e=ZC(),t=GD(),n=TypeError,r=Object.getOwnPropertyDescriptor;return WN=e&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,i){if(t(e)&&!r(e,`length`).writable)throw new n(`Cannot set read only .length`);return e.length=i}:function(e,t){return e.length=t},WN}var qN,JN;function YN(){if(JN)return qN;JN=1;var e=qw(),t=TypeError;return qN=function(n,r){if(!delete n[r])throw new t(`Cannot delete property `+e(r)+` of `+e(n))},qN}var XN;function ZN(){if(XN)return UN;XN=1;var e=z(),t=_T(),n=hE(),r=fE(),i=xE(),a=KN(),o=JD(),s=hO(),c=ZD(),l=YN(),u=vO()(`splice`),d=Math.max,f=Math.min;return e({target:`Array`,proto:!0,forced:!u},{splice:function(e,u){var p=t(this),m=i(p),h=n(e,m),g=arguments.length,_,v,y,b,x,S;for(g===0?_=v=0:g===1?(_=0,v=m-h):(_=g-2,v=f(d(r(u),0),m-h)),o(m+_-v),y=s(p,v),b=0;b<v;b++)x=h+b,x in p&&c(y,b,p[x]);if(y.length=v,_<v){for(b=h;b<m-v;b++)x=b+v,S=b+_,x in p?p[S]=p[x]:l(p,S);for(b=m;b>m-v+_;b--)l(p,b-1)}else if(_>v)for(b=m-v;b>h;b--)x=b+v-1,S=b+_-1,x in p?p[S]=p[x]:l(p,S);for(b=0;b<_;b++)p[b+h]=arguments[b+2];return a(p,m-v+_),y}}),UN}var QN,$N;function eP(){return $N?QN:($N=1,ZN(),QN=fD()(`Array`,`splice`),QN)}var tP,nP;function rP(){if(nP)return tP;nP=1;var e=kw(),t=eP(),n=Array.prototype;return tP=function(r){var i=r.splice;return r===n||e(n,r)&&i===n.splice?t:i},tP}var iP,aP;function oP(){return aP?iP:(aP=1,iP=rP(),iP)}var sP,cP;function lP(){return cP?sP:(cP=1,sP=oP(),sP)}var uP=F(lP()),dP={},fP;function pP(){if(fP)return dP;fP=1;var e=z(),t=wE().includes,n=I(),r=HA();return e({target:`Array`,proto:!0,forced:n(function(){return![,].includes()})},{includes:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),r(`includes`),dP}var mP,hP;function gP(){return hP?mP:(hP=1,pP(),mP=fD()(`Array`,`includes`),mP)}var _P={},vP,yP;function bP(){if(yP)return vP;yP=1;var e=xw(),t=VC(),n=ET()(`match`);return vP=function(r){var i;return e(r)&&((i=r[n])===void 0?t(r)===`RegExp`:!!i)},vP}var xP,SP;function CP(){if(SP)return xP;SP=1;var e=bP(),t=TypeError;return xP=function(n){if(e(n))throw new t(`The method doesn't accept regular expressions`);return n},xP}var wP,TP;function EP(){if(TP)return wP;TP=1;var e=ET()(`match`);return wP=function(t){var n=/./;try{`/./`[t](n)}catch{try{return n[e]=!1,`/./`[t](n)}catch{}}return!1},wP}var DP;function OP(){if(DP)return _P;DP=1;var e=z(),t=L(),n=CP(),r=hw(),i=TO(),a=EP(),o=t(``.indexOf);return e({target:`String`,proto:!0,forced:!a(`includes`)},{includes:function(e){return!!~o(i(r(this)),i(n(e)),arguments.length>1?arguments[1]:void 0)}}),_P}var kP,AP;function jP(){return AP?kP:(AP=1,OP(),kP=fD()(`String`,`includes`),kP)}var MP,NP;function PP(){if(NP)return MP;NP=1;var e=kw(),t=gP(),n=jP(),r=Array.prototype,i=String.prototype;return MP=function(a){var o=a.includes;return a===r||e(r,a)&&o===r.includes?t:typeof a==`string`||a===i||e(i,a)&&o===i.includes?n:o},MP}var FP,IP;function LP(){return IP?FP:(IP=1,FP=PP(),FP)}var RP,zP;function BP(){return zP?RP:(zP=1,RP=LP(),RP)}var VP=F(BP()),HP={},UP;function WP(){if(UP)return HP;UP=1;var e=z(),t=I(),n=_T(),r=ej(),i=ZA();return e({target:`Object`,stat:!0,forced:t(function(){r(1)}),sham:!i},{getPrototypeOf:function(e){return r(n(e))}}),HP}var GP,KP;function qP(){return KP?GP:(KP=1,WP(),GP=R().Object.getPrototypeOf,GP)}var JP,YP;function XP(){return YP?JP:(YP=1,JP=qP(),JP)}var ZP,QP;function $P(){return QP?ZP:(QP=1,ZP=XP(),ZP)}var eF=F($P()),tF,nF;function rF(){return nF?tF:(nF=1,bO(),tF=fD()(`Array`,`concat`),tF)}var iF,aF;function oF(){if(aF)return iF;aF=1;var e=kw(),t=rF(),n=Array.prototype;return iF=function(r){var i=r.concat;return r===n||e(n,r)&&i===n.concat?t:i},iF}var sF,cF;function lF(){return cF?sF:(cF=1,sF=oF(),sF)}var uF,dF;function fF(){return dF?uF:(dF=1,uF=lF(),uF)}var pF=F(fF()),mF={},hF;function gF(){if(hF)return mF;hF=1;var e=z(),t=yk().filter;return e({target:`Array`,proto:!0,forced:!vO()(`filter`)},{filter:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),mF}var _F,vF;function yF(){return vF?_F:(vF=1,gF(),_F=fD()(`Array`,`filter`),_F)}var bF,xF;function SF(){if(xF)return bF;xF=1;var e=kw(),t=yF(),n=Array.prototype;return bF=function(r){var i=r.filter;return r===n||e(n,r)&&i===n.filter?t:i},bF}var CF,wF;function TF(){return wF?CF:(wF=1,CF=SF(),CF)}var EF,DF;function OF(){return DF?EF:(DF=1,EF=TF(),EF)}var kF=F(OF()),AF={},jF,MF;function NF(){if(MF)return jF;MF=1;var e=ZC(),t=I(),n=L(),r=ej(),i=IE(),a=vw(),o=rw().f,s=n(o),c=n([].push),l=e&&t(function(){var e=Object.create(null);return e[2]=2,!s(e,2)}),u=function(t){return function(n){for(var o=a(n),u=i(o),d=l&&r(o)===null,f=u.length,p=0,m=[],h;f>p;)h=u[p++],(!e||(d?h in o:s(o,h)))&&c(m,t?[h,o[h]]:o[h]);return m}};return jF={entries:u(!0),values:u(!1)},jF}var PF;function FF(){if(PF)return AF;PF=1;var e=z(),t=NF().values;return e({target:`Object`,stat:!0},{values:function(e){return t(e)}}),AF}var IF,LF;function RF(){return LF?IF:(LF=1,FF(),IF=R().Object.values,IF)}var zF,BF;function VF(){return BF?zF:(BF=1,zF=RF(),zF)}var HF,UF;function WF(){return UF?HF:(UF=1,HF=VF(),HF)}var GF=F(WF()),KF={},qF,JF;function YF(){return JF?qF:(JF=1,qF=`
|
|
4
4
|
\v\f\r \xA0 \u2028\u2029`,qF)}var XF,ZF;function QF(){if(ZF)return XF;ZF=1;var e=L(),t=hw(),n=TO(),r=YF(),i=e(``.replace),a=RegExp(`^[`+r+`]+`),o=RegExp(`(^|[^`+r+`])[`+r+`]+$`),s=function(e){return function(r){var s=n(t(r));return e&1&&(s=i(s,a,``)),e&2&&(s=i(s,o,`$1`)),s}};return XF={start:s(1),end:s(2),trim:s(3)},XF}var $F,eI;function tI(){if(eI)return $F;eI=1;var e=OC(),t=I(),n=L(),r=TO(),i=QF().trim,a=YF(),o=e.parseInt,s=e.Symbol,c=s&&s.iterator,l=/^[+-]?0x/i,u=n(l.exec);return $F=o(a+`08`)!==8||o(a+`0x16`)!==22||c&&!t(function(){o(Object(c))})?function(e,t){var n=i(r(e));return o(n,t>>>0||(u(l,n)?16:10))}:o,$F}var nI;function rI(){if(nI)return KF;nI=1;var e=z(),t=tI();return e({global:!0,forced:parseInt!==t},{parseInt:t}),KF}var iI,aI;function oI(){return aI?iI:(aI=1,rI(),iI=R().parseInt,iI)}var sI,cI;function lI(){return cI?sI:(cI=1,sI=oI(),sI)}var uI,dI;function fI(){return dI?uI:(dI=1,uI=lI(),uI)}var pI=F(fI()),mI={},hI;function gI(){if(hI)return mI;hI=1;var e=z(),t=WC(),n=wE().indexOf,r=lN(),i=t([].indexOf),a=!!i&&1/i([1],1,-0)<0;return e({target:`Array`,proto:!0,forced:a||!r(`indexOf`)},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return a?i(this,e,t)||0:n(this,e,t)}}),mI}var _I,vI;function yI(){return vI?_I:(vI=1,gI(),_I=fD()(`Array`,`indexOf`),_I)}var bI,xI;function SI(){if(xI)return bI;xI=1;var e=kw(),t=yI(),n=Array.prototype;return bI=function(r){var i=r.indexOf;return r===n||e(n,r)&&i===n.indexOf?t:i},bI}var CI,wI;function TI(){return wI?CI:(wI=1,CI=SI(),CI)}var EI,DI;function OI(){return DI?EI:(DI=1,EI=TI(),EI)}var H=F(OI()),kI={},AI;function jI(){return AI?kI:(AI=1,z()({target:`Object`,stat:!0,sham:!ZC()},{create:LO()}),kI)}var MI,NI;function PI(){if(NI)return MI;NI=1,jI();var e=R().Object;return MI=function(t,n){return e.create(t,n)},MI}var FI,II;function LI(){return II?FI:(II=1,FI=PI(),FI)}var RI,zI;function BI(){return zI?RI:(zI=1,RI=LI(),RI)}var VI=F(BI()),HI={},UI,WI;function GI(){if(WI)return UI;WI=1;var e=fE(),t=TO(),n=hw(),r=RangeError;return UI=function(i){var a=t(n(this)),o=``,s=e(i);if(s<0||s===1/0)throw new r(`Wrong number of repetitions`);for(;s>0;(s>>>=1)&&(a+=a))s&1&&(o+=a);return o},UI}var KI,qI;function JI(){if(qI)return KI;qI=1;var e=L(),t=vE(),n=TO(),r=GI(),i=hw(),a=e(r),o=e(``.slice),s=Math.ceil,c=function(e){return function(r,c,l){var u=n(i(r)),d=t(c),f=u.length,p=l===void 0?` `:n(l),m,h;return d<=f||p===``?u:(m=d-f,h=a(p,s(m/p.length)),h.length>m&&(h=o(h,0,m)),e?u+h:h+u)}};return KI={start:c(!1),end:c(!0)},KI}var YI,XI;function ZI(){if(XI)return YI;XI=1;var e=L(),t=I(),n=JI().start,r=RangeError,i=isFinite,a=Math.abs,o=Date.prototype,s=o.toISOString,c=e(o.getTime),l=e(o.getUTCDate),u=e(o.getUTCFullYear),d=e(o.getUTCHours),f=e(o.getUTCMilliseconds),p=e(o.getUTCMinutes),m=e(o.getUTCMonth),h=e(o.getUTCSeconds);return YI=t(function(){return s.call(new Date(-50000000000001))!==`0385-07-25T07:06:39.999Z`})||!t(function(){s.call(new Date(NaN))})?function(){if(!i(c(this)))throw new r(`Invalid time value`);var e=this,t=u(e),o=f(e),s=t<0?`-`:t>9999?`+`:``;return s+n(a(t),s?6:4,0)+`-`+n(m(e)+1,2,0)+`-`+n(l(e),2,0)+`T`+n(d(e),2,0)+`:`+n(p(e),2,0)+`:`+n(h(e),2,0)+`.`+n(o,3,0)+`Z`}:s,YI}var QI;function $I(){if(QI)return HI;QI=1;var e=z(),t=ew(),n=_T(),r=kT(),i=ZI(),a=VC();return e({target:`Date`,proto:!0,forced:I()(function(){return new Date(NaN).toJSON()!==null||t(Date.prototype.toJSON,{toISOString:function(){return 1}})!==1})},{toJSON:function(e){var o=n(this),s=r(o,`number`);return typeof s==`number`&&!isFinite(s)?null:!(`toISOString`in o)&&a(o)===`Date`?t(i,o):o.toISOString()}}),HI}var eL,tL;function nL(){if(tL)return eL;tL=1,$I(),Ik();var e=R(),t=IC();return e.JSON||={stringify:JSON.stringify},eL=function(n,r,i){return t(e.JSON.stringify,null,arguments)},eL}var rL,iL;function aL(){return iL?rL:(iL=1,rL=nL(),rL)}var oL,sL;function cL(){return sL?oL:(sL=1,oL=aL(),oL)}var lL=F(cL()),uL={},dL={},fL,pL;function mL(){if(pL)return fL;pL=1;var e=OC(),t=Mw(),n=VC(),r=function(e){return t.slice(0,e.length)===e};return fL=(function(){return r(`Bun/`)?`BUN`:r(`Cloudflare-Workers`)?`CLOUDFLARE`:r(`Deno/`)?`DENO`:r(`Node.js/`)?`NODE`:e.Bun&&typeof Bun.version==`string`?`BUN`:e.Deno&&typeof Deno.version==`object`?`DENO`:n(e.process)===`process`?`NODE`:e.window&&e.document?`BROWSER`:`REST`})(),fL}var hL,gL;function _L(){if(gL)return hL;gL=1;var e=TypeError;return hL=function(t,n){if(t<n)throw new e(`Not enough arguments`);return t},hL}var vL,yL;function bL(){if(yL)return vL;yL=1;var e=OC(),t=IC(),n=qC(),r=mL(),i=Mw(),a=iD(),o=_L(),s=e.Function,c=/MSIE .\./.test(i)||r===`BUN`&&(function(){var t=e.Bun.version.split(`.`);return t.length<3||t[0]===`0`&&(t[1]<3||t[1]===`3`&&t[2]===`0`)})();return vL=function(e,r){var i=r?2:1;return c?function(c,l){var u=o(arguments.length,1)>i,d=n(c)?c:s(c),f=u?a(arguments,i):[],p=u?function(){t(d,this,f)}:d;return r?e(p,l):e(p)}:e},vL}var xL;function SL(){if(xL)return dL;xL=1;var e=z(),t=OC(),n=bL()(t.setInterval,!0);return e({global:!0,bind:!0,forced:t.setInterval!==n},{setInterval:n}),dL}var CL={},wL;function TL(){if(wL)return CL;wL=1;var e=z(),t=OC(),n=bL()(t.setTimeout,!0);return e({global:!0,bind:!0,forced:t.setTimeout!==n},{setTimeout:n}),CL}var EL;function DL(){return EL?uL:(EL=1,SL(),TL(),uL)}var OL,kL;function AL(){return kL?OL:(kL=1,DL(),OL=R().setTimeout,OL)}var jL,ML;function NL(){return ML?jL:(ML=1,jL=AL(),jL)}var PL=F(NL()),FL={},IL,LL;function RL(){if(LL)return IL;LL=1;var e=_T(),t=hE(),n=xE();return IL=function(r){for(var i=e(this),a=n(i),o=arguments.length,s=t(o>1?arguments[1]:void 0,a),c=o>2?arguments[2]:void 0,l=c===void 0?a:t(c,a);l>s;)i[s++]=r;return i},IL}var zL;function BL(){if(zL)return FL;zL=1;var e=z(),t=RL(),n=HA();return e({target:`Array`,proto:!0},{fill:t}),n(`fill`),FL}var VL,HL;function UL(){return HL?VL:(HL=1,BL(),VL=fD()(`Array`,`fill`),VL)}var WL,GL;function KL(){if(GL)return WL;GL=1;var e=kw(),t=UL(),n=Array.prototype;return WL=function(r){var i=r.fill;return r===n||e(n,r)&&i===n.fill?t:i},WL}var qL,JL;function YL(){return JL?qL:(JL=1,qL=KL(),qL)}var XL,ZL;function QL(){return ZL?XL:(ZL=1,XL=YL(),XL)}var $L=F(QL());function eR(){return eR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eR.apply(this,arguments)}function tR(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function nR(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var rR=typeof Object.assign==`function`?Object.assign:function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t},iR=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],aR=typeof document>`u`?{style:{}}:document.createElement(`div`),oR=`function`,sR=Math.round,cR=Math.abs,lR=Date.now;function uR(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<iR.length;){if(n=iR[a],r=n?n+i:t,r in e)return r;a++}}var dR=typeof window>`u`?{}:window,fR=uR(aR.style,`touchAction`),pR=fR!==void 0;function mR(){if(!pR)return!1;var e={},t=dR.CSS&&dR.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(n){return e[n]=t?dR.CSS.supports(`touch-action`,n):!0}),e}var hR=`compute`,gR=`auto`,_R=`manipulation`,vR=`none`,yR=`pan-x`,bR=`pan-y`,xR=mR(),SR=/mobile|tablet|ip(ad|hone|od)|android/i,CR=`ontouchstart`in dR,wR=uR(dR,`PointerEvent`)!==void 0,TR=CR&&SR.test(navigator.userAgent),ER=`touch`,DR=`pen`,OR=`mouse`,kR=`kinect`,AR=25,jR=1,MR=2,NR=4,PR=8,FR=1,IR=2,LR=4,RR=8,zR=16,BR=IR|LR,VR=RR|zR,HR=BR|VR,UR=[`x`,`y`],WR=[`clientX`,`clientY`];function GR(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==void 0)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function KR(e,t){return typeof e===oR?e.apply(t&&t[0]||void 0,t):e}function qR(e,t){return e.indexOf(t)>-1}function JR(e){if(qR(e,vR))return vR;var t=qR(e,yR),n=qR(e,bR);return t&&n?vR:t||n?t?yR:bR:qR(e,_R)?_R:gR}var YR=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===hR&&(e=this.compute()),pR&&this.manager.element.style&&xR[e]&&(this.manager.element.style[fR]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return GR(this.manager.recognizers,function(t){KR(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),JR(e.join(` `))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=qR(r,vR)&&!xR[vR],a=qR(r,bR)&&!xR[bR],o=qR(r,yR)&&!xR[yR];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&BR||o&&n&VR))return this.preventSrc(t)},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function XR(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function ZR(e){var t=e.length;if(t===1)return{x:sR(e[0].clientX),y:sR(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:sR(n/t),y:sR(r/t)}}function QR(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:sR(e.pointers[n].clientX),clientY:sR(e.pointers[n].clientY)},n++;return{timeStamp:lR(),pointers:t,center:ZR(t),deltaX:e.deltaX,deltaY:e.deltaY}}function $R(e,t,n){n||=UR;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function ez(e,t,n){n||=UR;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function tz(e,t){return e===t?FR:cR(e)>=cR(t)?e<0?IR:LR:t<0?RR:zR}function nz(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===jR||a.eventType===NR)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function rz(e,t,n){return{x:t/e||0,y:n/e||0}}function iz(e,t){return $R(t[0],t[1],WR)/$R(e[0],e[1],WR)}function az(e,t){return ez(t[1],t[0],WR)+ez(e[1],e[0],WR)}function oz(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,i,a,o,s;if(t.eventType!==PR&&(r>AR||n.velocity===void 0)){var c=t.deltaX-n.deltaX,l=t.deltaY-n.deltaY,u=rz(r,c,l);a=u.x,o=u.y,i=cR(u.x)>cR(u.y)?u.x:u.y,s=tz(c,l),e.lastInterval=t}else i=n.velocity,a=n.velocityX,o=n.velocityY,s=n.direction;t.velocity=i,t.velocityX=a,t.velocityY=o,t.direction=s}function sz(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=QR(t),i>1&&!n.firstMultiple?n.firstMultiple=QR(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=ZR(r);t.timeStamp=lR(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=ez(s,c),t.distance=$R(s,c),nz(n,t),t.offsetDirection=tz(t.deltaX,t.deltaY);var l=rz(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=cR(l.x)>cR(l.y)?l.x:l.y,t.scale=o?iz(o.pointers,r):1,t.rotation=o?az(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,oz(n,t);var u=e.element,d=t.srcEvent,f=d.composedPath?d.composedPath()[0]:d.path?d.path[0]:d.target;XR(f,u)&&(u=f),t.target=u}function cz(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&jR&&r-i===0,o=t&(NR|PR)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,sz(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function lz(e){return e.trim().split(/\s+/g)}function uz(e,t,n){GR(lz(t),function(t){e.addEventListener(t,n,!1)})}function dz(e,t,n){GR(lz(t),function(t){e.removeEventListener(t,n,!1)})}function fz(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var pz=function(){function e(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){KR(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&uz(this.element,this.evEl,this.domHandler),this.evTarget&&uz(this.target,this.evTarget,this.domHandler),this.evWin&&uz(fz(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&dz(this.element,this.evEl,this.domHandler),this.evTarget&&dz(this.target,this.evTarget,this.domHandler),this.evWin&&dz(fz(this.element),this.evWin,this.domHandler)},e}();function mz(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}var hz={pointerdown:jR,pointermove:MR,pointerup:NR,pointercancel:PR,pointerout:PR},gz={2:ER,3:DR,4:OR,5:kR},_z=`pointerdown`,vz=`pointermove pointerup pointercancel`;dR.MSPointerEvent&&!dR.PointerEvent&&(_z=`MSPointerDown`,vz=`MSPointerMove MSPointerUp MSPointerCancel`);var yz=function(e){tR(t,e);function t(){var n,r=t.prototype;return r.evEl=_z,r.evWin=vz,n=e.apply(this,arguments)||this,n.store=n.manager.session.pointerEvents=[],n}var n=t.prototype;return n.handler=function(e){var t=this.store,n=!1,r=hz[e.type.toLowerCase().replace(`ms`,``)],i=gz[e.pointerType]||e.pointerType,a=i===ER,o=mz(t,e.pointerId,`pointerId`);r&jR&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(NR|PR)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))},t}(pz);function bz(e){return Array.prototype.slice.call(e,0)}function xz(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];mz(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}var Sz={touchstart:jR,touchmove:MR,touchend:NR,touchcancel:PR},Cz=`touchstart touchmove touchend touchcancel`,wz=function(e){tR(t,e);function t(){var n;return t.prototype.evTarget=Cz,n=e.apply(this,arguments)||this,n.targetIds={},n}var n=t.prototype;return n.handler=function(e){var t=Sz[e.type],n=Tz.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:ER,srcEvent:e})},t}(pz);function Tz(e,t){var n=bz(e.touches),r=this.targetIds;if(t&(jR|MR)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=bz(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return XR(e.target,c)}),t===jR)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&(NR|PR)&&delete r[o[i].identifier],i++;if(s.length)return[xz(a.concat(s),`identifier`,!0),s]}var Ez={mousedown:jR,mousemove:MR,mouseup:NR},Dz=`mousedown`,Oz=`mousemove mouseup`,kz=function(e){tR(t,e);function t(){var n,r=t.prototype;return r.evEl=Dz,r.evWin=Oz,n=e.apply(this,arguments)||this,n.pressed=!1,n}var n=t.prototype;return n.handler=function(e){var t=Ez[e.type];t&jR&&e.button===0&&(this.pressed=!0),t&MR&&e.which!==1&&(t=NR),this.pressed&&(t&NR&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:OR,srcEvent:e}))},t}(pz),Az=2500,jz=25;function Mz(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(n),setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},Az)}}function Nz(e,t){e&jR?(this.primaryTouch=t.changedPointers[0].identifier,Mz.call(this,t)):e&(NR|PR)&&Mz.call(this,t)}function Pz(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=jz&&o<=jz)return!0}return!1}var Fz=function(){return function(e){tR(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.handler=function(e,t,n){var i=n.pointerType===ER,a=n.pointerType===OR;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)Nz.call(nR(nR(r)),t,n);else if(a&&Pz.call(nR(nR(r)),n))return;r.callback(e,t,n)}},r.touch=new wz(r.manager,r.handler),r.mouse=new kz(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}var n=t.prototype;return n.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(pz)}();function Iz(e){var t;return t=e.options.inputClass||(wR?yz:TR?wz:CR?Fz:kz),new t(e,cz)}function Lz(e,t,n){return Array.isArray(e)?(GR(e,n[t],n),!0):!1}var Rz=1,zz=2,Bz=4,Vz=8,Hz=Vz,Uz=16,Wz=32,Gz=1;function Kz(){return Gz++}function qz(e,t){var n=t.manager;return n?n.get(e):e}function Jz(e){return e&Uz?`cancel`:e&Vz?`end`:e&Bz?`move`:e&zz?`start`:``}var Yz=function(){function e(e){e===void 0&&(e={}),this.options=eR({enable:!0},e),this.id=Kz(),this.manager=null,this.state=Rz,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return rR(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(Lz(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=qz(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return Lz(e,`dropRecognizeWith`,this)?this:(e=qz(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(Lz(e,`requireFailure`,this))return this;var t=this.requireFail;return e=qz(e,this),mz(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(Lz(e,`dropRequireFailure`,this))return this;e=qz(e,this);var t=mz(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<Vz&&r(t.options.event+Jz(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=Vz&&r(t.options.event+Jz(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=Wz},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(Wz|Rz)))return!1;e++}return!0},t.recognize=function(e){var t=rR({},e);if(!KR(this.options.enable,[this,t])){this.reset(),this.state=Wz;return}this.state&(Hz|Uz|Wz)&&(this.state=Rz),this.state=this.process(t),this.state&(zz|Bz|Vz|Uz)&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),Xz=function(e){tR(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,eR({event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var n=t.prototype;return n.getTouchAction=function(){return[_R]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&jR&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==NR)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<n.interval:!0,s=!this.pCenter||$R(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!s||!o?this.count=1:this.count+=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=Hz,t.tryEmit()},n.interval),zz):Hz}return Wz},n.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=Wz},this.options.interval),Wz},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===Hz&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(Yz),Zz=function(e){tR(t,e);function t(t){return t===void 0&&(t={}),e.call(this,eR({pointers:1},t))||this}var n=t.prototype;return n.attrTest=function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,r=t&(zz|Bz),i=this.attrTest(e);return r&&(n&PR||!i)?t|Uz:r||i?n&NR?t|Vz:t&zz?t|Bz:zz:Wz},t}(Yz);function Qz(e){return e===zR?`down`:e===RR?`up`:e===IR?`left`:e===LR?`right`:``}var $z=function(e){tR(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,eR({event:`pan`,threshold:10,pointers:1,direction:HR},t))||this,n.pX=null,n.pY=null,n}var n=t.prototype;return n.getTouchAction=function(){var e=this.options.direction,t=[];return e&BR&&t.push(bR),e&VR&&t.push(yR),t},n.directionTest=function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&BR?(i=a===0?FR:a<0?IR:LR,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?FR:o<0?RR:zR,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return Zz.prototype.attrTest.call(this,e)&&(this.state&zz||!(this.state&zz)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=Qz(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(Zz),eB=function(e){tR(t,e);function t(t){return t===void 0&&(t={}),e.call(this,eR({event:`swipe`,threshold:10,velocity:.3,direction:BR|VR,pointers:1},t))||this}var n=t.prototype;return n.getTouchAction=function(){return $z.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n=this.options.direction,r;return n&(BR|VR)?r=t.overallVelocity:n&BR?r=t.overallVelocityX:n&VR&&(r=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&cR(r)>this.options.velocity&&t.eventType&NR},n.emit=function(e){var t=Qz(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(Zz),tB=function(e){tR(t,e);function t(t){return t===void 0&&(t={}),e.call(this,eR({event:`pinch`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[vR]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&zz)},n.emit=function(t){if(t.scale!==1){var n=t.scale<1?`in`:`out`;t.additionalEvent=this.options.event+n}e.prototype.emit.call(this,t)},t}(Zz),nB=function(e){tR(t,e);function t(t){return t===void 0&&(t={}),e.call(this,eR({event:`rotate`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[vR]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&zz)},t}(Zz),rB=function(e){tR(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,eR({event:`press`,pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var n=t.prototype;return n.getTouchAction=function(){return[gR]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime>n.time;if(this._input=e,!i||!r||e.eventType&(NR|PR)&&!a)this.reset();else if(e.eventType&jR)this.reset(),this._timer=setTimeout(function(){t.state=Hz,t.tryEmit()},n.time);else if(e.eventType&NR)return Hz;return Wz},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===Hz&&(e&&e.eventType&NR?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=lR(),this.manager.emit(this.options.event,this._input)))},t}(Yz),iB={domEvents:!1,touchAction:hR,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},aB=[[nB,{enable:!1}],[tB,{enable:!1},[`rotate`]],[eB,{direction:BR}],[$z,{direction:BR},[`swipe`]],[Xz],[Xz,{event:`doubletap`,taps:2},[`tap`]],[rB]],oB=1,sB=2;function cB(e,t){var n=e.element;if(n.style){var r;GR(e.options.cssProps,function(i,a){r=uR(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function lB(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var uB=function(){function e(e,t){var n=this;this.options=rR({},iB,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=Iz(this),this.touchAction=new YR(this,this.options.touchAction),cB(this,!0),GR(this.options.recognizers,function(e){var t=n.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return rR(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?sB:oB},t.recognize=function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&Hz)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==sB&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(zz|Bz|Vz)&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof Yz)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(Lz(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(Lz(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=mz(n,t);r!==-1&&(n.splice(r,1),this.touchAction.update())}return this},t.on=function(e,t){if(e===void 0||t===void 0)return this;var n=this.handlers;return GR(lz(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},t.off=function(e,t){if(e===void 0)return this;var n=this.handlers;return GR(lz(e),function(e){t?n[e]&&n[e].splice(mz(n[e],t),1):delete n[e]}),this},t.emit=function(e,t){this.options.domEvents&&lB(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(!(!n||!n.length)){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},t.destroy=function(){this.element&&cB(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),dB={touchstart:jR,touchmove:MR,touchend:NR,touchcancel:PR},fB=`touchstart`,pB=`touchstart touchmove touchend touchcancel`,mB=function(e){tR(t,e);function t(){var n,r=t.prototype;return r.evTarget=fB,r.evWin=pB,n=e.apply(this,arguments)||this,n.started=!1,n}var n=t.prototype;return n.handler=function(e){var t=dB[e.type];if(t===jR&&(this.started=!0),this.started){var n=hB.call(this,e,t);t&(NR|PR)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:ER,srcEvent:e})}},t}(pz);function hB(e,t){var n=bz(e.touches),r=bz(e.changedTouches);return t&(NR|PR)&&(n=xz(n.concat(r),`identifier`,!0)),[n,r]}function gB(e,t,n){var r=`DEPRECATED METHOD: `+t+`
|
|
@@ -23,4 +23,4 @@ var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u
|
|
|
23
23
|
`,AV()):K+=G,AV();if(G!=`"`)throw KV(`End of string " expected`);AV(),OV=wV.IDENTIFIER;return}for(OV=wV.UNKNOWN;G!=``;)K+=G,AV();throw SyntaxError(`Syntax error in part "`+qV(K,30)+`"`)}function RV(){var e={};if(kV(),q(),K===`strict`&&(e.strict=!0,q()),(K===`graph`||K===`digraph`)&&(e.type=K,q()),OV===wV.IDENTIFIER&&(e.id=K,q()),K!=`{`)throw KV(`Angle bracket { expected`);if(q(),zV(e),K!=`}`)throw KV(`Angle bracket } expected`);if(q(),K!==``)throw KV(`End of file expected`);return q(),delete e.node,delete e.edge,delete e.graph,e}function zV(e){for(;K!==``&&K!=`}`;)BV(e),K===`;`&&q()}function BV(e){var t=VV(e);if(t){WV(e,t);return}if(!HV(e)){if(OV!=wV.IDENTIFIER)throw KV(`Identifier expected`);var n=K;if(q(),K===`=`){if(q(),OV!=wV.IDENTIFIER)throw KV(`Identifier expected`);e[n]=K,q()}else UV(e,n)}}function VV(e){var t=null;if(K===`subgraph`&&(t={},t.type=`subgraph`,q(),OV===wV.IDENTIFIER&&(t.id=K,q())),K===`{`){if(q(),t||={},t.parent=e,t.node=e.node,t.edge=e.edge,t.graph=e.graph,zV(t),K!=`}`)throw KV(`Angle bracket } expected`);q(),delete t.node,delete t.edge,delete t.graph,delete t.parent,e.subgraphs||=[],e.subgraphs.push(t)}return t}function HV(e){return K===`node`?(q(),e.node=GV(),`node`):K===`edge`?(q(),e.edge=GV(),`edge`):K===`graph`?(q(),e.graph=GV(),`graph`):null}function UV(e,t){var n={id:t},r=GV();r&&(n.attr=r),FV(e,n),WV(e,t)}function WV(e,t){for(;K===`->`||K===`--`;){var n,r=K;q();var i=VV(e);if(i)n=i;else{if(OV!=wV.IDENTIFIER)throw KV(`Identifier or subgraph expected`);n=K,FV(e,{id:n}),q()}var a=GV();IV(e,LV(e,t,n,r,a)),t=n}}function GV(){for(var e,t=null,n={dashed:!0,solid:!1,dotted:[1,5]},r={dot:`circle`,box:`box`,crow:`crow`,curve:`curve`,icurve:`inv_curve`,normal:`triangle`,inv:`inv_triangle`,diamond:`diamond`,tee:`bar`,vee:`vee`},i=[],a=[];K===`[`;){for(q(),t={};K!==``&&K!=`]`;){if(OV!=wV.IDENTIFIER)throw KV(`Attribute name expected`);var o=K;if(q(),K!=`=`)throw KV(`Equal sign = expected`);if(q(),OV!=wV.IDENTIFIER)throw KV(`Attribute value expected`);var s=K;o===`style`&&(s=n[s]);var c;o===`arrowhead`&&(c=r[s],o=`arrows`,s={to:{enabled:!0,type:c}}),o===`arrowtail`&&(c=r[s],o=`arrows`,s={from:{enabled:!0,type:c}}),i.push({attr:t,name:o,value:s}),a.push(o),q(),K==`,`&&q()}if(K!=`]`)throw KV(`Bracket ] expected`);q()}if(VP(a).call(a,`dir`)){var l={};for(l.arrows={},e=0;e<i.length;e++)if(i[e].name===`arrows`)if(i[e].value.to!=null)l.arrows.to=e;else if(i[e].value.from!=null)l.arrows.from=e;else throw KV(`Invalid value of arrows`);else i[e].name===`dir`&&(l.dir=e);var u=i[l.dir].value;if(!VP(a).call(a,`arrows`))if(u===`both`)i.push({attr:i[l.dir].attr,name:`arrows`,value:{to:{enabled:!0}}}),l.arrows.to=i.length-1,i.push({attr:i[l.dir].attr,name:`arrows`,value:{from:{enabled:!0}}}),l.arrows.from=i.length-1;else if(u===`forward`)i.push({attr:i[l.dir].attr,name:`arrows`,value:{to:{enabled:!0}}}),l.arrows.to=i.length-1;else if(u===`back`)i.push({attr:i[l.dir].attr,name:`arrows`,value:{from:{enabled:!0}}}),l.arrows.from=i.length-1;else if(u===`none`)i.push({attr:i[l.dir].attr,name:`arrows`,value:``}),l.arrows.to=i.length-1;else throw KV(`Invalid dir type "`+u+`"`);var d,f;if(u===`both`)l.arrows.to&&l.arrows.from?(f=i[l.arrows.to].value.to.type,d=i[l.arrows.from].value.from.type,i[l.arrows.to]={attr:i[l.arrows.to].attr,name:i[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:d}}},uP(i).call(i,l.arrows.from,1)):l.arrows.to?(f=i[l.arrows.to].value.to.type,d=`arrow`,i[l.arrows.to]={attr:i[l.arrows.to].attr,name:i[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:d}}}):l.arrows.from&&(f=`arrow`,d=i[l.arrows.from].value.from.type,i[l.arrows.from]={attr:i[l.arrows.from].attr,name:i[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:d}}});else if(u===`back`)l.arrows.to&&l.arrows.from?(f=``,d=i[l.arrows.from].value.from.type,i[l.arrows.from]={attr:i[l.arrows.from].attr,name:i[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:d}}}):l.arrows.to?(f=``,d=`arrow`,l.arrows.from=l.arrows.to,i[l.arrows.from]={attr:i[l.arrows.from].attr,name:i[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:d}}}):l.arrows.from&&(f=``,d=i[l.arrows.from].value.from.type,i[l.arrows.to]={attr:i[l.arrows.from].attr,name:i[l.arrows.from].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:d}}}),i[l.arrows.from]={attr:i[l.arrows.from].attr,name:i[l.arrows.from].name,value:{from:{enabled:!0,type:i[l.arrows.from].value.from.type}}};else if(u===`none`){var p=l.arrows.to?l.arrows.to:l.arrows.from;i[p]={attr:i[p].attr,name:i[p].name,value:``}}else if(u===`forward`)l.arrows.to&&l.arrows.from||l.arrows.to?(f=i[l.arrows.to].value.to.type,d=``,i[l.arrows.to]={attr:i[l.arrows.to].attr,name:i[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:d}}}):l.arrows.from&&(f=`arrow`,d=``,l.arrows.to=l.arrows.from,i[l.arrows.to]={attr:i[l.arrows.to].attr,name:i[l.arrows.to].name,value:{to:{enabled:!0,type:f},from:{enabled:!0,type:d}}}),i[l.arrows.to]={attr:i[l.arrows.to].attr,name:i[l.arrows.to].name,value:{to:{enabled:!0,type:i[l.arrows.to].value.to.type}}};else throw KV(`Invalid dir type "`+u+`"`);uP(i).call(i,l.dir,1)}var m;if(VP(a).call(a,`penwidth`)){var h=[];for(m=i.length,e=0;e<m;e++)i[e].name!==`width`&&(i[e].name===`penwidth`&&(i[e].name=`width`),h.push(i[e]));i=h}for(m=i.length,e=0;e<m;e++)PV(i[e].attr,i[e].name,i[e].value);return t}function KV(e){return SyntaxError(e+`, got "`+qV(K,30)+`" (char `+DV+`)`)}function qV(e,t){return e.length<=t?e:e.substr(0,27)+`...`}function JV(e,t,n){_M(e)?V(e).call(e,function(e){_M(t)?V(t).call(t,function(t){n(e,t)}):n(e,t)}):_M(t)?V(t).call(t,function(t){n(e,t)}):n(e,t)}function YV(e,t,n){for(var r=t.split(`.`),i=r.pop(),a=e,o=0;o<r.length;o++){var s=r[o];s in a||(a[s]={}),a=a[s]}return a[i]=n,e}function XV(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=t[r];_M(i)?V(i).call(i,function(t){YV(n,t,e[r])}):typeof i==`string`?YV(n,i,e[r]):YV(n,r,e[r])}return n}function ZV(e){var t=xV(e),n={nodes:[],edges:[],options:{}};if(t.nodes){var r;V(r=t.nodes).call(r,function(e){var t={id:e.id,label:String(e.label||e.id)};NV(t,XV(e.attr,SV)),t.image&&(t.shape=`image`),n.nodes.push(t)})}if(t.edges){var i,a=function(e){var t={from:e.from,to:e.to};return NV(t,XV(e.attr,CV)),t.arrows==null&&e.type===`->`&&(t.arrows=`to`),t};V(i=t.edges).call(i,function(e){var t=e.from instanceof Object?e.from.nodes:{id:e.from},r=e.to instanceof Object?e.to.nodes:{id:e.to};if(e.from instanceof Object&&e.from.edges){var i;V(i=e.from.edges).call(i,function(e){var t=a(e);n.edges.push(t)})}if(JV(t,r,function(t,r){var i=a(LV(n,t.id,r.id,e.type,e.attr));n.edges.push(i)}),e.to instanceof Object&&e.to.edges){var o;V(o=e.to.edges).call(o,function(e){var t=a(e);n.edges.push(t)})}})}return t.attr&&(n.options=t.attr),n}function QV(e,t){var n;let r={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};t!=null&&(t.fixed!=null&&(r.nodes.fixed=t.fixed),t.parseColor!=null&&(r.nodes.parseColor=t.parseColor),t.inheritColor!=null&&(r.edges.inheritColor=t.inheritColor));let i=e.edges,a=NM(i).call(i,e=>{let t={from:e.source,id:e.id,to:e.target};return e.attributes!=null&&(t.attributes=e.attributes),e.label!=null&&(t.label=e.label),e.attributes!=null&&e.attributes.title!=null&&(t.title=e.attributes.title),e.type===`Directed`&&(t.arrows=`to`),e.color&&r.edges.inheritColor===!1&&(t.color=e.color),t});return{nodes:NM(n=e.nodes).call(n,e=>{let t={id:e.id,fixed:r.nodes.fixed&&e.x!=null&&e.y!=null};return e.attributes!=null&&(t.attributes=e.attributes),e.label!=null&&(t.label=e.label),e.size!=null&&(t.size=e.size),e.attributes!=null&&e.attributes.title!=null&&(t.title=e.attributes.title),e.title!=null&&(t.title=e.title),e.x!=null&&(t.x=e.x),e.y!=null&&(t.y=e.y),e.color!=null&&(r.nodes.parseColor===!0?t.color=e.color:t.color={background:e.color,border:e.color,highlight:{background:e.color,border:e.color},hover:{background:e.color,border:e.color}}),t}),edges:a}}var $V=Object.freeze({__proto__:null,cn:{addDescription:`单击空白处放置新节点。`,addEdge:`添加连接线`,addNode:`添加节点`,back:`返回`,close:`關閉`,createEdgeError:`无法将连接线连接到群集。`,del:`删除选定`,deleteClusterError:`无法删除群集。`,edgeDescription:`单击某个节点并将该连接线拖动到另一个节点以连接它们。`,edit:`编辑`,editClusterError:`无法编辑群集。`,editEdge:`编辑连接线`,editEdgeDescription:`单击控制节点并将它们拖到节点上连接。`,editNode:`编辑节点`},cs:{addDescription:`Kluknutím do prázdného prostoru můžete přidat nový vrchol.`,addEdge:`Přidat hranu`,addNode:`Přidat vrchol`,back:`Zpět`,close:`Zavřít`,createEdgeError:`Nelze připojit hranu ke shluku.`,del:`Smazat výběr`,deleteClusterError:`Nelze mazat shluky.`,edgeDescription:`Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.`,edit:`Upravit`,editClusterError:`Nelze upravovat shluky.`,editEdge:`Upravit hranu`,editEdgeDescription:`Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.`,editNode:`Upravit vrchol`},de:{addDescription:`Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.`,addEdge:`Kante hinzufügen`,addNode:`Knoten hinzufügen`,back:`Zurück`,close:`Schließen`,createEdgeError:`Es ist nicht möglich, Kanten mit Clustern zu verbinden.`,del:`Lösche Auswahl`,deleteClusterError:`Cluster können nicht gelöscht werden.`,edgeDescription:`Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.`,edit:`Editieren`,editClusterError:`Cluster können nicht editiert werden.`,editEdge:`Kante editieren`,editEdgeDescription:`Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.`,editNode:`Knoten editieren`},en:{addDescription:`Click in an empty space to place a new node.`,addEdge:`Add Edge`,addNode:`Add Node`,back:`Back`,close:`Close`,createEdgeError:`Cannot link edges to a cluster.`,del:`Delete selected`,deleteClusterError:`Clusters cannot be deleted.`,edgeDescription:`Click on a node and drag the edge to another node to connect them.`,edit:`Edit`,editClusterError:`Clusters cannot be edited.`,editEdge:`Edit Edge`,editEdgeDescription:`Click on the control points and drag them to a node to connect to it.`,editNode:`Edit Node`},es:{addDescription:`Haga clic en un lugar vacío para colocar un nuevo nodo.`,addEdge:`Añadir arista`,addNode:`Añadir nodo`,back:`Atrás`,close:`Cerrar`,createEdgeError:`No se puede conectar una arista a un grupo.`,del:`Eliminar selección`,deleteClusterError:`No es posible eliminar grupos.`,edgeDescription:`Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.`,edit:`Editar`,editClusterError:`No es posible editar grupos.`,editEdge:`Editar arista`,editEdgeDescription:`Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.`,editNode:`Editar nodo`},fr:{addDescription:`Cliquez dans un endroit vide pour placer un nœud.`,addEdge:`Ajouter un lien`,addNode:`Ajouter un nœud`,back:`Retour`,close:`Fermer`,createEdgeError:`Impossible de créer un lien vers un cluster.`,del:`Effacer la sélection`,deleteClusterError:`Les clusters ne peuvent pas être effacés.`,edgeDescription:`Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.`,edit:`Éditer`,editClusterError:`Les clusters ne peuvent pas être édités.`,editEdge:`Éditer le lien`,editEdgeDescription:`Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.`,editNode:`Éditer le nœud`},it:{addDescription:`Clicca per aggiungere un nuovo nodo`,addEdge:`Aggiungi un vertice`,addNode:`Aggiungi un nodo`,back:`Indietro`,close:`Chiudere`,createEdgeError:`Non si possono collegare vertici ad un cluster`,del:`Cancella la selezione`,deleteClusterError:`I cluster non possono essere cancellati`,edgeDescription:`Clicca su un nodo e trascinalo ad un altro nodo per connetterli.`,edit:`Modifica`,editClusterError:`I clusters non possono essere modificati.`,editEdge:`Modifica il vertice`,editEdgeDescription:`Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.`,editNode:`Modifica il nodo`},nl:{addDescription:`Klik op een leeg gebied om een nieuwe node te maken.`,addEdge:`Link toevoegen`,addNode:`Node toevoegen`,back:`Terug`,close:`Sluiten`,createEdgeError:`Kan geen link maken naar een cluster.`,del:`Selectie verwijderen`,deleteClusterError:`Clusters kunnen niet worden verwijderd.`,edgeDescription:`Klik op een node en sleep de link naar een andere node om ze te verbinden.`,edit:`Wijzigen`,editClusterError:`Clusters kunnen niet worden aangepast.`,editEdge:`Link wijzigen`,editEdgeDescription:`Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.`,editNode:`Node wijzigen`},pt:{addDescription:`Clique em um espaço em branco para adicionar um novo nó`,addEdge:`Adicionar aresta`,addNode:`Adicionar nó`,back:`Voltar`,close:`Fechar`,createEdgeError:`Não foi possível linkar arestas a um cluster.`,del:`Remover selecionado`,deleteClusterError:`Clusters não puderam ser removidos.`,edgeDescription:`Clique em um nó e arraste a aresta até outro nó para conectá-los`,edit:`Editar`,editClusterError:`Clusters não puderam ser editados.`,editEdge:`Editar aresta`,editEdgeDescription:`Clique nos pontos de controle e os arraste para um nó para conectá-los`,editNode:`Editar nó`},ru:{addDescription:`Кликните в свободное место, чтобы добавить новый узел.`,addEdge:`Добавить ребро`,addNode:`Добавить узел`,back:`Назад`,close:`Закрывать`,createEdgeError:`Невозможно соединить ребра в кластер.`,del:`Удалить выбранное`,deleteClusterError:`Кластеры не могут быть удалены`,edgeDescription:`Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.`,edit:`Редактировать`,editClusterError:`Кластеры недоступны для редактирования.`,editEdge:`Редактировать ребро`,editEdgeDescription:`Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.`,editNode:`Редактировать узел`},uk:{addDescription:`Kлікніть на вільне місце, щоб додати новий вузол.`,addEdge:`Додати край`,addNode:`Додати вузол`,back:`Назад`,close:`Закрити`,createEdgeError:`Не можливо об'єднати краї в групу.`,del:`Видалити обране`,deleteClusterError:`Групи не можуть бути видалені.`,edgeDescription:`Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.`,edit:`Редагувати`,editClusterError:`Групи недоступні для редагування.`,editEdge:`Редагувати край`,editEdgeDescription:`Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.`,editNode:`Редагувати вузол`}});function eH(e,t){try{let[r,i]=t.split(/[-_ /]/,2),a=r==null?null:r.toLowerCase(),o=i==null?null:i.toUpperCase();if(a&&o){let t=a+`-`+o;if(Object.prototype.hasOwnProperty.call(e,t))return t;var n;console.warn(pF(n=`Unknown variant ${o} of language `).call(n,a,`.`))}if(a){let t=a;if(Object.prototype.hasOwnProperty.call(e,t))return t;console.warn(`Unknown language ${a}`)}return console.warn(`Unknown locale ${t}, falling back to English.`),`en`}catch(e){return console.error(e),console.warn(`Unexpected error while normalizing locale ${t}, falling back to English.`),`en`}}var tH=class{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement(`canvas`)}init(){if(this.initialized())return;this.src=this.image.src;let e=this.image.width,t=this.image.height;this.width=e,this.height=t;let n=Math.floor(t/2),r=Math.floor(t/4),i=Math.floor(t/8),a=Math.floor(t/16),o=Math.floor(e/2),s=Math.floor(e/4),c=Math.floor(e/8),l=Math.floor(e/16);this.canvas.width=3*s,this.canvas.height=n,this.coordinates=[[0,0,o,n],[o,0,s,r],[o,r,c,i],[5*c,r,l,a]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){let e=this.canvas.getContext(`2d`),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(let t=1;t<this.NUM_ITERATIONS;t++){let n=this.coordinates[t-1],r=this.coordinates[t];e.drawImage(this.canvas,n[0],n[1],n[2],n[3],r[0],r[1],r[2],r[3])}}drawImageAtPosition(e,t,n,r,i,a){if(this.initialized())if(t>2){t*=.5;let o=0;for(;t>2&&o<this.NUM_ITERATIONS;)t*=.5,o+=1;o>=this.NUM_ITERATIONS&&(o=this.NUM_ITERATIONS-1);let s=this.coordinates[o];e.drawImage(this.canvas,s[0],s[1],s[2],s[3],n,r,i,a)}else e.drawImage(this.image,n,r,i,a)}},nH=class{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,t,n){if(!(e===void 0||n===void 0)){if(t===void 0){console.warn(`No broken url image defined`);return}n.image.onerror=()=>{console.error(`Could not load brokenImage:`,t)},n.image.src=t}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,t){let n=this.images[e];if(n)return n;let r=new tH;return this.images[e]=r,r.image.onload=()=>{this._fixImageCoordinates(r.image),r.init(),this._redrawWithImage(r)},r.image.onerror=()=>{console.error(`Could not load image:`,e),this._tryloadBrokenUrl(e,t,r)},r.image.src=e,r}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}},rH={},iH={},aH={exports:{}},oH,sH;function cH(){return sH?oH:(sH=1,oH=I()(function(){if(typeof ArrayBuffer==`function`){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,`a`,{value:8})}}),oH)}var lH,uH;function dH(){if(uH)return lH;uH=1;var e=I(),t=xw(),n=VC(),r=cH(),i=Object.isExtensible;return lH=e(function(){})||r?function(e){return!t(e)||r&&n(e)===`ArrayBuffer`?!1:i?i(e):!0}:i,lH}var fH,pH;function mH(){return pH?fH:(pH=1,fH=!I()(function(){return Object.isExtensible(Object.preventExtensions({}))}),fH)}var hH;function gH(){if(hH)return aH.exports;hH=1;var e=z(),t=L(),n=DE(),r=xw(),i=bT(),a=tE().f,o=BO(),s=UO(),c=dH(),l=CT(),u=mH(),d=!1,f=l(`meta`),p=0,m=function(e){a(e,f,{value:{objectID:`O`+ p++,weakData:{}}})},h=aH.exports={enable:function(){h.enable=function(){},d=!0;var n=o.f,r=t([].splice),i={};i[f]=1,n(i).length&&(o.f=function(e){for(var t=n(e),i=0,a=t.length;i<a;i++)if(t[i]===f){r(t,i,1);break}return t},e({target:`Object`,stat:!0,forced:!0},{getOwnPropertyNames:s.f}))},fastKey:function(e,t){if(!r(e))return typeof e==`symbol`?e:(typeof e==`string`?`S`:`P`)+e;if(!i(e,f)){if(!c(e))return`F`;if(!t)return`E`;m(e)}return e[f].objectID},getWeakData:function(e,t){if(!i(e,f)){if(!c(e))return!0;if(!t)return!1;m(e)}return e[f].weakData},onFreeze:function(e){return u&&d&&c(e)&&!i(e,f)&&m(e),e}};return n[f]=!0,aH.exports}var _H,vH;function yH(){if(vH)return _H;vH=1;var e=ET(),t=GA(),n=e(`iterator`),r=Array.prototype;return _H=function(e){return e!==void 0&&(t.Array===e||r[n]===e)},_H}var bH,xH;function SH(){if(xH)return bH;xH=1;var e=rO(),t=$w(),n=fw(),r=GA(),i=ET()(`iterator`);return bH=function(a){if(!n(a))return t(a,i)||t(a,`@@iterator`)||r[e(a)]},bH}var CH,wH;function TH(){if(wH)return CH;wH=1;var e=ew(),t=Xw(),n=$T(),r=qw(),i=SH(),a=TypeError;return CH=function(o,s){var c=arguments.length<2?i(o):s;if(t(c))return n(e(c,o));throw new a(r(o)+` is not iterable`)},CH}var EH,DH;function OH(){if(DH)return EH;DH=1;var e=ew(),t=$T(),n=$w();return EH=function(r,i,a){var o,s;t(r);try{if(o=n(r,`return`),!o){if(i===`throw`)throw a;return a}o=e(o,r)}catch(e){s=!0,o=e}if(i===`throw`)throw a;if(s)throw o;return t(o),a},EH}var kH,AH;function jH(){if(AH)return kH;AH=1;var e=KT(),t=ew(),n=$T(),r=qw(),i=yH(),a=xE(),o=kw(),s=TH(),c=SH(),l=OH(),u=TypeError,d=function(e,t){this.stopped=e,this.result=t},f=d.prototype;return kH=function(p,m,h){var g=h&&h.that,_=!!(h&&h.AS_ENTRIES),v=!!(h&&h.IS_RECORD),y=!!(h&&h.IS_ITERATOR),b=!!(h&&h.INTERRUPTED),x=e(m,g),S,C,w,T,E,D,ee,te=function(e){return S&&l(S,`normal`),new d(!0,e)},O=function(e){return _?(n(e),b?x(e[0],e[1],te):x(e[0],e[1])):b?x(e,te):x(e)};if(v)S=p.iterator;else if(y)S=p;else{if(C=c(p),!C)throw new u(r(p)+` is not iterable`);if(i(C)){for(w=0,T=a(p);T>w;w++)if(E=O(p[w]),E&&o(f,E))return E;return new d(!1)}S=s(p,C)}for(D=v?p.next:S.next;!(ee=t(D,S)).done;){try{E=O(ee.value)}catch(e){l(S,`throw`,e)}if(typeof E==`object`&&E&&o(f,E))return E}return new d(!1)},kH}var MH,NH;function PH(){if(NH)return MH;NH=1;var e=kw(),t=TypeError;return MH=function(n,r){if(e(r,n))return n;throw new t(`Incorrect invocation`)},MH}var FH,IH;function LH(){if(IH)return FH;IH=1;var e=z(),t=OC(),n=gH(),r=I(),i=iE(),a=jH(),o=PH(),s=qC(),c=xw(),l=fw(),u=uk(),d=tE().f,f=yk().forEach,p=ZC(),m=gk(),h=m.set,g=m.getterFor;return FH=function(m,_,v){var y=m.indexOf(`Map`)!==-1,b=m.indexOf(`Weak`)!==-1,x=y?`set`:`add`,S=t[m],C=S&&S.prototype,w={},T;if(!p||!s(S)||!(b||C.forEach&&!r(function(){new S().entries().next()})))T=v.getConstructor(_,m,y,x),n.enable();else{T=_(function(e,t){h(o(e,E),{type:m,collection:new S}),l(t)||a(t,e[x],{that:e,AS_ENTRIES:y})});var E=T.prototype,D=g(m);f([`add`,`clear`,`delete`,`forEach`,`get`,`has`,`set`,`keys`,`values`,`entries`],function(e){var t=e===`add`||e===`set`;e in C&&!(b&&e===`clear`)&&i(E,e,function(n,r){var i=D(this).collection;if(!t&&b&&!c(n))return e===`get`?void 0:!1;var a=i[e](n===0?0:n,r);return t?this:a})}),b||d(E,`size`,{configurable:!0,get:function(){return D(this).collection.size}})}return u(T,m,!1,!0),w[m]=T,e({global:!0,forced:!0},w),b||v.setStrong(T,m,y),T},FH}var RH,zH;function BH(){if(zH)return RH;zH=1;var e=KO();return RH=function(t,n,r){for(var i in n)r&&r.unsafe&&t[i]?t[i]=n[i]:e(t,i,n[i],r);return t},RH}var VH,HH;function UH(){if(HH)return VH;HH=1;var e=Ew(),t=YO(),n=ET(),r=ZC(),i=n(`species`);return VH=function(n){var a=e(n);r&&a&&!a[i]&&t(a,i,{configurable:!0,get:function(){return this}})},VH}var WH,GH;function KH(){if(GH)return WH;GH=1;var e=LO(),t=YO(),n=BH(),r=KT(),i=PH(),a=fw(),o=jH(),s=xj(),c=wj(),l=UH(),u=ZC(),d=gH().fastKey,f=gk(),p=f.set,m=f.getterFor;return WH={getConstructor:function(s,c,l,f){var h=s(function(t,n){i(t,g),p(t,{type:c,index:e(null),first:null,last:null,size:0}),u||(t.size=0),a(n)||o(n,t[f],{that:t,AS_ENTRIES:l})}),g=h.prototype,_=m(c),v=function(e,t,n){var r=_(e),i=y(e,t),a,o;return i?i.value=n:(r.last=i={index:o=d(t,!0),key:t,value:n,previous:a=r.last,next:null,removed:!1},r.first||=i,a&&(a.next=i),u?r.size++:e.size++,o!==`F`&&(r.index[o]=i)),e},y=function(e,t){var n=_(e),r=d(t),i;if(r!==`F`)return n.index[r];for(i=n.first;i;i=i.next)if(i.key===t)return i};return n(g,{clear:function(){for(var t=this,n=_(t),r=n.first;r;)r.removed=!0,r.previous&&=r.previous.next=null,r=r.next;n.first=n.last=null,n.index=e(null),u?n.size=0:t.size=0},delete:function(e){var t=this,n=_(t),r=y(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),u?n.size--:t.size--}return!!r},forEach:function(e){for(var t=_(this),n=r(e,arguments.length>1?arguments[1]:void 0),i;i=i?i.next:t.first;)for(n(i.value,i.key,this);i&&i.removed;)i=i.previous},has:function(e){return!!y(this,e)}}),n(g,l?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return v(this,e===0?0:e,t)}}:{add:function(e){return v(this,e=e===0?0:e,e)}}),u&&t(g,`size`,{configurable:!0,get:function(){return _(this).size}}),h},setStrong:function(e,t,n){var r=t+` Iterator`,i=m(t),a=m(r);s(e,t,function(e,t){p(this,{type:r,target:e,state:i(e),kind:t,last:null})},function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return!e.target||!(e.last=n=n?n.next:e.state.first)?(e.target=null,c(void 0,!0)):c(t===`keys`?n.key:t===`values`?n.value:[n.key,n.value],!1)},n?`entries`:`values`,!n,!0),l(t)}},WH}var qH;function JH(){return qH?iH:(qH=1,LH()(`Map`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},KH()),iH)}var YH;function XH(){return YH?rH:(YH=1,JH(),rH)}var ZH={},QH,$H;function eU(){return $H?QH:($H=1,QH=function(e,t){return t===1?function(t,n){return t[e](n)}:function(t,n,r){return t[e](n,r)}},QH)}var tU,nU;function rU(){if(nU)return tU;nU=1;var e=Ew(),t=eU(),n=e(`Map`);return tU={Map:n,set:t(`set`,2),get:t(`get`,1),has:t(`has`,1),remove:t(`delete`,1),proto:n.prototype},tU}var iU;function aU(){if(iU)return ZH;iU=1;var e=z(),t=L(),n=Xw(),r=hw(),i=jH(),a=rU(),o=oT(),s=I(),c=a.Map,l=a.has,u=a.get,d=a.set,f=t([].push),p=o||s(function(){return c.groupBy(`ab`,function(e){return e}).get(`a`).length!==1});return e({target:`Map`,stat:!0,forced:o||p},{groupBy:function(e,t){r(e),n(t);var a=new c,o=0;return i(e,function(e){var n=t(e,o++);l(a,n)?f(u(a,n),e):d(a,n,[e])}),a}}),ZH}var oU={},sU,cU;function lU(){if(cU)return sU;cU=1;var e=L(),t=fE(),n=TO(),r=hw(),i=e(``.charAt),a=e(``.charCodeAt),o=e(``.slice),s=function(e){return function(s,c){var l=n(r(s)),u=t(c),d=l.length,f,p;return u<0||u>=d?e?``:void 0:(f=a(l,u),f<55296||f>56319||u+1===d||(p=a(l,u+1))<56320||p>57343?e?i(l,u):f:e?o(l,u,u+2):(f-55296<<10)+(p-56320)+65536)}};return sU={codeAt:s(!1),charAt:s(!0)},sU}var uU;function dU(){if(uU)return oU;uU=1;var e=lU().charAt,t=TO(),n=gk(),r=xj(),i=wj(),a=`String Iterator`,o=n.set,s=n.getterFor(a);return r(String,`String`,function(e){o(this,{type:a,string:t(e),index:0})},function(){var t=s(this),n=t.string,r=t.index,a;return r>=n.length?i(void 0,!0):(a=e(n,r),t.index+=a.length,i(a,!1))}),oU}var fU,pU;function mU(){return pU?fU:(pU=1,Dj(),XH(),aU(),dU(),fU=R().Map,fU)}var hU,gU;function _U(){if(gU)return hU;gU=1;var e=mU();return Mj(),hU=e,hU}var vU,yU;function bU(){return yU?vU:(yU=1,vU=_U(),vU)}var xU=F(bU()),SU=class{constructor(){this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:`#2B7CE9`,background:`#97C2FC`,highlight:{border:`#2B7CE9`,background:`#D2E5FF`},hover:{border:`#2B7CE9`,background:`#D2E5FF`}},{border:`#FFA500`,background:`#FFFF00`,highlight:{border:`#FFA500`,background:`#FFFFA3`},hover:{border:`#FFA500`,background:`#FFFFA3`}},{border:`#FA0A10`,background:`#FB7E81`,highlight:{border:`#FA0A10`,background:`#FFAFB1`},hover:{border:`#FA0A10`,background:`#FFAFB1`}},{border:`#41A906`,background:`#7BE141`,highlight:{border:`#41A906`,background:`#A1EC76`},hover:{border:`#41A906`,background:`#A1EC76`}},{border:`#E129F0`,background:`#EB7DF4`,highlight:{border:`#E129F0`,background:`#F0B3F5`},hover:{border:`#E129F0`,background:`#F0B3F5`}},{border:`#7C29F0`,background:`#AD85E4`,highlight:{border:`#7C29F0`,background:`#D3BDF0`},hover:{border:`#7C29F0`,background:`#D3BDF0`}},{border:`#C37F00`,background:`#FFA807`,highlight:{border:`#C37F00`,background:`#FFCA66`},hover:{border:`#C37F00`,background:`#FFCA66`}},{border:`#4220FB`,background:`#6E6EFD`,highlight:{border:`#4220FB`,background:`#9B9BFD`},hover:{border:`#4220FB`,background:`#9B9BFD`}},{border:`#FD5A77`,background:`#FFC0CB`,highlight:{border:`#FD5A77`,background:`#FFD1D9`},hover:{border:`#FD5A77`,background:`#FFD1D9`}},{border:`#4AD63A`,background:`#C2FABC`,highlight:{border:`#4AD63A`,background:`#E6FFE3`},hover:{border:`#4AD63A`,background:`#E6FFE3`}},{border:`#990000`,background:`#EE0000`,highlight:{border:`#BB0000`,background:`#FF3333`},hover:{border:`#BB0000`,background:`#FF3333`}},{border:`#FF6000`,background:`#FF6000`,highlight:{border:`#FF6000`,background:`#FF6000`},hover:{border:`#FF6000`,background:`#FF6000`}},{border:`#97C2FC`,background:`#2B7CE9`,highlight:{border:`#D2E5FF`,background:`#2B7CE9`},hover:{border:`#D2E5FF`,background:`#2B7CE9`}},{border:`#399605`,background:`#255C03`,highlight:{border:`#399605`,background:`#255C03`},hover:{border:`#399605`,background:`#255C03`}},{border:`#B70054`,background:`#FF007E`,highlight:{border:`#B70054`,background:`#FF007E`},hover:{border:`#B70054`,background:`#FF007E`}},{border:`#AD85E4`,background:`#7C29F0`,highlight:{border:`#D3BDF0`,background:`#7C29F0`},hover:{border:`#D3BDF0`,background:`#7C29F0`}},{border:`#4557FA`,background:`#000EA1`,highlight:{border:`#6E6EFD`,background:`#000EA1`},hover:{border:`#6E6EFD`,background:`#000EA1`}},{border:`#FFC0CB`,background:`#FD5A77`,highlight:{border:`#FFD1D9`,background:`#FD5A77`},hover:{border:`#FFD1D9`,background:`#FD5A77`}},{border:`#C2FABC`,background:`#74D66A`,highlight:{border:`#E6FFE3`,background:`#74D66A`},hover:{border:`#E6FFE3`,background:`#74D66A`}},{border:`#EE0000`,background:`#990000`,highlight:{border:`#FF3333`,background:`#BB0000`},hover:{border:`#FF3333`,background:`#BB0000`}}],this.options={},this.defaultOptions={useDefaultGroups:!0},eD(this.options,this.defaultOptions)}setOptions(e){let t=[`useDefaultGroups`];if(e!==void 0){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&H(t).call(t,n)===-1){let t=e[n];this.add(n,t)}}}clear(){this._groups=new xU,this._groupNames=[]}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this._groups.get(e);if(n===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){let t=this._groupIndex%this._groupNames.length;++this._groupIndex,n={},n.color=this._groups.get(this._groupNames[t]),this._groups.set(e,n)}else{let t=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,n={},n.color=this._defaultGroups[t],this._groups.set(e,n)}return n}add(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}},CU={},wU;function TU(){return wU?CU:(wU=1,z()({target:`Number`,stat:!0},{isNaN:function(e){return e!==e}}),CU)}var EU,DU;function OU(){return DU?EU:(DU=1,TU(),EU=R().Number.isNaN,EU)}var kU,AU;function jU(){return AU?kU:(AU=1,kU=OU(),kU)}var MU,NU;function PU(){return NU?MU:(NU=1,MU=jU(),MU)}var FU=F(PU()),IU={},LU,RU;function zU(){if(RU)return LU;RU=1;var e=OC().isFinite;return LU=Number.isFinite||function(t){return typeof t==`number`&&e(t)},LU}var BU;function VU(){return BU?IU:(BU=1,z()({target:`Number`,stat:!0},{isFinite:zU()}),IU)}var HU,UU;function WU(){return UU?HU:(UU=1,VU(),HU=R().Number.isFinite,HU)}var GU,KU;function qU(){return KU?GU:(KU=1,GU=WU(),GU)}var JU,YU;function XU(){return YU?JU:(YU=1,JU=qU(),JU)}var ZU=F(XU()),QU={},$U;function eW(){if($U)return QU;$U=1;var e=z(),t=yk().some;return e({target:`Array`,proto:!0,forced:!lN()(`some`)},{some:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),QU}var tW,nW;function rW(){return nW?tW:(nW=1,eW(),tW=fD()(`Array`,`some`),tW)}var iW,aW;function oW(){if(aW)return iW;aW=1;var e=kw(),t=rW(),n=Array.prototype;return iW=function(r){var i=r.some;return r===n||e(n,r)&&i===n.some?t:i},iW}var sW,cW;function lW(){return cW?sW:(cW=1,sW=oW(),sW)}var uW,dW;function fW(){return dW?uW:(dW=1,uW=lW(),uW)}var pW=F(fW()),mW={exports:{}},hW={},gW;function _W(){if(gW)return hW;gW=1;var e=z(),t=ZC(),n=tE().f;return e({target:`Object`,stat:!0,forced:Object.defineProperty!==n,sham:!t},{defineProperty:n}),hW}var vW;function yW(){if(vW)return mW.exports;vW=1,_W();var e=R().Object,t=mW.exports=function(t,n,r){return e.defineProperty(t,n,r)};return e.defineProperty.sham&&(t.sham=!0),mW.exports}var bW,xW;function SW(){return xW?bW:(xW=1,bW=yW(),bW)}var CW,wW;function TW(){return wW?CW:(wW=1,CW=SW(),CW)}var EW,DW;function OW(){return DW?EW:(DW=1,EW=TW(),EW)}var kW,AW;function jW(){return AW?kW:(AW=1,kW=OW(),kW)}var MW=F(jW()),NW={},PW;function FW(){if(PW)return NW;PW=1;var e=ET(),t=tE().f,n=e(`metadata`),r=Function.prototype;return r[n]===void 0&&t(r,n,{value:null}),NW}var IW={},LW;function RW(){return LW?IW:(LW=1,Wk(),IW)}var zW={},BW;function VW(){return BW?zW:(BW=1,Xk(),zW)}var HW={},UW;function WW(){return UW?HW:(UW=1,tk()(`metadata`),HW)}var GW,KW;function qW(){if(KW)return GW;KW=1;var e=Fj();return FW(),RW(),VW(),WW(),GW=e,GW}var JW={},YW,XW;function ZW(){if(XW)return YW;XW=1;var e=Ew(),t=L(),n=e(`Symbol`),r=n.keyFor,i=t(n.prototype.valueOf);return YW=n.isRegisteredSymbol||function(e){try{return r(i(e))!==void 0}catch{return!1}},YW}var QW;function $W(){return QW?JW:(QW=1,z()({target:`Symbol`,stat:!0},{isRegisteredSymbol:ZW()}),JW)}var eG={},tG,nG;function rG(){if(nG)return tG;nG=1;for(var e=mT(),t=Ew(),n=L(),r=Ww(),i=ET(),a=t(`Symbol`),o=a.isWellKnownSymbol,s=t(`Object`,`getOwnPropertyNames`),c=n(a.prototype.valueOf),l=e(`wks`),u=0,d=s(a),f=d.length;u<f;u++)try{var p=d[u];r(a[p])&&i(p)}catch{}return tG=function(e){if(o&&o(e))return!0;try{for(var t=c(e),n=0,r=s(l),i=r.length;n<i;n++)if(l[r[n]]==t)return!0}catch{}return!1},tG}var iG;function aG(){return iG?eG:(iG=1,z()({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:rG()}),eG)}var oG={},sG;function cG(){return sG?oG:(sG=1,tk()(`customMatcher`),oG)}var lG={},uG;function dG(){return uG?lG:(uG=1,tk()(`observable`),lG)}var fG={},pG;function mG(){return pG?fG:(pG=1,z()({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:ZW()}),fG)}var hG={},gG;function _G(){return gG?hG:(gG=1,z()({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:rG()}),hG)}var vG={},yG;function bG(){return yG?vG:(yG=1,tk()(`matcher`),vG)}var xG={},SG;function CG(){return SG?xG:(SG=1,tk()(`metadataKey`),xG)}var wG={},TG;function EG(){return TG?wG:(TG=1,tk()(`patternMatch`),wG)}var DG={},OG;function kG(){return OG?DG:(OG=1,tk()(`replaceAll`),DG)}var AG,jG;function MG(){if(jG)return AG;jG=1;var e=qW();return $W(),aG(),cG(),dG(),mG(),_G(),bG(),CG(),EG(),kG(),AG=e,AG}var NG,PG;function FG(){return PG?NG:(PG=1,NG=MG(),NG)}var IG=F(FG()),LG,RG;function zG(){return RG?LG:(RG=1,Dj(),dU(),aA(),LG=QO().f(`iterator`),LG)}var BG,VG;function HG(){if(VG)return BG;VG=1;var e=zG();return Mj(),BG=e,BG}var UG,WG;function GG(){return WG?UG:(WG=1,UG=HG(),UG)}var KG,qG;function JG(){return qG?KG:(qG=1,KG=GG(),KG)}var YG,XG;function ZG(){return XG?YG:(XG=1,YG=JG(),YG)}var QG=F(ZG());function $G(e){"@babel/helpers - typeof";return $G=typeof IG==`function`&&typeof QG==`symbol`?function(e){return typeof e}:function(e){return e&&typeof IG==`function`&&e.constructor===IG&&e!==IG.prototype?`symbol`:typeof e},$G(e)}var eK,tK;function nK(){return tK?eK:(tK=1,EA(),eK=QO().f(`toPrimitive`),eK)}var rK,iK;function aK(){return iK?rK:(iK=1,rK=nK(),rK)}var oK,sK;function cK(){return sK?oK:(sK=1,oK=aK(),oK)}var lK,uK;function dK(){return uK?lK:(uK=1,lK=cK(),lK)}var fK,pK;function mK(){return pK?fK:(pK=1,fK=dK(),fK)}var hK=F(mK());function gK(e,t){if($G(e)!=`object`||!e)return e;var n=e[hK];if(n!==void 0){var r=n.call(e,t);if($G(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function _K(e){var t=gK(e,`string`);return $G(t)==`symbol`?t:t+``}function vK(e,t,n){return(t=_K(t))in e?MW(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yK={},bK,xK;function SK(){if(xK)return bK;xK=1;var e=OC(),t=I(),n=L(),r=TO(),i=QF().trim,a=YF(),o=n(``.charAt),s=e.parseFloat,c=e.Symbol,l=c&&c.iterator;return bK=1/s(a+`-0`)!=-1/0||l&&!t(function(){s(Object(l))})?function(e){var t=i(r(e)),n=s(t);return n===0&&o(t,0)===`-`?-0:n}:s,bK}var CK;function wK(){if(CK)return yK;CK=1;var e=z(),t=SK();return e({global:!0,forced:parseFloat!==t},{parseFloat:t}),yK}var TK,EK;function DK(){return EK?TK:(EK=1,wK(),TK=R().parseFloat,TK)}var OK,kK;function AK(){return kK?OK:(kK=1,OK=DK(),OK)}var jK,MK;function NK(){return MK?jK:(MK=1,jK=AK(),jK)}var PK=F(NK()),FK={},IK;function LK(){if(IK)return FK;IK=1;var e=z(),t=I(),n=UO().f;return e({target:`Object`,stat:!0,forced:t(function(){return!Object.getOwnPropertyNames(1)})},{getOwnPropertyNames:n}),FK}var RK,zK;function BK(){if(zK)return RK;zK=1,LK();var e=R().Object;return RK=function(t){return e.getOwnPropertyNames(t)},RK}var VK,HK;function UK(){return HK?VK:(HK=1,VK=BK(),VK)}var WK,GK;function KK(){return GK?WK:(GK=1,WK=UK(),WK)}var qK=F(KK()),JK,YK;function XK(){return YK?JK:(YK=1,Vk(),JK=R().Object.getOwnPropertySymbols,JK)}var ZK,QK;function $K(){return QK?ZK:(QK=1,ZK=XK(),ZK)}var eq,tq;function nq(){return tq?eq:(tq=1,eq=$K(),eq)}var rq=F(nq()),iq={exports:{}},aq={},oq;function sq(){if(oq)return aq;oq=1;var e=z(),t=I(),n=vw(),r=BT().f,i=ZC();return e({target:`Object`,stat:!0,forced:!i||t(function(){r(1)}),sham:!i},{getOwnPropertyDescriptor:function(e,t){return r(n(e),t)}}),aq}var cq;function lq(){if(cq)return iq.exports;cq=1,sq();var e=R().Object,t=iq.exports=function(t,n){return e.getOwnPropertyDescriptor(t,n)};return e.getOwnPropertyDescriptor.sham&&(t.sham=!0),iq.exports}var uq,dq;function fq(){return dq?uq:(dq=1,uq=lq(),uq)}var pq,mq;function hq(){return mq?pq:(mq=1,pq=fq(),pq)}var gq=F(hq()),_q={},vq;function yq(){if(vq)return _q;vq=1;var e=z(),t=ZC(),n=iM(),r=vw(),i=BT(),a=ZD();return e({target:`Object`,stat:!0,sham:!t},{getOwnPropertyDescriptors:function(e){for(var t=r(e),o=i.f,s=n(t),c={},l=0,u,d;s.length>l;)d=o(t,u=s[l++]),d!==void 0&&a(c,u,d);return c}}),_q}var bq,xq;function Sq(){return xq?bq:(xq=1,yq(),bq=R().Object.getOwnPropertyDescriptors,bq)}var Cq,wq;function Tq(){return wq?Cq:(wq=1,Cq=Sq(),Cq)}var Eq,Dq;function Oq(){return Dq?Eq:(Dq=1,Eq=Tq(),Eq)}var kq=F(Oq()),Aq={exports:{}},jq={},Mq;function Nq(){if(Mq)return jq;Mq=1;var e=z(),t=ZC(),n=OO().f;return e({target:`Object`,stat:!0,forced:Object.defineProperties!==n,sham:!t},{defineProperties:n}),jq}var Pq;function Fq(){if(Pq)return Aq.exports;Pq=1,Nq();var e=R().Object,t=Aq.exports=function(t,n){return e.defineProperties(t,n)};return e.defineProperties.sham&&(t.sham=!0),Aq.exports}var Iq,Lq;function Rq(){return Lq?Iq:(Lq=1,Iq=Fq(),Iq)}var zq,Bq;function Vq(){return Bq?zq:(Bq=1,zq=Rq(),zq)}var Hq=F(Vq()),Uq,Wq;function Gq(){return Wq?Uq:(Wq=1,Uq=SW(),Uq)}var Kq=F(Gq());function qq(e,t){let n=[`node`,`edge`,`label`],r=!0,i=aV(t,`chosen`);if(typeof i==`boolean`)r=i;else if(typeof i==`object`){if(H(n).call(n,e)===-1)throw Error(`choosify: subOption '`+e+`' should be one of '`+n.join(`', '`)+`'`);let i=aV(t,[`chosen`,e]);(typeof i==`boolean`||typeof i==`function`)&&(r=i)}return r}function Jq(e,t,n){if(e.width<=0||e.height<=0)return!1;if(n!==void 0){let e={x:t.x-n.x,y:t.y-n.y};if(n.angle!==0){let r=-n.angle;t={x:Math.cos(r)*e.x-Math.sin(r)*e.y,y:Math.sin(r)*e.x+Math.cos(r)*e.y}}else t=e}let r=e.x+e.width,i=e.y+e.width;return e.left<t.x&&r>t.x&&e.top<t.y&&i>t.y}function Yq(e){return typeof e==`string`&&e!==``}function Xq(e,t,n,r){let i=r.x,a=r.y;if(typeof r.distanceToBorder==`function`){let n=r.distanceToBorder(e,t),o=Math.sin(t)*n,s=Math.cos(t)*n;s===n?(i+=n,a=r.y):o===n?(i=r.x,a-=n):(i+=s,a-=o)}else r.shape.width>r.shape.height?(i=r.x+r.shape.width*.5,a=r.y-n):(i=r.x+n,a=r.y-r.shape.height*.5);return{x:i,y:a}}var Zq,Qq;function $q(){return Qq?Zq:(Qq=1,Dj(),Zq=fD()(`Array`,`values`),Zq)}var eJ,tJ;function nJ(){return tJ?eJ:(tJ=1,eJ=$q(),eJ)}var rJ,iJ;function aJ(){if(iJ)return rJ;iJ=1,Mj();var e=rO(),t=bT(),n=kw(),r=nJ(),i=Array.prototype,a={DOMTokenList:!0,NodeList:!0};return rJ=function(o){var s=o.values;return o===i||n(i,o)&&s===i.values||t(a,e(o))?r:s},rJ}var oJ,sJ;function cJ(){return sJ?oJ:(sJ=1,oJ=aJ(),oJ)}var lJ=F(cJ()),uJ=class{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`normal`;this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let r=t;(t===void 0||t===``)&&(r=` `);let i=this.measureText(r,n),a=eD({},lJ(i));a.text=t,a.width=i.width,a.mod=n,(t===void 0||t===``)&&(a.width=0),this.lines[e].blocks.push(a),this.lines[e].width+=a.width}curWidth(){let e=this.lines[this.current];return e===void 0?0:e.width}append(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`normal`;this._add(this.current,e,t)}newLine(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`normal`;this._add(this.current,e,t),this.current++}determineLineHeights(){for(let e=0;e<this.lines.length;e++){let t=this.lines[e],n=0;if(t.blocks!==void 0)for(let e=0;e<t.blocks.length;e++){let r=t.blocks[e];n<r.height&&(n=r.height)}t.height=n}}determineLabelSize(){let e=0,t=0;for(let n=0;n<this.lines.length;n++){let r=this.lines[n];r.width>e&&(e=r.width),t+=r.height}this.width=e,this.height=t}removeEmptyBlocks(){let e=[];for(let t=0;t<this.lines.length;t++){let n=this.lines[t];if(n.blocks.length===0||t===this.lines.length-1&&n.width===0)continue;let r={};eD(r,n),r.blocks=[];let i,a=[];for(let e=0;e<n.blocks.length;e++){let t=n.blocks[e];t.width===0?i===void 0&&(i=t):a.push(t)}a.length===0&&i!==void 0&&a.push(i),r.blocks=a,e.push(r)}return e}finalize(){this.determineLineHeights(),this.determineLabelSize();let e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}},dJ={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},fJ=class{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer=``,this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?`normal`:this.modStack[0]}modName(){if(this.modStack.length===0)return`normal`;if(this.modStack[0]===`mono`)return`mono`;if(this.bold&&this.ital)return`boldital`;if(this.bold)return`bold`;if(this.ital)return`ital`}emitBlock(){this.spacing&&=(this.add(` `),!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer=``)}add(e){e===` `&&(this.spacing=!0),this.spacing&&=(this.buffer+=` `,!1),e!=` `&&(this.buffer+=e)}parseWS(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}match(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,[n,r]=this.prepareRegExp(e),i=n.test(this.text.substr(this.position,r));return i&&t&&(this.position+=r-1),i}parseEndTag(e,t,n){let r=this.mod()===e;return e===`mono`?r&&=this.mono:r&&=!this.mono,r&&this.match(t)?((n===void 0||this.position===this.text.length-1||this.match(n,!1))&&this.unsetTag(e),!0):!1}replace(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}prepareRegExp(e){let t,n;if(e instanceof RegExp)n=e,t=1;else{let r=dJ[e];n=r===void 0?new RegExp(e):r,t=e.length}return[n,t]}},pJ=class{constructor(e,t,n,r){this.ctx=e,this.parent=t,this.selected=n,this.hover=r,this.lines=new uJ((t,i)=>{if(t===void 0)return 0;let a=this.parent.getFormattingValues(e,n,r,i),o=0;return t!==``&&(o=this.ctx.measureText(t).width),{width:o,values:a}})}process(e){if(!Yq(e))return this.lines.finalize();let t=this.parent.fontOptions;e=e.replace(/\r\n/g,`
|
|
24
24
|
`),e=e.replace(/\r/g,`
|
|
25
25
|
`);let n=String(e).split(`
|
|
26
|
-
`),r=n.length;if(t.multi)for(let e=0;e<r;e++){let r=this.splitBlocks(n[e],t.multi);if(r!==void 0){if(r.length===0){this.lines.newLine(``);continue}if(t.maxWdt>0)for(let e=0;e<r.length;e++){let t=r[e].mod,n=r[e].text;this.splitStringIntoLines(n,t,!0)}else for(let e=0;e<r.length;e++){let t=r[e].mod,n=r[e].text;this.lines.append(n,t)}this.lines.newLine()}}else if(t.maxWdt>0)for(let e=0;e<r;e++)this.splitStringIntoLines(n[e]);else for(let e=0;e<r;e++)this.lines.newLine(n[e]);return this.lines.finalize()}decodeMarkupSystem(e){let t=`none`;return e===`markdown`||e===`md`?t=`markdown`:(e===!0||e===`html`)&&(t=`html`),t}splitHtmlBlocks(e){let t=new fJ(e),n=e=>/&/.test(e)?(t.replace(t.text,`<`,`<`)||t.replace(t.text,`&`,`&`)||t.add(`&`),!0):!1;for(;t.position<t.text.length;){let e=t.text.charAt(t.position);t.parseWS(e)||/</.test(e)&&(t.parseStartTag(`bold`,`<b>`)||t.parseStartTag(`ital`,`<i>`)||t.parseStartTag(`mono`,`<code>`)||t.parseEndTag(`bold`,`</b>`)||t.parseEndTag(`ital`,`</i>`)||t.parseEndTag(`mono`,`</code>`))||n(e)||t.add(e),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){let t=new fJ(e),n=!0,r=e=>/\\/.test(e)?(t.position<this.text.length+1&&(t.position++,e=this.text.charAt(t.position),/ \t/.test(e)?t.spacing=!0:(t.add(e),n=!1)),!0):!1;for(;t.position<t.text.length;){let e=t.text.charAt(t.position);t.parseWS(e)||r(e)||(n||t.spacing)&&(t.parseStartTag(`bold`,`*`)||t.parseStartTag(`ital`,`_`)||t.parseStartTag(`mono`,"`"))||t.parseEndTag(`bold`,`*`,`afterBold`)||t.parseEndTag(`ital`,`_`,`afterItal`)||t.parseEndTag(`mono`,"`",`afterMono`)||(t.add(e),n=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){let n=this.decodeMarkupSystem(t);if(n===`none`)return[{text:e,mod:`normal`}];if(n===`markdown`)return this.splitMarkdownBlocks(e);if(n===`html`)return this.splitHtmlBlocks(e)}overMaxWidth(e){let t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t=``,n=0;for(;n<e.length;){let r=t+(t===``?``:` `)+e[n];if(this.overMaxWidth(r))break;t=r,n++}return n}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(tM(e).call(e,0,t));)t++;return t}splitStringIntoLines(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`normal`,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,`$1\r`),e=e.replace(/([^\r][^ ]*)( +)/g,`$1\r$2\r`);let r=e.split(`\r`);for(;r.length>0;){let e=this.getLongestFit(r);if(e===0){let e=r[0],n=this.getLongestFitWord(e);this.lines.newLine(tM(e).call(e,0,n),t),r[0]=tM(e).call(e,n)}else{let i=e;r[e-1]===` `?e--:r[i]===` `&&i++;let a=tM(r).call(r,0,e).join(``);e==r.length&&n?this.lines.append(a,t):this.lines.newLine(a,t),r=tM(r).call(r,i)}}}},mJ=[`bold`,`ital`,`boldital`,`mono`],hJ=class e{constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=n}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),Yq(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font==`string`)this.baseSize=this.fontOptions.size;else if(typeof e.font==`object`){let t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(t){if(W(mJ,e=>{this.fontOptions[e]={}}),e.parseFontString(this.fontOptions,t)){this.fontOptions.vadjust=0;return}W(t,(e,t)=>{e!=null&&typeof e!=`object`&&(this.fontOptions[t]=e)})}static parseFontString(e,t){if(!t||typeof t!=`string`)return!1;let n=t.split(` `);return e.size=+n[0].replace(`px`,``),e.face=n[1],e.color=n[2],!0}constrain(e){let t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:`middle`},n=aV(e,`widthConstraint`);if(typeof n==`number`)t.maxWdt=Number(n),t.minWdt=Number(n);else if(typeof n==`object`){let n=aV(e,[`widthConstraint`,`maximum`]);typeof n==`number`&&(t.maxWdt=Number(n));let r=aV(e,[`widthConstraint`,`minimum`]);typeof r==`number`&&(t.minWdt=Number(r))}let r=aV(e,`heightConstraint`);if(typeof r==`number`)t.minHgt=Number(r);else if(typeof r==`object`){let n=aV(e,[`heightConstraint`,`minimum`]);typeof n==`number`&&(t.minHgt=Number(n));let r=aV(e,[`heightConstraint`,`valign`]);typeof r==`string`&&(r===`top`||r===`bottom`)&&(t.valign=r)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),U(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=qq(`label`,t)}adjustSizes(e){let t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);let n=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=n)}addFontOptionsToPile(e,t){for(let n=0;n<t.length;++n)this.addFontToPile(e,t[n])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;let n=t.font;e.push(n)}getBasicOptions(t){let n={};for(let r=0;r<t.length;++r){let i=t[r],a={};e.parseFontString(a,i)&&(i=a),W(i,(e,t)=>{e!==void 0&&(Object.prototype.hasOwnProperty.call(n,t)||(H(mJ).call(mJ,t)===-1?n[t]=e:n[t]={}))})}return n}getFontOption(t,n,r){let i;for(let a=0;a<t.length;++a){let o=t[a];if(Object.prototype.hasOwnProperty.call(o,n)){if(i=o[n],i==null)continue;let t={};if(e.parseFontString(t,i)&&(i=t),Object.prototype.hasOwnProperty.call(i,r))return i[r]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,r))return this.fontOptions[r];throw Error(`Did not find value for multi-font for property: '`+r+`'`)}getFontOptions(e,t){let n={},r=[`color`,`size`,`face`,`mod`,`vadjust`];for(let i=0;i<r.length;++i){let a=r[i];n[a]=this.getFontOption(e,t,a)}return n}propagateFonts(e){let t=[];this.addFontOptionsToPile(t,e),this.fontOptions=this.getBasicOptions(t);for(let e=0;e<mJ.length;++e){let n=mJ[e],r=this.fontOptions[n];W(this.getFontOptions(t,n),(e,t)=>{r[t]=e}),r.size=Number(r.size),r.vadjust=Number(r.vadjust)}}draw(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:`middle`;if(this.elementOptions.label===void 0)return;let o=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&o<this.elementOptions.scaling.label.drawThreshold-1||(o>=this.elementOptions.scaling.label.maxVisible&&(o=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,r,i,t,n,a),this._drawBackground(e),this._drawText(e,t,this.size.yLine,a,o))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!==`none`){e.fillStyle=this.fontOptions.background;let t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}_drawText(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`middle`,i=arguments.length>4?arguments[4]:void 0;[t,n]=this._setAlignment(e,t,n,r),e.textAlign=`left`,t-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign===`top`&&(n-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign===`bottom`&&(n+=(this.size.height-this.size.labelHeight)/2));for(let r=0;r<this.lineCount;r++){let a=this.lines[r];if(a&&a.blocks){let r=0;this.isEdgeLabel||this.fontOptions.align===`center`?r+=(this.size.width-a.width)/2:this.fontOptions.align===`right`&&(r+=this.size.width-a.width);for(let o=0;o<a.blocks.length;o++){let s=a.blocks[o];e.font=s.font;let[c,l]=this._getColor(s.color,i,s.strokeColor);s.strokeWidth>0&&(e.lineWidth=s.strokeWidth,e.strokeStyle=l,e.lineJoin=`round`),e.fillStyle=c,s.strokeWidth>0&&e.strokeText(s.text,t+r,n+s.vadjust),e.fillText(s.text,t+r,n+s.vadjust),r+=s.width}n+=a.height}}}_setAlignment(e,t,n,r){return this.isEdgeLabel&&this.fontOptions.align!==`horizontal`&&this.pointToSelf===!1?(t=0,n=0,this.fontOptions.align===`top`?(e.textBaseline=`alphabetic`,n-=4):this.fontOptions.align===`bottom`?(e.textBaseline=`hanging`,n+=4):e.textBaseline=`middle`):e.textBaseline=r,[t,n]}_getColor(e,t,n){let r=e||`#000000`,i=n||`#ffffff`;if(t<=this.elementOptions.scaling.label.drawThreshold){let e=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));r=KB(r,e),i=KB(i,e)}return[r,i]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,n),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let e=this.size.left,t=this.size.top-.5*2;if(this.isEdgeLabel){let n=-this.size.width*.5;switch(this.fontOptions.align){case`middle`:e=n,t=-this.size.height*.5;break;case`top`:e=n,t=-(this.size.height+2);break;case`bottom`:e=n,t=2;break}}return{left:e,top:t,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:`middle`;this._processLabel(e,t,n),this.size.left=r-this.size.width*.5,this.size.top=i-this.size.height*.5,this.size.yLine=i+(1-this.lineCount)*.5*this.fontOptions.size,a===`hanging`&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,n,r){let i=function(e,t,n){return t===`normal`?n===`mod`?``:e[n]:e[t][n]===void 0?e[n]:e[t][n]},a={color:i(this.fontOptions,r,`color`),size:i(this.fontOptions,r,`size`),face:i(this.fontOptions,r,`face`),mod:i(this.fontOptions,r,`mod`),vadjust:i(this.fontOptions,r,`vadjust`),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||n)&&(r===`normal`&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?a.mod=`bold`:typeof this.fontOptions.chooser==`function`&&this.fontOptions.chooser(a,this.elementOptions.id,t,n));let o=``;return a.mod!==void 0&&a.mod!==``&&(o+=a.mod+` `),o+=a.size+`px `+a.face,e.font=o.replace(/"/g,``),a.font=e.font,a.height=a.size,a}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,n,r){return new pJ(e,this,t,n).process(r)}_processLabel(e,t,n){if(this.labelDirty===!1&&!this.differentState(t,n))return;let r=this._processLabelText(e,t,n,this.elementOptions.label);this.fontOptions.minWdt>0&&r.width<this.fontOptions.minWdt&&(r.width=this.fontOptions.minWdt),this.size.labelHeight=r.height,this.fontOptions.minHgt>0&&r.height<this.fontOptions.minHgt&&(r.height=this.fontOptions.minHgt),this.lines=r.lines,this.lineCount=r.lines.length,this.size.width=r.width,this.size.height=r.height,this.selectedState=t,this.hoverState=n,this.labelDirty=!1}visible(){return!(this.size.width===0||this.size.height===0||this.elementOptions.label===void 0||this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}},gJ=class{constructor(e,t,n){this.body=t,this.labelModule=n,this.setOptions(e),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}setOptions(e){this.options=e}_setMargins(e){this.margin={},this.options.margin&&(typeof this.options.margin==`object`?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}_distanceToBorder(e,t){let n=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+n}enableShadow(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow&&(e.shadowColor=`rgba(0,0,0,0)`,e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}enableBorderDashes(e,t){if(t.borderDashes!==!1)if(e.setLineDash!==void 0){let n=t.borderDashes;n===!0&&(n=[5,15]),e.setLineDash(n)}else console.warn(`setLineDash is not supported in this browser. The dashed borders cannot be used.`),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}disableBorderDashes(e,t){t.borderDashes!==!1&&(e.setLineDash===void 0?(console.warn(`setLineDash is not supported in this browser. The dashed borders cannot be used.`),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1):e.setLineDash([0]))}needsRefresh(e,t){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,t)}initContextForDraw(e,t){let n=t.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,n),e.strokeStyle=t.borderColor,e.fillStyle=t.color}performStroke(e,t){let n=t.borderWidth/this.body.view.scale;e.save(),n>0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}performFill(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),$L(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,t,n,r,i){n!==void 0&&this.resize(n,r,i),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(e,t,n,r,i){this._updateBoundingBox(e,t,n,r,i)}getDimensionsFromLabel(e,t,n){this.textSize=this.labelModule.getTextSize(e,t,n);let r=this.textSize.width,i=this.textSize.height;return r===0&&(r=14,i=14),{width:r,height:i}}},_J=class extends gJ{constructor(e,t,n){super(e,t,n),this._setMargins(n)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,n)){let r=this.getDimensionsFromLabel(e,t,n);this.width=r.width+this.margin.right+this.margin.left,this.height=r.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this.initContextForDraw(e,a),jD(e,this.left,this.top,this.width,this.height,a.borderRadius),this.performFill(e,a),this.updateBoundingBox(t,n,e,r,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,i)}updateBoundingBox(e,t,n,r,i){this._updateBoundingBox(e,t,n,r,i);let a=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(a)}distanceToBorder(e,t){e&&this.resize(e);let n=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+n}},vJ=class extends gJ{constructor(e,t,n){super(e,t,n),this.labelOffset=0,this.selected=!1}setOptions(e,t,n){this.options=e,t===void 0&&n===void 0||this.setImages(t,n)}setImages(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}switchImages(e){let t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){let e=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=e}}_getImagePadding(){let e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){let t=this.options.imagePadding;typeof t==`object`?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}_resizeImage(){let e,t;if(this.options.shapeProperties.useImageSize===!1){let n=1,r=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?n=this.imageObj.width/this.imageObj.height:r=this.imageObj.height/this.imageObj.width),e=this.options.size*2*n,t=this.options.size*2*r}else{let n=this._getImagePadding();e=this.imageObj.width+n.left+n.right,t=this.imageObj.height+n.top+n.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,n,r){this.initContextForDraw(e,r),TD(e,t,n,r.size),this.performFill(e,r)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity===void 0?1:t.opacity,this.enableShadow(e,t);let n=1;this.options.shapeProperties.interpolation===!0&&(n=this.imageObj.width/this.width/this.body.view.scale);let r=this._getImagePadding(),i=this.left+r.left,a=this.top+r.top,o=this.width-r.left-r.right,s=this.height-r.top-r.bottom;this.imageObj.drawImageAtPosition(e,n,i,a,o,s),this.disableShadow(e,t)}}_drawImageLabel(e,t,n,r,i){let a=0;if(this.height!==void 0){a=this.height*.5;let t=this.labelModule.getTextSize(e,r,i);t.lineCount>=1&&(a+=t.height/2)}let o=n+a;this.options.label&&(this.labelOffset=a),this.labelModule.draw(e,t,o,r,i,`hanging`)}},yJ=class extends vJ{constructor(e,t,n){super(e,t,n),this._setMargins(n)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,n)){let r=this.getDimensionsFromLabel(e,t,n),i=Math.max(r.width+this.margin.right+this.margin.left,r.height+this.margin.top+this.margin.bottom);this.options.size=i/2,this.width=i,this.height=i,this.radius=this.width/2}}draw(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this._drawRawCircle(e,t,n,a),this.updateBoundingBox(t,n),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,n,r,i)}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}},bJ=class extends vJ{constructor(e,t,n,r,i){super(e,t,n),this.setImages(r,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let e=this.options.size*2;this.width=e,this.height=e,this.radius=.5*this.width;return}this.needsRefresh(t,n)&&this._resizeImage()}draw(e,t,n,r,i,a){this.switchImages(r),this.resize();let o=t,s=n;this.options.shapeProperties.coordinateOrigin===`top-left`?(this.left=t,this.top=n,o+=this.width/2,s+=this.height/2):(this.left=t-this.width/2,this.top=n-this.height/2),this._drawRawCircle(e,o,s,a),e.save(),e.clip(),this._drawImageAtPosition(e,a),e.restore(),this._drawImageLabel(e,o,s,r,i),this.updateBoundingBox(t,n)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin===`top-left`?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=t+this.options.size*2):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(e){return e&&this.resize(e),this.width*.5}},xJ=class extends gJ{constructor(e,t,n){super(e,t,n)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,n)){this.labelModule.getTextSize(e,t,n);let i=2*r.size;this.width=this.customSizeWidth??i,this.height=this.customSizeHeight??i,this.radius=.5*this.width}}_drawShape(e,t,n,r,i,a,o,s){return this.resize(e,a,o,s),this.left=r-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,s),LD(t)(e,r,i,s.size),this.performFill(e,s),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(a?`bold `:``)+this.height/2+`px `+(this.options.icon.face||`FontAwesome`),e.fillStyle=this.options.icon.color||`black`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(this.options.icon.code,r,i)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,a,o,r,i,`hanging`);let t=i+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,r,t,a,o,`hanging`)}this.updateBoundingBox(r,i)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}};function SJ(e,t){var n=KM(e);if(rq){var r=rq(e);t&&(r=kF(r).call(r,function(t){return gq(e,t).enumerable})),n.push.apply(n,r)}return n}function CJ(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?V(n=SJ(Object(i),!0)).call(n,function(t){vK(e,t,i[t])}):kq?Hq(e,kq(i)):V(r=SJ(Object(i))).call(r,function(t){Kq(e,t,gq(i,t))})}return e}var wJ=class extends xJ{constructor(e,t,n,r){super(e,t,n,r),this.ctxRenderer=r}draw(e,t,n,r,i,a){this.resize(e,r,i,a),this.left=t-this.width/2,this.top=n-this.height/2,e.save();let o=this.ctxRenderer({ctx:e,id:this.options.id,x:t,y:n,state:{selected:r,hover:i},style:CJ({},a),label:this.options.label});if(o.drawNode!=null&&o.drawNode(),e.restore(),o.drawExternalLabel){let t=o.drawExternalLabel;o.drawExternalLabel=()=>{e.save(),t(),e.restore()}}return o.nodeDimensions&&(this.customSizeWidth=o.nodeDimensions.width,this.customSizeHeight=o.nodeDimensions.height),o}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},TJ=class extends gJ{constructor(e,t,n){super(e,t,n),this._setMargins(n)}resize(e,t,n){if(this.needsRefresh(t,n)){let r=this.getDimensionsFromLabel(e,t,n).width+this.margin.right+this.margin.left;this.width=r,this.height=r,this.radius=this.width/2}}draw(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this.initContextForDraw(e,a),ND(e,t-this.width/2,n-this.height/2,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,n,e,r,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,i)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},EJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`diamond`,4,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},DJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`circle`,2,t,n,r,i,a)}distanceToBorder(e){return e&&this.resize(e),this.options.size}},OJ=class extends gJ{constructor(e,t,n){super(e,t,n)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,n)){let r=this.getDimensionsFromLabel(e,t,n);this.height=r.height*2,this.width=r.width+r.height,this.radius=.5*this.width}}draw(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width*.5,this.top=n-this.height*.5,this.initContextForDraw(e,a),MD(e,this.left,this.top,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,n,e,r,i),this.labelModule.draw(e,t,n,r,i)}distanceToBorder(e,t){e&&this.resize(e);let n=this.width*.5,r=this.height*.5,i=Math.sin(t)*n,a=Math.cos(t)*r;return n*r/Math.sqrt(i*i+a*a)}},kJ=class extends gJ{constructor(e,t,n){super(e,t,n),this._setMargins(n)}resize(e,t,n){this.needsRefresh(t,n)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,n,r,i,a){return this.resize(e,r,i),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=n-this.height/2,this._icon(e,t,n,r,i,a),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,n+this.height/2+5,r),this.updateBoundingBox(t,n)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=t+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5))}_icon(e,t,n,r,i,a){let o=Number(this.options.icon.size);this.options.icon.code===void 0?console.error(`When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.`):(e.font=[this.options.icon.weight==null?r?`bold`:``:this.options.icon.weight,(this.options.icon.weight!=null&&r?5:0)+o+`px`,this.options.icon.face].join(` `),e.fillStyle=this.options.icon.color||`black`,e.textAlign=`center`,e.textBaseline=`middle`,this.enableShadow(e,a),e.fillText(this.options.icon.code,t,n),this.disableShadow(e,a))}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},AJ=class extends vJ{constructor(e,t,n,r,i){super(e,t,n),this.setImages(r,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let e=this.options.size*2;this.width=e,this.height=e;return}this.needsRefresh(t,n)&&this._resizeImage()}draw(e,t,n,r,i,a){e.save(),this.switchImages(r),this.resize();let o=t,s=n;if(this.options.shapeProperties.coordinateOrigin===`top-left`?(this.left=t,this.top=n,o+=this.width/2,s+=this.height/2):(this.left=t-this.width/2,this.top=n-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){let t=this.options.borderWidth,n=this.options.borderWidthSelected||2*this.options.borderWidth,o=(r?n:t)/this.body.view.scale;e.lineWidth=Math.min(this.width,o),e.beginPath();let s=r?this.options.color.highlight.border:i?this.options.color.hover.border:this.options.color.border,c=r?this.options.color.highlight.background:i?this.options.color.hover.background:this.options.color.background;a.opacity!==void 0&&(s=KB(s,a.opacity),c=KB(c,a.opacity)),e.strokeStyle=s,e.fillStyle=c,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),$L(e).call(e),this.performStroke(e,a),e.closePath()}this._drawImageAtPosition(e,a),this._drawImageLabel(e,o,s,r,i),this.updateBoundingBox(t,n),e.restore()}updateBoundingBox(e,t){this.resize(),this.options.shapeProperties.coordinateOrigin===`top-left`?(this.left=e,this.top=t):(this.left=e-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},jJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`square`,2,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},MJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`hexagon`,4,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},NJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`star`,4,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},PJ=class extends gJ{constructor(e,t,n){super(e,t,n),this._setMargins(n)}resize(e,t,n){this.needsRefresh(t,n)&&(this.textSize=this.labelModule.getTextSize(e,t,n),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this.enableShadow(e,a),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,i),this.disableShadow(e,a),this.updateBoundingBox(t,n,e,r,i)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},FJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`triangle`,3,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},IJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`triangleDown`,3,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};function LJ(e,t){var n=KM(e);if(rq){var r=rq(e);t&&(r=kF(r).call(r,function(t){return gq(e,t).enumerable})),n.push.apply(n,r)}return n}function RJ(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?V(n=LJ(Object(i),!0)).call(n,function(t){vK(e,t,i[t])}):kq?Hq(e,kq(i)):V(r=LJ(Object(i))).call(r,function(t){Kq(e,t,gq(i,t))})}return e}var zJ=class e{constructor(e,t,n,r,i,a){this.options=nV(i),this.globalOptions=i,this.defaultOptions=a,this.body=t,this.edges=[],this.id=void 0,this.imagelist=n,this.grouplist=r,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new hJ(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var t;H(t=this.edges).call(t,e)===-1&&this.edges.push(e)}detachEdge(e){var t;let n=H(t=this.edges).call(t,e);if(n!=-1){var r;uP(r=this.edges).call(r,n,1)}}setOptions(t){let n=this.options.shape;if(t){if(t.color!==void 0&&(this._localColor=t.color),t.id!==void 0&&(this.id=t.id),this.id===void 0)throw Error(`Node must have an id`);return e.checkMass(t,this.id),t.x!==void 0&&(t.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=pI(t.x),this.predefinedPosition=!0)),t.y!==void 0&&(t.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=pI(t.y),this.predefinedPosition=!0)),t.size!==void 0&&(this.baseSize=t.size),t.value!==void 0&&(t.value=PK(t.value)),e.parseOptions(this.options,t,!0,this.globalOptions,this.grouplist),this.chooser=qq(`node`,[t,this.options,this.defaultOptions]),this._load_images(),this.updateLabelModule(t),t.opacity!==void 0&&e.checkOpacity(t.opacity)&&(this.options.opacity=t.opacity),this.updateShape(n),t.hidden!==void 0||t.physics!==void 0}}_load_images(){if((this.options.shape===`circularImage`||this.options.shape===`image`)&&this.options.image===void 0)throw Error(`Option image must be defined for node type '`+this.options.shape+`'`);if(this.options.image!==void 0){if(this.imagelist===void 0)throw Error(`Internal Error: No images provided`);if(typeof this.options.image==`string`)this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(this.options.image.unselected===void 0)throw Error(`No unselected image provided`);this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.options.image.selected===void 0?this.imageObjAlt=void 0:this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id)}}}static checkOpacity(e){return 0<=e&&e<=1}static checkCoordinateOrigin(e){return e===void 0||e===`center`||e===`top-left`}static updateGroupOptions(t,n,r){var i;if(r===void 0)return;let a=t.group;if(n!==void 0&&n.group!==void 0&&a!==n.group)throw Error(`updateGroupOptions: group values in options don't match.`);if(!(typeof a==`number`||typeof a==`string`&&a!=``))return;let o=r.get(a);o.opacity!==void 0&&n.opacity===void 0&&(e.checkOpacity(o.opacity)||(console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+o.opacity),o.opacity=void 0));let s=kF(i=qK(n)).call(i,e=>n[e]!=null);s.push(`font`),BB(s,t,o),t.color=JB(t.color)}static parseOptions(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0;if(BB([`color`,`fixed`,`shadow`],t,n,r),e.checkMass(n),t.opacity!==void 0&&(e.checkOpacity(t.opacity)||(console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+t.opacity),t.opacity=void 0)),n.opacity!==void 0&&(e.checkOpacity(n.opacity)||(console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+n.opacity),n.opacity=void 0)),n.shapeProperties&&!e.checkCoordinateOrigin(n.shapeProperties.coordinateOrigin)&&console.error(`Invalid option for node coordinateOrigin, found: `+n.shapeProperties.coordinateOrigin),rV(t,n,`shadow`,i),n.color!==void 0&&n.color!==null){let e=JB(n.color);RB(t.color,e)}else r===!0&&n.color===null&&(t.color=nV(i.color));n.fixed!==void 0&&n.fixed!==null&&(typeof n.fixed==`boolean`?(t.fixed.x=n.fixed,t.fixed.y=n.fixed):(n.fixed.x!==void 0&&typeof n.fixed.x==`boolean`&&(t.fixed.x=n.fixed.x),n.fixed.y!==void 0&&typeof n.fixed.y==`boolean`&&(t.fixed.y=n.fixed.y))),r===!0&&n.font===null&&(t.font=nV(i.font)),e.updateGroupOptions(t,n,a),n.scaling!==void 0&&rV(t.scaling,n.scaling,`label`,i.scaling)}getFormattingValues(){let e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected==null?e.borderWidth*=2:e.borderWidth=this.options.borderWidthSelected,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser==`function`&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){let t=this.options.opacity;e.borderColor=KB(e.borderColor,t),e.color=KB(e.color,t),e.shadowColor=KB(e.shadowColor,t)}return e}updateLabelModule(t){(this.options.label===void 0||this.options.label===null)&&(this.options.label=``),e.updateGroupOptions(this.options,RJ(RJ({},t),{},{color:t&&t.color||this._localColor||void 0}),this.grouplist);let n=this.grouplist.get(this.options.group,!1),r=[t,this.options,n,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,r),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case`box`:this.shape=new _J(this.options,this.body,this.labelModule);break;case`circle`:this.shape=new yJ(this.options,this.body,this.labelModule);break;case`circularImage`:this.shape=new bJ(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case`custom`:this.shape=new wJ(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case`database`:this.shape=new TJ(this.options,this.body,this.labelModule);break;case`diamond`:this.shape=new EJ(this.options,this.body,this.labelModule);break;case`dot`:this.shape=new DJ(this.options,this.body,this.labelModule);break;case`ellipse`:this.shape=new OJ(this.options,this.body,this.labelModule);break;case`icon`:this.shape=new kJ(this.options,this.body,this.labelModule);break;case`image`:this.shape=new AJ(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case`square`:this.shape=new jJ(this.options,this.body,this.labelModule);break;case`hexagon`:this.shape=new MJ(this.options,this.body,this.labelModule);break;case`star`:this.shape=new NJ(this.options,this.body,this.labelModule);break;case`text`:this.shape=new PJ(this.options,this.body,this.labelModule);break;case`triangle`:this.shape=new FJ(this.options,this.body,this.labelModule);break;case`triangleDown`:this.shape=new IJ(this.options,this.body,this.labelModule);break;default:this.shape=new OJ(this.options,this.body,this.labelModule);break}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(e,t){return this.shape.distanceToBorder(e,t)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(e,t,n){if(this.options.value!==void 0){let r=this.options.scaling.customScalingFunction(e,t,n,this.options.value),i=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let e=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+r*e}this.options.size=this.options.scaling.min+r*i}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){let t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){let t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}getItemsOnPoint(e){let t=[];return this.labelModule.visible()&&Jq(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),Jq(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}isOverlappingWith(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}static checkMass(e,t){if(e.mass!==void 0&&e.mass<=0){let n=``;t!==void 0&&(n=` in node id: `+t),console.error(`%cNegative or zero mass disallowed`+n+`, setting mass to 1.`,yV),e.mass=1}}},BJ=class{constructor(e,t,n,r){var i;if(this.body=e,this.images=t,this.groups=n,this.layoutEngine=r,this.body.functions.createNode=B(i=this.create).call(i,this),this.nodesListeners={add:(e,t)=>{this.add(t.items)},update:(e,t)=>{this.update(t.items,t.data,t.oldData)},remove:(e,t)=>{this.remove(t.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:`#2B7CE9`,background:`#97C2FC`,highlight:{border:`#2B7CE9`,background:`#D2E5FF`},hover:{border:`#2B7CE9`,background:`#D2E5FF`}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:`#343434`,size:14,face:`arial`,background:`none`,strokeWidth:0,strokeColor:`#ffffff`,align:`center`,vadjust:0,multi:!1,bold:{mod:`bold`},boldital:{mod:`bold italic`},ital:{mod:`italic`},mono:{mod:``,size:15,face:`monospace`,vadjust:2}},group:void 0,hidden:!1,icon:{face:`FontAwesome`,code:void 0,size:50,color:`#2B7CE9`},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,n,r){if(t===e)return .5;{let n=1/(t-e);return Math.max(0,(r-e)*n)}}},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:10,x:5,y:5},shape:`ellipse`,shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:`center`},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw`Internal error: mass in defaultOptions of NodesHandler may not be zero or negative`;this.options=nV(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on(`refreshNodes`,B(e=this.refresh).call(e,this)),this.body.emitter.on(`refresh`,B(t=this.refresh).call(t,this)),this.body.emitter.on(`destroy`,()=>{W(this.nodesListeners,(e,t)=>{this.body.data.nodes&&this.body.data.nodes.off(t,e)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(zJ.parseOptions(this.options,e),e.opacity!==void 0&&(FU(e.opacity)||!ZU(e.opacity)||e.opacity<0||e.opacity>1?console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this.body.nodes[e].updateShape();if(e.font!==void 0||e.widthConstraint!==void 0||e.heightConstraint!==void 0)for(let e of KM(this.body.nodes))this.body.nodes[e].updateLabelModule(),this.body.nodes[e].needsRefresh();if(e.size!==void 0)for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this.body.nodes[e].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit(`_dataChanged`)}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.data.nodes;if(CC(`id`,e))this.body.data.nodes=e;else if(_M(e))this.body.data.nodes=new xC,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new xC;else throw TypeError(`Array or DataSet expected`);if(n&&W(this.nodesListeners,function(e,t){n.off(t,e)}),this.body.nodes={},this.body.data.nodes){let e=this;W(this.nodesListeners,function(t,n){e.body.data.nodes.on(n,t)});let t=this.body.data.nodes.getIds();this.add(t,!0)}t===!1&&this.body.emitter.emit(`_dataChanged`)}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n,r=[];for(let t=0;t<e.length;t++){n=e[t];let i=this.body.data.nodes.get(n),a=this.create(i);r.push(a),this.body.nodes[n]=a}this.layoutEngine.positionInitially(r),t===!1&&this.body.emitter.emit(`_dataChanged`)}update(e,t,n){let r=this.body.nodes,i=!1;for(let n=0;n<e.length;n++){let a=e[n],o=r[a],s=t[n];o===void 0?(i=!0,o=this.create(s),r[a]=o):o.setOptions(s)&&(i=!0)}!i&&n!==void 0&&(i=pW(t).call(t,function(e,t){let r=n[t];return r&&r.level!==e.level})),i===!0?this.body.emitter.emit(`_dataChanged`):this.body.emitter.emit(`_dataUpdated`)}remove(e){let t=this.body.nodes;for(let n=0;n<e.length;n++){let r=e[n];delete t[r]}this.body.emitter.emit(`_dataChanged`)}create(e){return new(arguments.length>1&&arguments[1]!==void 0?arguments[1]:zJ)(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;W(this.body.nodes,(t,n)=>{let r=this.body.data.nodes.get(n);r!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(r))})}getPositions(e){let t={};if(e!==void 0){if(_M(e)===!0){for(let n=0;n<e.length;n++)if(this.body.nodes[e[n]]!==void 0){let r=this.body.nodes[e[n]];t[e[n]]={x:Math.round(r.x),y:Math.round(r.y)}}}else if(this.body.nodes[e]!==void 0){let n=this.body.nodes[e];t[e]={x:Math.round(n.x),y:Math.round(n.y)}}}else for(let e=0;e<this.body.nodeIndices.length;e++){let n=this.body.nodes[this.body.nodeIndices[e]];t[this.body.nodeIndices[e]]={x:Math.round(n.x),y:Math.round(n.y)}}return t}getPosition(e){if(e==null)throw TypeError(`No id was specified for getPosition method.`);if(this.body.nodes[e]==null)throw ReferenceError(`NodeId provided for getPosition does not exist. Provided: ${e}`);return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}storePositions(){let e=[],t=this.body.data.nodes.getDataSet();for(let n of t.get()){let t=n.id,r=this.body.nodes[t],i=Math.round(r.x),a=Math.round(r.y);(n.x!==i||n.y!==a)&&e.push({id:t,x:i,y:a})}t.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,t){let n=[];if(this.body.nodes[e]!==void 0){let r=this.body.nodes[e],i={};for(let e=0;e<r.edges.length;e++){let a=r.edges[e];t!==`to`&&a.toId==r.id?i[a.fromId]===void 0&&(n.push(a.fromId),i[a.fromId]=!0):t!==`from`&&a.fromId==r.id&&i[a.toId]===void 0&&(n.push(a.toId),i[a.toId]=!0)}}return n}getConnectedEdges(e){let t=[];if(this.body.nodes[e]!==void 0){let n=this.body.nodes[e];for(let e=0;e<n.edges.length;e++)t.push(n.edges[e].id)}else console.error(`NodeId provided for getConnectedEdges does not exist. Provided: `,e);return t}moveNode(e,t,n){this.body.nodes[e]===void 0?console.error(`Node id supplied to moveNode does not exist. Provided: `,e):(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(n),PL(()=>{this.body.emitter.emit(`startSimulation`)},0))}},VJ={},HJ;function UJ(){if(HJ)return VJ;HJ=1;var e=z(),t=Math.hypot,n=Math.abs,r=Math.sqrt;return e({target:`Math`,stat:!0,arity:2,forced:!!t&&t(1/0,NaN)!==1/0},{hypot:function(e,t){for(var i=0,a=0,o=arguments.length,s=0,c,l;a<o;)c=n(arguments[a++]),s<c?(l=s/c,i=i*l*l+1,s=c):c>0?(l=c/s,i+=l*l):i+=c;return s===1/0?1/0:s*r(i)}}),VJ}var WJ,GJ;function KJ(){return GJ?WJ:(GJ=1,UJ(),WJ=R().Math.hypot,WJ)}var qJ,JJ;function YJ(){return JJ?qJ:(JJ=1,qJ=KJ(),qJ)}var XJ,ZJ;function QJ(){return ZJ?XJ:(ZJ=1,XJ=YJ(),XJ)}var $J=F(QJ()),eY=class{static transform(e,t){_M(e)||(e=[e]);let n=t.point.x,r=t.point.y,i=t.angle,a=t.length;for(let t=0;t<e.length;++t){let o=e[t],s=o.x*Math.cos(i)-o.y*Math.sin(i),c=o.x*Math.sin(i)+o.y*Math.cos(i);o.x=n+a*s,o.y=r+a*c}}static drawPath(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(let n=1;n<t.length;++n)e.lineTo(t[n].x,t[n].y);e.closePath()}},tY=class extends eY{static draw(e,t){if(t.image){e.save(),e.translate(t.point.x,t.point.y),e.rotate(Math.PI/2+t.angle);let n=t.imageWidth==null?t.image.width:t.imageWidth,r=t.imageHeight==null?t.image.height:t.imageHeight;t.image.drawImageAtPosition(e,1,-n/2,0,n,r),e.restore()}return!1}},nY=class extends eY{static draw(e,t){let n=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return eY.transform(n,t),eY.drawPath(e,n),!0}},rY=class{static draw(e,t){let n=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return eY.transform(n,t),eY.drawPath(e,n),!0}},iY=class{static draw(e,t){let n={x:-.4,y:0};eY.transform(n,t),e.strokeStyle=e.fillStyle,e.fillStyle=`rgba(0, 0, 0, 0)`;let r=Math.PI,i=t.angle-r/2,a=t.angle+r/2;return e.beginPath(),e.arc(n.x,n.y,t.length*.4,i,a,!1),e.stroke(),!0}},aY=class{static draw(e,t){let n={x:-.3,y:0};eY.transform(n,t),e.strokeStyle=e.fillStyle,e.fillStyle=`rgba(0, 0, 0, 0)`;let r=Math.PI,i=t.angle+r/2,a=t.angle+3*r/2;return e.beginPath(),e.arc(n.x,n.y,t.length*.4,i,a,!1),e.stroke(),!0}},oY=class{static draw(e,t){let n=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return eY.transform(n,t),eY.drawPath(e,n),!0}},sY=class{static draw(e,t){let n=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return eY.transform(n,t),eY.drawPath(e,n),!0}},cY=class{static draw(e,t){let n={x:-.4,y:0};return eY.transform(n,t),TD(e,n.x,n.y,t.length*.4),!0}},lY=class{static draw(e,t){let n=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return eY.transform(n,t),eY.drawPath(e,n),!0}},uY=class{static draw(e,t){let n=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return eY.transform(n,t),eY.drawPath(e,n),!0}},dY=class{static draw(e,t){let n=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return eY.transform(n,t),eY.drawPath(e,n),!0}},fY=class{static draw(e,t){let n=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return eY.transform(n,t),eY.drawPath(e,n),!0}},pY=class{static draw(e,t){let n;switch(t.type&&(n=t.type.toLowerCase()),n){case`image`:return tY.draw(e,t);case`circle`:return cY.draw(e,t);case`box`:return uY.draw(e,t);case`crow`:return rY.draw(e,t);case`curve`:return iY.draw(e,t);case`diamond`:return dY.draw(e,t);case`inv_curve`:return aY.draw(e,t);case`triangle`:return oY.draw(e,t);case`inv_triangle`:return sY.draw(e,t);case`bar`:return lY.draw(e,t);case`vee`:return fY.draw(e,t);default:return nY.draw(e,t)}}};function mY(e,t){var n=KM(e);if(rq){var r=rq(e);t&&(r=kF(r).call(r,function(t){return gq(e,t).enumerable})),n.push.apply(n,r)}return n}function hY(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?V(n=mY(Object(i),!0)).call(n,function(t){vK(e,t,i[t])}):kq?Hq(e,kq(i)):V(r=mY(Object(i))).call(r,function(t){Kq(e,t,gq(i,t))})}return e}var gY=class{constructor(e,t,n){vK(this,`color`,{}),vK(this,`colorDirty`,!0),vK(this,`hoverWidth`,1.5),vK(this,`selectionWidth`,2),this._body=t,this._labelModule=n,this.setOptions(e),this.fromPoint=this.from,this.toPoint=this.to}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}cleanup(){return!1}setOptions(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}drawLine(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes===!1?this._drawLine(e,t,i):this._drawDashedLine(e,t,i)}_drawLine(e,t,n,r,i){if(this.from!=this.to)this._line(e,t,n,r,i);else{let[n,r,i]=this._getCircleData(e);this._circle(e,t,n,r,i)}}_drawDashedLine(e,t,n,r,i){e.lineCap=`round`;let a=_M(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(a),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,n);else{let[n,r,i]=this._getCircleData(e);this._circle(e,t,n,r,i)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)PD(e,this.from.x,this.from.y,this.to.x,this.to.y,a);else{let[n,r,i]=this._getCircleData(e);this._circle(e,t,n,r,i)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,n){return this.from==this.to?this._findBorderPositionCircle(e,t,n):this._findBorderPosition(e,t,n)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;let[n,r]=tM(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:.6,high:.8,direction:1})}}}_getCircleData(e){let t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);let n=Xq(e,this.options.selfReference.angle,t,this.from);return[n.x,n.y,t]}_pointOnCircle(e,t,n,r){let i=r*2*Math.PI;return{x:e+n*Math.cos(i),y:t-n*Math.sin(i)}}_findBorderPositionCircle(e,t,n){let r=n.x,i=n.y,a=n.low,o=n.high,s=n.direction,c=this.options.selfReference.size,l,u=(a+o)*.5,d=0;this.options.arrowStrikethrough===!0&&(s===-1?d=this.options.endPointOffset.from:s===1&&(d=this.options.endPointOffset.to));let f=0;do{u=(a+o)*.5,l=this._pointOnCircle(r,i,c,u);let n=Math.atan2(e.y-l.y,e.x-l.x),p=e.distanceToBorder(t,n)+d-Math.sqrt((l.x-e.x)**2+(l.y-e.y)**2);if(Math.abs(p)<.05)break;p>0?s>0?a=u:o=u:s>0?o=u:a=u,++f}while(a<=o&&f<10);return hY(hY({},l),{},{t:u})}getLineWidth(e,t){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):t===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(e,t){if(t.inheritsColor!==!1){if(t.inheritsColor===`both`&&this.from.id!==this.to.id){let n=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),r=this.from.options.color.highlight.border,i=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(r=KB(this.from.options.color.border,t.opacity),i=KB(this.to.options.color.border,t.opacity)):this.from.selected===!0&&this.to.selected===!1?i=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(r=this.from.options.color.border),n.addColorStop(0,r),n.addColorStop(1,i),n}return t.inheritsColor===`to`?KB(this.to.options.color.border,t.opacity):KB(this.from.options.color.border,t.opacity)}else return KB(t.color,t.opacity)}_circle(e,t,n,r,i){this.enableShadow(e,t);let a=0,o=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){let t=this.options.selfReference.angle,i=this.options.selfReference.angle+Math.PI,s=this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:t,high:i,direction:-1}),c=this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:t,high:i,direction:1});a=Math.atan2(s.y-r,s.x-n),o=Math.atan2(c.y-r,c.x-n)}e.beginPath(),e.arc(n,r,i,a,o,!1),e.stroke(),this.disableShadow(e,t)}getDistanceToEdge(e,t,n,r,i,a){if(this.from!=this.to)return this._getDistanceToEdge(e,t,n,r,i,a);{let[e,t,n]=this._getCircleData(void 0),r=e-i,o=t-a;return Math.abs(Math.sqrt(r*r+o*o)-n)}}_getDistanceToLine(e,t,n,r,i,a){let o=n-e,s=r-t,c=o*o+s*s,l=((i-e)*o+(a-t)*s)/c;l>1?l=1:l<0&&(l=0);let u=e+l*o,d=t+l*s,f=u-i,p=d-a;return Math.sqrt(f*f+p*p)}getArrowData(e,t,n,r,i,a){let o,s,c,l,u,d,f,p=a.width;t===`from`?(c=this.from,l=this.to,u=a.fromArrowScale<0,d=Math.abs(a.fromArrowScale),f=a.fromArrowType):t===`to`?(c=this.to,l=this.from,u=a.toArrowScale<0,d=Math.abs(a.toArrowScale),f=a.toArrowType):(c=this.to,l=this.from,u=a.middleArrowScale<0,d=Math.abs(a.middleArrowScale),f=a.middleArrowType);let m=15*d+3*p;if(c!=l){let r=m/$J(c.x-l.x,c.y-l.y);if(t!==`middle`)if(this.options.smooth.enabled===!0){let i=this._findBorderPosition(c,e,{via:n}),a=this.getPoint(i.t+r*(t===`from`?1:-1),n);o=Math.atan2(i.y-a.y,i.x-a.x),s=i}else o=Math.atan2(c.y-l.y,c.x-l.x),s=this._findBorderPosition(c,e);else{let e=(u?-r:r)/2,t=this.getPoint(.5+e,n),i=this.getPoint(.5-e,n);o=Math.atan2(t.y-i.y,t.x-i.x),s=this.getPoint(.5,n)}}else{let[n,r,i]=this._getCircleData(e);if(t===`from`){let t=this.options.selfReference.angle,i=this.options.selfReference.angle+Math.PI,a=this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:t,high:i,direction:-1});o=a.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,s=a}else if(t===`to`){let t=this.options.selfReference.angle,i=this.options.selfReference.angle+Math.PI,a=this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:t,high:i,direction:1});o=a.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,s=a}else{let e=this.options.selfReference.angle/(2*Math.PI);s=this._pointOnCircle(n,r,i,e),o=e*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}let h={x:s.x-m*.9*Math.cos(o),y:s.y-m*.9*Math.sin(o)};return{point:s,core:h,angle:o,length:m,type:f}}drawArrowHead(e,t,n,r,i){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,pY.draw(e,i)&&(this.enableShadow(e,t),$L(e).call(e),this.disableShadow(e,t))}enableShadow(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow===!0&&(e.shadowColor=`rgba(0,0,0,0)`,e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,t){if(t.background!==!1){let n={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=n.strokeStyle,e.lineWidth=n.lineWidth,e.dashes=n.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){let n=_M(t)?t:[5,5];e.setLineDash(n)}else console.warn(`setLineDash is not supported in this browser. The dashed stroke cannot be used.`);else e.setLineDash===void 0?console.warn(`setLineDash is not supported in this browser. The dashed stroke cannot be used.`):e.setLineDash([])}};function _Y(e,t){var n=KM(e);if(rq){var r=rq(e);t&&(r=kF(r).call(r,function(t){return gq(e,t).enumerable})),n.push.apply(n,r)}return n}function vY(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?V(n=_Y(Object(i),!0)).call(n,function(t){vK(e,t,i[t])}):kq?Hq(e,kq(i)):V(r=_Y(Object(i))).call(r,function(t){Kq(e,t,gq(i,t))})}return e}var yY=class extends gY{constructor(e,t,n){super(e,t,n)}_findBorderPositionBezier(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),r=!1,i=1,a=0,o=this.to,s,c,l=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(o=this.from,r=!0,l=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(l=0);let u=0;do{c=(a+i)*.5,s=this.getPoint(c,n);let e=Math.atan2(o.y-s.y,o.x-s.x),d=o.distanceToBorder(t,e)+l-Math.sqrt((s.x-o.x)**2+(s.y-o.y)**2);if(Math.abs(d)<.2)break;d<0?r===!1?a=c:i=c:r===!1?i=c:a=c,++u}while(a<=i&&u<10);return vY(vY({},s),{},{t:c})}_getDistanceToBezierEdge(e,t,n,r,i,a,o){let s=1e9,c,l,u,d,f,p=e,m=t;for(l=1;l<10;l++)u=.1*l,d=(1-u)**2*e+2*u*(1-u)*o.x+u**2*n,f=(1-u)**2*t+2*u*(1-u)*o.y+u**2*r,l>0&&(c=this._getDistanceToLine(p,m,d,f,i,a),s=c<s?c:s),p=d,m=f;return s}_bezierCurve(e,t,n,r){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),n!=null&&n.x!=null?r!=null&&r.x!=null?e.bezierCurveTo(n.x,n.y,r.x,r.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(n.x,n.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,t),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){return this._getViaCoordinates()}},bY=class extends yY{constructor(e,t,n){super(e,t,n),vK(this,`via`,this.via),this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on(`_repositionBezierNodes`,this._boundFunction)}setOptions(e){super.setOptions(e);let t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),t===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1||this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off(`_repositionBezierNodes`,this._boundFunction),this.via===void 0?!1:(delete this._body.nodes[this.via.id],this.via=void 0,!0)}setupSupportNode(){if(this.via===void 0){let e=`edgeId:`+this.id,t=this._body.functions.createNode({id:e,shape:`circle`,physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,t,n){this._bezierCurve(e,t,n)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){let[t,n,r]=this._getCircleData(),i=2*Math.PI*(1-e);return{x:t+r*Math.sin(i),y:n+r-r*(1-Math.cos(i))}}else return{x:(1-e)**2*this.fromPoint.x+2*e*(1-e)*t.x+e**2*this.toPoint.x,y:(1-e)**2*this.fromPoint.y+2*e*(1-e)*t.y+e**2*this.toPoint.y}}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t,this.via)}_getDistanceToEdge(e,t,n,r,i,a){return this._getDistanceToBezierEdge(e,t,n,r,i,a,this.via)}},xY=class extends yY{constructor(e,t,n){super(e,t,n)}_line(e,t,n){this._bezierCurve(e,t,n)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){let e=this.options.smooth.roundness,t=this.options.smooth.type,n=Math.abs(this.from.x-this.to.x),r=Math.abs(this.from.y-this.to.y);if(t===`discrete`||t===`diagonalCross`){let i,a;i=a=n<=r?e*r:e*n,this.from.x>this.to.x&&(i=-i),this.from.y>=this.to.y&&(a=-a);let o=this.from.x+i,s=this.from.y+a;return t===`discrete`&&(n<=r?o=n<e*r?this.from.x:o:s=r<e*n?this.from.y:s),{x:o,y:s}}else if(t===`straightCross`){let t=(1-e)*n,i=(1-e)*r;return n<=r?(t=0,this.from.y<this.to.y&&(i=-i)):(this.from.x<this.to.x&&(t=-t),i=0),{x:this.to.x+t,y:this.to.y+i}}else if(t===`horizontal`){let t=(1-e)*n;return this.from.x<this.to.x&&(t=-t),{x:this.to.x+t,y:this.from.y}}else if(t===`vertical`){let t=(1-e)*r;return this.from.y<this.to.y&&(t=-t),{x:this.from.x,y:this.to.y+t}}else if(t===`curvedCW`){n=this.to.x-this.from.x,r=this.from.y-this.to.y;let t=Math.sqrt(n*n+r*r),i=Math.PI,a=(Math.atan2(r,n)+(e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*t*Math.sin(a),y:this.from.y+(e*.5+.5)*t*Math.cos(a)}}else if(t===`curvedCCW`){n=this.to.x-this.from.x,r=this.from.y-this.to.y;let t=Math.sqrt(n*n+r*r),i=Math.PI,a=(Math.atan2(r,n)+(-e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*t*Math.sin(a),y:this.from.y+(e*.5+.5)*t*Math.cos(a)}}else{let t,i;t=i=n<=r?e*r:e*n,this.from.x>this.to.x&&(t=-t),this.from.y>=this.to.y&&(i=-i);let a=this.from.x+t,o=this.from.y+i;return n<=r?a=this.from.x<=this.to.x?this.to.x<a?this.to.x:a:this.to.x>a?this.to.x:a:o=this.from.y>=this.to.y?this.to.y>o?this.to.y:o:this.to.y<o?this.to.y:o,{x:a,y:o}}}_findBorderPosition(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,n.via)}_getDistanceToEdge(e,t,n,r,i,a){let o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,n,r,i,a,o)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),n=e;return{x:(1-n)**2*this.fromPoint.x+2*n*(1-n)*t.x+n**2*this.toPoint.x,y:(1-n)**2*this.fromPoint.y+2*n*(1-n)*t.y+n**2*this.toPoint.y}}},SY=class extends yY{constructor(e,t,n){super(e,t,n)}_getDistanceToBezierEdge2(e,t,n,r,i,a,o,s){let c=1e9,l=e,u=t,d=[0,0,0,0];for(let f=1;f<10;f++){let p=.1*f;d[0]=(1-p)**3,d[1]=3*p*(1-p)**2,d[2]=3*p**2*(1-p),d[3]=p**3;let m=d[0]*e+d[1]*o.x+d[2]*s.x+d[3]*n,h=d[0]*t+d[1]*o.y+d[2]*s.y+d[3]*r;if(f>0){let e=this._getDistanceToLine(l,u,m,h,i,a);c=e<c?e:c}l=m,u=h}return c}},CY=class extends SY{constructor(e,t,n){super(e,t,n)}_line(e,t,n){let r=n[0],i=n[1];this._bezierCurve(e,t,r,i)}_getViaCoordinates(){let e=this.from.x-this.to.x,t=this.from.y-this.to.y,n,r,i,a,o=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(t)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection===`horizontal`)&&this.options.smooth.forceDirection!==`vertical`?(r=this.from.y,a=this.to.y,n=this.from.x-o*e,i=this.to.x+o*e):(r=this.from.y-o*t,a=this.to.y+o*t,n=this.from.x,i=this.to.x),[{x:n,y:r},{x:i,y:a}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,n,r,i,a){let[o,s]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,n,r,i,a,o,s)}getPoint(e){let[t,n]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),r=e,i=[(1-r)**3,3*r*(1-r)**2,3*r**2*(1-r),r**3];return{x:i[0]*this.fromPoint.x+i[1]*t.x+i[2]*n.x+i[3]*this.toPoint.x,y:i[0]*this.fromPoint.y+i[1]*t.y+i[2]*n.y+i[3]*this.toPoint.y}}},wY=class extends gY{constructor(e,t,n){super(e,t,n)}_line(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,t){let n=this.to,r=this.from;e.id===this.from.id&&(n=this.from,r=this.to);let i=Math.atan2(n.y-r.y,n.x-r.x),a=n.x-r.x,o=n.y-r.y,s=Math.sqrt(a*a+o*o),c=(s-e.distanceToBorder(t,i))/s;return{x:(1-c)*r.x+c*n.x,y:(1-c)*r.y+c*n.y,t:0}}_getDistanceToEdge(e,t,n,r,i,a){return this._getDistanceToLine(e,t,n,r,i,a)}},TY=class e{constructor(e,t,n,r,i){if(t===void 0)throw Error(`No body provided`);this.options=nV(r),this.globalOptions=r,this.defaultOptions=i,this.body=t,this.imagelist=n,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new hJ(this.body,this.options,!0),this.setOptions(e)}setOptions(t){if(!t)return;let n=t.physics!==void 0&&this.options.physics!==t.physics||t.hidden!==void 0&&(this.options.hidden||!1)!==(t.hidden||!1)||t.from!==void 0&&this.options.from!==t.from||t.to!==void 0&&this.options.to!==t.to;return e.parseOptions(this.options,t,!0,this.globalOptions),t.id!==void 0&&(this.id=t.id),t.from!==void 0&&(this.fromId=t.from),t.to!==void 0&&(this.toId=t.to),t.title!==void 0&&(this.title=t.title),t.value!==void 0&&(t.value=PK(t.value)),this.chooser=qq(`edge`,[t,this.options,this.defaultOptions]),this.updateLabelModule(t),n=this.updateEdgeType()||n,this._setInteractionWidths(),this.connect(),n}static parseOptions(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(zB([`endPointOffset`,`arrowStrikethrough`,`id`,`from`,`hidden`,`hoverWidth`,`labelHighlightBold`,`length`,`line`,`opacity`,`physics`,`scaling`,`selectionWidth`,`selfReferenceSize`,`selfReference`,`to`,`title`,`value`,`width`,`font`,`chosen`,`widthConstraint`],e,t,n),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(ZU(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=r.endPointOffset.from===void 0?0:r.endPointOffset.from,console.error(`endPointOffset.from is not a valid number`))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(ZU(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=r.endPointOffset.to===void 0?0:r.endPointOffset.to,console.error(`endPointOffset.to is not a valid number`))),Yq(t.label)?e.label=t.label:Yq(e.label)||(e.label=void 0),rV(e,t,`smooth`,r),rV(e,t,`shadow`,r),rV(e,t,`background`,r),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:n===!0&&t.dashes===null&&(e.dashes=VI(r.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),rV(e.scaling,t.scaling,`label`,r.scaling)):n===!0&&t.scaling===null&&(e.scaling=VI(r.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows==`string`){let n=t.arrows.toLowerCase();e.arrows.to.enabled=H(n).call(n,`to`)!=-1,e.arrows.middle.enabled=H(n).call(n,`middle`)!=-1,e.arrows.from.enabled=H(n).call(n,`from`)!=-1}else if(typeof t.arrows==`object`)rV(e.arrows,t.arrows,`to`,r.arrows),rV(e.arrows,t.arrows,`middle`,r.arrows),rV(e.arrows,t.arrows,`from`,r.arrows);else throw Error(`The arrow newOptions can only be an object or a string. Refer to the documentation. You used:`+lL(t.arrows));else n===!0&&t.arrows===null&&(e.arrows=VI(r.arrows));if(t.color!==void 0&&t.color!==null){let a=FB(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,o=e.color;if(i)U(o,r.color,!1,n);else for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&delete o[e];if(FB(o))o.color=o,o.highlight=o,o.hover=o,o.inherit=!1,a.opacity===void 0&&(o.opacity=1);else{let e=!1;a.color!==void 0&&(o.color=a.color,e=!0),a.highlight!==void 0&&(o.highlight=a.highlight,e=!0),a.hover!==void 0&&(o.hover=a.hover,e=!0),a.inherit!==void 0&&(o.inherit=a.inherit),a.opacity!==void 0&&(o.opacity=Math.min(1,Math.max(0,a.opacity))),e===!0?o.inherit=!1:o.inherit===void 0&&(o.inherit=`from`)}}else n===!0&&t.color===null&&(e.color=nV(r.color));n===!0&&t.font===null&&(e.font=nV(r.font)),Object.prototype.hasOwnProperty.call(t,`selfReferenceSize`)&&(console.warn(`The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}`),e.selfReference.size=t.selfReferenceSize)}getFormattingValues(){let e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,n=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,r=this.options.color.inherit,i={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:n,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:r?void 0:this.options.color.color,inheritsColor:r,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){let e=this.options.selectionWidth;typeof e==`function`?i.width=e(i.width):typeof e==`number`&&(i.width+=e),i.width=Math.max(i.width,.3/this.body.view.scale),i.color=this.options.color.highlight,i.shadow=this.options.shadow.enabled}else if(this.hover){let e=this.options.hoverWidth;typeof e==`function`?i.width=e(i.width):typeof e==`number`&&(i.width+=e),i.width=Math.max(i.width,.3/this.body.view.scale),i.color=this.options.color.hover,i.shadow=this.options.shadow.enabled}}else typeof this.chooser==`function`&&(this.chooser(i,this.options.id,this.selected,this.hover),i.color!==void 0&&(i.inheritsColor=!1),i.shadow===!1&&(i.shadowColor!==this.options.shadow.color||i.shadowSize!==this.options.shadow.size||i.shadowX!==this.options.shadow.x||i.shadowY!==this.options.shadow.y)&&(i.shadow=!0));else i.shadow=this.options.shadow.enabled,i.width=Math.max(i.width,.3/this.body.view.scale);return i}updateLabelModule(e){let t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){let e=this.options.smooth,t=!1,n=!0;return this.edgeType!==void 0&&((this.edgeType instanceof bY&&e.enabled===!0&&e.type===`dynamic`||this.edgeType instanceof CY&&e.enabled===!0&&e.type===`cubicBezier`||this.edgeType instanceof xY&&e.enabled===!0&&e.type!==`dynamic`&&e.type!==`cubicBezier`||this.edgeType instanceof wY&&e.type.enabled===!1)&&(n=!1),n===!0&&(t=this.cleanup())),n===!0?e.enabled===!0?e.type===`dynamic`?(t=!0,this.edgeType=new bY(this.options,this.body,this.labelModule)):e.type===`cubicBezier`?this.edgeType=new CY(this.options,this.body,this.labelModule):this.edgeType=new xY(this.options,this.body,this.labelModule):this.edgeType=new wY(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&=(this.from.detachEdge(this),void 0),this.to&&=(this.to.detachEdge(this),void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(e,t,n){if(this.options.value!==void 0){let r=this.options.scaling.customScalingFunction(e,t,n,this.options.value),i=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let e=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+r*e}this.options.width=this.options.scaling.min+r*i}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){typeof this.options.hoverWidth==`function`?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth==`function`?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){let t=this.getFormattingValues();if(t.hidden)return;let n=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,n),this.drawLabel(e,n)}drawArrows(e){let t=this.getFormattingValues();if(t.hidden)return;let n=this.edgeType.getViaNode(),r={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(r.from=this.edgeType.getArrowData(e,`from`,n,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=r.from.core),t.fromArrowSrc&&(r.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(r.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(r.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(r.to=this.edgeType.getArrowData(e,`to`,n,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=r.to.core),t.toArrowSrc&&(r.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(r.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(r.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(r.middle=this.edgeType.getArrowData(e,`middle`,n,this.selected,this.hover,t),t.middleArrowSrc&&(r.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(r.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(r.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.to)}drawLabel(e,t){if(this.options.label!==void 0){let n=this.from,r=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let i;if(n.id!=r.id){this.labelModule.pointToSelf=!1,i=this.edgeType.getPoint(.5,t),e.save();let n=this._getRotation(e);n.angle!=0&&(e.translate(n.x,n.y),e.rotate(n.angle)),this.labelModule.draw(e,i.x,i.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;let t=Xq(e,this.options.selfReference.angle,this.options.selfReference.size,n);i=this._pointOnCircle(t.x,t.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,i.x,i.y,this.selected,this.hover)}}}getItemsOnPoint(e){let t=[];if(this.labelModule.visible()){let n=this._getRotation();Jq(this.labelModule.getSize(),e,n)&&t.push({edgeId:this.id,labelId:0})}let n={left:e.x,top:e.y};return this.isOverlappingWith(n)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){let t=this.from.x,n=this.from.y,r=this.to.x,i=this.to.y,a=e.left,o=e.top;return this.edgeType.getDistanceToEdge(t,n,r,i,a,o)<10}else return!1}_getRotation(e){let t=this.edgeType.getViaNode(),n=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,n.x,n.y);let r={x:n.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align===`horizontal`)return r;let i=this.from.y-this.to.y,a=this.from.x-this.to.x,o=Math.atan2(i,a);return(o<-1&&a<0||o>0&&a<0)&&(o+=Math.PI),r.angle=o,r}_pointOnCircle(e,t,n,r){return{x:e+n*Math.cos(r),y:t-n*Math.sin(r)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}},EY=class{constructor(e,t,n){var r;this.body=e,this.images=t,this.groups=n,this.body.functions.createEdge=B(r=this.create).call(r,this),this.edgesListeners={add:(e,t)=>{this.add(t.items)},update:(e,t)=>{this.update(t.items)},remove:(e,t)=>{this.remove(t.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:`arrow`},middle:{enabled:!1,scaleFactor:1,type:`arrow`},from:{enabled:!1,scaleFactor:1,type:`arrow`}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:`#848484`,highlight:`#848484`,hover:`#848484`,inherit:`from`,opacity:1},dashes:!1,font:{color:`#343434`,size:14,face:`arial`,background:`none`,strokeWidth:2,strokeColor:`#ffffff`,align:`horizontal`,multi:!1,vadjust:0,bold:{mod:`bold`},boldital:{mod:`bold italic`},ital:{mod:`italic`},mono:{mod:``,size:15,face:`courier new`,vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,n,r){if(t===e)return .5;{let n=1/(t-e);return Math.max(0,(r-e)*n)}}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:10,x:5,y:5},background:{enabled:!1,color:`rgba(111,111,111,1)`,size:10,dashes:!1},smooth:{enabled:!0,type:`dynamic`,forceDirection:`none`,roundness:.5},title:void 0,width:1,value:void 0},U(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,t,n;this.body.emitter.on(`_forceDisableDynamicCurves`,function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;t===`dynamic`&&(t=`continuous`);let r=!1;for(let n in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,n)){let i=e.body.edges[n],a=e.body.data.edges.get(n);if(a!=null){let e=a.smooth;e!==void 0&&e.enabled===!0&&e.type===`dynamic`&&(t===void 0?i.setOptions({smooth:!1}):i.setOptions({smooth:{type:t}}),r=!0)}}n===!0&&r===!0&&e.body.emitter.emit(`_dataChanged`)}),this.body.emitter.on(`_dataUpdated`,()=>{this.reconnectEdges()}),this.body.emitter.on(`refreshEdges`,B(t=this.refresh).call(t,this)),this.body.emitter.on(`refresh`,B(n=this.refresh).call(n,this)),this.body.emitter.on(`destroy`,()=>{W(this.edgesListeners,(e,t)=>{this.body.data.edges&&this.body.data.edges.off(t,e)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){TY.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(let e in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,e)&&(t=this.body.edges[e].updateEdgeType()||t);if(e.font!==void 0)for(let e in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,e)&&this.body.edges[e].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit(`_dataChanged`)}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.data.edges;if(CC(`id`,e))this.body.data.edges=e;else if(_M(e))this.body.data.edges=new xC,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new xC;else throw TypeError(`Array or DataSet expected`);if(n&&W(this.edgesListeners,(e,t)=>{n.off(t,e)}),this.body.edges={},this.body.data.edges){W(this.edgesListeners,(e,t)=>{this.body.data.edges.on(t,e)});let e=this.body.data.edges.getIds();this.add(e,!0)}this.body.emitter.emit(`_adjustEdgesForHierarchicalLayout`),t===!1&&this.body.emitter.emit(`_dataChanged`)}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.edges,r=this.body.data.edges;for(let t=0;t<e.length;t++){let i=e[t],a=n[i];a&&a.disconnect();let o=r.get(i,{showInternalIds:!0});n[i]=this.create(o)}this.body.emitter.emit(`_adjustEdgesForHierarchicalLayout`),t===!1&&this.body.emitter.emit(`_dataChanged`)}update(e){let t=this.body.edges,n=this.body.data.edges,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=n.get(a),s=t[a];s===void 0?(this.body.edges[a]=this.create(o),r=!0):(s.disconnect(),r=s.setOptions(o)||r,s.connect())}r===!0?(this.body.emitter.emit(`_adjustEdgesForHierarchicalLayout`),this.body.emitter.emit(`_dataChanged`)):this.body.emitter.emit(`_dataUpdated`)}remove(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;let n=this.body.edges;W(e,e=>{let t=n[e];t!==void 0&&t.remove()}),t&&this.body.emitter.emit(`_dataChanged`)}refresh(){W(this.body.edges,(e,t)=>{let n=this.body.data.edges.get(t);n!==void 0&&e.setOptions(n)})}create(e){return new TY(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e,t=this.body.nodes,n=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){let t=n[e];t.from=null,t.to=null,t.connect()}}getConnectedNodes(e){let t=[];if(this.body.edges[e]!==void 0){let n=this.body.edges[e];n.fromId!==void 0&&t.push(n.fromId),n.toId!==void 0&&t.push(n.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){let e=[];W(this.body.edges,(t,n)=>{let r=this.body.nodes[t.toId],i=this.body.nodes[t.fromId];r!==void 0&&r.isCluster===!0||i!==void 0&&i.isCluster===!0||(r===void 0||i===void 0)&&e.push(n)}),this.remove(e,!1)}_addMissingEdges(){let e=this.body.data.edges;if(e==null)return;let t=this.body.edges,n=[];V(e).call(e,(e,r)=>{t[r]===void 0&&n.push(r)}),this.add(n,!0)}},DY=class{constructor(e,t,n){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(n),this._rng=SB(`BARNES HUT SOLVER`)}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e,t=this.body.nodes,n=this.physicsBody.physicsNodeIndices,r=n.length,i=this._formBarnesHutTree(t,n);this.barnesHutTree=i;for(let a=0;a<r;a++)e=t[n[a]],e.options.mass>0&&this._getForceContributions(i.root,e)}}_getForceContributions(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}_getForceContribution(e,t){if(e.childrenCount>0){let n=e.centerOfMass.x-t.x,r=e.centerOfMass.y-t.y,i=Math.sqrt(n*n+r*r);i*e.calcSize>this.thetaInversed?this._calculateForces(i,n,r,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(i,n,r,t,e)}}_calculateForces(e,t,n,r,i){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&r.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*r.shape.radius,e-r.shape.radius));let a=this.options.gravitationalConstant*i.mass*r.options.mass/e**3,o=t*a,s=n*a;this.physicsBody.forces[r.id].x+=o,this.physicsBody.forces[r.id].y+=s}_formBarnesHutTree(e,t){let n,r=t.length,i=e[t[0]].x,a=e[t[0]].y,o=e[t[0]].x,s=e[t[0]].y;for(let n=1;n<r;n++){let r=e[t[n]],c=r.x,l=r.y;r.options.mass>0&&(c<i&&(i=c),c>o&&(o=c),l<a&&(a=l),l>s&&(s=l))}let c=Math.abs(o-i)-Math.abs(s-a);c>0?(a-=.5*c,s+=.5*c):(i+=.5*c,o-=.5*c);let l=Math.max(1e-5,Math.abs(o-i)),u=.5*l,d=.5*(i+o),f=.5*(a+s),p={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:d-u,maxX:d+u,minY:f-u,maxY:f+u},size:l,calcSize:1/l,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(p.root);for(let i=0;i<r;i++)n=e[t[i]],n.options.mass>0&&this._placeInTree(p.root,n);return p}_updateBranchMass(e,t){let n=e.centerOfMass,r=e.mass+t.options.mass,i=1/r;n.x=n.x*e.mass+t.x*t.options.mass,n.x*=i,n.y=n.y*e.mass+t.y*t.options.mass,n.y*=i,e.mass=r;let a=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<a?a:e.maxWidth}_placeInTree(e,t,n){(n!=1||n===void 0)&&this._updateBranchMass(e,t);let r=e.children.NW.range,i;i=r.maxX>t.x?r.maxY>t.y?`NW`:`SW`:r.maxY>t.y?`NE`:`SE`,this._placeInRegion(e,t,i)}_placeInRegion(e,t,n){let r=e.children[n];switch(r.childrenCount){case 0:r.children.data=t,r.childrenCount=1,this._updateBranchMass(r,t);break;case 1:r.children.data.x===t.x&&r.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(r),this._placeInTree(r,t));break;case 4:this._placeInTree(r,t);break}}_splitBranch(e){let t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,`NW`),this._insertRegion(e,`NE`),this._insertRegion(e,`SW`),this._insertRegion(e,`SE`),t!=null&&this._placeInTree(e,t)}_insertRegion(e,t){let n,r,i,a,o=.5*e.size;switch(t){case`NW`:n=e.range.minX,r=e.range.minX+o,i=e.range.minY,a=e.range.minY+o;break;case`NE`:n=e.range.minX+o,r=e.range.maxX,i=e.range.minY,a=e.range.minY+o;break;case`SW`:n=e.range.minX,r=e.range.minX+o,i=e.range.minY+o,a=e.range.maxY;break;case`SE`:n=e.range.minX+o,r=e.range.maxX,i=e.range.minY+o,a=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:n,maxX:r,minY:i,maxY:a},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}_drawBranch(e,t,n){n===void 0&&(n=`#FF0000`),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=n,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}},OY=class{constructor(e,t,n){this._rng=SB(`REPULSION SOLVER`),this.body=e,this.physicsBody=t,this.setOptions(n)}setOptions(e){this.options=e}solve(){let e,t,n,r,i,a,o,s,c=this.body.nodes,l=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,d=this.options.nodeDistance,f=-2/3/d;for(let p=0;p<l.length-1;p++){o=c[l[p]];for(let m=p+1;m<l.length;m++)s=c[l[m]],e=s.x-o.x,t=s.y-o.y,n=Math.sqrt(e*e+t*t),n===0&&(n=.1*this._rng(),e=n),n<2*d&&(a=n<.5*d?1:f*n+1.3333333333333333,a/=n,r=e*a,i=t*a,u[o.id].x-=r,u[o.id].y-=i,u[s.id].x+=r,u[s.id].y+=i)}}},kY=class{constructor(e,t,n){this.body=e,this.physicsBody=t,this.setOptions(n)}setOptions(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){let e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,n=this.physicsBody.forces,r=this.options.nodeDistance;for(let i=0;i<t.length-1;i++){let a=e[t[i]];for(let o=i+1;o<t.length;o++){let i=e[t[o]];if(a.level===i.level){let e=r+this.overlapAvoidanceFactor*((a.shape.radius||0)/2+(i.shape.radius||0)/2),t=i.x-a.x,o=i.y-a.y,s=Math.sqrt(t*t+o*o),c=.05,l;l=s<e?-((c*s)**2)+(c*e)**2:0,s!==0&&(l/=s);let u=t*l,d=o*l;n[a.id].x-=u,n[a.id].y-=d,n[i.id].x+=u,n[i.id].y+=d}}}}},AY=class{constructor(e,t,n){this.body=e,this.physicsBody=t,this.setOptions(n)}setOptions(e){this.options=e}solve(){let e,t,n=this.physicsBody.physicsEdgeIndices,r=this.body.edges,i,a,o;for(let s=0;s<n.length;s++)t=r[n[s]],t.connected===!0&&t.toId!==t.fromId&&this.body.nodes[t.toId]!==void 0&&this.body.nodes[t.fromId]!==void 0&&(t.edgeType.via===void 0?(e=t.options.length===void 0?this.options.springLength*1.5:t.options.length,this._calculateSpringForce(t.from,t.to,e)):(e=t.options.length===void 0?this.options.springLength:t.options.length,i=t.to,a=t.edgeType.via,o=t.from,this._calculateSpringForce(i,a,.5*e),this._calculateSpringForce(a,o,.5*e)))}_calculateSpringForce(e,t,n){let r=e.x-t.x,i=e.y-t.y,a=Math.max(Math.sqrt(r*r+i*i),.01),o=this.options.springConstant*(n-a)/a,s=r*o,c=i*o;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=s,this.physicsBody.forces[e.id].y+=c),this.physicsBody.forces[t.id]!==void 0&&(this.physicsBody.forces[t.id].x-=s,this.physicsBody.forces[t.id].y-=c)}},jY=class{constructor(e,t,n){this.body=e,this.physicsBody=t,this.setOptions(n)}setOptions(e){this.options=e}solve(){let e,t,n,r,i,a,o,s,c=this.body.edges,l=.5,u=this.physicsBody.physicsEdgeIndices,d=this.physicsBody.physicsNodeIndices,f=this.physicsBody.forces;for(let e=0;e<d.length;e++){let t=d[e];f[t].springFx=0,f[t].springFy=0}for(let d=0;d<u.length;d++)t=c[u[d]],t.connected===!0&&(e=t.options.length===void 0?this.options.springLength:t.options.length,n=t.from.x-t.to.x,r=t.from.y-t.to.y,s=Math.sqrt(n*n+r*r),s=s===0?.01:s,o=this.options.springConstant*(e-s)/s,i=n*o,a=r*o,t.to.level==t.from.level?(f[t.toId]!==void 0&&(f[t.toId].x-=l*i,f[t.toId].y-=l*a),f[t.fromId]!==void 0&&(f[t.fromId].x+=l*i,f[t.fromId].y+=l*a)):(f[t.toId]!==void 0&&(f[t.toId].springFx-=i,f[t.toId].springFy-=a),f[t.fromId]!==void 0&&(f[t.fromId].springFx+=i,f[t.fromId].springFy+=a)));o=1;let p,m;for(let e=0;e<d.length;e++){let t=d[e];p=Math.min(o,Math.max(-o,f[t].springFx)),m=Math.min(o,Math.max(-o,f[t].springFy)),f[t].x+=p,f[t].y+=m}let h=0,g=0;for(let e=0;e<d.length;e++){let t=d[e];h+=f[t].x,g+=f[t].y}let _=h/d.length,v=g/d.length;for(let e=0;e<d.length;e++){let t=d[e];f[t].x-=_,f[t].y-=v}}},MY=class{constructor(e,t,n){this.body=e,this.physicsBody=t,this.setOptions(n)}setOptions(e){this.options=e}solve(){let e,t,n,r,i=this.body.nodes,a=this.physicsBody.physicsNodeIndices,o=this.physicsBody.forces;for(let s=0;s<a.length;s++)r=i[a[s]],e=-r.x,t=-r.y,n=Math.sqrt(e*e+t*t),this._calculateForces(n,e,t,o,r)}_calculateForces(e,t,n,r,i){let a=e===0?0:this.options.centralGravity/e;r[i.id].x=t*a,r[i.id].y=n*a}},NY=class extends DY{constructor(e,t,n){super(e,t,n),this._rng=SB(`FORCE ATLAS 2 BASED REPULSION SOLVER`)}_calculateForces(e,t,n,r,i){e===0&&(e=.1*this._rng(),t=e),this.overlapAvoidanceFactor<1&&r.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*r.shape.radius,e-r.shape.radius));let a=r.edges.length+1,o=this.options.gravitationalConstant*i.mass*r.options.mass*a/e**2,s=t*o,c=n*o;this.physicsBody.forces[r.id].x+=s,this.physicsBody.forces[r.id].y+=c}},PY=class extends MY{constructor(e,t,n){super(e,t,n)}_calculateForces(e,t,n,r,i){if(e>0){let e=i.edges.length+1,a=this.options.centralGravity*e*i.options.mass;r[i.id].x=t*a,r[i.id].y=n*a}}},FY=class{constructor(e){this.body=e,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:`barnesHut`,stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},eD(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on(`initPhysics`,()=>{this.initPhysics()}),this.body.emitter.on(`_layoutFailed`,()=>{this.layoutFailed=!0}),this.body.emitter.on(`resetPhysics`,()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on(`disablePhysics`,()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on(`restorePhysics`,()=>{this.setOptions(this.options),this.ready===!0&&this.startSimulation()}),this.body.emitter.on(`startSimulation`,()=>{this.ready===!0&&this.startSimulation()}),this.body.emitter.on(`stopSimulation`,()=>{this.stopSimulation()}),this.body.emitter.on(`destroy`,()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on(`_dataChanged`,()=>{this.updatePhysicsData()})}setOptions(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,BB([`stabilization`],this.options,e),rV(this.options,e,`stabilization`),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());let t=this.options.wind;t&&((typeof t.x!=`number`||FU(t.x))&&(t.x=0),(typeof t.y!=`number`||FU(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver===`forceAtlas2Based`?(e=this.options.forceAtlas2Based,this.nodesSolver=new NY(this.body,this.physicsBody,e),this.edgesSolver=new AY(this.body,this.physicsBody,e),this.gravitySolver=new PY(this.body,this.physicsBody,e)):this.options.solver===`repulsion`?(e=this.options.repulsion,this.nodesSolver=new OY(this.body,this.physicsBody,e),this.edgesSolver=new AY(this.body,this.physicsBody,e),this.gravitySolver=new MY(this.body,this.physicsBody,e)):this.options.solver===`hierarchicalRepulsion`?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new kY(this.body,this.physicsBody,e),this.edgesSolver=new jY(this.body,this.physicsBody,e),this.gravitySolver=new MY(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new DY(this.body,this.physicsBody,e),this.edgesSolver=new AY(this.body,this.physicsBody,e),this.gravitySolver=new MY(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit(`fit`,{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit(`fit`))}startSimulation(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit(`_resizeNodes`),this.viewFunction===void 0){var e;this.viewFunction=B(e=this.simulationStep).call(e,this),this.body.emitter.on(`initRedraw`,this.viewFunction),this.body.emitter.emit(`_startRendering`)}}else this.body.emitter.emit(`_redraw`)}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off(`initRedraw`,this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit(`_stopRendering`))}simulationStep(){let e=aN();this.physicsTick(),(aN()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&PL(()=>{this.body.emitter.emit(`stabilized`,{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){let e=1.2;this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/e<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/e))}physicsTick(){this._startStabilizing(),this.stabilized!==!0&&(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0?(this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1):(this.timestep=this.options.timestep,this.physicsStep()),this.stabilized===!0&&this.revert(),this.stabilizationIterations++)}updatePhysicsData(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];let e=this.body.nodes,t=this.body.edges;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[t].id);for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&t[e].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[e].id);for(let e=0;e<this.physicsBody.physicsNodeIndices.length;e++){let t=this.physicsBody.physicsNodeIndices[e];this.physicsBody.forces[t]={x:0,y:0},this.physicsBody.velocities[t]===void 0&&(this.physicsBody.velocities[t]={x:0,y:0})}for(let t in this.physicsBody.velocities)e[t]===void 0&&delete this.physicsBody.velocities[t]}revert(){let e=KM(this.previousStates),t=this.body.nodes,n=this.physicsBody.velocities;this.referenceState={};for(let r=0;r<e.length;r++){let i=e[r];t[i]===void 0?delete this.previousStates[i]:t[i].options.physics===!0&&(this.referenceState[i]={positions:{x:t[i].x,y:t[i].y}},n[i].x=this.previousStates[i].vx,n[i].y=this.previousStates[i].vy,t[i].x=this.previousStates[i].x,t[i].y=this.previousStates[i].y)}}_evaluateStepQuality(){let e,t,n,r=this.body.nodes,i=this.referenceState;for(let a in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,a)&&r[a]!==void 0&&(e=r[a].x-i[a].positions.x,t=r[a].y-i[a].positions.y,n=Math.sqrt(e**2+t**2),n>.3))return!1;return!0}moveNodes(){let e=this.physicsBody.physicsNodeIndices,t=0,n=0;for(let r=0;r<e.length;r++){let i=e[r],a=this._performStep(i);t=Math.max(t,a),n+=a}this.adaptiveTimestepEnabled=n/e.length<5,this.stabilized=t<this.options.minVelocity}calculateComponentVelocity(e,t,n){let r=(t-this.modelOptions.damping*e)/n;e+=r*this.timestep;let i=this.options.maxVelocity||1e9;return Math.abs(e)>i&&(e=e>0?i:-i),e}_performStep(e){let t=this.body.nodes[e],n=this.physicsBody.forces[e];this.options.wind&&(n.x+=this.options.wind.x,n.y+=this.options.wind.y);let r=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:r.x,vy:r.y},t.options.fixed.x===!1?(r.x=this.calculateComponentVelocity(r.x,n.x,t.options.mass),t.x+=r.x*this.timestep):(n.x=0,r.x=0),t.options.fixed.y===!1?(r.y=this.calculateComponentVelocity(r.y,n.y,t.options.mass),t.y+=r.y*this.timestep):(n.y=0,r.y=0),Math.sqrt(r.x**2+r.y**2)}_freezeNodes(){let e=this.body.nodes;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){let n=e[t].options.fixed;this.freezeCache[t]={x:n.x,y:n.y},n.x=!0,n.y=!0}}_restoreFrozenNodes(){let e=this.body.nodes;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!=`number`&&(e=this.options.stabilization.iterations,console.error(`The stabilize method needs a numeric amount of iterations. Switching to default: `,e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit(`_resizeNodes`),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit(`_blockRedraw`),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,PL(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit(`startStabilizing`),this.startedStabilization=!0,!0)}_stabilizationBatch(){let e=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,t=()=>{this.body.emitter.emit(`stabilizationProgress`,{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&t();let n=0;for(;e()&&n<this.options.stabilization.updateInterval;)this.physicsTick(),n++;if(t(),e()){var r;PL(B(r=this._stabilizationBatch).call(r,this),0)}else this._finalizeStabilization()}_finalizeStabilization(){this.body.emitter.emit(`_allowRedraw`),this.options.stabilization.fit===!0&&this.body.emitter.emit(`fit`),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit(`stabilizationIterationsDone`),this.body.emitter.emit(`_requestRedraw`),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}_drawForces(e){for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){let n=this.physicsBody.physicsNodeIndices[t],r=this.body.nodes[n],i=this.physicsBody.forces[n],a=Math.sqrt(i.x**2+i.x**2),o=Math.min(Math.max(5,a),15),s=3*o,c=ZB((180-Math.min(1,Math.max(0,.03*a))*180)/360,1,1),l={x:r.x+20*i.x,y:r.y+20*i.y};e.lineWidth=o,e.strokeStyle=c,e.beginPath(),e.moveTo(r.x,r.y),e.lineTo(l.x,l.y),e.stroke();let u=Math.atan2(i.y,i.x);e.fillStyle=c,pY.draw(e,{type:`arrow`,point:l,angle:u,length:s}),$L(e).call(e)}}},IY=[];for(let e=0;e<256;++e)IY.push((e+256).toString(16).slice(1));function LY(e,t=0){return(IY[e[t+0]]+IY[e[t+1]]+IY[e[t+2]]+IY[e[t+3]]+`-`+IY[e[t+4]]+IY[e[t+5]]+`-`+IY[e[t+6]]+IY[e[t+7]]+`-`+IY[e[t+8]]+IY[e[t+9]]+`-`+IY[e[t+10]]+IY[e[t+11]]+IY[e[t+12]]+IY[e[t+13]]+IY[e[t+14]]+IY[e[t+15]]).toLowerCase()}var RY,zY=new Uint8Array(16);function BY(){if(!RY){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);RY=crypto.getRandomValues.bind(crypto)}return RY(zY)}var VY={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function HY(e,t,n){e||={};let r=e.random??e.rng?.()??BY();if(r.length<16)throw Error(`Random bytes length must be >= 16`);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,LY(r)}function UY(e,t,n){return VY.randomUUID&&!e?VY.randomUUID():HY(e)}var WY=class{constructor(){}static getRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,r=-1e9,i=1e9,a=-1e9,o;if(t.length>0)for(let s=0;s<t.length;s++)o=e[t[s]],i>o.shape.boundingBox.left&&(i=o.shape.boundingBox.left),a<o.shape.boundingBox.right&&(a=o.shape.boundingBox.right),n>o.shape.boundingBox.top&&(n=o.shape.boundingBox.top),r<o.shape.boundingBox.bottom&&(r=o.shape.boundingBox.bottom);return i===1e9&&a===-1e9&&n===1e9&&r===-1e9&&(n=0,r=0,i=0,a=0),{minX:i,maxX:a,minY:n,maxY:r}}static getRangeCore(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,r=-1e9,i=1e9,a=-1e9,o;if(t.length>0)for(let s=0;s<t.length;s++)o=e[t[s]],i>o.x&&(i=o.x),a<o.x&&(a=o.x),n>o.y&&(n=o.y),r<o.y&&(r=o.y);return i===1e9&&a===-1e9&&n===1e9&&r===-1e9&&(n=0,r=0,i=0,a=0),{minX:i,maxX:a,minY:n,maxY:r}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,t){let n={};return t===void 0||t===`node`?(U(n,e.options,!0),n.x=e.x,n.y=e.y,n.amountOfConnections=e.edges.length):U(n,e.options,!0),n}},GY=class extends zJ{constructor(e,t,n,r,i,a){super(e,t,n,r,i,a),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(e){let t=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw Error(`node with id: `+e+` not in current cluster`);if(!t.isCluster)throw Error(`node with id: `+e+` is not a cluster`);delete this.containedNodes[e],W(t.edges,e=>{delete this.containedEdges[e.id]}),W(t.containedNodes,(e,t)=>{this.containedNodes[t]=e}),t.containedNodes={},W(t.containedEdges,(e,t)=>{this.containedEdges[t]=e}),t.containedEdges={},W(t.edges,e=>{W(this.edges,t=>{var n,r;let i=H(n=t.clusteringEdgeReplacingIds).call(n,e.id);i!==-1&&(W(e.clusteringEdgeReplacingIds,e=>{t.clusteringEdgeReplacingIds.push(e),this.body.edges[e].edgeReplacedById=t.id}),uP(r=t.clusteringEdgeReplacingIds).call(r,i,1))})}),t.edges=[]}},KY=class{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},eD(this.options,this.defaultOptions),this.body.emitter.on(`_resetData`,()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,t){e===void 0?e=this._getHubSize():typeof e==`object`&&(t=this._checkOptions(e),e=this._getHubSize());let n=[];for(let t=0;t<this.body.nodeIndices.length;t++){let r=this.body.nodes[this.body.nodeIndices[t]];r.edges.length>=e&&n.push(r.id)}for(let e=0;e<n.length;e++)this.clusterByConnection(n[e],t,!0);this.body.emitter.emit(`_dataChanged`)}cluster(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw Error(`Cannot call clusterByNodeData without a joinCondition function in the options.`);e=this._checkOptions(e);let n={},r={};W(this.body.nodes,(t,i)=>{t.options&&e.joinCondition(t.options)===!0&&(n[i]=t,W(t.edges,e=>{this.clusteredEdges[e.id]===void 0&&(r[e.id]=e)}))}),this._cluster(n,r,e,t)}clusterByEdgeCount(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);let r=[],i={},a,o,s;for(let n=0;n<this.body.nodeIndices.length;n++){let c={},l={},u=this.body.nodeIndices[n],d=this.body.nodes[u];if(i[u]===void 0){s=0,o=[];for(let e=0;e<d.edges.length;e++)a=d.edges[e],this.clusteredEdges[a.id]===void 0&&(a.toId!==a.fromId&&s++,o.push(a));if(s===e){let e=function(e){if(t.joinCondition===void 0||t.joinCondition===null)return!0;let n=WY.cloneOptions(e);return t.joinCondition(n)},n=!0;for(let t=0;t<o.length;t++){a=o[t];let r=this._getConnectedId(a,u);if(e(d))l[a.id]=a,c[u]=d,c[r]=this.body.nodes[r],i[u]=!0;else{n=!1;break}}if(KM(c).length>0&&KM(l).length>0&&n===!0){let e=function(){for(let e=0;e<r.length;++e)for(let t in c)if(r[e].nodes[t]!==void 0)return r[e]}();if(e!==void 0){for(let t in c)e.nodes[t]===void 0&&(e.nodes[t]=c[t]);for(let t in l)e.edges[t]===void 0&&(e.edges[t]=l[t])}else r.push({nodes:c,edges:l})}}}}for(let e=0;e<r.length;e++)this._cluster(r[e].nodes,r[e].edges,t,!1);n===!0&&this.body.emitter.emit(`_dataChanged`)}clusterOutliers(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var n;let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw Error(`No nodeId supplied to clusterByConnection!`);if(this.body.nodes[e]===void 0)throw Error(`The nodeId given to clusterByConnection does not exist!`);let i=this.body.nodes[e];t=this._checkOptions(t,i),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=i.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=i.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=i.options.fixed.x,t.clusterNodeProperties.fixed.y=i.options.fixed.y);let a={},o={},s=i.id,c=WY.cloneOptions(i);a[s]=i;for(let e=0;e<i.edges.length;e++){let n=i.edges[e];if(this.clusteredEdges[n.id]===void 0){let e=this._getConnectedId(n,s);if(this.clusteredNodes[e]===void 0)if(e!==s)if(t.joinCondition===void 0)o[n.id]=n,a[e]=this.body.nodes[e];else{let r=WY.cloneOptions(this.body.nodes[e]);t.joinCondition(c,r)===!0&&(o[n.id]=n,a[e]=this.body.nodes[e])}else o[n.id]=n}}let l=NM(n=KM(a)).call(n,function(e){return a[e].id});for(let e in a){if(!Object.prototype.hasOwnProperty.call(a,e))continue;let t=a[e];for(let e=0;e<t.edges.length;e++){let n=t.edges[e];H(l).call(l,this._getConnectedId(n,t.id))>-1&&(o[n.id]=n)}}this._cluster(a,o,t,r)}_createClusterEdges(e,t,n,r){let i,a,o,s,c,l,u=KM(e),d=[];for(let r=0;r<u.length;r++){a=u[r],o=e[a];for(let r=0;r<o.edges.length;r++)i=o.edges[r],this.clusteredEdges[i.id]===void 0&&(i.toId==i.fromId?t[i.id]=i:i.toId==a?(s=n.id,c=i.fromId,l=c):(s=i.toId,c=n.id,l=s),e[l]===void 0&&d.push({edge:i,fromId:c,toId:s}))}let f=[],p=function(e){for(let t=0;t<f.length;t++){let n=f[t],r=e.fromId===n.fromId&&e.toId===n.toId,i=e.fromId===n.toId&&e.toId===n.fromId;if(r||i)return n}return null};for(let e=0;e<d.length;e++){let t=d[e],n=t.edge,i=p(t);i===null?(i=this._createClusteredEdge(t.fromId,t.toId,n,r),f.push(i)):i.clusteringEdgeReplacingIds.push(n.id),this.body.edges[n.id].edgeReplacedById=i.id,this._backupEdgeOptions(n),n.setOptions({physics:!1})}}_checkOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=[];for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.clusteredNodes[t]!==void 0&&i.push(t);for(let t=0;t<i.length;++t)delete e[i[t]];if(KM(e).length==0||KM(e).length==1&&n.clusterNodeProperties.allowSingleNodeCluster!=1)return;let a=U({},n.clusterNodeProperties);if(n.processProperties!==void 0){let r=[];for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=WY.cloneOptions(e[t]);r.push(n)}let i=[];for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&e.substr(0,12)!==`clusterEdge:`){let n=WY.cloneOptions(t[e],`edge`);i.push(n)}if(a=n.processProperties(a,r,i),!a)throw Error(`The processProperties function does not return properties!`)}a.id===void 0&&(a.id=`cluster:`+UY());let o=a.id;a.label===void 0&&(a.label=`cluster`);let s;a.x===void 0&&(s=this._getClusterPosition(e),a.x=s.x),a.y===void 0&&(s===void 0&&(s=this._getClusterPosition(e)),a.y=s.y),a.id=o;let c=this.body.functions.createNode(a,GY);c.containedNodes=e,c.containedEdges=t,c.clusterEdgeProperties=n.clusterEdgeProperties,this.body.nodes[a.id]=c,this._clusterEdges(e,t,a,n.clusterEdgeProperties),a.id=void 0,r===!0&&this.body.emitter.emit(`_dataChanged`)}_backupEdgeOptions(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}_restoreEdge(e){let t=this.clusteredEdges[e.id];t!==void 0&&(e.setOptions({physics:t.physics}),delete this.clusteredEdges[e.id])}isCluster(e){return this.body.nodes[e]===void 0?(console.error(`Node does not exist.`),!1):this.body.nodes[e].isCluster===!0}_getClusterPosition(e){let t=KM(e),n=e[t[0]].x,r=e[t[0]].x,i=e[t[0]].y,a=e[t[0]].y,o;for(let s=1;s<t.length;s++)o=e[t[s]],n=o.x<n?o.x:n,r=o.x>r?o.x:r,i=o.y<i?o.y:i,a=o.y>a?o.y:a;return{x:.5*(n+r),y:.5*(i+a)}}openCluster(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw Error(`No clusterNodeId supplied to openCluster.`);let r=this.body.nodes[e];if(r===void 0)throw Error(`The clusterNodeId supplied to openCluster does not exist.`);if(r.isCluster!==!0||r.containedNodes===void 0||r.containedEdges===void 0)throw Error(`The node:`+e+` is not a valid cluster.`);let i=this.findNode(e),a=H(i).call(i,e)-1;if(a>=0){let t=i[a];this.body.nodes[t]._openChildCluster(e),delete this.body.nodes[e],n===!0&&this.body.emitter.emit(`_dataChanged`);return}let o=r.containedNodes,s=r.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction==`function`){let e={},n={x:r.x,y:r.y};for(let t in o)if(Object.prototype.hasOwnProperty.call(o,t)){let n=this.body.nodes[t];e[t]={x:n.x,y:n.y}}let i=t.releaseFunction(n,e);for(let e in o)if(Object.prototype.hasOwnProperty.call(o,e)){let t=this.body.nodes[e];i[e]!==void 0&&(t.x=i[e].x===void 0?r.x:i[e].x,t.y=i[e].y===void 0?r.y:i[e].y)}}else W(o,function(e){e.options.fixed.x===!1&&(e.x=r.x),e.options.fixed.y===!1&&(e.y=r.y)});for(let e in o)if(Object.prototype.hasOwnProperty.call(o,e)){let t=this.body.nodes[e];t.vx=r.vx,t.vy=r.vy,t.setOptions({physics:!0}),delete this.clusteredNodes[e]}let c=[];for(let e=0;e<r.edges.length;e++)c.push(r.edges[e]);for(let t=0;t<c.length;t++){let n=c[t],r=this._getConnectedId(n,e),i=this.clusteredNodes[r];for(let e=0;e<n.clusteringEdgeReplacingIds.length;e++){let t=n.clusteringEdgeReplacingIds[e],a=this.body.edges[t];if(a!==void 0)if(i!==void 0){let e=this.body.nodes[i.clusterId];e.containedEdges[a.id]=a,delete s[a.id];let t=a.fromId,n=a.toId;a.toId==r?n=i.clusterId:t=i.clusterId,this._createClusteredEdge(t,n,a,e.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(a)}n.remove()}for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&this._restoreEdge(s[e]);delete this.body.nodes[e],n===!0&&this.body.emitter.emit(`_dataChanged`)}getNodesInCluster(e){let t=[];if(this.isCluster(e)===!0){let n=this.body.nodes[e].containedNodes;for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.push(this.body.nodes[e].id)}return t}findNode(e){let t=[],n=0,r;for(;this.clusteredNodes[e]!==void 0&&n<100;){if(r=this.body.nodes[e],r===void 0)return[];t.push(r.id),e=this.clusteredNodes[e].clusterId,n++}return r=this.body.nodes[e],r===void 0?[]:(t.push(r.id),HN(t).call(t),t)}updateClusteredNode(e,t){if(e===void 0)throw Error(`No clusteredNodeId supplied to updateClusteredNode.`);if(t===void 0)throw Error(`No newOptions supplied to updateClusteredNode.`);if(this.body.nodes[e]===void 0)throw Error(`The clusteredNodeId supplied to updateClusteredNode does not exist.`);this.body.nodes[e].setOptions(t),this.body.emitter.emit(`_dataChanged`)}updateEdge(e,t){if(e===void 0)throw Error(`No startEdgeId supplied to updateEdge.`);if(t===void 0)throw Error(`No newOptions supplied to updateEdge.`);if(this.body.edges[e]===void 0)throw Error(`The startEdgeId supplied to updateEdge does not exist.`);let n=this.getClusteredEdges(e);for(let e=0;e<n.length;e++)this.body.edges[n[e]].setOptions(t);this.body.emitter.emit(`_dataChanged`)}getClusteredEdges(e){let t=[],n=0;for(;e!==void 0&&this.body.edges[e]!==void 0&&n<100;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,n++;return HN(t).call(t),t}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){let t=[e],n=[],r=[],i=0;for(;t.length>0&&i<100;){let e=t.pop();if(e===void 0)continue;let a=this.body.edges[e];if(a===void 0)continue;i++;let o=a.clusteringEdgeReplacingIds;if(o===void 0)r.push(e);else for(let e=0;e<o.length;++e){let r=o[e];H(t).call(t,o)!==-1||H(n).call(n,o)!==-1||t.push(r)}n.push(e)}return r}_getConnectedId(e,t){return e.toId==t?(e.fromId,e.fromId):e.toId}_getHubSize(){let e=0,t=0,n=0,r=0;for(let i=0;i<this.body.nodeIndices.length;i++){let a=this.body.nodes[this.body.nodeIndices[i]];a.edges.length>r&&(r=a.edges.length),e+=a.edges.length,t+=a.edges.length**2,n+=1}e/=n,t/=n;let i=t-e**2,a=Math.sqrt(i),o=Math.floor(e+2*a);return o>r&&(o=r),o}_createClusteredEdge(e,t,n,r,i){let a=WY.cloneOptions(n,`edge`);U(a,r),a.from=e,a.to=t,a.id=`clusterEdge:`+UY(),i!==void 0&&U(a,i);let o=this.body.functions.createEdge(a);return o.clusteringEdgeReplacingIds=[n.id],o.connect(),this.body.edges[o.id]=o,o}_clusterEdges(e,t,n,r){if(t instanceof TY){let e=t,n={};n[e.id]=e,t=n}if(e instanceof zJ){let t=e,n={};n[t.id]=t,e=n}if(n==null)throw Error(`_clusterEdges: parameter clusterNode required`);r===void 0&&(r=n.clusterEdgeProperties),this._createClusterEdges(e,t,n,r);for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&this.body.edges[e]!==void 0){let t=this.body.edges[e];this._backupEdgeOptions(t),t.setOptions({physics:!1})}for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.clusteredNodes[t]={clusterId:n.id,node:this.body.nodes[t]},this.body.nodes[t].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;let t=this.clusteredNodes[e];if(t===void 0)return;let n=t.clusterId;if(n!==void 0)return this.body.nodes[n]}_filter(e,t){let n=[];return W(e,e=>{t(e)&&n.push(e)}),n}_updateState(){let e,t=[],n={},r=e=>{W(this.body.nodes,t=>{t.isCluster===!0&&e(t)})};for(e in this.clusteredNodes)Object.prototype.hasOwnProperty.call(this.clusteredNodes,e)&&this.body.nodes[e]===void 0&&t.push(e);r(function(e){for(let n=0;n<t.length;n++)delete e.containedNodes[t[n]]});for(let e=0;e<t.length;e++)delete this.clusteredNodes[t[e]];W(this.clusteredEdges,e=>{let t=this.body.edges[e];(t===void 0||!t.endPointsValid())&&(n[e]=e)}),r(function(e){W(e.containedEdges,(e,t)=>{!e.endPointsValid()&&!n[t]&&(n[t]=t)})}),W(this.body.edges,(e,t)=>{let r=!0,i=e.clusteringEdgeReplacingIds;if(i!==void 0){let e=0;W(i,t=>{let n=this.body.edges[t];n!==void 0&&n.endPointsValid()&&(e+=1)}),r=e>0}(!e.endPointsValid()||!r)&&(n[t]=t)}),r(e=>{W(n,t=>{delete e.containedEdges[t],W(e.edges,(r,i)=>{if(r.id===t){e.edges[i]=null;return}r.clusteringEdgeReplacingIds=this._filter(r.clusteringEdgeReplacingIds,function(e){return!n[e]})}),e.edges=this._filter(e.edges,function(e){return e!==null})})}),W(n,e=>{delete this.clusteredEdges[e]}),W(n,e=>{delete this.body.edges[e]}),W(KM(this.body.edges),e=>{let t=this.body.edges[e],n=this._isClusteredNode(t.fromId)||this._isClusteredNode(t.toId);if(n!==this._isClusteredEdge(t.id))if(n){let e=this._getClusterNodeForNode(t.fromId);e!==void 0&&this._clusterEdges(this.body.nodes[t.fromId],t,e);let n=this._getClusterNodeForNode(t.toId);n!==void 0&&this._clusterEdges(this.body.nodes[t.toId],t,n)}else delete this._clusterEdges[e],this._restoreEdge(t)});let i=!1,a=!0;for(;a;){let e=[];r(function(t){let n=KM(t.containedNodes).length,r=t.options.allowSingleNodeCluster===!0;(r&&n<1||!r&&n<2)&&e.push(t.id)});for(let t=0;t<e.length;++t)this.openCluster(e[t],{},!1);a=e.length>0,i||=a}i&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}},qY=class{constructor(e,t){this.body=e,this.canvas=t,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},eD(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.on(`dragStart`,()=>{this.dragging=!0}),this.body.emitter.on(`dragEnd`,()=>{this.dragging=!1}),this.body.emitter.on(`zoom`,()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=PL(()=>{var e;this.zooming=!1,B(e=this._requestRedraw).call(e,this)()},250)}),this.body.emitter.on(`_resizeNodes`,()=>{this._resizeNodes()}),this.body.emitter.on(`_redraw`,()=>{this.renderingActive===!1&&this._redraw()}),this.body.emitter.on(`_blockRedraw`,()=>{this.allowRedraw=!1}),this.body.emitter.on(`_allowRedraw`,()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on(`_requestRedraw`,B(e=this._requestRedraw).call(e,this)),this.body.emitter.on(`_startRendering`,()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on(`_stopRendering`,()=>{--this.renderRequests,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0}),this.body.emitter.on(`destroy`,()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()})}setOptions(e){e!==void 0&&zB([`hideEdgesOnDrag`,`hideEdgesOnZoom`,`hideNodesOnDrag`],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(B(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit(`setSize`),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit(`initRedraw`),this.redrawRequested=!1;let t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();let n=this.canvas.getContext(),r=this.canvas.frame.canvas.clientWidth,i=this.canvas.frame.canvas.clientHeight;if(n.clearRect(0,0,r,i),this.canvas.frame.clientWidth===0)return;if(n.save(),n.translate(this.body.view.translation.x,this.body.view.translation.y),n.scale(this.body.view.scale,this.body.view.scale),n.beginPath(),this.body.emitter.emit(`beforeDrawing`,n),n.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(n),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){let{drawExternalLabels:r}=this._drawNodes(n,e);t.drawExternalLabels=r}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(n),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(n),n.beginPath(),this.body.emitter.emit(`afterDrawing`,n),n.closePath(),n.restore(),e===!0&&n.clearRect(0,0,r,i)}}_resizeNodes(){this.canvas.setTransform();let e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);let t=this.body.nodes,n;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n=t[r],n.resize(e),n.updateBoundingBox(e,n.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.nodes,r=this.body.nodeIndices,i,a=[],o=[],s=this.canvas.DOMtoCanvas({x:-20,y:-20}),c=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),l={top:s.y,left:s.x,bottom:c.y,right:c.x},u=[];for(let s=0;s<r.length;s++)if(i=n[r[s]],i.hover)o.push(r[s]);else if(i.isSelected())a.push(r[s]);else if(t===!0){let t=i.draw(e);t.drawExternalLabel!=null&&u.push(t.drawExternalLabel)}else if(i.isBoundingBoxOverlappingWith(l)===!0){let t=i.draw(e);t.drawExternalLabel!=null&&u.push(t.drawExternalLabel)}else i.updateBoundingBox(e,i.selected);let d,f=a.length,p=o.length;for(d=0;d<f;d++){i=n[a[d]];let t=i.draw(e);t.drawExternalLabel!=null&&u.push(t.drawExternalLabel)}for(d=0;d<p;d++){i=n[o[d]];let t=i.draw(e);t.drawExternalLabel!=null&&u.push(t.drawExternalLabel)}return{drawExternalLabels:()=>{for(let e of u)e()}}}_drawEdges(e){let t=this.body.edges,n=this.body.edgeIndices;for(let r=0;r<n.length;r++){let i=t[n[r]];i.connected===!0&&i.draw(e)}}_drawArrows(e){let t=this.body.edges,n=this.body.edgeIndices;for(let r=0;r<n.length;r++){let i=t[n[r]];i.connected===!0&&i.drawArrows(e)}}_drawSelectionBox(e){if(this.body.selectionBox.show){e.beginPath();let t=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,n=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;e.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,n),e.fillStyle=`rgba(151, 194, 252, 0.2)`,e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,n),e.strokeStyle=`rgba(151, 194, 252, 1)`,e.stroke()}else e.closePath()}},JY,YY;function XY(){return YY?JY:(YY=1,DL(),JY=R().setInterval,JY)}var ZY,QY;function $Y(){return QY?ZY:(QY=1,ZY=XY(),ZY)}var eX=F($Y());function tX(e,t){t.inputHandler=function(e){e.isFirst&&t(e)},e.on(`hammer.input`,t.inputHandler)}function nX(e,t){return t.inputHandler=function(e){e.isFinal&&t(e)},e.on(`hammer.input`,t.inputHandler)}var rX=class{constructor(e){this.body=e,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:`100%`,width:`100%`},eD(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once(`resize`,e=>{e.width!==0&&(this.body.view.translation.x=e.width*.5),e.height!==0&&(this.body.view.translation.y=e.height*.5)}),this.body.emitter.on(`setSize`,B(e=this.setSize).call(e,this)),this.body.emitter.on(`destroy`,()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&zB([`width`,`height`,`autoResize`],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){let e=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit(`_requestRedraw`)}),{frame:t}=this;e.observe(t),this._cleanupCallbacks.push(()=>{e.unobserve(t)})}else{let e=eX(()=>{this.setSize()===!0&&this.body.emitter.emit(`_requestRedraw`)},1e3);this._cleanupCallbacks.push(()=>{clearInterval(e)})}let e=B(t=this._onResize).call(t,this);window.addEventListener(`resize`,e),this._cleanupCallbacks.push(()=>{window.removeEventListener(`resize`,e)})}}_cleanUp(){var e,t,n;V(e=HN(t=uP(n=this._cleanupCallbacks).call(n,0)).call(t)).call(e,e=>{try{e()}catch(e){console.error(e)}})}_onResize(){this.setSize(),this.body.emitter.emit(`_redraw`)}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){let e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,n=this.cameraState.scale;e!=1&&t!=1?n=this.cameraState.scale*.5*(e+t):e==1?t!=1&&(n=this.cameraState.scale*t):n=this.cameraState.scale*e,this.body.view.scale=n;let r=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),i={x:r.x-this.cameraState.position.x,y:r.y-this.cameraState.position.y};this.body.view.translation.x+=i.x*this.body.view.scale,this.body.view.translation.y+=i.y*this.body.view.scale}}_prepareValue(e){if(typeof e==`number`)return e+`px`;if(typeof e==`string`){if(H(e).call(e,`%`)!==-1||H(e).call(e,`px`)!==-1)return e;if(H(e).call(e,`%`)===-1)return e+`px`}throw Error(`Could not use the value supplied for width or height:`+e)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement(`div`),this.frame.className=`vis-network`,this.frame.style.position=`relative`,this.frame.style.overflow=`hidden`,this.frame.tabIndex=0,this.frame.canvas=document.createElement(`canvas`),this.frame.canvas.style.position=`relative`,this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{let e=document.createElement(`DIV`);e.style.color=`red`,e.style.fontWeight=`bold`,e.style.padding=`10px`,e.innerText=`Error: your browser does not support HTML canvas`,this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new _V(this.frame.canvas),this.hammer.get(`pinch`).set({enable:!0}),this.hammer.get(`pan`).set({threshold:5,direction:_V.DIRECTION_ALL}),tX(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on(`tap`,e=>{this.body.eventListeners.onTap(e)}),this.hammer.on(`doubletap`,e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on(`press`,e=>{this.body.eventListeners.onHold(e)}),this.hammer.on(`panstart`,e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on(`panmove`,e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on(`panend`,e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on(`pinch`,e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener(`wheel`,e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener(`mousemove`,e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener(`contextmenu`,e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new _V(this.frame),nX(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);let n=!1,r=this.frame.canvas.width,i=this.frame.canvas.height,a=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(a),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width=`100%`,this.frame.canvas.style.height=`100%`,this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},n=!0;else{let e=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),t=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==e||this.frame.canvas.height!==t)&&this._getCameraState(a),this.frame.canvas.width!==e&&(this.frame.canvas.width=e,n=!0),this.frame.canvas.height!==t&&(this.frame.canvas.height=t,n=!0)}return n===!0&&(this.body.emitter.emit(`resize`,{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(r/this.pixelRatio),oldHeight:Math.round(i/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,n}getContext(){return this.frame.canvas.getContext(`2d`)}_determinePixelRatio(){let e=this.getContext();if(e===void 0)throw Error(`Could not get canvax context`);let t=1;typeof window<`u`&&(t=window.devicePixelRatio||1);let n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/n}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){let e=this.getContext();if(e===void 0)throw Error(`Could not get canvax context`);e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}};function iX(e,t){let n=eD({nodes:t,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},e??{});if(!_M(n.nodes))throw TypeError(`Nodes has to be an array of ids.`);if(n.nodes.length===0&&(n.nodes=t),!(typeof n.minZoomLevel==`number`&&n.minZoomLevel>0))throw TypeError(`Min zoom level has to be a number higher than zero.`);if(!(typeof n.maxZoomLevel==`number`&&n.minZoomLevel<=n.maxZoomLevel))throw TypeError(`Max zoom level has to be a number higher than min zoom level.`);return n}var aX=class{constructor(e,t){var n,r;this.body=e,this.canvas=t,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction=`easeInOutQuint`,this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on(`fit`,B(n=this.fit).call(n,this)),this.body.emitter.on(`animationFinished`,()=>{this.body.emitter.emit(`_stopRendering`)}),this.body.emitter.on(`unlockNode`,B(r=this.releaseNode).call(r,this))}setOptions(){this.options=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}}fit(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=iX(e,this.body.nodeIndices);let n=this.canvas.frame.canvas.clientWidth,r=this.canvas.frame.canvas.clientHeight,i,a;if(n===0||r===0)a=1,i=WY.getRange(this.body.nodes,e.nodes);else if(t===!0){let t=0;for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this.body.nodes[e].predefinedPosition===!0&&(t+=1);if(t>.5*this.body.nodeIndices.length){this.fit(e,!1);return}i=WY.getRange(this.body.nodes,e.nodes),a=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;let o=Math.min(n/600,r/600);a*=o}else{this.body.emitter.emit(`_resizeNodes`),i=WY.getRange(this.body.nodes,e.nodes);let t=Math.abs(i.maxX-i.minX)*1.1,o=Math.abs(i.maxY-i.minY)*1.1,s=n/t,c=r/o;a=s<=c?s:c}a>e.maxZoomLevel?a=e.maxZoomLevel:a<e.minZoomLevel&&(a=e.minZoomLevel);let o={position:WY.findCenter(i),scale:a,animation:e.animation};this.moveTo(o)}focus(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.body.nodes[e]===void 0?console.error(`Node: `+e+` cannot be found.`):(t.position={x:this.body.nodes[e].x,y:this.body.nodes[e].y},t.lockedOnNode=e,this.moveTo(t))}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!ZU(e.offset.x))throw TypeError(`The option "offset.x" has to be a finite number.`)}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!ZU(e.offset.y))throw TypeError(`The option "offset.y" has to be a finite number.`)}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!ZU(e.position.x))throw TypeError(`The option "position.x" has to be a finite number.`)}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!ZU(e.position.y))throw TypeError(`The option "position.y" has to be a finite number.`)}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw TypeError(`The option "scale" has to be a number greater than zero.`)}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction=`easeInOutQuad`),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;let t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+n.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+n.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var r;this.viewFunction=B(r=this._lockedRedraw).call(r,this),this.body.emitter.on(`initRedraw`,this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit(`_requestRedraw`);else{var i;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=B(i=this._transitionRedraw).call(i,this),this.body.emitter.on(`initRedraw`,this.viewFunction),this.body.emitter.emit(`_startRendering`)}}_lockedRedraw(){let e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:t.x-e.x,y:t.y-e.y},r=this.body.view.translation,i={x:r.x+n.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:r.y+n.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=i}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off(`initRedraw`,this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;let t=iV[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){if(this.body.emitter.off(`initRedraw`,this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var n;this.viewFunction=B(n=this._lockedRedraw).call(n,this),this.body.emitter.on(`initRedraw`,this.viewFunction)}this.body.emitter.emit(`animationFinished`)}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}};function oX(e){var t=e&&e.preventDefault||!1,n=e&&e.container||window,r={},i={keydown:{},keyup:{}},a={},o;for(o=97;o<=122;o++)a[String.fromCharCode(o)]={code:65+(o-97),shift:!1};for(o=65;o<=90;o++)a[String.fromCharCode(o)]={code:o,shift:!0};for(o=0;o<=9;o++)a[``+o]={code:48+o,shift:!1};for(o=1;o<=12;o++)a[`F`+o]={code:111+o,shift:!1};for(o=0;o<=9;o++)a[`num`+o]={code:96+o,shift:!1};a[`num*`]={code:106,shift:!1},a[`num+`]={code:107,shift:!1},a[`num-`]={code:109,shift:!1},a[`num/`]={code:111,shift:!1},a[`num.`]={code:110,shift:!1},a.left={code:37,shift:!1},a.up={code:38,shift:!1},a.right={code:39,shift:!1},a.down={code:40,shift:!1},a.space={code:32,shift:!1},a.enter={code:13,shift:!1},a.shift={code:16,shift:void 0},a.esc={code:27,shift:!1},a.backspace={code:8,shift:!1},a.tab={code:9,shift:!1},a.ctrl={code:17,shift:!1},a.alt={code:18,shift:!1},a.delete={code:46,shift:!1},a.pageup={code:33,shift:!1},a.pagedown={code:34,shift:!1},a[`=`]={code:187,shift:!1},a[`-`]={code:189,shift:!1},a[`]`]={code:221,shift:!1},a[`[`]={code:219,shift:!1};var s=function(e){l(e,`keydown`)},c=function(e){l(e,`keyup`)},l=function(e,n){if(i[n][e.keyCode]!==void 0){for(var r=i[n][e.keyCode],a=0;a<r.length;a++)(r[a].shift===void 0||r[a].shift==1&&e.shiftKey==1||r[a].shift==0&&e.shiftKey==0)&&r[a].fn(e);t==1&&e.preventDefault()}};return r.bind=function(e,t,n){if(n===void 0&&(n=`keydown`),a[e]===void 0)throw Error(`unsupported key: `+e);i[n][a[e].code]===void 0&&(i[n][a[e].code]=[]),i[n][a[e].code].push({fn:t,shift:a[e].shift})},r.bindAll=function(e,t){for(var n in t===void 0&&(t=`keydown`),a)a.hasOwnProperty(n)&&r.bind(n,e,t)},r.getKey=function(e){for(var t in a)if(a.hasOwnProperty(t)&&(e.shiftKey==1&&a[t].shift==1&&e.keyCode==a[t].code||e.shiftKey==0&&a[t].shift==0&&e.keyCode==a[t].code||e.keyCode==a[t].code&&t==`shift`))return t;return`unknown key, currently not supported`},r.unbind=function(e,t,n){if(n===void 0&&(n=`keydown`),a[e]===void 0)throw Error(`unsupported key: `+e);if(t!==void 0){var r=[],o=i[n][a[e].code];if(o!==void 0)for(var s=0;s<o.length;s++)o[s].fn==t&&o[s].shift==a[e].shift||r.push(i[n][a[e].code][s]);i[n][a[e].code]=r}else i[n][a[e].code]=[]},r.reset=function(){i={keydown:{},keyup:{}}},r.destroy=function(){i={keydown:{},keyup:{}},n.removeEventListener(`keydown`,s,!0),n.removeEventListener(`keyup`,c,!0)},n.addEventListener(`keydown`,s,!0),n.addEventListener(`keyup`,c,!0),r}var sX=class{constructor(e,t){this.body=e,this.canvas=t,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on(`activate`,()=>{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on(`deactivate`,()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on(`destroy`,()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}loadNavigationElements(){this.cleanNavigation(),this.navigationDOM={};let e=[`up`,`down`,`left`,`right`,`zoomIn`,`zoomOut`,`zoomExtends`],t=[`_moveUp`,`_moveDown`,`_moveLeft`,`_moveRight`,`_zoomIn`,`_zoomOut`,`_fit`];this.navigationDOM.wrapper=document.createElement(`div`),this.navigationDOM.wrapper.className=`vis-navigation`,this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(let i=0;i<e.length;i++){this.navigationDOM[e[i]]=document.createElement(`div`),this.navigationDOM[e[i]].className=`vis-button vis-`+e[i],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[i]]);let a=new _V(this.navigationDOM[e[i]]);if(t[i]===`_fit`){var n;tX(a,B(n=this._fit).call(n,this))}else{var r;tX(a,B(r=this.bindToRedraw).call(r,this,t[i]))}this.navigationHammers.push(a)}let i=new _V(this.canvas.frame);nX(i,()=>{this._stopMovement()}),this.navigationHammers.push(i),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=B(t=this[e]).call(t,this),this.body.emitter.on(`initRedraw`,this.boundFunctions[e]),this.body.emitter.emit(`_startRendering`)}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off(`initRedraw`,this.boundFunctions[e]),this.body.emitter.emit(`_stopRendering`),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit(`fit`,{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(let e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off(`initRedraw`,this.boundFunctions[e]),this.body.emitter.emit(`_stopRendering`));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){let e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,r=t/e,i=(1-r)*this.canvas.canvasViewCenter.x+n.x*r,a=(1-r)*this.canvas.canvasViewCenter.y+n.y*r;this.body.view.scale=t,this.body.view.translation={x:i,y:a},this.body.emitter.emit(`zoom`,{direction:`+`,scale:this.body.view.scale,pointer:null})}_zoomOut(){let e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,r=t/e,i=(1-r)*this.canvas.canvasViewCenter.x+n.x*r,a=(1-r)*this.canvas.canvasViewCenter.y+n.y*r;this.body.view.scale=t,this.body.view.translation={x:i,y:a},this.body.emitter.emit(`zoom`,{direction:`-`,scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=oX({container:window,preventDefault:!0}):this.keycharm=oX({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C;B(e=this.keycharm).call(e,`up`,()=>{this.bindToRedraw(`_moveUp`)},`keydown`),B(t=this.keycharm).call(t,`down`,()=>{this.bindToRedraw(`_moveDown`)},`keydown`),B(n=this.keycharm).call(n,`left`,()=>{this.bindToRedraw(`_moveLeft`)},`keydown`),B(r=this.keycharm).call(r,`right`,()=>{this.bindToRedraw(`_moveRight`)},`keydown`),B(i=this.keycharm).call(i,`=`,()=>{this.bindToRedraw(`_zoomIn`)},`keydown`),B(a=this.keycharm).call(a,`num+`,()=>{this.bindToRedraw(`_zoomIn`)},`keydown`),B(o=this.keycharm).call(o,`num-`,()=>{this.bindToRedraw(`_zoomOut`)},`keydown`),B(s=this.keycharm).call(s,`-`,()=>{this.bindToRedraw(`_zoomOut`)},`keydown`),B(c=this.keycharm).call(c,`[`,()=>{this.bindToRedraw(`_zoomOut`)},`keydown`),B(l=this.keycharm).call(l,`]`,()=>{this.bindToRedraw(`_zoomIn`)},`keydown`),B(u=this.keycharm).call(u,`pageup`,()=>{this.bindToRedraw(`_zoomIn`)},`keydown`),B(d=this.keycharm).call(d,`pagedown`,()=>{this.bindToRedraw(`_zoomOut`)},`keydown`),B(f=this.keycharm).call(f,`up`,()=>{this.unbindFromRedraw(`_moveUp`)},`keyup`),B(p=this.keycharm).call(p,`down`,()=>{this.unbindFromRedraw(`_moveDown`)},`keyup`),B(m=this.keycharm).call(m,`left`,()=>{this.unbindFromRedraw(`_moveLeft`)},`keyup`),B(h=this.keycharm).call(h,`right`,()=>{this.unbindFromRedraw(`_moveRight`)},`keyup`),B(g=this.keycharm).call(g,`=`,()=>{this.unbindFromRedraw(`_zoomIn`)},`keyup`),B(_=this.keycharm).call(_,`num+`,()=>{this.unbindFromRedraw(`_zoomIn`)},`keyup`),B(v=this.keycharm).call(v,`num-`,()=>{this.unbindFromRedraw(`_zoomOut`)},`keyup`),B(y=this.keycharm).call(y,`-`,()=>{this.unbindFromRedraw(`_zoomOut`)},`keyup`),B(b=this.keycharm).call(b,`[`,()=>{this.unbindFromRedraw(`_zoomOut`)},`keyup`),B(x=this.keycharm).call(x,`]`,()=>{this.unbindFromRedraw(`_zoomIn`)},`keyup`),B(S=this.keycharm).call(S,`pageup`,()=>{this.unbindFromRedraw(`_zoomIn`)},`keyup`),B(C=this.keycharm).call(C,`pagedown`,()=>{this.unbindFromRedraw(`_zoomOut`)},`keyup`)}}},cX=class{constructor(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m,h;this.body=e,this.canvas=t,this.selectionHandler=n,this.navigationHandler=new sX(e,t),this.body.eventListeners.onTap=B(r=this.onTap).call(r,this),this.body.eventListeners.onTouch=B(i=this.onTouch).call(i,this),this.body.eventListeners.onDoubleTap=B(a=this.onDoubleTap).call(a,this),this.body.eventListeners.onHold=B(o=this.onHold).call(o,this),this.body.eventListeners.onDragStart=B(s=this.onDragStart).call(s,this),this.body.eventListeners.onDrag=B(c=this.onDrag).call(c,this),this.body.eventListeners.onDragEnd=B(l=this.onDragEnd).call(l,this),this.body.eventListeners.onMouseWheel=B(u=this.onMouseWheel).call(u,this),this.body.eventListeners.onPinch=B(d=this.onPinch).call(d,this),this.body.eventListeners.onMouseMove=B(f=this.onMouseMove).call(f,this),this.body.eventListeners.onRelease=B(p=this.onRelease).call(p,this),this.body.eventListeners.onContext=B(m=this.onContext).call(m,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=B(h=this.getPointer).call(h,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},eD(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on(`destroy`,()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(BB([`hideEdgesOnDrag`,`hideEdgesOnZoom`,`hideNodesOnDrag`,`keyboard`,`multiselect`,`selectable`,`selectConnectedEdges`],this.options,e),rV(this.options,e,`keyboard`),e.tooltip&&(eD(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=JB(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-UB(this.canvas.frame.canvas),y:e.y-WB(this.canvas.frame.canvas)}}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){let t=this.getPointer(e.center),n=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,n),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent(`click`,e,t)}onDoubleTap(e){let t=this.getPointer(e.center);this.selectionHandler.generateClickEvent(`doubleClick`,e,t)}onHold(e){let t=this.getPointer(e.center),n=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,n),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent(`click`,e,t),this.selectionHandler.generateClickEvent(`hold`,e,t)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){let t=this.getPointer(e.center);this.selectionHandler.generateClickEvent(`release`,e,t),this.touchTime=new Date().valueOf()}}onContext(e){let t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent(`oncontext`,e,t)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){let n=function(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];H(t).call(t,i)===-1&&n.push(i)}return n};return{nodes:n(e.nodes,t.nodes),edges:n(e.edges,t.edges)}}onDragStart(e){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(e);let t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=eD({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;let t=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)}}else if(t!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=t.id,t.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[t.id]}),this.selectionHandler.generateClickEvent(`dragStart`,e,this.drag.pointer);for(let e of this.selectionHandler.getSelectedNodes()){let t={id:e.id,node:e,x:e.x,y:e.y,xFixed:e.options.fixed.x,yFixed:e.options.fixed.y};e.options.fixed.x=!0,e.options.fixed.y=!0,this.drag.selection.push(t)}}else this.selectionHandler.generateClickEvent(`dragStart`,e,this.drag.pointer,void 0,!0)}onDrag(e){if(this.drag.pinched===!0)return;this.body.emitter.emit(`unlockNode`);let t=this.getPointer(e.center),n=this.drag.selection;if(n&&n.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent(`dragging`,e,t);let r=t.x-this.drag.pointer.x,i=t.y-this.drag.pointer.y;V(n).call(n,e=>{let t=e.node;e.xFixed===!1&&(t.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(e.x)+r)),e.yFixed===!1&&(t.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(e.y)+i))}),this.body.emitter.emit(`startSimulation`)}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent(`dragging`,e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.emitter.emit(`_requestRedraw`)}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent(`dragging`,e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}let n=t.x-this.drag.pointer.x,r=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+n,y:this.drag.translation.y+r},this.body.emitter.emit(`_requestRedraw`)}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;let n=this.body.selectionBox.position,r={minX:Math.min(n.start.x,n.end.x),minY:Math.min(n.start.y,n.end.y),maxX:Math.max(n.start.x,n.end.x),maxY:Math.max(n.start.y,n.end.y)},i=kF(t=this.body.nodeIndices).call(t,e=>{let t=this.body.nodes[e];return t.x>=r.minX&&t.x<=r.maxX&&t.y>=r.minY&&t.y<=r.maxY});V(i).call(i,e=>this.selectionHandler.selectObject(this.body.nodes[e]));let a=this.getPointer(e.center);this.selectionHandler.commitAndEmit(a,e),this.selectionHandler.generateClickEvent(`dragEnd`,e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit(`_requestRedraw`)}else{let t=this.drag.selection;t&&t.length?(V(t).call(t,function(e){e.node.options.fixed.x=e.xFixed,e.node.options.fixed.y=e.yFixed}),this.selectionHandler.generateClickEvent(`dragEnd`,e,this.getPointer(e.center)),this.body.emitter.emit(`startSimulation`)):(this.selectionHandler.generateClickEvent(`dragEnd`,e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit(`_requestRedraw`))}}onPinch(e){let t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);let n=this.pinch.scale*e.scale;this.zoom(n,t)}zoom(e,t){if(this.options.zoomView===!0){let n=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let r;this.drag!==void 0&&this.drag.dragging===!0&&(r=this.canvas.DOMtoCanvas(this.drag.pointer));let i=this.body.view.translation,a=e/n,o=(1-a)*t.x+i.x*a,s=(1-a)*t.y+i.y*a;if(this.body.view.scale=e,this.body.view.translation={x:o,y:s},r!=null){let e=this.canvas.canvasToDOM(r);this.drag.pointer.x=e.x,this.drag.pointer.y=e.y}this.body.emitter.emit(`_requestRedraw`),n<e?this.body.emitter.emit(`zoom`,{direction:`+`,scale:this.body.view.scale,pointer:t}):this.body.emitter.emit(`zoom`,{direction:`-`,scale:this.body.view.scale,pointer:t})}}onMouseWheel(e){if(this.options.zoomView===!0){if(e.deltaY!==0){let t=this.body.view.scale;t*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);let n=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(t,n)}e.preventDefault()}}onMouseMove(e){let t=this.getPointer({x:e.clientX,y:e.clientY}),n=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(t),this.popup.hidden===!1&&(n=!0,this.popup.setPosition(t.x+3,t.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),n===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=PL(()=>this._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){let t=this.canvas._XconvertDOMtoCanvas(e.x),n=this.canvas._YconvertDOMtoCanvas(e.y),r={left:t,top:n,right:t,bottom:n},i=this.popupObj===void 0?void 0:this.popupObj.id,a=!1,o=`node`;if(this.popupObj===void 0){let e=this.body.nodeIndices,t=this.body.nodes,n,i=[];for(let o=0;o<e.length;o++)n=t[e[o]],n.isOverlappingWith(r)===!0&&(a=!0,n.getTitle()!==void 0&&i.push(e[o]));i.length>0&&(this.popupObj=t[i[i.length-1]],a=!0)}if(this.popupObj===void 0&&a===!1){let e=this.body.edgeIndices,t=this.body.edges,n,i=[];for(let a=0;a<e.length;a++)n=t[e[a]],n.isOverlappingWith(r)===!0&&n.connected===!0&&n.getTitle()!==void 0&&i.push(e[a]);i.length>0&&(this.popupObj=t[i[i.length-1]],o=`edge`)}this.popupObj===void 0?this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit(`hidePopup`)):this.popupObj.id!==i&&(this.popup===void 0&&(this.popup=new vV(this.canvas.frame)),this.popup.popupTargetType=o,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit(`showPopup`,this.popupObj.id))}_checkHidePopup(e){let t=this.selectionHandler._pointerToPositionObject(e),n=!1;if(this.popup.popupTargetType===`node`){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(n=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),n===!0)){let t=this.selectionHandler.getNodeAt(e);n=t===void 0?!1:t.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(n=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));n===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit(`hidePopup`))}},lX={},uX={},dX;function fX(){return dX?uX:(dX=1,LH()(`Set`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},KH()),uX)}var pX;function mX(){return pX?lX:(pX=1,fX(),lX)}var hX={},gX,_X;function vX(){if(_X)return gX;_X=1;var e=qw(),t=TypeError;return gX=function(n){if(typeof n==`object`&&`size`in n&&`has`in n&&`add`in n&&`delete`in n&&`keys`in n)return n;throw new t(e(n)+` is not a set`)},gX}var yX,bX;function xX(){if(bX)return yX;bX=1;var e=Ew(),t=eU(),n=e(`Set`),r=n.prototype;return yX={Set:n,add:t(`add`,1),has:t(`has`,1),remove:t(`delete`,1),proto:r},yX}var SX,CX;function wX(){if(CX)return SX;CX=1;var e=ew();return SX=function(t,n,r){for(var i=r?t:t.iterator,a=t.next,o,s;!(o=e(a,i)).done;)if(s=n(o.value),s!==void 0)return s},SX}var TX,EX;function DX(){if(EX)return TX;EX=1;var e=wX();return TX=function(t,n,r){return r?e(t.keys(),n,!0):t.forEach(n)},TX}var OX,kX;function AX(){if(kX)return OX;kX=1;var e=xX(),t=DX(),n=e.Set,r=e.add;return OX=function(e){var i=new n;return t(e,function(e){r(i,e)}),i},OX}var jX,MX;function NX(){return MX?jX:(MX=1,jX=function(e){return e.size},jX)}var PX,FX;function IX(){return FX?PX:(FX=1,PX=function(e){return{iterator:e,next:e.next,done:!1}},PX)}var LX,RX;function zX(){if(RX)return LX;RX=1;var e=Xw(),t=$T(),n=ew(),r=fE(),i=IX(),a=`Invalid size`,o=RangeError,s=TypeError,c=Math.max,l=function(t,n){this.set=t,this.size=c(n,0),this.has=e(t.has),this.keys=e(t.keys)};return l.prototype={getIterator:function(){return i(t(n(this.keys,this.set)))},includes:function(e){return n(this.has,this.set,e)}},LX=function(e){t(e);var n=+e.size;if(n!==n)throw new s(a);var i=r(n);if(i<0)throw new o(a);return new l(e,i)},LX}var BX,VX;function HX(){if(VX)return BX;VX=1;var e=vX(),t=xX(),n=AX(),r=NX(),i=zX(),a=DX(),o=wX(),s=t.has,c=t.remove;return BX=function(t){var l=e(this),u=i(t),d=n(l);return r(l)<=u.size?a(l,function(e){u.includes(e)&&c(d,e)}):o(u.getIterator(),function(e){s(d,e)&&c(d,e)}),d},BX}var UX,WX;function GX(){return WX?UX:(WX=1,UX=function(){return!1},UX)}var KX;function qX(){if(KX)return hX;KX=1;var e=z(),t=HX(),n=I();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`difference`,function(e){return e.size===0})||n(function(){var e={size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var n=e++>1;return t.has(1)&&t.clear(),{done:n,value:2}}}}},t=new Set([1,2,3,4]);return t.difference(e).size!==3})},{difference:t}),hX}var JX={},YX,XX;function ZX(){if(XX)return YX;XX=1;var e=vX(),t=xX(),n=NX(),r=zX(),i=DX(),a=wX(),o=t.Set,s=t.add,c=t.has;return YX=function(t){var l=e(this),u=r(t),d=new o;return n(l)>u.size?a(u.getIterator(),function(e){c(l,e)&&s(d,e)}):i(l,function(e){u.includes(e)&&s(d,e)}),d},YX}var QX;function $X(){if(QX)return JX;QX=1;var e=z(),t=I(),n=ZX();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`intersection`,function(e){return e.size===2&&e.has(1)&&e.has(2)})||t(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!==`3,2`})},{intersection:n}),JX}var eZ={},tZ,nZ;function rZ(){if(nZ)return tZ;nZ=1;var e=vX(),t=xX().has,n=NX(),r=zX(),i=DX(),a=wX(),o=OH();return tZ=function(s){var c=e(this),l=r(s);if(n(c)<=l.size)return i(c,function(e){if(l.includes(e))return!1},!0)!==!1;var u=l.getIterator();return a(u,function(e){if(t(c,e))return o(u,`normal`,!1)})!==!1},tZ}var iZ;function aZ(){if(iZ)return eZ;iZ=1;var e=z(),t=rZ();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`isDisjointFrom`,function(e){return!e})},{isDisjointFrom:t}),eZ}var oZ={},sZ,cZ;function lZ(){if(cZ)return sZ;cZ=1;var e=vX(),t=NX(),n=DX(),r=zX();return sZ=function(i){var a=e(this),o=r(i);return t(a)>o.size?!1:n(a,function(e){if(!o.includes(e))return!1},!0)!==!1},sZ}var uZ;function dZ(){if(uZ)return oZ;uZ=1;var e=z(),t=lZ();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`isSubsetOf`,function(e){return e})},{isSubsetOf:t}),oZ}var fZ={},pZ,mZ;function hZ(){if(mZ)return pZ;mZ=1;var e=vX(),t=xX().has,n=NX(),r=zX(),i=wX(),a=OH();return pZ=function(o){var s=e(this),c=r(o);if(n(s)<c.size)return!1;var l=c.getIterator();return i(l,function(e){if(!t(s,e))return a(l,`normal`,!1)})!==!1},pZ}var gZ;function _Z(){if(gZ)return fZ;gZ=1;var e=z(),t=hZ();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`isSupersetOf`,function(e){return!e})},{isSupersetOf:t}),fZ}var vZ={},yZ,bZ;function xZ(){if(bZ)return yZ;bZ=1;var e=vX(),t=xX(),n=AX(),r=zX(),i=wX(),a=t.add,o=t.has,s=t.remove;return yZ=function(t){var c=e(this),l=r(t).getIterator(),u=n(c);return i(l,function(e){o(c,e)?s(u,e):a(u,e)}),u},yZ}var SZ,CZ;function wZ(){return CZ?SZ:(CZ=1,SZ=function(e){try{var t=new Set,n=t[e]({size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},`next`,{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}});return n.size===1&&n.values().next().value===4}catch{return!1}},SZ)}var TZ;function EZ(){if(TZ)return vZ;TZ=1;var e=z(),t=xZ(),n=wZ();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`symmetricDifference`)||!n(`symmetricDifference`)},{symmetricDifference:t}),vZ}var DZ={},OZ,kZ;function AZ(){if(kZ)return OZ;kZ=1;var e=vX(),t=xX().add,n=AX(),r=zX(),i=wX();return OZ=function(a){var o=e(this),s=r(a).getIterator(),c=n(o);return i(s,function(e){t(c,e)}),c},OZ}var jZ;function MZ(){if(jZ)return DZ;jZ=1;var e=z(),t=AZ(),n=wZ();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`union`)||!n(`union`)},{union:t}),DZ}var NZ,PZ;function FZ(){return PZ?NZ:(PZ=1,Dj(),mX(),qX(),$X(),aZ(),dZ(),_Z(),EZ(),MZ(),dU(),NZ=R().Set,NZ)}var IZ,LZ;function RZ(){if(LZ)return IZ;LZ=1;var e=FZ();return Mj(),IZ=e,IZ}var zZ,BZ;function VZ(){return BZ?zZ:(BZ=1,zZ=RZ(),zZ)}var HZ=F(VZ()),UZ={},WZ={},GZ,KZ;function qZ(){if(KZ)return GZ;KZ=1;var e=L(),t=BH(),n=gH().getWeakData,r=PH(),i=$T(),a=fw(),o=xw(),s=jH(),c=yk(),l=bT(),u=gk(),d=u.set,f=u.getterFor,p=c.find,m=c.findIndex,h=e([].splice),g=0,_=function(e){return e.frozen||=new v},v=function(){this.entries=[]},y=function(e,t){return p(e.entries,function(e){return e[0]===t})};return v.prototype={get:function(e){var t=y(this,e);if(t)return t[1]},has:function(e){return!!y(this,e)},set:function(e,t){var n=y(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=m(this.entries,function(t){return t[0]===e});return~t&&h(this.entries,t,1),!!~t}},GZ={getConstructor:function(e,c,u,p){var m=e(function(e,t){r(e,h),d(e,{type:c,id:g++,frozen:null}),a(t)||s(t,e[p],{that:e,AS_ENTRIES:u})}),h=m.prototype,v=f(c),y=function(e,t,r){var a=v(e),o=n(i(t),!0);return o===!0?_(a).set(t,r):o[a.id]=r,e};return t(h,{delete:function(e){var t=v(this);if(!o(e))return!1;var r=n(e);return r===!0?_(t).delete(e):r&&l(r,t.id)&&delete r[t.id]},has:function(e){var t=v(this);if(!o(e))return!1;var r=n(e);return r===!0?_(t).has(e):r&&l(r,t.id)}}),t(h,u?{get:function(e){var t=v(this);if(o(e)){var r=n(e);if(r===!0)return _(t).get(e);if(r)return r[t.id]}},set:function(e,t){return y(this,e,t)}}:{add:function(e){return y(this,e,!0)}}),m}},GZ}var JZ;function YZ(){if(JZ)return WZ;JZ=1;var e=mH(),t=OC(),n=L(),r=BH(),i=gH(),a=LH(),o=qZ(),s=xw(),c=gk().enforce,l=I(),u=pk(),d=Object,f=Array.isArray,p=d.isExtensible,m=d.isFrozen,h=d.isSealed,g=d.freeze,_=d.seal,v=!t.ActiveXObject&&`ActiveXObject`in t,y,b=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},x=a(`WeakMap`,b,o),S=x.prototype,C=n(S.set),w=function(){return e&&l(function(){var e=g([]);return C(new x,e,1),!m(e)})};if(u)if(v){y=o.getConstructor(b,`WeakMap`,!0),i.enable();var T=n(S.delete),E=n(S.has),D=n(S.get);r(S,{delete:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,T(this,e)||t.frozen.delete(e)}return T(this,e)},has:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,E(this,e)||t.frozen.has(e)}return E(this,e)},get:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,E(this,e)?D(this,e):t.frozen.get(e)}return D(this,e)},set:function(e,t){if(s(e)&&!p(e)){var n=c(this);n.frozen||=new y,E(this,e)?C(this,e,t):n.frozen.set(e,t)}else C(this,e,t);return this}})}else w()&&r(S,{set:function(e,t){var n;return f(e)&&(m(e)?n=g:h(e)&&(n=_)),C(this,e,t),n&&n(e),this}});return WZ}var XZ;function ZZ(){return XZ?UZ:(XZ=1,YZ(),UZ)}var QZ,$Z;function eQ(){return $Z?QZ:($Z=1,Dj(),ZZ(),QZ=R().WeakMap,QZ)}var tQ,nQ;function rQ(){if(nQ)return tQ;nQ=1;var e=eQ();return Mj(),tQ=e,tQ}var iQ,aQ;function oQ(){return aQ?iQ:(aQ=1,iQ=rQ(),iQ)}var sQ=F(oQ());function cQ(e,t,n){lQ(e,t),t.set(e,n)}function lQ(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function uQ(e,t,n){return e.set(dQ(e,t),n),n}function J(e,t){return e.get(dQ(e,t))}function dQ(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function fQ(e,t){let n=new HZ;for(let r of t)e.has(r)||n.add(r);return n}var pQ=new sQ,mQ=new sQ,hQ=class{constructor(){cQ(this,pQ,new HZ),cQ(this,mQ,new HZ)}get size(){return J(mQ,this).size}add(){var e=[...arguments];for(let t of e)J(mQ,this).add(t)}delete(){var e=[...arguments];for(let t of e)J(mQ,this).delete(t)}clear(){J(mQ,this).clear()}getSelection(){return[...J(mQ,this)]}getChanges(){return{added:[...fQ(J(pQ,this),J(mQ,this))],deleted:[...fQ(J(mQ,this),J(pQ,this))],previous:[...new HZ(J(pQ,this))],current:[...new HZ(J(mQ,this))]}}commit(){let e=this.getChanges();uQ(pQ,this,J(mQ,this)),uQ(mQ,this,new HZ(J(pQ,this)));for(let t of e.added)t.select();for(let t of e.deleted)t.unselect();return e}},gQ=new sQ,_Q=new sQ,vQ=new sQ,yQ=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};cQ(this,gQ,new hQ),cQ(this,_Q,new hQ),cQ(this,vQ,void 0),uQ(vQ,this,e)}get sizeNodes(){return J(gQ,this).size}get sizeEdges(){return J(_Q,this).size}getNodes(){return J(gQ,this).getSelection()}getEdges(){return J(_Q,this).getSelection()}addNodes(){J(gQ,this).add(...arguments)}addEdges(){J(_Q,this).add(...arguments)}deleteNodes(e){J(gQ,this).delete(e)}deleteEdges(e){J(_Q,this).delete(e)}clear(){J(gQ,this).clear(),J(_Q,this).clear()}commit(){let e={nodes:J(gQ,this).commit(),edges:J(_Q,this).commit()};var t=[...arguments];return J(vQ,this).call(this,e,...t),e}},bQ=class{constructor(e,t){this.body=e,this.canvas=t,this._selectionAccumulator=new yQ,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},eD(this.options,this.defaultOptions),this.body.emitter.on(`_dataChanged`,()=>{this.updateSelection()})}setOptions(e){e!==void 0&&zB([`multiselect`,`hoverConnectedEdges`,`selectable`,`selectConnectedEdges`],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){let n=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),n!==void 0&&(t=this.selectObject(n)),this.body.emitter.emit(`_requestRedraw`)}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){let n=this.getNodeAt(e)||this.getEdgeAt(e);n!==void 0&&(t=!0,n.isSelected()===!0?this.deselectObject(n):this.selectObject(n),this.body.emitter.emit(`_requestRedraw`))}return t}_initBaseEvent(e,t){let n={};return n.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},n.event=e,n}generateClickEvent(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,a=this._initBaseEvent(t,n);if(i===!0)a.nodes=[],a.edges=[];else{let e=this.getSelection();a.nodes=e.nodes,a.edges=e.edges}r!==void 0&&(a.previousSelection=r),e==`click`&&(a.items=this.getClickedItems(n)),t.controlEdge!==void 0&&(a.controlEdge=t.controlEdge),this.body.emitter.emit(e,a)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e===void 0?!1:(e instanceof zJ?(t===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0)}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){let t=[],n=this.body.nodes;for(let r=0;r<this.body.nodeIndices.length;r++){let i=this.body.nodeIndices[r];n[i].isOverlappingWith(e)&&t.push(i)}return t}_pointerToPositionObject(e){let t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}getNodeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this._pointerToPositionObject(e),r=this._getAllNodesOverlappingWith(n);if(r.length>0)return t===!0?this.body.nodes[r[r.length-1]]:r[r.length-1]}_getEdgesOverlappingWith(e,t){let n=this.body.edges;for(let r=0;r<this.body.edgeIndices.length;r++){let i=this.body.edgeIndices[r];n[i].isOverlappingWith(e)&&t.push(i)}}_getAllEdgesOverlappingWith(e){let t=[];return this._getEdgesOverlappingWith(e,t),t}getEdgeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this.canvas.DOMtoCanvas(e),r=10,i=null,a=this.body.edges;for(let e=0;e<this.body.edgeIndices.length;e++){let t=this.body.edgeIndices[e],o=a[t];if(o.connected){let e=o.from.x,a=o.from.y,s=o.to.x,c=o.to.y,l=o.edgeType.getDistanceToEdge(e,a,s,c,n.x,n.y);l<r&&(i=t,r=l)}}if(i!==null)return t===!0?this.body.edges[i]:i}_addToHover(e){e instanceof zJ?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof zJ?(this._selectionAccumulator.deleteNodes(e),this._selectionAccumulator.deleteEdges(...e.edges)):this._selectionAccumulator.deleteEdges(e)}unselectAll(){this._selectionAccumulator.clear()}getSelectedNodeCount(){return this._selectionAccumulator.sizeNodes}getSelectedEdgeCount(){return this._selectionAccumulator.sizeEdges}_hoverConnectedEdges(e){for(let t=0;t<e.edges.length;t++){let n=e.edges[t];n.hover=!0,this._addToHover(n)}}emitBlurEvent(e,t,n){let r=this._initBaseEvent(e,t);n.hover===!0&&(n.hover=!1,n instanceof zJ?(r.node=n.id,this.body.emitter.emit(`blurNode`,r)):(r.edge=n.id,this.body.emitter.emit(`blurEdge`,r)))}emitHoverEvent(e,t,n){let r=this._initBaseEvent(e,t),i=!1;return n.hover===!1&&(n.hover=!0,this._addToHover(n),i=!0,n instanceof zJ?(r.node=n.id,this.body.emitter.emit(`hoverNode`,r)):(r.edge=n.id,this.body.emitter.emit(`hoverEdge`,r))),i}hoverObject(e,t){let n=this.getNodeAt(t);n===void 0&&(n=this.getEdgeAt(t));let r=!1;for(let i in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,i)&&(n===void 0||n instanceof zJ&&n.id!=i||n instanceof TY)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[i]),delete this.hoverObj.nodes[i],r=!0);for(let i in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,i)&&(r===!0?(this.hoverObj.edges[i].hover=!1,delete this.hoverObj.edges[i]):(n===void 0||n instanceof TY&&n.id!=i||n instanceof zJ&&!n.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[i]),delete this.hoverObj.edges[i],r=!0));if(n!==void 0){let i=KM(this.hoverObj.edges).length,a=KM(this.hoverObj.nodes).length,o=n instanceof TY&&i===0&&a===0,s=n instanceof zJ&&i===0&&a===0;(r||o||s)&&(r=this.emitHoverEvent(e,t,n)),n instanceof zJ&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(n)}r===!0&&this.body.emitter.emit(`_requestRedraw`)}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,t){let n=!1,r=this._selectionAccumulator.commit(),i={nodes:r.nodes.previous,edges:r.edges.previous};r.edges.deleted.length>0&&(this.generateClickEvent(`deselectEdge`,t,e,i),n=!0),r.nodes.deleted.length>0&&(this.generateClickEvent(`deselectNode`,t,e,i),n=!0),r.nodes.added.length>0&&(this.generateClickEvent(`selectNode`,t,e),n=!0),r.edges.added.length>0&&(this.generateClickEvent(`selectEdge`,t,e),n=!0),n===!0&&this.generateClickEvent(`select`,t,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return NM(e=this._selectionAccumulator.getNodes()).call(e,e=>e.id)}getSelectedEdgeIds(){var e;return NM(e=this._selectionAccumulator.getEdges()).call(e,e=>e.id)}setSelection(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw TypeError(`Selection must be an object with nodes and/or edges properties`);if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(let n of e.nodes){let e=this.body.nodes[n];if(!e)throw RangeError(`Node with id "`+n+`" not found`);this.selectObject(e,t.highlightEdges)}if(e.edges)for(let t of e.edges){let e=this.body.edges[t];if(!e)throw RangeError(`Edge with id "`+t+`" not found`);this.selectObject(e)}this.body.emitter.emit(`_requestRedraw`),this._selectionAccumulator.commit()}selectNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw`Selection must be an array with ids`;this.setSelection({nodes:e},{highlightEdges:t})}selectEdges(e){if(!e||e.length===void 0)throw`Selection must be an array with ids`;this.setSelection({edges:e})}updateSelection(){for(let e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(let e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){let t=this.canvas.DOMtoCanvas(e),n=[],r=this.body.nodeIndices,i=this.body.nodes;for(let e=r.length-1;e>=0;e--){let a=i[r[e]].getItemsOnPoint(t);n.push.apply(n,a)}let a=this.body.edgeIndices,o=this.body.edges;for(let e=a.length-1;e>=0;e--){let r=o[a[e]].getItemsOnPoint(t);n.push.apply(n,r)}return n}},xQ={},SQ,CQ;function wQ(){if(CQ)return SQ;CQ=1;var e=iD(),t=Math.floor,n=function(r,i){var a=r.length;if(a<8)for(var o=1,s,c;o<a;){for(c=o,s=r[o];c&&i(r[c-1],s)>0;)r[c]=r[--c];c!==o++&&(r[c]=s)}else for(var l=t(a/2),u=n(e(r,0,l),i),d=n(e(r,l),i),f=u.length,p=d.length,m=0,h=0;m<f||h<p;)r[m+h]=m<f&&h<p?i(u[m],d[h])<=0?u[m++]:d[h++]:m<f?u[m++]:d[h++];return r};return SQ=n,SQ}var TQ,EQ;function DQ(){if(EQ)return TQ;EQ=1;var e=Mw().match(/firefox\/(\d+)/i);return TQ=!!e&&+e[1],TQ}var OQ,kQ;function AQ(){if(kQ)return OQ;kQ=1;var e=Mw();return OQ=/MSIE|Trident/.test(e),OQ}var jQ,MQ;function NQ(){if(MQ)return jQ;MQ=1;var e=Mw().match(/AppleWebKit\/(\d+)\./);return jQ=!!e&&+e[1],jQ}var PQ;function FQ(){if(PQ)return xQ;PQ=1;var e=z(),t=L(),n=Xw(),r=_T(),i=xE(),a=YN(),o=TO(),s=I(),c=wQ(),l=lN(),u=DQ(),d=AQ(),f=Fw(),p=NQ(),m=[],h=t(m.sort),g=t(m.push),_=s(function(){m.sort(void 0)}),v=s(function(){m.sort(null)}),y=l(`sort`),b=!s(function(){if(f)return f<70;if(!(u&&u>3)){if(d)return!0;if(p)return p<603;var e=``,t,n,r,i;for(t=65;t<76;t++){switch(n=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(i=0;i<47;i++)m.push({k:n+i,v:r})}for(m.sort(function(e,t){return t.v-e.v}),i=0;i<m.length;i++)n=m[i].k.charAt(0),e.charAt(e.length-1)!==n&&(e+=n);return e!==`DGBEFHACIJK`}}),x=_||!v||!y||!b,S=function(e){return function(t,n){return n===void 0?-1:t===void 0?1:e===void 0?o(t)>o(n)?1:-1:+e(t,n)||0}};return e({target:`Array`,proto:!0,forced:x},{sort:function(e){e!==void 0&&n(e);var t=r(this);if(b)return e===void 0?h(t):h(t,e);var o=[],s=i(t),l,u;for(u=0;u<s;u++)u in t&&g(o,t[u]);for(c(o,S(e)),l=i(o),u=0;u<l;)t[u]=o[u++];for(;u<s;)a(t,u++);return t}}),xQ}var IQ,LQ;function RQ(){return LQ?IQ:(LQ=1,FQ(),IQ=fD()(`Array`,`sort`),IQ)}var zQ,BQ;function VQ(){if(BQ)return zQ;BQ=1;var e=kw(),t=RQ(),n=Array.prototype;return zQ=function(r){var i=r.sort;return r===n||e(n,r)&&i===n.sort?t:i},zQ}var HQ,UQ;function WQ(){return UQ?HQ:(UQ=1,HQ=VQ(),HQ)}var GQ,KQ;function qQ(){return KQ?GQ:(KQ=1,GQ=WQ(),GQ)}var JQ=F(qQ()),YQ={},XQ,ZQ;function QQ(){if(ZQ)return XQ;ZQ=1;var e=Xw(),t=_T(),n=lw(),r=xE(),i=TypeError,a=`Reduce of empty array with no initial value`,o=function(o){return function(s,c,l,u){var d=t(s),f=n(d),p=r(d);if(e(c),p===0&&l<2)throw new i(a);var m=o?p-1:0,h=o?-1:1;if(l<2)for(;;){if(m in f){u=f[m],m+=h;break}if(m+=h,o?m<0:p<=m)throw new i(a)}for(;o?m>=0:p>m;m+=h)m in f&&(u=c(u,f[m],m,d));return u}};return XQ={left:o(!1),right:o(!0)},XQ}var $Q,e$;function t$(){return e$?$Q:(e$=1,$Q=mL()===`NODE`,$Q)}var n$;function r$(){if(n$)return YQ;n$=1;var e=z(),t=QQ().left,n=lN(),r=Fw();return e({target:`Array`,proto:!0,forced:!t$()&&r>79&&r<83||!n(`reduce`)},{reduce:function(e){var n=arguments.length;return t(this,e,n,n>1?arguments[1]:void 0)}}),YQ}var i$,a$;function o$(){return a$?i$:(a$=1,r$(),i$=fD()(`Array`,`reduce`),i$)}var s$,c$;function l$(){if(c$)return s$;c$=1;var e=kw(),t=o$(),n=Array.prototype;return s$=function(r){var i=r.reduce;return r===n||e(n,r)&&i===n.reduce?t:i},s$}var u$,d$;function f$(){return d$?u$:(d$=1,u$=l$(),u$)}var p$,m$;function h$(){return m$?p$:(m$=1,p$=f$(),p$)}var g$=F(h$()),_$=class{abstract(){throw Error(`Can't instantiate abstract class!`)}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,n),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,t){this.fake_use(e,t),this.abstract()}shift(e,t){this.fake_use(e,t),this.abstract()}},v$=class extends _${constructor(e){super(),this.layout=e}curveType(){return`horizontal`}getPosition(e){return e.x}setPosition(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;n!==void 0&&this.layout.hierarchical.addToOrdering(e,n),e.x=t}getTreeSize(e){let t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}sort(e){JQ(e).call(e,function(e,t){return e.x-t.x})}fix(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}shift(e,t){this.layout.body.nodes[e].x+=t}},y$=class extends _${constructor(e){super(),this.layout=e}curveType(){return`vertical`}getPosition(e){return e.y}setPosition(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;n!==void 0&&this.layout.hierarchical.addToOrdering(e,n),e.y=t}getTreeSize(e){let t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}sort(e){JQ(e).call(e,function(e,t){return e.y-t.y})}fix(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}shift(e,t){this.layout.body.nodes[e].y+=t}},b$={},x$;function S$(){if(x$)return b$;x$=1;var e=z(),t=yk().every;return e({target:`Array`,proto:!0,forced:!lN()(`every`)},{every:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),b$}var C$,w$;function T$(){return w$?C$:(w$=1,S$(),C$=fD()(`Array`,`every`),C$)}var E$,D$;function O$(){if(D$)return E$;D$=1;var e=kw(),t=T$(),n=Array.prototype;return E$=function(r){var i=r.every;return r===n||e(n,r)&&i===n.every?t:i},E$}var k$,A$;function j$(){return A$?k$:(A$=1,k$=O$(),k$)}var M$,N$;function P$(){return N$?M$:(N$=1,M$=j$(),M$)}var F$=F(P$());function I$(e,t){let n=new HZ;return V(e).call(e,e=>{var t;V(t=e.edges).call(t,e=>{e.connected&&n.add(e)})}),V(n).call(n,e=>{let n=e.from.id,r=e.to.id;t[n]??(t[n]=0),(t[r]==null||t[n]>=t[r])&&(t[r]=t[n]+1)}),t}function L$(e){return z$(t=>{var n,r;return F$(n=kF(r=t.edges).call(r,t=>e.has(t.toId))).call(n,e=>e.to===t)},(e,t)=>t>e,`from`,e)}function R$(e){return z$(t=>{var n,r;return F$(n=kF(r=t.edges).call(r,t=>e.has(t.toId))).call(n,e=>e.from===t)},(e,t)=>t<e,`to`,e)}function z$(e,t,n,r){var i;let a=VI(null),o=g$(i=[...lJ(r).call(r)]).call(i,(e,t)=>e+1+t.edges.length,0),s=n+`Id`,c=n===`to`?1:-1;for(let[i,d]of r){if(!r.has(i)||!e(d))continue;a[i]=0;let f=[d],p=0,m;for(;m=f.pop();){var l,u;if(!r.has(i))continue;let e=a[m.id]+c;if(V(l=kF(u=m.edges).call(u,e=>e.connected&&e.to!==e.from&&e[n]!==m&&r.has(e.toId)&&r.has(e.fromId))).call(l,r=>{let i=r[s],o=a[i];(o==null||t(e,o))&&(a[i]=e,f.push(r[n]))}),p>o)return I$(r,a);++p}}return a}var B$=class{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}checkIfTree(){for(let e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){let t={},n=e=>{if(t[e]!==void 0)return t[e];let r=this.levels[e];if(this.childrenReference[e]){let t=this.childrenReference[e];if(t.length>0)for(let e=0;e<t.length;e++)r=Math.max(r,n(t[e]))}return t[e]=r,r};return n(e)}levelDownstream(e,t){this.levels[t.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[t.id]=this.levels[e.id]+1)}setMinLevelToZero(){var e;let t=new xU,n=0,r=JQ(e=[...new HZ(GF(this.levels))]).call(e,(e,t)=>e-t);for(let e of r)t.set(e,n++);for(let e in this.levels)Object.prototype.hasOwnProperty.call(this.levels,e)&&(this.levels[e]=t.get(this.levels[e]))}getTreeSize(e,t){let n=1e9,r=-1e9,i=1e9,a=-1e9;for(let o in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,o)&&this.trees[o]===t){let t=e[o];n=Math.min(t.x,n),r=Math.max(t.x,r),i=Math.min(t.y,i),a=Math.max(t.y,a)}return{min_x:n,max_x:r,min_y:i,max_y:a}}hasSameParent(e,t){let n=this.parentReference[e.id],r=this.parentReference[t.id];if(n===void 0||r===void 0)return!1;for(let e=0;e<n.length;e++)for(let t=0;t<r.length;t++)if(n[e]==r[t])return!0;return!1}inSameSubNetwork(e,t){return this.trees[e.id]===this.trees[t.id]}getLevels(){return KM(this.distributionOrdering)}addToOrdering(e,t){this.distributionOrdering[t]===void 0&&(this.distributionOrdering[t]=[]);let n=!1,r=this.distributionOrdering[t];for(let t in r)if(r[t]===e){n=!0;break}n||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}},V$=class{constructor(e){this.body=e,this._resetRNG(Math.random()+`:`+aN()),this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:`UD`,sortMethod:`hubsize`}},eD(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on(`_dataChanged`,()=>{this.setupHierarchicalLayout()}),this.body.emitter.on(`_dataLoaded`,()=>{this.layoutNetwork()}),this.body.emitter.on(`_resetHierarchicalLayout`,()=>{this.setupHierarchicalLayout()}),this.body.emitter.on(`_adjustEdgesForHierarchicalLayout`,()=>{if(this.options.hierarchical.enabled!==!0)return;let e=this.direction.curveType();this.body.emitter.emit(`_forceDisableDynamicCurves`,e,!1)})}setOptions(e,t){if(e!==void 0){let n=this.options.hierarchical,r=n.enabled;if(zB([`randomSeed`,`improvedLayout`,`clusterThreshold`],this.options,e),rV(this.options,e,`hierarchical`),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),n.enabled===!0)return r===!0&&this.body.emitter.emit(`refresh`,!0),n.direction===`RL`||n.direction===`DU`?n.levelSeparation>0&&(n.levelSeparation*=-1):n.levelSeparation<0&&(n.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit(`_resetHierarchicalLayout`),this.adaptAllOptionsForHierarchicalLayout(t);if(r===!0)return this.body.emitter.emit(`refresh`),U(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=SB(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){let t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:`hierarchicalRepulsion`},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||`barnesHut`):typeof e.physics==`object`?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||`barnesHut`,e.physics.solver=`hierarchicalRepulsion`):e.physics!==!1&&(t.solver=`barnesHut`,e.physics={solver:`hierarchicalRepulsion`});let n=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:`dynamic`}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:`dynamic`}},e.edges.smooth=!1;else if(typeof e.edges.smooth==`boolean`)this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:n};else{let t=e.edges.smooth;t.type!==void 0&&t.type!==`dynamic`&&(n=t.type),this.optionsBackup.edges={smooth:{enabled:t.enabled===void 0?!0:t.enabled,type:t.type===void 0?`dynamic`:t.type,roundness:t.roundness===void 0?.5:t.roundness,forceDirection:t.forceDirection===void 0?!1:t.forceDirection}},e.edges.smooth={enabled:t.enabled===void 0?!0:t.enabled,type:n,roundness:t.roundness===void 0?.5:t.roundness,forceDirection:t.forceDirection===void 0?!1:t.forceDirection}}this.body.emitter.emit(`_forceDisableDynamicCurves`,n)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);let t=e.length+50;for(let n=0;n<e.length;n++){let r=e[n],i=2*Math.PI*this._rng();r.x===void 0&&(r.x=t*Math.cos(i)),r.y===void 0&&(r.y=t*Math.sin(i))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){let e=this.body.nodeIndices,t=0;for(let n=0;n<e.length;n++)this.body.nodes[e[n]].predefinedPosition===!0&&(t+=1);if(t<.5*e.length){let t=0,n=this.options.clusterThreshold,r={clusterNodeProperties:{shape:`ellipse`,label:``,group:``,font:{multi:!1}},clusterEdgeProperties:{label:``,font:{multi:!1},smooth:{enabled:!1}}};if(e.length>n){let i=e.length;for(;e.length>n&&t<=10;){t+=1;let n=e.length;if(t%3==0?this.body.modules.clustering.clusterBridges(r):this.body.modules.clustering.clusterOutliers(r),n==e.length&&t%3!=0){this._declusterAll(),this.body.emitter.emit(`_layoutFailed`),console.info(`This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.`);return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*i)})}t>10&&console.info(`The clustering didn't succeed within the amount of interations allowed, progressing with partial result.`),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();for(let t=0;t<e.length;t++){let n=this.body.nodes[e[t]];n.predefinedPosition===!1&&(n.x+=(.5-this._rng())*70,n.y+=(.5-this._rng())*70)}this._declusterAll(),this.body.emitter.emit(`_repositionBezierNodes`)}}}_shiftToCenter(){let e=WY.getRangeCore(this.body.nodes,this.body.nodeIndices),t=WY.findCenter(e);for(let e=0;e<this.body.nodeIndices.length;e++){let n=this.body.nodes[this.body.nodeIndices[e]];n.x-=t.x,n.y-=t.y}}_declusterAll(){let e=!0;for(;e===!0;){e=!1;for(let t=0;t<this.body.nodeIndices.length;t++)this.body.nodes[this.body.nodeIndices[t]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));e===!0&&this.body.emitter.emit(`_dataChanged`)}}getSeed(){return this.initialRandomSeed}setupHierarchicalLayout(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){let e,t,n=!1,r=!1;for(t in this.lastNodeOnLevel={},this.hierarchical=new B$,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level===void 0?r=!0:(n=!0,this.hierarchical.levels[t]=e.options.level));if(r===!0&&n===!0)throw Error(`To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.`);{if(r===!0){let e=this.options.hierarchical.sortMethod;e===`hubsize`?this._determineLevelsByHubsize():e===`directed`?this._determineLevelsDirected():e===`custom`&&this._determineLevelsCustomCallback()}for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this.hierarchical.ensureLevel(e);let e=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(e),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1,n={},r=()=>{let e=a(),t=0;for(let n=0;n<e.length-1;n++){let r=e[n].max-e[n+1].min;t+=r+this.options.hierarchical.treeSpacing,i(n+1,t)}},i=(e,t)=>{let n=this.hierarchical.trees;for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e&&this.direction.shift(r,t)},a=()=>{let e=[];for(let t=0;t<this.hierarchical.numTrees();t++)e.push(this.direction.getTreeSize(t));return e},o=(e,t)=>{if(!t[e.id]&&(t[e.id]=!0,this.hierarchical.childrenReference[e.id])){let n=this.hierarchical.childrenReference[e.id];if(n.length>0)for(let e=0;e<n.length;e++)o(this.body.nodes[n[e]],t)}},s=function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,r=1e9,i=1e9,a=1e9,o=-1e9;for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s)){let c=e.body.nodes[s],l=e.hierarchical.levels[c.id],u=e.direction.getPosition(c),[d,f]=e._getSpaceAroundNode(c,t);r=Math.min(d,r),i=Math.min(f,i),l<=n&&(a=Math.min(u,a),o=Math.max(u,o))}return[a,o,r,i]},c=(e,t)=>{let n=this.hierarchical.getMaxLevel(e.id),r=this.hierarchical.getMaxLevel(t.id);return Math.min(n,r)},l=(e,t,n)=>{let r=this.hierarchical;for(let i=0;i<t.length;i++){let a=t[i],o=r.distributionOrdering[a];if(o.length>1)for(let t=0;t<o.length-1;t++){let i=o[t],a=o[t+1];r.hasSameParent(i,a)&&r.inSameSubNetwork(i,a)&&e(i,a,n)}}},u=function(n,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=e.direction.getPosition(n),l=e.direction.getPosition(r),u=Math.abs(l-a),d=e.options.hierarchical.nodeSpacing;if(u>d){let a={},l={};o(n,a),o(r,l);let u=c(n,r),f=s(a,u),p=s(l,u),m=f[1],h=p[0],g=p[2];if(Math.abs(m-h)>d){let n=m-h+d;n<-g+d&&(n=-g+d),n<0&&(e._shiftBlock(r.id,n),t=!0,i===!0&&e._centerParent(r))}}},d=(e,r)=>{let i=r.id,a=r.edges,c=this.hierarchical.levels[r.id],l=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,u={},d=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.toId!=t.fromId){let n=t.toId==i?t.from:t.to;u[a[e].id]=n,this.hierarchical.levels[n.id]<c&&d.push(t)}}let f=(e,t)=>{let n=0;for(let r=0;r<t.length;r++)if(u[t[r].id]!==void 0){let i=this.direction.getPosition(u[t[r].id])-e;n+=i/Math.sqrt(i*i+l)}return n},p=(e,t)=>{let n=0;for(let r=0;r<t.length;r++)if(u[t[r].id]!==void 0){let i=this.direction.getPosition(u[t[r].id])-e;n-=l*(i*i+l)**-1.5}return n},m=(e,t)=>{let n=this.direction.getPosition(r),i={};for(let r=0;r<e;r++){let e=f(n,t),a=p(n,t),o=Math.max(-40,Math.min(40,Math.round(e/a)));if(n-=o,i[n]!==void 0)break;i[n]=r}return n},h=e=>{let i=this.direction.getPosition(r);if(n[r.id]===void 0){let e={};o(r,e),n[r.id]=e}let a=s(n[r.id]),c=a[2],l=a[3],u=e-i,d=0;u>0?d=Math.min(u,l-this.options.hierarchical.nodeSpacing):u<0&&(d=-Math.min(-u,c-this.options.hierarchical.nodeSpacing)),d!=0&&(this._shiftBlock(r.id,d),t=!0)},g=e=>{let n=this.direction.getPosition(r),[i,a]=this._getSpaceAroundNode(r),o=e-n,s=n;o>0?s=Math.min(n+(a-this.options.hierarchical.nodeSpacing),e):o<0&&(s=Math.max(n-(i-this.options.hierarchical.nodeSpacing),e)),s!==n&&(this.direction.setPosition(r,s),t=!0)},_=m(e,d);h(_),_=m(e,a),g(_)};this.options.hierarchical.blockShifting===!0&&((e=>{let n=this.hierarchical.getLevels();n=HN(n).call(n);for(let r=0;r<e&&(t=!1,l(u,n,!0),t===!0);r++);})(5),(()=>{for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this._centerParent(this.body.nodes[e])})()),this.options.hierarchical.edgeMinimization===!0&&(e=>{let n=this.hierarchical.getLevels();n=HN(n).call(n);for(let r=0;r<e;r++){t=!1;for(let e=0;e<n.length;e++){let t=n[e],r=this.hierarchical.distributionOrdering[t];for(let e=0;e<r.length;e++)d(1e3,r[e])}if(t!==!0)break}})(20),this.options.hierarchical.parentCentralization===!0&&(()=>{let e=this.hierarchical.getLevels();e=HN(e).call(e);for(let t=0;t<e.length;t++){let n=e[t],r=this.hierarchical.distributionOrdering[n];for(let e=0;e<r.length;e++)this._centerParent(r[e])}})(),r()}_getSpaceAroundNode(e,t){let n=!0;t===void 0&&(n=!1);let r=this.hierarchical.levels[e.id];if(r!==void 0){let i=this.hierarchical.distributionIndex[e.id],a=this.direction.getPosition(e),o=this.hierarchical.distributionOrdering[r],s=1e9,c=1e9;if(i!==0){let e=o[i-1];(n===!0&&t[e.id]===void 0||n===!1)&&(s=a-this.direction.getPosition(e))}if(i!=o.length-1){let e=o[i+1];if(n===!0&&t[e.id]===void 0||n===!1){let t=this.direction.getPosition(e);c=Math.min(c,t-a)}}return[s,c]}else return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){let t=this.hierarchical.parentReference[e.id];for(let e=0;e<t.length;e++){let n=t[e],r=this.body.nodes[n],i=this.hierarchical.childrenReference[n];if(i!==void 0){let e=this._getCenterPosition(i),t=this.direction.getPosition(r),[n,a]=this._getSpaceAroundNode(r),o=t-e;(o<0&&Math.abs(o)<a-this.options.hierarchical.nodeSpacing||o>0&&Math.abs(o)<n-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(r,e)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var t;let r=KM(e[n]);r=this._indexArrayToNodes(r),JQ(t=this.direction).call(t,r);let i=0;for(let e=0;e<r.length;e++){let t=r[e];if(this.positionedNodes[t.id]===void 0){let a=this.options.hierarchical.nodeSpacing,o=a*i;i>0&&(o=this.direction.getPosition(r[e-1])+a),this.direction.setPosition(t,o,n),this._validatePositionAndContinue(t,n,o),i++}}}}_placeBranchNodes(e,t){var n;let r=this.hierarchical.childrenReference[e];if(r===void 0)return;let i=[];for(let e=0;e<r.length;e++)i.push(this.body.nodes[r[e]]);JQ(n=this.direction).call(n,i);for(let n=0;n<i.length;n++){let r=i[n],a=this.hierarchical.levels[r.id];if(a>t&&this.positionedNodes[r.id]===void 0){let t=this.options.hierarchical.nodeSpacing,o;o=n===0?this.direction.getPosition(this.body.nodes[e]):this.direction.getPosition(i[n-1])+t,this.direction.setPosition(r,o,a),this._validatePositionAndContinue(r,a,o)}else return}let a=this._getCenterPosition(i);this.direction.setPosition(this.body.nodes[e],a,t)}_validatePositionAndContinue(e,t,n){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){let r=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(n-r<this.options.hierarchical.nodeSpacing){let i=r+this.options.hierarchical.nodeSpacing-n,a=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(a.withChild,i)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}_indexArrayToNodes(e){let t=[];for(let n=0;n<e.length;n++)t.push(this.body.nodes[e[n]]);return t}_getDistribution(){let e={},t,n;for(t in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,t)){n=this.body.nodes[t];let r=this.hierarchical.levels[t]===void 0?0:this.hierarchical.levels[t];this.direction.fix(n,r),e[r]===void 0&&(e[r]={}),e[r][t]=n}return e}_getActiveEdges(e){let t=[];return W(e.edges,e=>{var n;H(n=this.body.edgeIndices).call(n,e.id)!==-1&&t.push(e)}),t}_getHubSizes(){let e={},t=this.body.nodeIndices;W(t,t=>{let n=this.body.nodes[t],r=this._getActiveEdges(n).length;e[r]=!0});let n=[];return W(e,e=>{n.push(Number(e))}),JQ(n).call(n,function(e,t){return t-e}),n}_determineLevelsByHubsize(){let e=(e,t)=>{this.hierarchical.levelDownstream(e,t)},t=this._getHubSizes();for(let n=0;n<t.length;++n){let r=t[n];if(r===0)break;W(this.body.nodeIndices,t=>{let n=this.body.nodes[t];r===this._getActiveEdges(n).length&&this._crawlNetwork(e,t)})}}_determineLevelsCustomCallback(){this._crawlNetwork((e,t,n)=>{let r=this.hierarchical.levels[e.id];r===void 0&&(r=this.hierarchical.levels[e.id]=1e5),WY.cloneOptions(e,`node`),WY.cloneOptions(t,`node`),WY.cloneOptions(n,`edge`),this.hierarchical.levels[t.id]=r+void 0}),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;let t=g$(e=this.body.nodeIndices).call(e,(e,t)=>(e.set(t,this.body.nodes[t]),e),new xU);this.options.hierarchical.shakeTowards===`roots`?this.hierarchical.levels=R$(t):this.hierarchical.levels=L$(t),this.hierarchical.setMinLevelToZero()}_generateMap(){this._crawlNetwork((e,t)=>{this.hierarchical.levels[t.id]>this.hierarchical.levels[e.id]&&this.hierarchical.addRelation(e.id,t.id)}),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0,n={},r=(t,i)=>{if(n[t.id]===void 0){this.hierarchical.setTreeIndex(t,i),n[t.id]=!0;let a,o=this._getActiveEdges(t);for(let n=0;n<o.length;n++){let s=o[n];s.connected===!0&&(a=s.toId==t.id?s.from:s.to,t.id!=a.id&&(e(t,a,s),r(a,i)))}}};if(t===void 0){let e=0;for(let t=0;t<this.body.nodeIndices.length;t++){let i=this.body.nodeIndices[t];if(n[i]===void 0){let t=this.body.nodes[i];r(t,e),e+=1}}}else{let e=this.body.nodes[t];if(e===void 0){console.error(`Node not found:`,t);return}r(e)}}_shiftBlock(e,t){let n={},r=e=>{if(n[e])return;n[e]=!0,this.direction.shift(e,t);let i=this.hierarchical.childrenReference[e];if(i!==void 0)for(let e=0;e<i.length;e++)r(i[e])};r(e)}_findCommonParent(e,t){let n={},r=(e,t)=>{let n=this.hierarchical.parentReference[t];if(n!==void 0)for(let t=0;t<n.length;t++){let i=n[t];e[i]=!0,r(e,i)}},i=(e,t)=>{let n=this.hierarchical.parentReference[t];if(n!==void 0)for(let r=0;r<n.length;r++){let a=n[r];if(e[a]!==void 0)return{foundParent:a,withChild:t};let o=i(e,a);if(o.foundParent!==null)return o}return{foundParent:null,withChild:t}};return r(n,e),i(n,t)}setDirectionStrategy(){this.options.hierarchical.direction===`UD`||this.options.hierarchical.direction===`DU`?this.direction=new v$(this):this.direction=new y$(this)}_getCenterPosition(e){let t=1e9,n=-1e9;for(let r=0;r<e.length;r++){let i;if(e[r].id!==void 0)i=e[r];else{let t=e[r];i=this.body.nodes[t]}let a=this.direction.getPosition(i);t=Math.min(t,a),n=Math.max(n,a)}return .5*(t+n)}},H$=class{constructor(e,t,n,r){var i,a;this.body=e,this.canvas=t,this.selectionHandler=n,this.interactionHandler=r,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:`dot`,size:6,color:{background:`#ff0000`,border:`#3c3c3c`,highlight:{background:`#07f968`,border:`#3c3c3c`}},borderWidth:2,borderWidthSelected:2}},eD(this.options,this.defaultOptions),this.body.emitter.on(`destroy`,()=>{this._clean()}),this.body.emitter.on(`_dataChanged`,B(i=this._restore).call(i,this)),this.body.emitter.on(`_resetData`,B(a=this._restore).call(a,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,n){t!==void 0&&(t.locale===void 0?this.options.locale=n.locale:this.options.locale=t.locale,t.locales===void 0?this.options.locales=n.locales:this.options.locales=t.locales),e!==void 0&&(typeof e==`boolean`?this.options.enabled=e:(this.options.enabled=!0,U(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display=`block`,this.closeDiv.style.display=`block`,this.editModeDiv.style.display=`none`,this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display=`none`,this.closeDiv.style.display=`none`,this.editModeDiv.style.display=`block`,this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,t;this.editMode=!0,this.manipulationDiv.style.display=`block`,this.closeDiv.style.display=`block`;let n=this.selectionHandler.getSelectedNodeCount(),r=this.selectionHandler.getSelectedEdgeCount(),i=n+r,a=this.options.locales[this.options.locale],o=!1;this.options.addNode!==!1&&(this._createAddNodeButton(a),o=!0),this.options.addEdge!==!1&&(o===!0?this._createSeperator(1):o=!0,this._createAddEdgeButton(a)),n===1&&typeof this.options.editNode==`function`?(o===!0?this._createSeperator(2):o=!0,this._createEditNodeButton(a)):r===1&&n===0&&this.options.editEdge!==!1&&(o===!0?this._createSeperator(3):o=!0,this._createEditEdgeButton(a)),i!==0&&(n>0&&this.options.deleteNode!==!1||n===0&&this.options.deleteEdge!==!1)&&(o===!0&&this._createSeperator(4),this._createDeleteButton(a)),this._bindElementEvents(this.closeDiv,B(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent(`select`,B(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit(`_redraw`)}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode=`addNode`,this.guiEnabled===!0){var t;let e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,B(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent(`click`,B(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();let e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode=`editNode`,typeof this.options.editNode==`function`)if(e.isCluster!==!0){let t=U({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length===2)this.options.editNode(t,e=>{e!=null&&this.inMode===`editNode`&&this.body.data.nodes.getDataSet().update(e),this.showManipulatorToolbar()});else throw Error(`The function for edit does not support two arguments (data, callback)`)}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw Error(`No function has been configured to handle the editing of nodes.`);else this.showManipulatorToolbar()}addEdgeMode(){var e,t,n,r,i;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode=`addEdge`,this.guiEnabled===!0){var a;let e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,B(a=this.toggleEditMode).call(a,this))}this._temporaryBindUI(`onTouch`,B(e=this._handleConnect).call(e,this)),this._temporaryBindUI(`onDragEnd`,B(t=this._finishConnect).call(t,this)),this._temporaryBindUI(`onDrag`,B(n=this._dragControlNode).call(n,this)),this._temporaryBindUI(`onRelease`,B(r=this._finishConnect).call(r,this)),this._temporaryBindUI(`onDragStart`,B(i=this._dragStartEdge).call(i,this)),this._temporaryBindUI(`onHold`,()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode=`editEdge`,typeof this.options.editEdge==`object`&&typeof this.options.editEdge.editWithoutDrag==`function`&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){let e=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(e.from.id,e.to.id);return}if(this.guiEnabled===!0){var e;let t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,B(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,n,r,i;let e=this.body.edges[this.edgeBeingEditedId],a=this._getNewTargetNode(e.from.x,e.from.y),o=this._getNewTargetNode(e.to.x,e.to.y);this.temporaryIds.nodes.push(a.id),this.temporaryIds.nodes.push(o.id),this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id),this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id),this._temporaryBindUI(`onTouch`,B(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI(`onTap`,()=>{}),this._temporaryBindUI(`onHold`,()=>{}),this._temporaryBindUI(`onDragStart`,B(n=this._controlNodeDragStart).call(n,this)),this._temporaryBindUI(`onDrag`,B(r=this._controlNodeDrag).call(r,this)),this._temporaryBindUI(`onDragEnd`,B(i=this._controlNodeDragEnd).call(i,this)),this._temporaryBindUI(`onMouseMove`,()=>{}),this._temporaryBindEvent(`beforeDrawing`,t=>{let n=e.edgeType.findBorderPositions(t);a.selected===!1&&(a.x=n.from.x,a.y=n.from.y),o.selected===!1&&(o.x=n.to.x,o.y=n.to.y)}),this.body.emitter.emit(`_redraw`)}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode=`delete`;let e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds(),n;if(e.length>0){for(let t=0;t<e.length;t++)if(this.body.nodes[e[t]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode==`function`&&(n=this.options.deleteNode)}else t.length>0&&typeof this.options.deleteEdge==`function`&&(n=this.options.deleteEdge);if(typeof n==`function`){let r={nodes:e,edges:t};if(n.length===2)n(r,e=>{e!=null&&this.inMode===`delete`?(this.body.data.edges.getDataSet().remove(e.edges),this.body.data.nodes.getDataSet().remove(e.nodes),this.body.emitter.emit(`startSimulation`),this.showManipulatorToolbar()):(this.body.emitter.emit(`startSimulation`),this.showManipulatorToolbar())});else throw Error(`The function for delete does not support two arguments (data, callback)`)}else this.body.data.edges.getDataSet().remove(t),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit(`startSimulation`),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement(`div`),this.manipulationDiv.className=`vis-manipulation`,this.editMode===!0?this.manipulationDiv.style.display=`block`:this.manipulationDiv.style.display=`none`,this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement(`div`),this.editModeDiv.className=`vis-edit-mode`,this.editMode===!0?this.editModeDiv.style.display=`none`:this.editModeDiv.style.display=`block`,this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0&&(this.closeDiv=document.createElement(`button`),this.closeDiv.className=`vis-close`,this.closeDiv.setAttribute(`aria-label`,this.options.locales[this.options.locale]?.close??this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}_getNewTargetNode(e,t){let n=U({},this.options.controlNodeStyle);n.id=`targetNode`+UY(),n.hidden=!1,n.physics=!1,n.x=e,n.y=t;let r=this.body.functions.createNode(n);return r.shape.boundingBox={left:e,right:e,top:t,bottom:t},r}_createEditButton(){var e;this._clean(),this.manipulationDOM={},PB(this.editModeDiv);let t=this.options.locales[this.options.locale],n=this._createButton(`editMode`,`vis-edit vis-edit-mode`,t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(n),this._bindElementEvents(n,B(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(PB(this.editModeDiv),PB(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit(`restorePhysics`)}_cleanupDOMEventListeners(){for(let t of uP(e=this._domEventListenerCleanupQueue).call(e,0)){var e;t()}}_removeManipulationDOM(){this._clean(),PB(this.manipulationDiv),PB(this.editModeDiv),PB(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM[`seperatorLineDiv`+e]=document.createElement(`div`),this.manipulationDOM[`seperatorLineDiv`+e].className=`vis-separator-line`,this.manipulationDiv.appendChild(this.manipulationDOM[`seperatorLineDiv`+e])}_createAddNodeButton(e){var t;let n=this._createButton(`addNode`,`vis-add`,e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,B(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;let n=this._createButton(`addEdge`,`vis-connect`,e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,B(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;let n=this._createButton(`editNode`,`vis-edit`,e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,B(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;let n=this._createButton(`editEdge`,`vis-edit`,e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,B(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let n;n=this.options.rtl?`vis-delete-rtl`:`vis-delete`;let r=this._createButton(`delete`,n,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,B(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;let n=this._createButton(`back`,`vis-back`,e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,B(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`vis-label`;return this.manipulationDOM[e+`Div`]=document.createElement(`button`),this.manipulationDOM[e+`Div`].className=`vis-button `+t,this.manipulationDOM[e+`Label`]=document.createElement(`div`),this.manipulationDOM[e+`Label`].className=r,this.manipulationDOM[e+`Label`].innerText=n,this.manipulationDOM[e+`Div`].appendChild(this.manipulationDOM[e+`Label`]),this.manipulationDOM[e+`Div`]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement(`div`),this.manipulationDOM.descriptionLabel.className=`vis-none`,this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}_temporaryBindUI(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw Error(`This UI function does not exist. Typo? You tried: `+e+` possible are: `+lL(KM(this.body.eventListeners)))}_unbindTemporaryUIs(){for(let e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e<this.temporaryEventFunctions.length;e++){let t=this.temporaryEventFunctions[e].event,n=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,n)}this.temporaryEventFunctions=[]}_bindElementEvents(e,t){let n=new _V(e,{});tX(n,t),this._domEventListenerCleanupQueue.push(()=>{n.destroy()});let r=e=>{let{keyCode:n,key:r}=e;(r===`Enter`||r===` `||n===13||n===32)&&t()};e.addEventListener(`keyup`,r,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener(`keyup`,r,!1)})}_cleanupTemporaryNodesAndEdges(){for(let n=0;n<this.temporaryIds.edges.length;n++){var e;this.body.edges[this.temporaryIds.edges[n]].disconnect(),delete this.body.edges[this.temporaryIds.edges[n]];let r=H(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[n]);if(r!==-1){var t;uP(t=this.body.edgeIndices).call(t,r,1)}}for(let e=0;e<this.temporaryIds.nodes.length;e++){var n;delete this.body.nodes[this.temporaryIds.nodes[e]];let t=H(n=this.body.nodeIndices).call(n,this.temporaryIds.nodes[e]);if(t!==-1){var r;uP(r=this.body.nodeIndices).call(r,t,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=eD({},this.body.view.translation)}_controlNodeDragStart(){let e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),n=this.body.nodes[this.temporaryIds.nodes[0]],r=this.body.nodes[this.temporaryIds.nodes[1]],i=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;let a=n.isOverlappingWith(t),o=r.isOverlappingWith(t);a===!0?(this.selectedControlNode=n,i.edgeType.from=n):o===!0&&(this.selectedControlNode=r,i.edgeType.to=r),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit(`_redraw`)}_controlNodeDrag(e){this.body.emitter.emit(`disablePhysics`);let t=this.body.functions.getPointer(e.center),n=this.canvas.DOMtoCanvas(t);this.selectedControlNode===void 0?this.interactionHandler.onDrag(e):(this.selectedControlNode.x=n.x,this.selectedControlNode.y=n.y),this.body.emitter.emit(`_redraw`)}_controlNodeDragEnd(e){let t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),r=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();let i=this.selectionHandler._getAllNodesOverlappingWith(n),a;for(let e=i.length-1;e>=0;e--)if(i[e]!==this.selectedControlNode.id){a=this.body.nodes[i[e]];break}if(a!==void 0&&this.selectedControlNode!==void 0)if(a.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let e=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===e.id?this._performEditEdge(a.id,r.to.id):this._performEditEdge(r.from.id,a.id)}else r.updateEdgeType(),this.body.emitter.emit(`restorePhysics`);this.body.emitter.emit(`_redraw`)}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=eD({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;let t=this.lastTouch,n=this.selectionHandler.getNodeAt(t);if(n!==void 0)if(n.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let e=this._getNewTargetNode(n.x,n.y);this.body.nodes[e.id]=e,this.body.nodeIndices.push(e.id);let t=this.body.functions.createEdge({id:`connectionEdge`+UY(),from:n.id,to:e.id,physics:!1,smooth:{enabled:!0,type:`continuous`,roundness:.5}});this.body.edges[t.id]=t,this.body.edgeIndices.push(t.id),this.temporaryIds.nodes.push(e.id),this.temporaryIds.edges.push(t.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){let t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),r;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);let i=this.selectionHandler._getAllNodesOverlappingWith(n),a;for(let e=i.length-1;e>=0;e--){var o;if(H(o=this.temporaryIds.nodes).call(o,i[e])===-1){a=this.body.nodes[i[e]];break}}if(e.controlEdge={from:r,to:a?a.id:void 0},this.selectionHandler.generateClickEvent(`controlNodeDragging`,e,t),this.temporaryIds.nodes[0]!==void 0){let e=this.body.nodes[this.temporaryIds.nodes[0]];e.x=this.canvas._XconvertDOMtoCanvas(t.x),e.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit(`_redraw`)}else this.interactionHandler.onDrag(e)}_finishConnect(e){let t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),r;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);let i=this.selectionHandler._getAllNodesOverlappingWith(n),a;for(let e=i.length-1;e>=0;e--){var o;if(H(o=this.temporaryIds.nodes).call(o,i[e])===-1){a=this.body.nodes[i[e]];break}}this._cleanupTemporaryNodesAndEdges(),a!==void 0&&(a.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[r]!==void 0&&this.body.nodes[a.id]!==void 0&&this._performAddEdge(r,a.id)),e.controlEdge={from:r,to:a?a.id:void 0},this.selectionHandler.generateClickEvent(`controlNodeDragEnd`,e,t),this.body.emitter.emit(`_redraw`)}_dragStartEdge(e){let t=this.lastTouch;this.selectionHandler.generateClickEvent(`dragStart`,e,t,void 0,!0)}_performAddNode(e){let t={id:UY(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:`new`};if(typeof this.options.addNode==`function`)if(this.options.addNode.length===2)this.options.addNode(t,e=>{e!=null&&this.inMode===`addNode`&&this.body.data.nodes.getDataSet().add(e),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),Error(`The function for add does not support two arguments (data,callback)`);else this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()}_performAddEdge(e,t){let n={from:e,to:t};if(typeof this.options.addEdge==`function`)if(this.options.addEdge.length===2)this.options.addEdge(n,e=>{e!=null&&this.inMode===`addEdge`&&(this.body.data.edges.getDataSet().add(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw Error(`The function for connect does not support two arguments (data,callback)`);else this.body.data.edges.getDataSet().add(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){let n={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label},r=this.options.editEdge;if(typeof r==`object`&&(r=r.editWithoutDrag),typeof r==`function`)if(r.length===2)r(n,e=>{e==null||this.inMode!==`editEdge`?(this.body.edges[n.id].updateEdgeType(),this.body.emitter.emit(`_redraw`),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw Error(`The function for edit does not support two arguments (data, callback)`);else this.body.data.edges.getDataSet().update(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},Y=`string`,X=`boolean`,Z=`number`,U$=`array`,Q=`object`,W$=`dom`,G$=`any`,K$=[`arrow`,`bar`,`box`,`circle`,`crow`,`curve`,`diamond`,`image`,`inv_curve`,`inv_triangle`,`triangle`,`vee`],q$={borderWidth:{number:Z},borderWidthSelected:{number:Z,undefined:`undefined`},brokenImage:{string:Y,undefined:`undefined`},chosen:{label:{boolean:X,function:`function`},node:{boolean:X,function:`function`},__type__:{object:Q,boolean:X}},color:{border:{string:Y},background:{string:Y},highlight:{border:{string:Y},background:{string:Y},__type__:{object:Q,string:Y}},hover:{border:{string:Y},background:{string:Y},__type__:{object:Q,string:Y}},__type__:{object:Q,string:Y}},opacity:{number:Z,undefined:`undefined`},fixed:{x:{boolean:X},y:{boolean:X},__type__:{object:Q,boolean:X}},font:{align:{string:Y},color:{string:Y},size:{number:Z},face:{string:Y},background:{string:Y},strokeWidth:{number:Z},strokeColor:{string:Y},vadjust:{number:Z},multi:{boolean:X,string:Y},bold:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},boldital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},ital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},mono:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},__type__:{object:Q,string:Y}},group:{string:Y,number:Z,undefined:`undefined`},heightConstraint:{minimum:{number:Z},valign:{string:Y},__type__:{object:Q,boolean:X,number:Z}},hidden:{boolean:X},icon:{face:{string:Y},code:{string:Y},size:{number:Z},color:{string:Y},weight:{string:Y,number:Z},__type__:{object:Q}},id:{string:Y,number:Z},image:{selected:{string:Y,undefined:`undefined`},unselected:{string:Y,undefined:`undefined`},__type__:{object:Q,string:Y}},imagePadding:{top:{number:Z},right:{number:Z},bottom:{number:Z},left:{number:Z},__type__:{object:Q,number:Z}},label:{string:Y,undefined:`undefined`},labelHighlightBold:{boolean:X},level:{number:Z,undefined:`undefined`},margin:{top:{number:Z},right:{number:Z},bottom:{number:Z},left:{number:Z},__type__:{object:Q,number:Z}},mass:{number:Z},physics:{boolean:X},scaling:{min:{number:Z},max:{number:Z},label:{enabled:{boolean:X},min:{number:Z},max:{number:Z},maxVisible:{number:Z},drawThreshold:{number:Z},__type__:{object:Q,boolean:X}},customScalingFunction:{function:`function`},__type__:{object:Q}},shadow:{enabled:{boolean:X},color:{string:Y},size:{number:Z},x:{number:Z},y:{number:Z},__type__:{object:Q,boolean:X}},shape:{string:[`custom`,`ellipse`,`circle`,`database`,`box`,`text`,`image`,`circularImage`,`diamond`,`dot`,`star`,`triangle`,`triangleDown`,`square`,`icon`,`hexagon`]},ctxRenderer:{function:`function`},shapeProperties:{borderDashes:{boolean:X,array:U$},borderRadius:{number:Z},interpolation:{boolean:X},useImageSize:{boolean:X},useBorderWithImage:{boolean:X},coordinateOrigin:{string:[`center`,`top-left`]},__type__:{object:Q}},size:{number:Z},title:{string:Y,dom:W$,undefined:`undefined`},value:{number:Z,undefined:`undefined`},widthConstraint:{minimum:{number:Z},maximum:{number:Z},__type__:{object:Q,boolean:X,number:Z}},x:{number:Z},y:{number:Z},__type__:{object:Q}},J$={configure:{enabled:{boolean:X},filter:{boolean:X,string:Y,array:U$,function:`function`},container:{dom:W$},showButton:{boolean:X},__type__:{object:Q,boolean:X,string:Y,array:U$,function:`function`}},edges:{arrows:{to:{enabled:{boolean:X},scaleFactor:{number:Z},type:{string:K$},imageHeight:{number:Z},imageWidth:{number:Z},src:{string:Y},__type__:{object:Q,boolean:X}},middle:{enabled:{boolean:X},scaleFactor:{number:Z},type:{string:K$},imageWidth:{number:Z},imageHeight:{number:Z},src:{string:Y},__type__:{object:Q,boolean:X}},from:{enabled:{boolean:X},scaleFactor:{number:Z},type:{string:K$},imageWidth:{number:Z},imageHeight:{number:Z},src:{string:Y},__type__:{object:Q,boolean:X}},__type__:{string:[`from`,`to`,`middle`],object:Q}},endPointOffset:{from:{number:Z},to:{number:Z},__type__:{object:Q,number:Z}},arrowStrikethrough:{boolean:X},background:{enabled:{boolean:X},color:{string:Y},size:{number:Z},dashes:{boolean:X,array:U$},__type__:{object:Q,boolean:X}},chosen:{label:{boolean:X,function:`function`},edge:{boolean:X,function:`function`},__type__:{object:Q,boolean:X}},color:{color:{string:Y},highlight:{string:Y},hover:{string:Y},inherit:{string:[`from`,`to`,`both`],boolean:X},opacity:{number:Z},__type__:{object:Q,string:Y}},dashes:{boolean:X,array:U$},font:{color:{string:Y},size:{number:Z},face:{string:Y},background:{string:Y},strokeWidth:{number:Z},strokeColor:{string:Y},align:{string:[`horizontal`,`top`,`middle`,`bottom`]},vadjust:{number:Z},multi:{boolean:X,string:Y},bold:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},boldital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},ital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},mono:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},__type__:{object:Q,string:Y}},hidden:{boolean:X},hoverWidth:{function:`function`,number:Z},label:{string:Y,undefined:`undefined`},labelHighlightBold:{boolean:X},length:{number:Z,undefined:`undefined`},physics:{boolean:X},scaling:{min:{number:Z},max:{number:Z},label:{enabled:{boolean:X},min:{number:Z},max:{number:Z},maxVisible:{number:Z},drawThreshold:{number:Z},__type__:{object:Q,boolean:X}},customScalingFunction:{function:`function`},__type__:{object:Q}},selectionWidth:{function:`function`,number:Z},selfReferenceSize:{number:Z},selfReference:{size:{number:Z},angle:{number:Z},renderBehindTheNode:{boolean:X},__type__:{object:Q}},shadow:{enabled:{boolean:X},color:{string:Y},size:{number:Z},x:{number:Z},y:{number:Z},__type__:{object:Q,boolean:X}},smooth:{enabled:{boolean:X},type:{string:[`dynamic`,`continuous`,`discrete`,`diagonalCross`,`straightCross`,`horizontal`,`vertical`,`curvedCW`,`curvedCCW`,`cubicBezier`]},roundness:{number:Z},forceDirection:{string:[`horizontal`,`vertical`,`none`],boolean:X},__type__:{object:Q,boolean:X}},title:{string:Y,undefined:`undefined`},width:{number:Z},widthConstraint:{maximum:{number:Z},__type__:{object:Q,boolean:X,number:Z}},value:{number:Z,undefined:`undefined`},__type__:{object:Q}},groups:{useDefaultGroups:{boolean:X},__any__:q$,__type__:{object:Q}},interaction:{dragNodes:{boolean:X},dragView:{boolean:X},hideEdgesOnDrag:{boolean:X},hideEdgesOnZoom:{boolean:X},hideNodesOnDrag:{boolean:X},hover:{boolean:X},keyboard:{enabled:{boolean:X},speed:{x:{number:Z},y:{number:Z},zoom:{number:Z},__type__:{object:Q}},bindToWindow:{boolean:X},autoFocus:{boolean:X},__type__:{object:Q,boolean:X}},multiselect:{boolean:X},navigationButtons:{boolean:X},selectable:{boolean:X},selectConnectedEdges:{boolean:X},hoverConnectedEdges:{boolean:X},tooltipDelay:{number:Z},zoomView:{boolean:X},zoomSpeed:{number:Z},__type__:{object:Q}},layout:{randomSeed:{undefined:`undefined`,number:Z,string:Y},improvedLayout:{boolean:X},clusterThreshold:{number:Z},hierarchical:{enabled:{boolean:X},levelSeparation:{number:Z},nodeSpacing:{number:Z},treeSpacing:{number:Z},blockShifting:{boolean:X},edgeMinimization:{boolean:X},parentCentralization:{boolean:X},direction:{string:[`UD`,`DU`,`LR`,`RL`]},sortMethod:{string:[`hubsize`,`directed`]},shakeTowards:{string:[`leaves`,`roots`]},__type__:{object:Q,boolean:X}},__type__:{object:Q}},manipulation:{enabled:{boolean:X},initiallyActive:{boolean:X},addNode:{boolean:X,function:`function`},addEdge:{boolean:X,function:`function`},editNode:{function:`function`},editEdge:{editWithoutDrag:{function:`function`},__type__:{object:Q,boolean:X,function:`function`}},deleteNode:{boolean:X,function:`function`},deleteEdge:{boolean:X,function:`function`},controlNodeStyle:q$,__type__:{object:Q,boolean:X}},nodes:q$,physics:{enabled:{boolean:X},barnesHut:{theta:{number:Z},gravitationalConstant:{number:Z},centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},damping:{number:Z},avoidOverlap:{number:Z},__type__:{object:Q}},forceAtlas2Based:{theta:{number:Z},gravitationalConstant:{number:Z},centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},damping:{number:Z},avoidOverlap:{number:Z},__type__:{object:Q}},repulsion:{centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},nodeDistance:{number:Z},damping:{number:Z},__type__:{object:Q}},hierarchicalRepulsion:{centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},nodeDistance:{number:Z},damping:{number:Z},avoidOverlap:{number:Z},__type__:{object:Q}},maxVelocity:{number:Z},minVelocity:{number:Z},solver:{string:[`barnesHut`,`repulsion`,`hierarchicalRepulsion`,`forceAtlas2Based`]},stabilization:{enabled:{boolean:X},iterations:{number:Z},updateInterval:{number:Z},onlyDynamicEdges:{boolean:X},fit:{boolean:X},__type__:{object:Q,boolean:X}},timestep:{number:Z},adaptiveTimestep:{boolean:X},wind:{x:{number:Z},y:{number:Z},__type__:{object:Q}},__type__:{object:Q,boolean:X}},autoResize:{boolean:X},clickToUse:{boolean:X},locale:{string:Y},locales:{__any__:{any:G$},__type__:{object:Q}},height:{string:Y},width:{string:Y},__type__:{object:Q}},Y$={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:[`color`,`#2B7CE9`],background:[`color`,`#97C2FC`],highlight:{border:[`color`,`#2B7CE9`],background:[`color`,`#D2E5FF`]},hover:{border:[`color`,`#2B7CE9`],background:[`color`,`#D2E5FF`]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:[`color`,`#343434`],size:[14,0,100,1],face:[`arial`,`verdana`,`tahoma`],background:[`color`,`none`],strokeWidth:[0,0,50,1],strokeColor:[`color`,`#ffffff`]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:[`ellipse`,`box`,`circle`,`database`,`diamond`,`dot`,`square`,`star`,`text`,`triangle`,`triangleDown`,`hexagon`],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:`arrow`},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:`arrow`},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:`arrow`}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:[`color`,`#848484`],highlight:[`color`,`#848484`],hover:[`color`,`#848484`],inherit:[`from`,`to`,`both`,!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:[`color`,`#343434`],size:[14,0,100,1],face:[`arial`,`verdana`,`tahoma`],background:[`color`,`none`],strokeWidth:[2,0,50,1],strokeColor:[`color`,`#ffffff`],align:[`horizontal`,`top`,`middle`,`bottom`]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:[`dynamic`,`continuous`,`discrete`,`diagonalCross`,`straightCross`,`horizontal`,`vertical`,`curvedCW`,`curvedCCW`,`cubicBezier`],forceDirection:[`horizontal`,`vertical`,`none`],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:[`UD`,`DU`,`LR`,`RL`],sortMethod:[`hubsize`,`directed`],shakeTowards:[`leaves`,`roots`]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:[`barnesHut`,`forceAtlas2Based`,`repulsion`,`hierarchicalRepulsion`],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},X$=(e,t,n)=>{var r;return!!(VP(e).call(e,`physics`)&&VP(r=Y$.physics.solver).call(r,t)&&n.physics.solver!==t&&t!==`wind`)},Z$=class{constructor(){}getDistances(e,t,n){let r={},i=e.edges;for(let e=0;e<t.length;e++){let n=t[e],i={};r[n]=i;for(let n=0;n<t.length;n++)i[t[n]]=e==n?0:1e9}for(let e=0;e<n.length;e++){let t=i[n[e]];t.connected===!0&&r[t.fromId]!==void 0&&r[t.toId]!==void 0&&(r[t.fromId][t.toId]=1,r[t.toId][t.fromId]=1)}let a=t.length;for(let e=0;e<a;e++){let n=t[e],i=r[n];for(let e=0;e<a-1;e++){let o=t[e],s=r[o];for(let c=e+1;c<a;c++){let e=t[c],a=r[e],l=Math.min(s[e],s[n]+i[e]);s[e]=l,a[o]=l}}}return r}},Q$=class{constructor(e,t,n){this.body=e,this.springLength=t,this.springConstant=n,this.distanceSolver=new Z$}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(r),this._createK_matrix(r),this._createE_matrix();let i=0,a=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),o=1e9,s=0,c=0,l=0,u=0,d=0;for(;o>.01&&i<a;)for(i+=1,[s,o,c,l]=this._getHighestEnergyNode(n),u=o,d=0;u>1&&d<5;)d+=1,this._moveNode(s,c,l),[u,c,l]=this._getEnergy(s)}_getHighestEnergyNode(e){let t=this.body.nodeIndices,n=this.body.nodes,r=0,i=t[0],a=0,o=0;for(let s=0;s<t.length;s++){let c=t[s];if(n[c].predefinedPosition!==!0||n[c].isCluster===!0&&e===!0||n[c].options.fixed.x!==!0||n[c].options.fixed.y!==!0){let[e,t,n]=this._getEnergy(c);r<e&&(r=e,i=c,a=t,o=n)}}return[i,r,a,o]}_getEnergy(e){let[t,n]=this.E_sums[e];return[Math.sqrt(t**2+n**2),t,n]}_moveNode(e,t,n){let r=this.body.nodeIndices,i=this.body.nodes,a=0,o=0,s=0,c=i[e].x,l=i[e].y,u=this.K_matrix[e],d=this.L_matrix[e];for(let t=0;t<r.length;t++){let n=r[t];if(n!==e){let e=i[n].x,t=i[n].y,r=u[n],f=d[n],p=1/((c-e)**2+(l-t)**2)**1.5;a+=r*(1-f*(l-t)**2*p),o+=r*(f*(c-e)*(l-t)*p),s+=r*(1-f*(c-e)**2*p)}}let f=a,p=o,m=t,h=s,g=n,_=(m/f+g/p)/(p/f-h/p),v=-(p*_+m)/f;i[e].x+=v,i[e].y+=_,this._updateE_matrix(e)}_createL_matrix(e){let t=this.body.nodeIndices,n=this.springLength;this.L_matrix=[];for(let r=0;r<t.length;r++){this.L_matrix[t[r]]={};for(let i=0;i<t.length;i++)this.L_matrix[t[r]][t[i]]=n*e[t[r]][t[i]]}}_createK_matrix(e){let t=this.body.nodeIndices,n=this.springConstant;this.K_matrix=[];for(let r=0;r<t.length;r++){this.K_matrix[t[r]]={};for(let i=0;i<t.length;i++)this.K_matrix[t[r]][t[i]]=n*e[t[r]][t[i]]**-2}}_createE_matrix(){let e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(let t=0;t<e.length;t++)this.E_matrix[e[t]]=[];for(let n=0;n<e.length;n++){let r=e[n],i=t[r].x,a=t[r].y,o=0,s=0;for(let c=n;c<e.length;c++){let l=e[c];if(l!==r){let e=t[l].x,u=t[l].y,d=1/Math.sqrt((i-e)**2+(a-u)**2);this.E_matrix[r][c]=[this.K_matrix[r][l]*(i-e-this.L_matrix[r][l]*(i-e)*d),this.K_matrix[r][l]*(a-u-this.L_matrix[r][l]*(a-u)*d)],this.E_matrix[l][n]=this.E_matrix[r][c],o+=this.E_matrix[r][c][0],s+=this.E_matrix[r][c][1]}}this.E_sums[r]=[o,s]}}_updateE_matrix(e){let t=this.body.nodeIndices,n=this.body.nodes,r=this.E_matrix[e],i=this.K_matrix[e],a=this.L_matrix[e],o=n[e].x,s=n[e].y,c=0,l=0;for(let u=0;u<t.length;u++){let d=t[u];if(d!==e){let e=r[u],t=e[0],f=e[1],p=n[d].x,m=n[d].y,h=1/Math.sqrt((o-p)**2+(s-m)**2),g=i[d]*(o-p-a[d]*(o-p)*h),_=i[d]*(s-m-a[d]*(s-m)*h);r[u]=[g,_],c+=g,l+=_;let v=this.E_sums[d];v[0]+=g-t,v[1]+=_-f}}this.E_sums[e]=[c,l]}};function $(e,t,n){var r,i,a,o;if(!(this instanceof $))throw SyntaxError(`Constructor must be called with the new operator`);this.options={},this.defaultOptions={locale:`en`,locales:$V,clickToUse:!1},eD(this.options,this.defaultOptions),this.body={container:e,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:B(r=this.on).call(r,this),off:B(i=this.off).call(i,this),emit:B(a=this.emit).call(a,this),once:B(o=this.once).call(o,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new nH(()=>this.body.emitter.emit(`_requestRedraw`)),this.groups=new SU,this.canvas=new rX(this.body),this.selectionHandler=new bQ(this.body,this.canvas),this.interactionHandler=new cX(this.body,this.canvas,this.selectionHandler),this.view=new aX(this.body,this.canvas),this.renderer=new qY(this.body,this.canvas),this.physics=new FY(this.body),this.layoutEngine=new V$(this.body),this.clustering=new KY(this.body),this.manipulation=new H$(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new BJ(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new EY(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Q$(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(n),this.setData(t)}VD($.prototype),$.prototype.setOptions=function(e){if(e===null&&(e=void 0),e!==void 0){if(bV.validate(e,J$)===!0&&console.error(`%cErrors have been found in the supplied options object.`,yV),zB([`locale`,`locales`,`clickToUse`],this.options,e),e.locale!==void 0&&(e.locale=eH(e.locales||this.options.locales,e.locale)),e=this.layoutEngine.setOptions(e.layout,e),this.canvas.setOptions(e),this.groups.setOptions(e.groups),this.nodesHandler.setOptions(e.nodes),this.edgesHandler.setOptions(e.edges),this.physics.setOptions(e.physics),this.manipulation.setOptions(e.manipulation,e,this.options),this.interactionHandler.setOptions(e.interaction),this.renderer.setOptions(e.interaction),this.selectionHandler.setOptions(e.interaction),e.groups!==void 0&&this.body.emitter.emit(`refreshNodes`),`configure`in e&&(this.configurator||=new gV(this,this.body.container,Y$,this.canvas.pixelRatio,X$),this.configurator.setOptions(e.configure)),this.configurator&&this.configurator.options.enabled===!0){let e={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};U(e.nodes,this.nodesHandler.options),U(e.edges,this.edgesHandler.options),U(e.layout,this.layoutEngine.options),U(e.interaction,this.selectionHandler.options),U(e.interaction,this.renderer.options),U(e.interaction,this.interactionHandler.options),U(e.manipulation,this.manipulation.options),U(e.physics,this.physics.options),U(e.global,this.canvas.options),U(e.global,this.options),this.configurator.setModuleOptions(e)}e.clickToUse===void 0?this.body.emitter.emit(`activate`):e.clickToUse===!0?this.activator===void 0&&(this.activator=new hV(this.canvas.frame),this.activator.on(`change`,()=>{this.body.emitter.emit(`activate`)})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit(`activate`)),this.canvas.setSize(),this.body.emitter.emit(`startSimulation`)}},$.prototype._updateVisibleIndices=function(){let e=this.body.nodes,t=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&!this.clustering._isClusteredNode(t)&&e[t].options.hidden===!1&&this.body.nodeIndices.push(e[t].id);for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n],i=e[r.fromId],a=e[r.toId],o=i!==void 0&&a!==void 0;!this.clustering._isClusteredEdge(n)&&r.options.hidden===!1&&o&&i.options.hidden===!1&&a.options.hidden===!1&&this.body.edgeIndices.push(r.id)}},$.prototype.bindEventListeners=function(){this.body.emitter.on(`_dataChanged`,()=>{this.edgesHandler._updateState(),this.body.emitter.emit(`_dataUpdated`)}),this.body.emitter.on(`_dataUpdated`,()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit(`startSimulation`),this.body.emitter.emit(`_requestRedraw`)})},$.prototype.setData=function(e){if(this.body.emitter.emit(`resetPhysics`),this.body.emitter.emit(`_resetData`),this.selectionHandler.unselectAll(),e&&e.dot&&(e.nodes||e.edges))throw SyntaxError(`Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.`);if(this.setOptions(e&&e.options),e&&e.dot){console.warn(`The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);`);let t=ZV(e.dot);this.setData(t);return}else if(e&&e.gephi){console.warn(`The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);`);let t=QV(e.gephi);this.setData(t);return}else this.nodesHandler.setData(e&&e.nodes,!0),this.edgesHandler.setData(e&&e.edges,!0);this.body.emitter.emit(`_dataChanged`),this.body.emitter.emit(`_dataLoaded`),this.body.emitter.emit(`initPhysics`)},$.prototype.destroy=function(){this.body.emitter.emit(`destroy`),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&delete this.body.nodes[e];for(let e in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,e)&&delete this.body.edges[e];PB(this.body.container)},$.prototype._updateValueRange=function(e){let t,n,r,i=0;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let a=e[t].getValue();a!==void 0&&(n=n===void 0?a:Math.min(a,n),r=r===void 0?a:Math.max(a,r),i+=a)}if(n!==void 0&&r!==void 0)for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t].setValueRange(n,r,i)},$.prototype.isActive=function(){return!this.activator||this.activator.active},$.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},$.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},$.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},$.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},$.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},$.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},$.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},$.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},$.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},$.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},$.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},$.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},$.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},$.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},$.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},$.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},$.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},$.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},$.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},$.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},$.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},$.prototype.editNodeMode=function(){return console.warn(`Deprecated: Please use editNode instead of editNodeMode.`),this.manipulation.editNode.apply(this.manipulation,arguments)},$.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},$.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},$.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},$.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},$.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},$.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},$.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},$.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},$.prototype.getConnectedNodes=function(e){return this.body.nodes[e]===void 0?this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments):this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments)},$.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},$.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},$.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},$.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},$.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},$.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},$.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},$.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},$.prototype.getNodeAt=function(){let e=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return e!==void 0&&e.id!==void 0?e.id:e},$.prototype.getEdgeAt=function(){let e=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return e!==void 0&&e.id!==void 0?e.id:e},$.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},$.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},$.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},$.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},$.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},$.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},$.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},$.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},$.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},$.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},$.prototype.getOptionsFromConfigurator=function(){let e={};return this.configurator&&(e=this.configurator.getOptions.apply(this.configurator)),e};export{xC as n,$ as t};
|
|
26
|
+
`),r=n.length;if(t.multi)for(let e=0;e<r;e++){let r=this.splitBlocks(n[e],t.multi);if(r!==void 0){if(r.length===0){this.lines.newLine(``);continue}if(t.maxWdt>0)for(let e=0;e<r.length;e++){let t=r[e].mod,n=r[e].text;this.splitStringIntoLines(n,t,!0)}else for(let e=0;e<r.length;e++){let t=r[e].mod,n=r[e].text;this.lines.append(n,t)}this.lines.newLine()}}else if(t.maxWdt>0)for(let e=0;e<r;e++)this.splitStringIntoLines(n[e]);else for(let e=0;e<r;e++)this.lines.newLine(n[e]);return this.lines.finalize()}decodeMarkupSystem(e){let t=`none`;return e===`markdown`||e===`md`?t=`markdown`:(e===!0||e===`html`)&&(t=`html`),t}splitHtmlBlocks(e){let t=new fJ(e),n=e=>/&/.test(e)?(t.replace(t.text,`<`,`<`)||t.replace(t.text,`&`,`&`)||t.add(`&`),!0):!1;for(;t.position<t.text.length;){let e=t.text.charAt(t.position);t.parseWS(e)||/</.test(e)&&(t.parseStartTag(`bold`,`<b>`)||t.parseStartTag(`ital`,`<i>`)||t.parseStartTag(`mono`,`<code>`)||t.parseEndTag(`bold`,`</b>`)||t.parseEndTag(`ital`,`</i>`)||t.parseEndTag(`mono`,`</code>`))||n(e)||t.add(e),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){let t=new fJ(e),n=!0,r=e=>/\\/.test(e)?(t.position<this.text.length+1&&(t.position++,e=this.text.charAt(t.position),/ \t/.test(e)?t.spacing=!0:(t.add(e),n=!1)),!0):!1;for(;t.position<t.text.length;){let e=t.text.charAt(t.position);t.parseWS(e)||r(e)||(n||t.spacing)&&(t.parseStartTag(`bold`,`*`)||t.parseStartTag(`ital`,`_`)||t.parseStartTag(`mono`,"`"))||t.parseEndTag(`bold`,`*`,`afterBold`)||t.parseEndTag(`ital`,`_`,`afterItal`)||t.parseEndTag(`mono`,"`",`afterMono`)||(t.add(e),n=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){let n=this.decodeMarkupSystem(t);if(n===`none`)return[{text:e,mod:`normal`}];if(n===`markdown`)return this.splitMarkdownBlocks(e);if(n===`html`)return this.splitHtmlBlocks(e)}overMaxWidth(e){let t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t=``,n=0;for(;n<e.length;){let r=t+(t===``?``:` `)+e[n];if(this.overMaxWidth(r))break;t=r,n++}return n}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(tM(e).call(e,0,t));)t++;return t}splitStringIntoLines(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`normal`,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,`$1\r`),e=e.replace(/([^\r][^ ]*)( +)/g,`$1\r$2\r`);let r=e.split(`\r`);for(;r.length>0;){let e=this.getLongestFit(r);if(e===0){let e=r[0],n=this.getLongestFitWord(e);this.lines.newLine(tM(e).call(e,0,n),t),r[0]=tM(e).call(e,n)}else{let i=e;r[e-1]===` `?e--:r[i]===` `&&i++;let a=tM(r).call(r,0,e).join(``);e==r.length&&n?this.lines.append(a,t):this.lines.newLine(a,t),r=tM(r).call(r,i)}}}},mJ=[`bold`,`ital`,`boldital`,`mono`],hJ=class e{constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=n}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),Yq(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font==`string`)this.baseSize=this.fontOptions.size;else if(typeof e.font==`object`){let t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(t){if(W(mJ,e=>{this.fontOptions[e]={}}),e.parseFontString(this.fontOptions,t)){this.fontOptions.vadjust=0;return}W(t,(e,t)=>{e!=null&&typeof e!=`object`&&(this.fontOptions[t]=e)})}static parseFontString(e,t){if(!t||typeof t!=`string`)return!1;let n=t.split(` `);return e.size=+n[0].replace(`px`,``),e.face=n[1],e.color=n[2],!0}constrain(e){let t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:`middle`},n=aV(e,`widthConstraint`);if(typeof n==`number`)t.maxWdt=Number(n),t.minWdt=Number(n);else if(typeof n==`object`){let n=aV(e,[`widthConstraint`,`maximum`]);typeof n==`number`&&(t.maxWdt=Number(n));let r=aV(e,[`widthConstraint`,`minimum`]);typeof r==`number`&&(t.minWdt=Number(r))}let r=aV(e,`heightConstraint`);if(typeof r==`number`)t.minHgt=Number(r);else if(typeof r==`object`){let n=aV(e,[`heightConstraint`,`minimum`]);typeof n==`number`&&(t.minHgt=Number(n));let r=aV(e,[`heightConstraint`,`valign`]);typeof r==`string`&&(r===`top`||r===`bottom`)&&(t.valign=r)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),U(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=qq(`label`,t)}adjustSizes(e){let t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);let n=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=n)}addFontOptionsToPile(e,t){for(let n=0;n<t.length;++n)this.addFontToPile(e,t[n])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;let n=t.font;e.push(n)}getBasicOptions(t){let n={};for(let r=0;r<t.length;++r){let i=t[r],a={};e.parseFontString(a,i)&&(i=a),W(i,(e,t)=>{e!==void 0&&(Object.prototype.hasOwnProperty.call(n,t)||(H(mJ).call(mJ,t)===-1?n[t]=e:n[t]={}))})}return n}getFontOption(t,n,r){let i;for(let a=0;a<t.length;++a){let o=t[a];if(Object.prototype.hasOwnProperty.call(o,n)){if(i=o[n],i==null)continue;let t={};if(e.parseFontString(t,i)&&(i=t),Object.prototype.hasOwnProperty.call(i,r))return i[r]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,r))return this.fontOptions[r];throw Error(`Did not find value for multi-font for property: '`+r+`'`)}getFontOptions(e,t){let n={},r=[`color`,`size`,`face`,`mod`,`vadjust`];for(let i=0;i<r.length;++i){let a=r[i];n[a]=this.getFontOption(e,t,a)}return n}propagateFonts(e){let t=[];this.addFontOptionsToPile(t,e),this.fontOptions=this.getBasicOptions(t);for(let e=0;e<mJ.length;++e){let n=mJ[e],r=this.fontOptions[n];W(this.getFontOptions(t,n),(e,t)=>{r[t]=e}),r.size=Number(r.size),r.vadjust=Number(r.vadjust)}}draw(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:`middle`;if(this.elementOptions.label===void 0)return;let o=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&o<this.elementOptions.scaling.label.drawThreshold-1||(o>=this.elementOptions.scaling.label.maxVisible&&(o=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,r,i,t,n,a),this._drawBackground(e),this._drawText(e,t,this.size.yLine,a,o))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!==`none`){e.fillStyle=this.fontOptions.background;let t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}_drawText(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`middle`,i=arguments.length>4?arguments[4]:void 0;[t,n]=this._setAlignment(e,t,n,r),e.textAlign=`left`,t-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign===`top`&&(n-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign===`bottom`&&(n+=(this.size.height-this.size.labelHeight)/2));for(let r=0;r<this.lineCount;r++){let a=this.lines[r];if(a&&a.blocks){let r=0;this.isEdgeLabel||this.fontOptions.align===`center`?r+=(this.size.width-a.width)/2:this.fontOptions.align===`right`&&(r+=this.size.width-a.width);for(let o=0;o<a.blocks.length;o++){let s=a.blocks[o];e.font=s.font;let[c,l]=this._getColor(s.color,i,s.strokeColor);s.strokeWidth>0&&(e.lineWidth=s.strokeWidth,e.strokeStyle=l,e.lineJoin=`round`),e.fillStyle=c,s.strokeWidth>0&&e.strokeText(s.text,t+r,n+s.vadjust),e.fillText(s.text,t+r,n+s.vadjust),r+=s.width}n+=a.height}}}_setAlignment(e,t,n,r){return this.isEdgeLabel&&this.fontOptions.align!==`horizontal`&&this.pointToSelf===!1?(t=0,n=0,this.fontOptions.align===`top`?(e.textBaseline=`alphabetic`,n-=4):this.fontOptions.align===`bottom`?(e.textBaseline=`hanging`,n+=4):e.textBaseline=`middle`):e.textBaseline=r,[t,n]}_getColor(e,t,n){let r=e||`#000000`,i=n||`#ffffff`;if(t<=this.elementOptions.scaling.label.drawThreshold){let e=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));r=KB(r,e),i=KB(i,e)}return[r,i]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,n),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let e=this.size.left,t=this.size.top-.5*2;if(this.isEdgeLabel){let n=-this.size.width*.5;switch(this.fontOptions.align){case`middle`:e=n,t=-this.size.height*.5;break;case`top`:e=n,t=-(this.size.height+2);break;case`bottom`:e=n,t=2;break}}return{left:e,top:t,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:`middle`;this._processLabel(e,t,n),this.size.left=r-this.size.width*.5,this.size.top=i-this.size.height*.5,this.size.yLine=i+(1-this.lineCount)*.5*this.fontOptions.size,a===`hanging`&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,n,r){let i=function(e,t,n){return t===`normal`?n===`mod`?``:e[n]:e[t][n]===void 0?e[n]:e[t][n]},a={color:i(this.fontOptions,r,`color`),size:i(this.fontOptions,r,`size`),face:i(this.fontOptions,r,`face`),mod:i(this.fontOptions,r,`mod`),vadjust:i(this.fontOptions,r,`vadjust`),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||n)&&(r===`normal`&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?a.mod=`bold`:typeof this.fontOptions.chooser==`function`&&this.fontOptions.chooser(a,this.elementOptions.id,t,n));let o=``;return a.mod!==void 0&&a.mod!==``&&(o+=a.mod+` `),o+=a.size+`px `+a.face,e.font=o.replace(/"/g,``),a.font=e.font,a.height=a.size,a}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,n,r){return new pJ(e,this,t,n).process(r)}_processLabel(e,t,n){if(this.labelDirty===!1&&!this.differentState(t,n))return;let r=this._processLabelText(e,t,n,this.elementOptions.label);this.fontOptions.minWdt>0&&r.width<this.fontOptions.minWdt&&(r.width=this.fontOptions.minWdt),this.size.labelHeight=r.height,this.fontOptions.minHgt>0&&r.height<this.fontOptions.minHgt&&(r.height=this.fontOptions.minHgt),this.lines=r.lines,this.lineCount=r.lines.length,this.size.width=r.width,this.size.height=r.height,this.selectedState=t,this.hoverState=n,this.labelDirty=!1}visible(){return!(this.size.width===0||this.size.height===0||this.elementOptions.label===void 0||this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}},gJ=class{constructor(e,t,n){this.body=t,this.labelModule=n,this.setOptions(e),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}setOptions(e){this.options=e}_setMargins(e){this.margin={},this.options.margin&&(typeof this.options.margin==`object`?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}_distanceToBorder(e,t){let n=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+n}enableShadow(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow&&(e.shadowColor=`rgba(0,0,0,0)`,e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}enableBorderDashes(e,t){if(t.borderDashes!==!1)if(e.setLineDash!==void 0){let n=t.borderDashes;n===!0&&(n=[5,15]),e.setLineDash(n)}else console.warn(`setLineDash is not supported in this browser. The dashed borders cannot be used.`),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}disableBorderDashes(e,t){t.borderDashes!==!1&&(e.setLineDash===void 0?(console.warn(`setLineDash is not supported in this browser. The dashed borders cannot be used.`),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1):e.setLineDash([0]))}needsRefresh(e,t){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,t)}initContextForDraw(e,t){let n=t.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,n),e.strokeStyle=t.borderColor,e.fillStyle=t.color}performStroke(e,t){let n=t.borderWidth/this.body.view.scale;e.save(),n>0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}performFill(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),$L(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,t,n,r,i){n!==void 0&&this.resize(n,r,i),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(e,t,n,r,i){this._updateBoundingBox(e,t,n,r,i)}getDimensionsFromLabel(e,t,n){this.textSize=this.labelModule.getTextSize(e,t,n);let r=this.textSize.width,i=this.textSize.height;return r===0&&(r=14,i=14),{width:r,height:i}}},_J=class extends gJ{constructor(e,t,n){super(e,t,n),this._setMargins(n)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,n)){let r=this.getDimensionsFromLabel(e,t,n);this.width=r.width+this.margin.right+this.margin.left,this.height=r.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this.initContextForDraw(e,a),jD(e,this.left,this.top,this.width,this.height,a.borderRadius),this.performFill(e,a),this.updateBoundingBox(t,n,e,r,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,i)}updateBoundingBox(e,t,n,r,i){this._updateBoundingBox(e,t,n,r,i);let a=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(a)}distanceToBorder(e,t){e&&this.resize(e);let n=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+n}},vJ=class extends gJ{constructor(e,t,n){super(e,t,n),this.labelOffset=0,this.selected=!1}setOptions(e,t,n){this.options=e,t===void 0&&n===void 0||this.setImages(t,n)}setImages(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}switchImages(e){let t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){let e=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=e}}_getImagePadding(){let e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){let t=this.options.imagePadding;typeof t==`object`?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}_resizeImage(){let e,t;if(this.options.shapeProperties.useImageSize===!1){let n=1,r=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?n=this.imageObj.width/this.imageObj.height:r=this.imageObj.height/this.imageObj.width),e=this.options.size*2*n,t=this.options.size*2*r}else{let n=this._getImagePadding();e=this.imageObj.width+n.left+n.right,t=this.imageObj.height+n.top+n.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,n,r){this.initContextForDraw(e,r),TD(e,t,n,r.size),this.performFill(e,r)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity===void 0?1:t.opacity,this.enableShadow(e,t);let n=1;this.options.shapeProperties.interpolation===!0&&(n=this.imageObj.width/this.width/this.body.view.scale);let r=this._getImagePadding(),i=this.left+r.left,a=this.top+r.top,o=this.width-r.left-r.right,s=this.height-r.top-r.bottom;this.imageObj.drawImageAtPosition(e,n,i,a,o,s),this.disableShadow(e,t)}}_drawImageLabel(e,t,n,r,i){let a=0;if(this.height!==void 0){a=this.height*.5;let t=this.labelModule.getTextSize(e,r,i);t.lineCount>=1&&(a+=t.height/2)}let o=n+a;this.options.label&&(this.labelOffset=a),this.labelModule.draw(e,t,o,r,i,`hanging`)}},yJ=class extends vJ{constructor(e,t,n){super(e,t,n),this._setMargins(n)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,n)){let r=this.getDimensionsFromLabel(e,t,n),i=Math.max(r.width+this.margin.right+this.margin.left,r.height+this.margin.top+this.margin.bottom);this.options.size=i/2,this.width=i,this.height=i,this.radius=this.width/2}}draw(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this._drawRawCircle(e,t,n,a),this.updateBoundingBox(t,n),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,n,r,i)}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}},bJ=class extends vJ{constructor(e,t,n,r,i){super(e,t,n),this.setImages(r,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let e=this.options.size*2;this.width=e,this.height=e,this.radius=.5*this.width;return}this.needsRefresh(t,n)&&this._resizeImage()}draw(e,t,n,r,i,a){this.switchImages(r),this.resize();let o=t,s=n;this.options.shapeProperties.coordinateOrigin===`top-left`?(this.left=t,this.top=n,o+=this.width/2,s+=this.height/2):(this.left=t-this.width/2,this.top=n-this.height/2),this._drawRawCircle(e,o,s,a),e.save(),e.clip(),this._drawImageAtPosition(e,a),e.restore(),this._drawImageLabel(e,o,s,r,i),this.updateBoundingBox(t,n)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin===`top-left`?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=t+this.options.size*2):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(e){return e&&this.resize(e),this.width*.5}},xJ=class extends gJ{constructor(e,t,n){super(e,t,n)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,n)){this.labelModule.getTextSize(e,t,n);let i=2*r.size;this.width=this.customSizeWidth??i,this.height=this.customSizeHeight??i,this.radius=.5*this.width}}_drawShape(e,t,n,r,i,a,o,s){return this.resize(e,a,o,s),this.left=r-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,s),LD(t)(e,r,i,s.size),this.performFill(e,s),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(a?`bold `:``)+this.height/2+`px `+(this.options.icon.face||`FontAwesome`),e.fillStyle=this.options.icon.color||`black`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(this.options.icon.code,r,i)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,a,o,r,i,`hanging`);let t=i+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,r,t,a,o,`hanging`)}this.updateBoundingBox(r,i)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}};function SJ(e,t){var n=KM(e);if(rq){var r=rq(e);t&&(r=kF(r).call(r,function(t){return gq(e,t).enumerable})),n.push.apply(n,r)}return n}function CJ(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?V(n=SJ(Object(i),!0)).call(n,function(t){vK(e,t,i[t])}):kq?Hq(e,kq(i)):V(r=SJ(Object(i))).call(r,function(t){Kq(e,t,gq(i,t))})}return e}var wJ=class extends xJ{constructor(e,t,n,r){super(e,t,n,r),this.ctxRenderer=r}draw(e,t,n,r,i,a){this.resize(e,r,i,a),this.left=t-this.width/2,this.top=n-this.height/2,e.save();let o=this.ctxRenderer({ctx:e,id:this.options.id,x:t,y:n,state:{selected:r,hover:i},style:CJ({},a),label:this.options.label});if(o.drawNode!=null&&o.drawNode(),e.restore(),o.drawExternalLabel){let t=o.drawExternalLabel;o.drawExternalLabel=()=>{e.save(),t(),e.restore()}}return o.nodeDimensions&&(this.customSizeWidth=o.nodeDimensions.width,this.customSizeHeight=o.nodeDimensions.height),o}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},TJ=class extends gJ{constructor(e,t,n){super(e,t,n),this._setMargins(n)}resize(e,t,n){if(this.needsRefresh(t,n)){let r=this.getDimensionsFromLabel(e,t,n).width+this.margin.right+this.margin.left;this.width=r,this.height=r,this.radius=this.width/2}}draw(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this.initContextForDraw(e,a),ND(e,t-this.width/2,n-this.height/2,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,n,e,r,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,i)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},EJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`diamond`,4,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},DJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`circle`,2,t,n,r,i,a)}distanceToBorder(e){return e&&this.resize(e),this.options.size}},OJ=class extends gJ{constructor(e,t,n){super(e,t,n)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,n)){let r=this.getDimensionsFromLabel(e,t,n);this.height=r.height*2,this.width=r.width+r.height,this.radius=.5*this.width}}draw(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width*.5,this.top=n-this.height*.5,this.initContextForDraw(e,a),MD(e,this.left,this.top,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,n,e,r,i),this.labelModule.draw(e,t,n,r,i)}distanceToBorder(e,t){e&&this.resize(e);let n=this.width*.5,r=this.height*.5,i=Math.sin(t)*n,a=Math.cos(t)*r;return n*r/Math.sqrt(i*i+a*a)}},kJ=class extends gJ{constructor(e,t,n){super(e,t,n),this._setMargins(n)}resize(e,t,n){this.needsRefresh(t,n)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,n,r,i,a){return this.resize(e,r,i),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=n-this.height/2,this._icon(e,t,n,r,i,a),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,n+this.height/2+5,r),this.updateBoundingBox(t,n)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=t+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5))}_icon(e,t,n,r,i,a){let o=Number(this.options.icon.size);this.options.icon.code===void 0?console.error(`When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.`):(e.font=[this.options.icon.weight==null?r?`bold`:``:this.options.icon.weight,(this.options.icon.weight!=null&&r?5:0)+o+`px`,this.options.icon.face].join(` `),e.fillStyle=this.options.icon.color||`black`,e.textAlign=`center`,e.textBaseline=`middle`,this.enableShadow(e,a),e.fillText(this.options.icon.code,t,n),this.disableShadow(e,a))}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},AJ=class extends vJ{constructor(e,t,n,r,i){super(e,t,n),this.setImages(r,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let e=this.options.size*2;this.width=e,this.height=e;return}this.needsRefresh(t,n)&&this._resizeImage()}draw(e,t,n,r,i,a){e.save(),this.switchImages(r),this.resize();let o=t,s=n;if(this.options.shapeProperties.coordinateOrigin===`top-left`?(this.left=t,this.top=n,o+=this.width/2,s+=this.height/2):(this.left=t-this.width/2,this.top=n-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){let t=this.options.borderWidth,n=this.options.borderWidthSelected||2*this.options.borderWidth,o=(r?n:t)/this.body.view.scale;e.lineWidth=Math.min(this.width,o),e.beginPath();let s=r?this.options.color.highlight.border:i?this.options.color.hover.border:this.options.color.border,c=r?this.options.color.highlight.background:i?this.options.color.hover.background:this.options.color.background;a.opacity!==void 0&&(s=KB(s,a.opacity),c=KB(c,a.opacity)),e.strokeStyle=s,e.fillStyle=c,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),$L(e).call(e),this.performStroke(e,a),e.closePath()}this._drawImageAtPosition(e,a),this._drawImageLabel(e,o,s,r,i),this.updateBoundingBox(t,n),e.restore()}updateBoundingBox(e,t){this.resize(),this.options.shapeProperties.coordinateOrigin===`top-left`?(this.left=e,this.top=t):(this.left=e-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},jJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`square`,2,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},MJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`hexagon`,4,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},NJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`star`,4,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},PJ=class extends gJ{constructor(e,t,n){super(e,t,n),this._setMargins(n)}resize(e,t,n){this.needsRefresh(t,n)&&(this.textSize=this.labelModule.getTextSize(e,t,n),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this.enableShadow(e,a),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,i),this.disableShadow(e,a),this.updateBoundingBox(t,n,e,r,i)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},FJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`triangle`,3,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},IJ=class extends xJ{constructor(e,t,n){super(e,t,n)}draw(e,t,n,r,i,a){return this._drawShape(e,`triangleDown`,3,t,n,r,i,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};function LJ(e,t){var n=KM(e);if(rq){var r=rq(e);t&&(r=kF(r).call(r,function(t){return gq(e,t).enumerable})),n.push.apply(n,r)}return n}function RJ(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?V(n=LJ(Object(i),!0)).call(n,function(t){vK(e,t,i[t])}):kq?Hq(e,kq(i)):V(r=LJ(Object(i))).call(r,function(t){Kq(e,t,gq(i,t))})}return e}var zJ=class e{constructor(e,t,n,r,i,a){this.options=nV(i),this.globalOptions=i,this.defaultOptions=a,this.body=t,this.edges=[],this.id=void 0,this.imagelist=n,this.grouplist=r,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new hJ(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var t;H(t=this.edges).call(t,e)===-1&&this.edges.push(e)}detachEdge(e){var t;let n=H(t=this.edges).call(t,e);if(n!=-1){var r;uP(r=this.edges).call(r,n,1)}}setOptions(t){let n=this.options.shape;if(t){if(t.color!==void 0&&(this._localColor=t.color),t.id!==void 0&&(this.id=t.id),this.id===void 0)throw Error(`Node must have an id`);return e.checkMass(t,this.id),t.x!==void 0&&(t.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=pI(t.x),this.predefinedPosition=!0)),t.y!==void 0&&(t.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=pI(t.y),this.predefinedPosition=!0)),t.size!==void 0&&(this.baseSize=t.size),t.value!==void 0&&(t.value=PK(t.value)),e.parseOptions(this.options,t,!0,this.globalOptions,this.grouplist),this.chooser=qq(`node`,[t,this.options,this.defaultOptions]),this._load_images(),this.updateLabelModule(t),t.opacity!==void 0&&e.checkOpacity(t.opacity)&&(this.options.opacity=t.opacity),this.updateShape(n),t.hidden!==void 0||t.physics!==void 0}}_load_images(){if((this.options.shape===`circularImage`||this.options.shape===`image`)&&this.options.image===void 0)throw Error(`Option image must be defined for node type '`+this.options.shape+`'`);if(this.options.image!==void 0){if(this.imagelist===void 0)throw Error(`Internal Error: No images provided`);if(typeof this.options.image==`string`)this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(this.options.image.unselected===void 0)throw Error(`No unselected image provided`);this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.options.image.selected===void 0?this.imageObjAlt=void 0:this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id)}}}static checkOpacity(e){return 0<=e&&e<=1}static checkCoordinateOrigin(e){return e===void 0||e===`center`||e===`top-left`}static updateGroupOptions(t,n,r){var i;if(r===void 0)return;let a=t.group;if(n!==void 0&&n.group!==void 0&&a!==n.group)throw Error(`updateGroupOptions: group values in options don't match.`);if(!(typeof a==`number`||typeof a==`string`&&a!=``))return;let o=r.get(a);o.opacity!==void 0&&n.opacity===void 0&&(e.checkOpacity(o.opacity)||(console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+o.opacity),o.opacity=void 0));let s=kF(i=qK(n)).call(i,e=>n[e]!=null);s.push(`font`),BB(s,t,o),t.color=JB(t.color)}static parseOptions(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0;if(BB([`color`,`fixed`,`shadow`],t,n,r),e.checkMass(n),t.opacity!==void 0&&(e.checkOpacity(t.opacity)||(console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+t.opacity),t.opacity=void 0)),n.opacity!==void 0&&(e.checkOpacity(n.opacity)||(console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+n.opacity),n.opacity=void 0)),n.shapeProperties&&!e.checkCoordinateOrigin(n.shapeProperties.coordinateOrigin)&&console.error(`Invalid option for node coordinateOrigin, found: `+n.shapeProperties.coordinateOrigin),rV(t,n,`shadow`,i),n.color!==void 0&&n.color!==null){let e=JB(n.color);RB(t.color,e)}else r===!0&&n.color===null&&(t.color=nV(i.color));n.fixed!==void 0&&n.fixed!==null&&(typeof n.fixed==`boolean`?(t.fixed.x=n.fixed,t.fixed.y=n.fixed):(n.fixed.x!==void 0&&typeof n.fixed.x==`boolean`&&(t.fixed.x=n.fixed.x),n.fixed.y!==void 0&&typeof n.fixed.y==`boolean`&&(t.fixed.y=n.fixed.y))),r===!0&&n.font===null&&(t.font=nV(i.font)),e.updateGroupOptions(t,n,a),n.scaling!==void 0&&rV(t.scaling,n.scaling,`label`,i.scaling)}getFormattingValues(){let e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected==null?e.borderWidth*=2:e.borderWidth=this.options.borderWidthSelected,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser==`function`&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){let t=this.options.opacity;e.borderColor=KB(e.borderColor,t),e.color=KB(e.color,t),e.shadowColor=KB(e.shadowColor,t)}return e}updateLabelModule(t){(this.options.label===void 0||this.options.label===null)&&(this.options.label=``),e.updateGroupOptions(this.options,RJ(RJ({},t),{},{color:t&&t.color||this._localColor||void 0}),this.grouplist);let n=this.grouplist.get(this.options.group,!1),r=[t,this.options,n,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,r),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case`box`:this.shape=new _J(this.options,this.body,this.labelModule);break;case`circle`:this.shape=new yJ(this.options,this.body,this.labelModule);break;case`circularImage`:this.shape=new bJ(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case`custom`:this.shape=new wJ(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case`database`:this.shape=new TJ(this.options,this.body,this.labelModule);break;case`diamond`:this.shape=new EJ(this.options,this.body,this.labelModule);break;case`dot`:this.shape=new DJ(this.options,this.body,this.labelModule);break;case`ellipse`:this.shape=new OJ(this.options,this.body,this.labelModule);break;case`icon`:this.shape=new kJ(this.options,this.body,this.labelModule);break;case`image`:this.shape=new AJ(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case`square`:this.shape=new jJ(this.options,this.body,this.labelModule);break;case`hexagon`:this.shape=new MJ(this.options,this.body,this.labelModule);break;case`star`:this.shape=new NJ(this.options,this.body,this.labelModule);break;case`text`:this.shape=new PJ(this.options,this.body,this.labelModule);break;case`triangle`:this.shape=new FJ(this.options,this.body,this.labelModule);break;case`triangleDown`:this.shape=new IJ(this.options,this.body,this.labelModule);break;default:this.shape=new OJ(this.options,this.body,this.labelModule);break}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(e,t){return this.shape.distanceToBorder(e,t)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(e,t,n){if(this.options.value!==void 0){let r=this.options.scaling.customScalingFunction(e,t,n,this.options.value),i=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let e=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+r*e}this.options.size=this.options.scaling.min+r*i}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){let t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){let t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}getItemsOnPoint(e){let t=[];return this.labelModule.visible()&&Jq(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),Jq(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}isOverlappingWith(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}static checkMass(e,t){if(e.mass!==void 0&&e.mass<=0){let n=``;t!==void 0&&(n=` in node id: `+t),console.error(`%cNegative or zero mass disallowed`+n+`, setting mass to 1.`,yV),e.mass=1}}},BJ=class{constructor(e,t,n,r){var i;if(this.body=e,this.images=t,this.groups=n,this.layoutEngine=r,this.body.functions.createNode=B(i=this.create).call(i,this),this.nodesListeners={add:(e,t)=>{this.add(t.items)},update:(e,t)=>{this.update(t.items,t.data,t.oldData)},remove:(e,t)=>{this.remove(t.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:`#2B7CE9`,background:`#97C2FC`,highlight:{border:`#2B7CE9`,background:`#D2E5FF`},hover:{border:`#2B7CE9`,background:`#D2E5FF`}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:`#343434`,size:14,face:`arial`,background:`none`,strokeWidth:0,strokeColor:`#ffffff`,align:`center`,vadjust:0,multi:!1,bold:{mod:`bold`},boldital:{mod:`bold italic`},ital:{mod:`italic`},mono:{mod:``,size:15,face:`monospace`,vadjust:2}},group:void 0,hidden:!1,icon:{face:`FontAwesome`,code:void 0,size:50,color:`#2B7CE9`},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,n,r){if(t===e)return .5;{let n=1/(t-e);return Math.max(0,(r-e)*n)}}},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:10,x:5,y:5},shape:`ellipse`,shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:`center`},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw`Internal error: mass in defaultOptions of NodesHandler may not be zero or negative`;this.options=nV(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on(`refreshNodes`,B(e=this.refresh).call(e,this)),this.body.emitter.on(`refresh`,B(t=this.refresh).call(t,this)),this.body.emitter.on(`destroy`,()=>{W(this.nodesListeners,(e,t)=>{this.body.data.nodes&&this.body.data.nodes.off(t,e)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(zJ.parseOptions(this.options,e),e.opacity!==void 0&&(FU(e.opacity)||!ZU(e.opacity)||e.opacity<0||e.opacity>1?console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this.body.nodes[e].updateShape();if(e.font!==void 0||e.widthConstraint!==void 0||e.heightConstraint!==void 0)for(let e of KM(this.body.nodes))this.body.nodes[e].updateLabelModule(),this.body.nodes[e].needsRefresh();if(e.size!==void 0)for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this.body.nodes[e].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit(`_dataChanged`)}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.data.nodes;if(CC(`id`,e))this.body.data.nodes=e;else if(_M(e))this.body.data.nodes=new xC,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new xC;else throw TypeError(`Array or DataSet expected`);if(n&&W(this.nodesListeners,function(e,t){n.off(t,e)}),this.body.nodes={},this.body.data.nodes){let e=this;W(this.nodesListeners,function(t,n){e.body.data.nodes.on(n,t)});let t=this.body.data.nodes.getIds();this.add(t,!0)}t===!1&&this.body.emitter.emit(`_dataChanged`)}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n,r=[];for(let t=0;t<e.length;t++){n=e[t];let i=this.body.data.nodes.get(n),a=this.create(i);r.push(a),this.body.nodes[n]=a}this.layoutEngine.positionInitially(r),t===!1&&this.body.emitter.emit(`_dataChanged`)}update(e,t,n){let r=this.body.nodes,i=!1;for(let n=0;n<e.length;n++){let a=e[n],o=r[a],s=t[n];o===void 0?(i=!0,o=this.create(s),r[a]=o):o.setOptions(s)&&(i=!0)}!i&&n!==void 0&&(i=pW(t).call(t,function(e,t){let r=n[t];return r&&r.level!==e.level})),i===!0?this.body.emitter.emit(`_dataChanged`):this.body.emitter.emit(`_dataUpdated`)}remove(e){let t=this.body.nodes;for(let n=0;n<e.length;n++){let r=e[n];delete t[r]}this.body.emitter.emit(`_dataChanged`)}create(e){return new(arguments.length>1&&arguments[1]!==void 0?arguments[1]:zJ)(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;W(this.body.nodes,(t,n)=>{let r=this.body.data.nodes.get(n);r!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(r))})}getPositions(e){let t={};if(e!==void 0){if(_M(e)===!0){for(let n=0;n<e.length;n++)if(this.body.nodes[e[n]]!==void 0){let r=this.body.nodes[e[n]];t[e[n]]={x:Math.round(r.x),y:Math.round(r.y)}}}else if(this.body.nodes[e]!==void 0){let n=this.body.nodes[e];t[e]={x:Math.round(n.x),y:Math.round(n.y)}}}else for(let e=0;e<this.body.nodeIndices.length;e++){let n=this.body.nodes[this.body.nodeIndices[e]];t[this.body.nodeIndices[e]]={x:Math.round(n.x),y:Math.round(n.y)}}return t}getPosition(e){if(e==null)throw TypeError(`No id was specified for getPosition method.`);if(this.body.nodes[e]==null)throw ReferenceError(`NodeId provided for getPosition does not exist. Provided: ${e}`);return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}storePositions(){let e=[],t=this.body.data.nodes.getDataSet();for(let n of t.get()){let t=n.id,r=this.body.nodes[t],i=Math.round(r.x),a=Math.round(r.y);(n.x!==i||n.y!==a)&&e.push({id:t,x:i,y:a})}t.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,t){let n=[];if(this.body.nodes[e]!==void 0){let r=this.body.nodes[e],i={};for(let e=0;e<r.edges.length;e++){let a=r.edges[e];t!==`to`&&a.toId==r.id?i[a.fromId]===void 0&&(n.push(a.fromId),i[a.fromId]=!0):t!==`from`&&a.fromId==r.id&&i[a.toId]===void 0&&(n.push(a.toId),i[a.toId]=!0)}}return n}getConnectedEdges(e){let t=[];if(this.body.nodes[e]!==void 0){let n=this.body.nodes[e];for(let e=0;e<n.edges.length;e++)t.push(n.edges[e].id)}else console.error(`NodeId provided for getConnectedEdges does not exist. Provided: `,e);return t}moveNode(e,t,n){this.body.nodes[e]===void 0?console.error(`Node id supplied to moveNode does not exist. Provided: `,e):(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(n),PL(()=>{this.body.emitter.emit(`startSimulation`)},0))}},VJ={},HJ;function UJ(){if(HJ)return VJ;HJ=1;var e=z(),t=Math.hypot,n=Math.abs,r=Math.sqrt;return e({target:`Math`,stat:!0,arity:2,forced:!!t&&t(1/0,NaN)!==1/0},{hypot:function(e,t){for(var i=0,a=0,o=arguments.length,s=0,c,l;a<o;)c=n(arguments[a++]),s<c?(l=s/c,i=i*l*l+1,s=c):c>0?(l=c/s,i+=l*l):i+=c;return s===1/0?1/0:s*r(i)}}),VJ}var WJ,GJ;function KJ(){return GJ?WJ:(GJ=1,UJ(),WJ=R().Math.hypot,WJ)}var qJ,JJ;function YJ(){return JJ?qJ:(JJ=1,qJ=KJ(),qJ)}var XJ,ZJ;function QJ(){return ZJ?XJ:(ZJ=1,XJ=YJ(),XJ)}var $J=F(QJ()),eY=class{static transform(e,t){_M(e)||(e=[e]);let n=t.point.x,r=t.point.y,i=t.angle,a=t.length;for(let t=0;t<e.length;++t){let o=e[t],s=o.x*Math.cos(i)-o.y*Math.sin(i),c=o.x*Math.sin(i)+o.y*Math.cos(i);o.x=n+a*s,o.y=r+a*c}}static drawPath(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(let n=1;n<t.length;++n)e.lineTo(t[n].x,t[n].y);e.closePath()}},tY=class extends eY{static draw(e,t){if(t.image){e.save(),e.translate(t.point.x,t.point.y),e.rotate(Math.PI/2+t.angle);let n=t.imageWidth==null?t.image.width:t.imageWidth,r=t.imageHeight==null?t.image.height:t.imageHeight;t.image.drawImageAtPosition(e,1,-n/2,0,n,r),e.restore()}return!1}},nY=class extends eY{static draw(e,t){let n=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return eY.transform(n,t),eY.drawPath(e,n),!0}},rY=class{static draw(e,t){let n=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return eY.transform(n,t),eY.drawPath(e,n),!0}},iY=class{static draw(e,t){let n={x:-.4,y:0};eY.transform(n,t),e.strokeStyle=e.fillStyle,e.fillStyle=`rgba(0, 0, 0, 0)`;let r=Math.PI,i=t.angle-r/2,a=t.angle+r/2;return e.beginPath(),e.arc(n.x,n.y,t.length*.4,i,a,!1),e.stroke(),!0}},aY=class{static draw(e,t){let n={x:-.3,y:0};eY.transform(n,t),e.strokeStyle=e.fillStyle,e.fillStyle=`rgba(0, 0, 0, 0)`;let r=Math.PI,i=t.angle+r/2,a=t.angle+3*r/2;return e.beginPath(),e.arc(n.x,n.y,t.length*.4,i,a,!1),e.stroke(),!0}},oY=class{static draw(e,t){let n=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return eY.transform(n,t),eY.drawPath(e,n),!0}},sY=class{static draw(e,t){let n=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return eY.transform(n,t),eY.drawPath(e,n),!0}},cY=class{static draw(e,t){let n={x:-.4,y:0};return eY.transform(n,t),TD(e,n.x,n.y,t.length*.4),!0}},lY=class{static draw(e,t){let n=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return eY.transform(n,t),eY.drawPath(e,n),!0}},uY=class{static draw(e,t){let n=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return eY.transform(n,t),eY.drawPath(e,n),!0}},dY=class{static draw(e,t){let n=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return eY.transform(n,t),eY.drawPath(e,n),!0}},fY=class{static draw(e,t){let n=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return eY.transform(n,t),eY.drawPath(e,n),!0}},pY=class{static draw(e,t){let n;switch(t.type&&(n=t.type.toLowerCase()),n){case`image`:return tY.draw(e,t);case`circle`:return cY.draw(e,t);case`box`:return uY.draw(e,t);case`crow`:return rY.draw(e,t);case`curve`:return iY.draw(e,t);case`diamond`:return dY.draw(e,t);case`inv_curve`:return aY.draw(e,t);case`triangle`:return oY.draw(e,t);case`inv_triangle`:return sY.draw(e,t);case`bar`:return lY.draw(e,t);case`vee`:return fY.draw(e,t);default:return nY.draw(e,t)}}};function mY(e,t){var n=KM(e);if(rq){var r=rq(e);t&&(r=kF(r).call(r,function(t){return gq(e,t).enumerable})),n.push.apply(n,r)}return n}function hY(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?V(n=mY(Object(i),!0)).call(n,function(t){vK(e,t,i[t])}):kq?Hq(e,kq(i)):V(r=mY(Object(i))).call(r,function(t){Kq(e,t,gq(i,t))})}return e}var gY=class{constructor(e,t,n){vK(this,`color`,{}),vK(this,`colorDirty`,!0),vK(this,`hoverWidth`,1.5),vK(this,`selectionWidth`,2),this._body=t,this._labelModule=n,this.setOptions(e),this.fromPoint=this.from,this.toPoint=this.to}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}cleanup(){return!1}setOptions(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}drawLine(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes===!1?this._drawLine(e,t,i):this._drawDashedLine(e,t,i)}_drawLine(e,t,n,r,i){if(this.from!=this.to)this._line(e,t,n,r,i);else{let[n,r,i]=this._getCircleData(e);this._circle(e,t,n,r,i)}}_drawDashedLine(e,t,n,r,i){e.lineCap=`round`;let a=_M(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(a),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,n);else{let[n,r,i]=this._getCircleData(e);this._circle(e,t,n,r,i)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)PD(e,this.from.x,this.from.y,this.to.x,this.to.y,a);else{let[n,r,i]=this._getCircleData(e);this._circle(e,t,n,r,i)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,n){return this.from==this.to?this._findBorderPositionCircle(e,t,n):this._findBorderPosition(e,t,n)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;let[n,r]=tM(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:.6,high:.8,direction:1})}}}_getCircleData(e){let t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);let n=Xq(e,this.options.selfReference.angle,t,this.from);return[n.x,n.y,t]}_pointOnCircle(e,t,n,r){let i=r*2*Math.PI;return{x:e+n*Math.cos(i),y:t-n*Math.sin(i)}}_findBorderPositionCircle(e,t,n){let r=n.x,i=n.y,a=n.low,o=n.high,s=n.direction,c=this.options.selfReference.size,l,u=(a+o)*.5,d=0;this.options.arrowStrikethrough===!0&&(s===-1?d=this.options.endPointOffset.from:s===1&&(d=this.options.endPointOffset.to));let f=0;do{u=(a+o)*.5,l=this._pointOnCircle(r,i,c,u);let n=Math.atan2(e.y-l.y,e.x-l.x),p=e.distanceToBorder(t,n)+d-Math.sqrt((l.x-e.x)**2+(l.y-e.y)**2);if(Math.abs(p)<.05)break;p>0?s>0?a=u:o=u:s>0?o=u:a=u,++f}while(a<=o&&f<10);return hY(hY({},l),{},{t:u})}getLineWidth(e,t){return Math.max(e===!0?this.selectionWidth:t===!0?this.hoverWidth:this.options.width,.3/this._body.view.scale)}getColor(e,t){if(t.inheritsColor!==!1){if(t.inheritsColor===`both`&&this.from.id!==this.to.id){let n=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),r=this.from.options.color.highlight.border,i=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(r=KB(this.from.options.color.border,t.opacity),i=KB(this.to.options.color.border,t.opacity)):this.from.selected===!0&&this.to.selected===!1?i=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(r=this.from.options.color.border),n.addColorStop(0,r),n.addColorStop(1,i),n}return t.inheritsColor===`to`?KB(this.to.options.color.border,t.opacity):KB(this.from.options.color.border,t.opacity)}else return KB(t.color,t.opacity)}_circle(e,t,n,r,i){this.enableShadow(e,t);let a=0,o=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){let t=this.options.selfReference.angle,i=this.options.selfReference.angle+Math.PI,s=this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:t,high:i,direction:-1}),c=this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:t,high:i,direction:1});a=Math.atan2(s.y-r,s.x-n),o=Math.atan2(c.y-r,c.x-n)}e.beginPath(),e.arc(n,r,i,a,o,!1),e.stroke(),this.disableShadow(e,t)}getDistanceToEdge(e,t,n,r,i,a){if(this.from!=this.to)return this._getDistanceToEdge(e,t,n,r,i,a);{let[e,t,n]=this._getCircleData(void 0),r=e-i,o=t-a;return Math.abs(Math.sqrt(r*r+o*o)-n)}}_getDistanceToLine(e,t,n,r,i,a){let o=n-e,s=r-t,c=o*o+s*s,l=((i-e)*o+(a-t)*s)/c;l>1?l=1:l<0&&(l=0);let u=e+l*o,d=t+l*s,f=u-i,p=d-a;return Math.sqrt(f*f+p*p)}getArrowData(e,t,n,r,i,a){let o,s,c,l,u,d,f,p=a.width;t===`from`?(c=this.from,l=this.to,u=a.fromArrowScale<0,d=Math.abs(a.fromArrowScale),f=a.fromArrowType):t===`to`?(c=this.to,l=this.from,u=a.toArrowScale<0,d=Math.abs(a.toArrowScale),f=a.toArrowType):(c=this.to,l=this.from,u=a.middleArrowScale<0,d=Math.abs(a.middleArrowScale),f=a.middleArrowType);let m=15*d+3*p;if(c!=l){let r=m/$J(c.x-l.x,c.y-l.y);if(t!==`middle`)if(this.options.smooth.enabled===!0){let i=this._findBorderPosition(c,e,{via:n}),a=this.getPoint(i.t+r*(t===`from`?1:-1),n);o=Math.atan2(i.y-a.y,i.x-a.x),s=i}else o=Math.atan2(c.y-l.y,c.x-l.x),s=this._findBorderPosition(c,e);else{let e=(u?-r:r)/2,t=this.getPoint(.5+e,n),i=this.getPoint(.5-e,n);o=Math.atan2(t.y-i.y,t.x-i.x),s=this.getPoint(.5,n)}}else{let[n,r,i]=this._getCircleData(e);if(t===`from`){let t=this.options.selfReference.angle,i=this.options.selfReference.angle+Math.PI,a=this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:t,high:i,direction:-1});o=a.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,s=a}else if(t===`to`){let t=this.options.selfReference.angle,i=this.options.selfReference.angle+Math.PI,a=this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:t,high:i,direction:1});o=a.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,s=a}else{let e=this.options.selfReference.angle/(2*Math.PI);s=this._pointOnCircle(n,r,i,e),o=e*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}let h={x:s.x-m*.9*Math.cos(o),y:s.y-m*.9*Math.sin(o)};return{point:s,core:h,angle:o,length:m,type:f}}drawArrowHead(e,t,n,r,i){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,pY.draw(e,i)&&(this.enableShadow(e,t),$L(e).call(e),this.disableShadow(e,t))}enableShadow(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow===!0&&(e.shadowColor=`rgba(0,0,0,0)`,e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,t){if(t.background!==!1){let n={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=n.strokeStyle,e.lineWidth=n.lineWidth,e.dashes=n.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){let n=_M(t)?t:[5,5];e.setLineDash(n)}else console.warn(`setLineDash is not supported in this browser. The dashed stroke cannot be used.`);else e.setLineDash===void 0?console.warn(`setLineDash is not supported in this browser. The dashed stroke cannot be used.`):e.setLineDash([])}};function _Y(e,t){var n=KM(e);if(rq){var r=rq(e);t&&(r=kF(r).call(r,function(t){return gq(e,t).enumerable})),n.push.apply(n,r)}return n}function vY(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?V(n=_Y(Object(i),!0)).call(n,function(t){vK(e,t,i[t])}):kq?Hq(e,kq(i)):V(r=_Y(Object(i))).call(r,function(t){Kq(e,t,gq(i,t))})}return e}var yY=class extends gY{constructor(e,t,n){super(e,t,n)}_findBorderPositionBezier(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),r=!1,i=1,a=0,o=this.to,s,c,l=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(o=this.from,r=!0,l=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(l=0);let u=0;do{c=(a+i)*.5,s=this.getPoint(c,n);let e=Math.atan2(o.y-s.y,o.x-s.x),d=o.distanceToBorder(t,e)+l-Math.sqrt((s.x-o.x)**2+(s.y-o.y)**2);if(Math.abs(d)<.2)break;d<0?r===!1?a=c:i=c:r===!1?i=c:a=c,++u}while(a<=i&&u<10);return vY(vY({},s),{},{t:c})}_getDistanceToBezierEdge(e,t,n,r,i,a,o){let s=1e9,c,l,u,d,f,p=e,m=t;for(l=1;l<10;l++)u=.1*l,d=(1-u)**2*e+2*u*(1-u)*o.x+u**2*n,f=(1-u)**2*t+2*u*(1-u)*o.y+u**2*r,l>0&&(c=this._getDistanceToLine(p,m,d,f,i,a),s=c<s?c:s),p=d,m=f;return s}_bezierCurve(e,t,n,r){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),n!=null&&n.x!=null?r!=null&&r.x!=null?e.bezierCurveTo(n.x,n.y,r.x,r.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(n.x,n.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,t),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){return this._getViaCoordinates()}},bY=class extends yY{constructor(e,t,n){super(e,t,n),vK(this,`via`,this.via),this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on(`_repositionBezierNodes`,this._boundFunction)}setOptions(e){super.setOptions(e);let t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),t===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1||this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off(`_repositionBezierNodes`,this._boundFunction),this.via===void 0?!1:(delete this._body.nodes[this.via.id],this.via=void 0,!0)}setupSupportNode(){if(this.via===void 0){let e=`edgeId:`+this.id,t=this._body.functions.createNode({id:e,shape:`circle`,physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,t,n){this._bezierCurve(e,t,n)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){let[t,n,r]=this._getCircleData(),i=2*Math.PI*(1-e);return{x:t+r*Math.sin(i),y:n+r-r*(1-Math.cos(i))}}else return{x:(1-e)**2*this.fromPoint.x+2*e*(1-e)*t.x+e**2*this.toPoint.x,y:(1-e)**2*this.fromPoint.y+2*e*(1-e)*t.y+e**2*this.toPoint.y}}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t,this.via)}_getDistanceToEdge(e,t,n,r,i,a){return this._getDistanceToBezierEdge(e,t,n,r,i,a,this.via)}},xY=class extends yY{constructor(e,t,n){super(e,t,n)}_line(e,t,n){this._bezierCurve(e,t,n)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){let e=this.options.smooth.roundness,t=this.options.smooth.type,n=Math.abs(this.from.x-this.to.x),r=Math.abs(this.from.y-this.to.y);if(t===`discrete`||t===`diagonalCross`){let i,a;i=a=n<=r?e*r:e*n,this.from.x>this.to.x&&(i=-i),this.from.y>=this.to.y&&(a=-a);let o=this.from.x+i,s=this.from.y+a;return t===`discrete`&&(n<=r?o=n<e*r?this.from.x:o:s=r<e*n?this.from.y:s),{x:o,y:s}}else if(t===`straightCross`){let t=(1-e)*n,i=(1-e)*r;return n<=r?(t=0,this.from.y<this.to.y&&(i=-i)):(this.from.x<this.to.x&&(t=-t),i=0),{x:this.to.x+t,y:this.to.y+i}}else if(t===`horizontal`){let t=(1-e)*n;return this.from.x<this.to.x&&(t=-t),{x:this.to.x+t,y:this.from.y}}else if(t===`vertical`){let t=(1-e)*r;return this.from.y<this.to.y&&(t=-t),{x:this.from.x,y:this.to.y+t}}else if(t===`curvedCW`){n=this.to.x-this.from.x,r=this.from.y-this.to.y;let t=Math.sqrt(n*n+r*r),i=Math.PI,a=(Math.atan2(r,n)+(e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*t*Math.sin(a),y:this.from.y+(e*.5+.5)*t*Math.cos(a)}}else if(t===`curvedCCW`){n=this.to.x-this.from.x,r=this.from.y-this.to.y;let t=Math.sqrt(n*n+r*r),i=Math.PI,a=(Math.atan2(r,n)+(-e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*t*Math.sin(a),y:this.from.y+(e*.5+.5)*t*Math.cos(a)}}else{let t,i;t=i=n<=r?e*r:e*n,this.from.x>this.to.x&&(t=-t),this.from.y>=this.to.y&&(i=-i);let a=this.from.x+t,o=this.from.y+i;return n<=r?a=this.from.x<=this.to.x?this.to.x<a?this.to.x:a:this.to.x>a?this.to.x:a:o=this.from.y>=this.to.y?this.to.y>o?this.to.y:o:this.to.y<o?this.to.y:o,{x:a,y:o}}}_findBorderPosition(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,n.via)}_getDistanceToEdge(e,t,n,r,i,a){let o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,n,r,i,a,o)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),n=e;return{x:(1-n)**2*this.fromPoint.x+2*n*(1-n)*t.x+n**2*this.toPoint.x,y:(1-n)**2*this.fromPoint.y+2*n*(1-n)*t.y+n**2*this.toPoint.y}}},SY=class extends yY{constructor(e,t,n){super(e,t,n)}_getDistanceToBezierEdge2(e,t,n,r,i,a,o,s){let c=1e9,l=e,u=t,d=[0,0,0,0];for(let f=1;f<10;f++){let p=.1*f;d[0]=(1-p)**3,d[1]=3*p*(1-p)**2,d[2]=3*p**2*(1-p),d[3]=p**3;let m=d[0]*e+d[1]*o.x+d[2]*s.x+d[3]*n,h=d[0]*t+d[1]*o.y+d[2]*s.y+d[3]*r;if(f>0){let e=this._getDistanceToLine(l,u,m,h,i,a);c=e<c?e:c}l=m,u=h}return c}},CY=class extends SY{constructor(e,t,n){super(e,t,n)}_line(e,t,n){let r=n[0],i=n[1];this._bezierCurve(e,t,r,i)}_getViaCoordinates(){let e=this.from.x-this.to.x,t=this.from.y-this.to.y,n,r,i,a,o=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(t)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection===`horizontal`)&&this.options.smooth.forceDirection!==`vertical`?(r=this.from.y,a=this.to.y,n=this.from.x-o*e,i=this.to.x+o*e):(r=this.from.y-o*t,a=this.to.y+o*t,n=this.from.x,i=this.to.x),[{x:n,y:r},{x:i,y:a}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,n,r,i,a){let[o,s]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,n,r,i,a,o,s)}getPoint(e){let[t,n]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),r=e,i=[(1-r)**3,3*r*(1-r)**2,3*r**2*(1-r),r**3];return{x:i[0]*this.fromPoint.x+i[1]*t.x+i[2]*n.x+i[3]*this.toPoint.x,y:i[0]*this.fromPoint.y+i[1]*t.y+i[2]*n.y+i[3]*this.toPoint.y}}},wY=class extends gY{constructor(e,t,n){super(e,t,n)}_line(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,t){let n=this.to,r=this.from;e.id===this.from.id&&(n=this.from,r=this.to);let i=Math.atan2(n.y-r.y,n.x-r.x),a=n.x-r.x,o=n.y-r.y,s=Math.sqrt(a*a+o*o),c=(s-e.distanceToBorder(t,i))/s;return{x:(1-c)*r.x+c*n.x,y:(1-c)*r.y+c*n.y,t:0}}_getDistanceToEdge(e,t,n,r,i,a){return this._getDistanceToLine(e,t,n,r,i,a)}},TY=class e{constructor(e,t,n,r,i){if(t===void 0)throw Error(`No body provided`);this.options=nV(r),this.globalOptions=r,this.defaultOptions=i,this.body=t,this.imagelist=n,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new hJ(this.body,this.options,!0),this.setOptions(e)}setOptions(t){if(!t)return;let n=t.physics!==void 0&&this.options.physics!==t.physics||t.hidden!==void 0&&(this.options.hidden||!1)!==(t.hidden||!1)||t.from!==void 0&&this.options.from!==t.from||t.to!==void 0&&this.options.to!==t.to;return e.parseOptions(this.options,t,!0,this.globalOptions),t.id!==void 0&&(this.id=t.id),t.from!==void 0&&(this.fromId=t.from),t.to!==void 0&&(this.toId=t.to),t.title!==void 0&&(this.title=t.title),t.value!==void 0&&(t.value=PK(t.value)),this.chooser=qq(`edge`,[t,this.options,this.defaultOptions]),this.updateLabelModule(t),n=this.updateEdgeType()||n,this._setInteractionWidths(),this.connect(),n}static parseOptions(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(zB([`endPointOffset`,`arrowStrikethrough`,`id`,`from`,`hidden`,`hoverWidth`,`labelHighlightBold`,`length`,`line`,`opacity`,`physics`,`scaling`,`selectionWidth`,`selfReferenceSize`,`selfReference`,`to`,`title`,`value`,`width`,`font`,`chosen`,`widthConstraint`],e,t,n),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(ZU(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=r.endPointOffset.from===void 0?0:r.endPointOffset.from,console.error(`endPointOffset.from is not a valid number`))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(ZU(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=r.endPointOffset.to===void 0?0:r.endPointOffset.to,console.error(`endPointOffset.to is not a valid number`))),Yq(t.label)?e.label=t.label:Yq(e.label)||(e.label=void 0),rV(e,t,`smooth`,r),rV(e,t,`shadow`,r),rV(e,t,`background`,r),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:n===!0&&t.dashes===null&&(e.dashes=VI(r.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),rV(e.scaling,t.scaling,`label`,r.scaling)):n===!0&&t.scaling===null&&(e.scaling=VI(r.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows==`string`){let n=t.arrows.toLowerCase();e.arrows.to.enabled=H(n).call(n,`to`)!=-1,e.arrows.middle.enabled=H(n).call(n,`middle`)!=-1,e.arrows.from.enabled=H(n).call(n,`from`)!=-1}else if(typeof t.arrows==`object`)rV(e.arrows,t.arrows,`to`,r.arrows),rV(e.arrows,t.arrows,`middle`,r.arrows),rV(e.arrows,t.arrows,`from`,r.arrows);else throw Error(`The arrow newOptions can only be an object or a string. Refer to the documentation. You used:`+lL(t.arrows));else n===!0&&t.arrows===null&&(e.arrows=VI(r.arrows));if(t.color!==void 0&&t.color!==null){let a=FB(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,o=e.color;if(i)U(o,r.color,!1,n);else for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&delete o[e];if(FB(o))o.color=o,o.highlight=o,o.hover=o,o.inherit=!1,a.opacity===void 0&&(o.opacity=1);else{let e=!1;a.color!==void 0&&(o.color=a.color,e=!0),a.highlight!==void 0&&(o.highlight=a.highlight,e=!0),a.hover!==void 0&&(o.hover=a.hover,e=!0),a.inherit!==void 0&&(o.inherit=a.inherit),a.opacity!==void 0&&(o.opacity=Math.min(1,Math.max(0,a.opacity))),e===!0?o.inherit=!1:o.inherit===void 0&&(o.inherit=`from`)}}else n===!0&&t.color===null&&(e.color=nV(r.color));n===!0&&t.font===null&&(e.font=nV(r.font)),Object.prototype.hasOwnProperty.call(t,`selfReferenceSize`)&&(console.warn(`The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}`),e.selfReference.size=t.selfReferenceSize)}getFormattingValues(){let e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,n=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,r=this.options.color.inherit,i={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:n,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:r?void 0:this.options.color.color,inheritsColor:r,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){let e=this.options.selectionWidth;typeof e==`function`?i.width=e(i.width):typeof e==`number`&&(i.width+=e),i.width=Math.max(i.width,.3/this.body.view.scale),i.color=this.options.color.highlight,i.shadow=this.options.shadow.enabled}else if(this.hover){let e=this.options.hoverWidth;typeof e==`function`?i.width=e(i.width):typeof e==`number`&&(i.width+=e),i.width=Math.max(i.width,.3/this.body.view.scale),i.color=this.options.color.hover,i.shadow=this.options.shadow.enabled}}else typeof this.chooser==`function`&&(this.chooser(i,this.options.id,this.selected,this.hover),i.color!==void 0&&(i.inheritsColor=!1),i.shadow===!1&&(i.shadowColor!==this.options.shadow.color||i.shadowSize!==this.options.shadow.size||i.shadowX!==this.options.shadow.x||i.shadowY!==this.options.shadow.y)&&(i.shadow=!0));else i.shadow=this.options.shadow.enabled,i.width=Math.max(i.width,.3/this.body.view.scale);return i}updateLabelModule(e){let t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){let e=this.options.smooth,t=!1,n=!0;return this.edgeType!==void 0&&((this.edgeType instanceof bY&&e.enabled===!0&&e.type===`dynamic`||this.edgeType instanceof CY&&e.enabled===!0&&e.type===`cubicBezier`||this.edgeType instanceof xY&&e.enabled===!0&&e.type!==`dynamic`&&e.type!==`cubicBezier`||this.edgeType instanceof wY&&e.type.enabled===!1)&&(n=!1),n===!0&&(t=this.cleanup())),n===!0?e.enabled===!0?e.type===`dynamic`?(t=!0,this.edgeType=new bY(this.options,this.body,this.labelModule)):e.type===`cubicBezier`?this.edgeType=new CY(this.options,this.body,this.labelModule):this.edgeType=new xY(this.options,this.body,this.labelModule):this.edgeType=new wY(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&=(this.from.detachEdge(this),void 0),this.to&&=(this.to.detachEdge(this),void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(e,t,n){if(this.options.value!==void 0){let r=this.options.scaling.customScalingFunction(e,t,n,this.options.value),i=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let e=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+r*e}this.options.width=this.options.scaling.min+r*i}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){typeof this.options.hoverWidth==`function`?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth==`function`?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){let t=this.getFormattingValues();if(t.hidden)return;let n=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,n),this.drawLabel(e,n)}drawArrows(e){let t=this.getFormattingValues();if(t.hidden)return;let n=this.edgeType.getViaNode(),r={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(r.from=this.edgeType.getArrowData(e,`from`,n,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=r.from.core),t.fromArrowSrc&&(r.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(r.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(r.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(r.to=this.edgeType.getArrowData(e,`to`,n,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=r.to.core),t.toArrowSrc&&(r.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(r.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(r.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(r.middle=this.edgeType.getArrowData(e,`middle`,n,this.selected,this.hover,t),t.middleArrowSrc&&(r.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(r.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(r.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.to)}drawLabel(e,t){if(this.options.label!==void 0){let n=this.from,r=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let i;if(n.id!=r.id){this.labelModule.pointToSelf=!1,i=this.edgeType.getPoint(.5,t),e.save();let n=this._getRotation(e);n.angle!=0&&(e.translate(n.x,n.y),e.rotate(n.angle)),this.labelModule.draw(e,i.x,i.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;let t=Xq(e,this.options.selfReference.angle,this.options.selfReference.size,n);i=this._pointOnCircle(t.x,t.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,i.x,i.y,this.selected,this.hover)}}}getItemsOnPoint(e){let t=[];if(this.labelModule.visible()){let n=this._getRotation();Jq(this.labelModule.getSize(),e,n)&&t.push({edgeId:this.id,labelId:0})}let n={left:e.x,top:e.y};return this.isOverlappingWith(n)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){let t=this.from.x,n=this.from.y,r=this.to.x,i=this.to.y,a=e.left,o=e.top;return this.edgeType.getDistanceToEdge(t,n,r,i,a,o)<10}else return!1}_getRotation(e){let t=this.edgeType.getViaNode(),n=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,n.x,n.y);let r={x:n.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align===`horizontal`)return r;let i=this.from.y-this.to.y,a=this.from.x-this.to.x,o=Math.atan2(i,a);return(o<-1&&a<0||o>0&&a<0)&&(o+=Math.PI),r.angle=o,r}_pointOnCircle(e,t,n,r){return{x:e+n*Math.cos(r),y:t-n*Math.sin(r)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}},EY=class{constructor(e,t,n){var r;this.body=e,this.images=t,this.groups=n,this.body.functions.createEdge=B(r=this.create).call(r,this),this.edgesListeners={add:(e,t)=>{this.add(t.items)},update:(e,t)=>{this.update(t.items)},remove:(e,t)=>{this.remove(t.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:`arrow`},middle:{enabled:!1,scaleFactor:1,type:`arrow`},from:{enabled:!1,scaleFactor:1,type:`arrow`}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:`#848484`,highlight:`#848484`,hover:`#848484`,inherit:`from`,opacity:1},dashes:!1,font:{color:`#343434`,size:14,face:`arial`,background:`none`,strokeWidth:2,strokeColor:`#ffffff`,align:`horizontal`,multi:!1,vadjust:0,bold:{mod:`bold`},boldital:{mod:`bold italic`},ital:{mod:`italic`},mono:{mod:``,size:15,face:`courier new`,vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,n,r){if(t===e)return .5;{let n=1/(t-e);return Math.max(0,(r-e)*n)}}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:10,x:5,y:5},background:{enabled:!1,color:`rgba(111,111,111,1)`,size:10,dashes:!1},smooth:{enabled:!0,type:`dynamic`,forceDirection:`none`,roundness:.5},title:void 0,width:1,value:void 0},U(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,t,n;this.body.emitter.on(`_forceDisableDynamicCurves`,function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;t===`dynamic`&&(t=`continuous`);let r=!1;for(let n in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,n)){let i=e.body.edges[n],a=e.body.data.edges.get(n);if(a!=null){let e=a.smooth;e!==void 0&&e.enabled===!0&&e.type===`dynamic`&&(t===void 0?i.setOptions({smooth:!1}):i.setOptions({smooth:{type:t}}),r=!0)}}n===!0&&r===!0&&e.body.emitter.emit(`_dataChanged`)}),this.body.emitter.on(`_dataUpdated`,()=>{this.reconnectEdges()}),this.body.emitter.on(`refreshEdges`,B(t=this.refresh).call(t,this)),this.body.emitter.on(`refresh`,B(n=this.refresh).call(n,this)),this.body.emitter.on(`destroy`,()=>{W(this.edgesListeners,(e,t)=>{this.body.data.edges&&this.body.data.edges.off(t,e)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){TY.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(let e in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,e)&&(t=this.body.edges[e].updateEdgeType()||t);if(e.font!==void 0)for(let e in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,e)&&this.body.edges[e].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit(`_dataChanged`)}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.data.edges;if(CC(`id`,e))this.body.data.edges=e;else if(_M(e))this.body.data.edges=new xC,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new xC;else throw TypeError(`Array or DataSet expected`);if(n&&W(this.edgesListeners,(e,t)=>{n.off(t,e)}),this.body.edges={},this.body.data.edges){W(this.edgesListeners,(e,t)=>{this.body.data.edges.on(t,e)});let e=this.body.data.edges.getIds();this.add(e,!0)}this.body.emitter.emit(`_adjustEdgesForHierarchicalLayout`),t===!1&&this.body.emitter.emit(`_dataChanged`)}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.edges,r=this.body.data.edges;for(let t=0;t<e.length;t++){let i=e[t],a=n[i];a&&a.disconnect();let o=r.get(i,{showInternalIds:!0});n[i]=this.create(o)}this.body.emitter.emit(`_adjustEdgesForHierarchicalLayout`),t===!1&&this.body.emitter.emit(`_dataChanged`)}update(e){let t=this.body.edges,n=this.body.data.edges,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=n.get(a),s=t[a];s===void 0?(this.body.edges[a]=this.create(o),r=!0):(s.disconnect(),r=s.setOptions(o)||r,s.connect())}r===!0?(this.body.emitter.emit(`_adjustEdgesForHierarchicalLayout`),this.body.emitter.emit(`_dataChanged`)):this.body.emitter.emit(`_dataUpdated`)}remove(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;let n=this.body.edges;W(e,e=>{let t=n[e];t!==void 0&&t.remove()}),t&&this.body.emitter.emit(`_dataChanged`)}refresh(){W(this.body.edges,(e,t)=>{let n=this.body.data.edges.get(t);n!==void 0&&e.setOptions(n)})}create(e){return new TY(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e,t=this.body.nodes,n=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){let t=n[e];t.from=null,t.to=null,t.connect()}}getConnectedNodes(e){let t=[];if(this.body.edges[e]!==void 0){let n=this.body.edges[e];n.fromId!==void 0&&t.push(n.fromId),n.toId!==void 0&&t.push(n.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){let e=[];W(this.body.edges,(t,n)=>{let r=this.body.nodes[t.toId],i=this.body.nodes[t.fromId];r!==void 0&&r.isCluster===!0||i!==void 0&&i.isCluster===!0||(r===void 0||i===void 0)&&e.push(n)}),this.remove(e,!1)}_addMissingEdges(){let e=this.body.data.edges;if(e==null)return;let t=this.body.edges,n=[];V(e).call(e,(e,r)=>{t[r]===void 0&&n.push(r)}),this.add(n,!0)}},DY=class{constructor(e,t,n){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(n),this._rng=SB(`BARNES HUT SOLVER`)}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e,t=this.body.nodes,n=this.physicsBody.physicsNodeIndices,r=n.length,i=this._formBarnesHutTree(t,n);this.barnesHutTree=i;for(let a=0;a<r;a++)e=t[n[a]],e.options.mass>0&&this._getForceContributions(i.root,e)}}_getForceContributions(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}_getForceContribution(e,t){if(e.childrenCount>0){let n=e.centerOfMass.x-t.x,r=e.centerOfMass.y-t.y,i=Math.sqrt(n*n+r*r);i*e.calcSize>this.thetaInversed?this._calculateForces(i,n,r,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(i,n,r,t,e)}}_calculateForces(e,t,n,r,i){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&r.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*r.shape.radius,e-r.shape.radius));let a=this.options.gravitationalConstant*i.mass*r.options.mass/e**3,o=t*a,s=n*a;this.physicsBody.forces[r.id].x+=o,this.physicsBody.forces[r.id].y+=s}_formBarnesHutTree(e,t){let n,r=t.length,i=e[t[0]].x,a=e[t[0]].y,o=e[t[0]].x,s=e[t[0]].y;for(let n=1;n<r;n++){let r=e[t[n]],c=r.x,l=r.y;r.options.mass>0&&(c<i&&(i=c),c>o&&(o=c),l<a&&(a=l),l>s&&(s=l))}let c=Math.abs(o-i)-Math.abs(s-a);c>0?(a-=.5*c,s+=.5*c):(i+=.5*c,o-=.5*c);let l=Math.max(1e-5,Math.abs(o-i)),u=.5*l,d=.5*(i+o),f=.5*(a+s),p={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:d-u,maxX:d+u,minY:f-u,maxY:f+u},size:l,calcSize:1/l,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(p.root);for(let i=0;i<r;i++)n=e[t[i]],n.options.mass>0&&this._placeInTree(p.root,n);return p}_updateBranchMass(e,t){let n=e.centerOfMass,r=e.mass+t.options.mass,i=1/r;n.x=n.x*e.mass+t.x*t.options.mass,n.x*=i,n.y=n.y*e.mass+t.y*t.options.mass,n.y*=i,e.mass=r;let a=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<a?a:e.maxWidth}_placeInTree(e,t,n){(n!=1||n===void 0)&&this._updateBranchMass(e,t);let r=e.children.NW.range,i;i=r.maxX>t.x?r.maxY>t.y?`NW`:`SW`:r.maxY>t.y?`NE`:`SE`,this._placeInRegion(e,t,i)}_placeInRegion(e,t,n){let r=e.children[n];switch(r.childrenCount){case 0:r.children.data=t,r.childrenCount=1,this._updateBranchMass(r,t);break;case 1:r.children.data.x===t.x&&r.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(r),this._placeInTree(r,t));break;case 4:this._placeInTree(r,t);break}}_splitBranch(e){let t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,`NW`),this._insertRegion(e,`NE`),this._insertRegion(e,`SW`),this._insertRegion(e,`SE`),t!=null&&this._placeInTree(e,t)}_insertRegion(e,t){let n,r,i,a,o=.5*e.size;switch(t){case`NW`:n=e.range.minX,r=e.range.minX+o,i=e.range.minY,a=e.range.minY+o;break;case`NE`:n=e.range.minX+o,r=e.range.maxX,i=e.range.minY,a=e.range.minY+o;break;case`SW`:n=e.range.minX,r=e.range.minX+o,i=e.range.minY+o,a=e.range.maxY;break;case`SE`:n=e.range.minX+o,r=e.range.maxX,i=e.range.minY+o,a=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:n,maxX:r,minY:i,maxY:a},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}_drawBranch(e,t,n){n===void 0&&(n=`#FF0000`),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=n,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}},OY=class{constructor(e,t,n){this._rng=SB(`REPULSION SOLVER`),this.body=e,this.physicsBody=t,this.setOptions(n)}setOptions(e){this.options=e}solve(){let e,t,n,r,i,a,o,s,c=this.body.nodes,l=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,d=this.options.nodeDistance,f=-2/3/d;for(let p=0;p<l.length-1;p++){o=c[l[p]];for(let m=p+1;m<l.length;m++)s=c[l[m]],e=s.x-o.x,t=s.y-o.y,n=Math.sqrt(e*e+t*t),n===0&&(n=.1*this._rng(),e=n),n<2*d&&(a=n<.5*d?1:f*n+1.3333333333333333,a/=n,r=e*a,i=t*a,u[o.id].x-=r,u[o.id].y-=i,u[s.id].x+=r,u[s.id].y+=i)}}},kY=class{constructor(e,t,n){this.body=e,this.physicsBody=t,this.setOptions(n)}setOptions(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){let e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,n=this.physicsBody.forces,r=this.options.nodeDistance;for(let i=0;i<t.length-1;i++){let a=e[t[i]];for(let o=i+1;o<t.length;o++){let i=e[t[o]];if(a.level===i.level){let e=r+this.overlapAvoidanceFactor*((a.shape.radius||0)/2+(i.shape.radius||0)/2),t=i.x-a.x,o=i.y-a.y,s=Math.sqrt(t*t+o*o),c=.05,l;l=s<e?-((c*s)**2)+(c*e)**2:0,s!==0&&(l/=s);let u=t*l,d=o*l;n[a.id].x-=u,n[a.id].y-=d,n[i.id].x+=u,n[i.id].y+=d}}}}},AY=class{constructor(e,t,n){this.body=e,this.physicsBody=t,this.setOptions(n)}setOptions(e){this.options=e}solve(){let e,t,n=this.physicsBody.physicsEdgeIndices,r=this.body.edges,i,a,o;for(let s=0;s<n.length;s++)t=r[n[s]],t.connected===!0&&t.toId!==t.fromId&&this.body.nodes[t.toId]!==void 0&&this.body.nodes[t.fromId]!==void 0&&(t.edgeType.via===void 0?(e=t.options.length===void 0?this.options.springLength*1.5:t.options.length,this._calculateSpringForce(t.from,t.to,e)):(e=t.options.length===void 0?this.options.springLength:t.options.length,i=t.to,a=t.edgeType.via,o=t.from,this._calculateSpringForce(i,a,.5*e),this._calculateSpringForce(a,o,.5*e)))}_calculateSpringForce(e,t,n){let r=e.x-t.x,i=e.y-t.y,a=Math.max(Math.sqrt(r*r+i*i),.01),o=this.options.springConstant*(n-a)/a,s=r*o,c=i*o;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=s,this.physicsBody.forces[e.id].y+=c),this.physicsBody.forces[t.id]!==void 0&&(this.physicsBody.forces[t.id].x-=s,this.physicsBody.forces[t.id].y-=c)}},jY=class{constructor(e,t,n){this.body=e,this.physicsBody=t,this.setOptions(n)}setOptions(e){this.options=e}solve(){let e,t,n,r,i,a,o,s,c=this.body.edges,l=.5,u=this.physicsBody.physicsEdgeIndices,d=this.physicsBody.physicsNodeIndices,f=this.physicsBody.forces;for(let e=0;e<d.length;e++){let t=d[e];f[t].springFx=0,f[t].springFy=0}for(let d=0;d<u.length;d++)t=c[u[d]],t.connected===!0&&(e=t.options.length===void 0?this.options.springLength:t.options.length,n=t.from.x-t.to.x,r=t.from.y-t.to.y,s=Math.sqrt(n*n+r*r),s=s===0?.01:s,o=this.options.springConstant*(e-s)/s,i=n*o,a=r*o,t.to.level==t.from.level?(f[t.toId]!==void 0&&(f[t.toId].x-=l*i,f[t.toId].y-=l*a),f[t.fromId]!==void 0&&(f[t.fromId].x+=l*i,f[t.fromId].y+=l*a)):(f[t.toId]!==void 0&&(f[t.toId].springFx-=i,f[t.toId].springFy-=a),f[t.fromId]!==void 0&&(f[t.fromId].springFx+=i,f[t.fromId].springFy+=a)));o=1;let p,m;for(let e=0;e<d.length;e++){let t=d[e];p=Math.min(o,Math.max(-o,f[t].springFx)),m=Math.min(o,Math.max(-o,f[t].springFy)),f[t].x+=p,f[t].y+=m}let h=0,g=0;for(let e=0;e<d.length;e++){let t=d[e];h+=f[t].x,g+=f[t].y}let _=h/d.length,v=g/d.length;for(let e=0;e<d.length;e++){let t=d[e];f[t].x-=_,f[t].y-=v}}},MY=class{constructor(e,t,n){this.body=e,this.physicsBody=t,this.setOptions(n)}setOptions(e){this.options=e}solve(){let e,t,n,r,i=this.body.nodes,a=this.physicsBody.physicsNodeIndices,o=this.physicsBody.forces;for(let s=0;s<a.length;s++)r=i[a[s]],e=-r.x,t=-r.y,n=Math.sqrt(e*e+t*t),this._calculateForces(n,e,t,o,r)}_calculateForces(e,t,n,r,i){let a=e===0?0:this.options.centralGravity/e;r[i.id].x=t*a,r[i.id].y=n*a}},NY=class extends DY{constructor(e,t,n){super(e,t,n),this._rng=SB(`FORCE ATLAS 2 BASED REPULSION SOLVER`)}_calculateForces(e,t,n,r,i){e===0&&(e=.1*this._rng(),t=e),this.overlapAvoidanceFactor<1&&r.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*r.shape.radius,e-r.shape.radius));let a=r.edges.length+1,o=this.options.gravitationalConstant*i.mass*r.options.mass*a/e**2,s=t*o,c=n*o;this.physicsBody.forces[r.id].x+=s,this.physicsBody.forces[r.id].y+=c}},PY=class extends MY{constructor(e,t,n){super(e,t,n)}_calculateForces(e,t,n,r,i){if(e>0){let e=i.edges.length+1,a=this.options.centralGravity*e*i.options.mass;r[i.id].x=t*a,r[i.id].y=n*a}}},FY=class{constructor(e){this.body=e,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:`barnesHut`,stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},eD(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on(`initPhysics`,()=>{this.initPhysics()}),this.body.emitter.on(`_layoutFailed`,()=>{this.layoutFailed=!0}),this.body.emitter.on(`resetPhysics`,()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on(`disablePhysics`,()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on(`restorePhysics`,()=>{this.setOptions(this.options),this.ready===!0&&this.startSimulation()}),this.body.emitter.on(`startSimulation`,()=>{this.ready===!0&&this.startSimulation()}),this.body.emitter.on(`stopSimulation`,()=>{this.stopSimulation()}),this.body.emitter.on(`destroy`,()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on(`_dataChanged`,()=>{this.updatePhysicsData()})}setOptions(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,BB([`stabilization`],this.options,e),rV(this.options,e,`stabilization`),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());let t=this.options.wind;t&&((typeof t.x!=`number`||FU(t.x))&&(t.x=0),(typeof t.y!=`number`||FU(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver===`forceAtlas2Based`?(e=this.options.forceAtlas2Based,this.nodesSolver=new NY(this.body,this.physicsBody,e),this.edgesSolver=new AY(this.body,this.physicsBody,e),this.gravitySolver=new PY(this.body,this.physicsBody,e)):this.options.solver===`repulsion`?(e=this.options.repulsion,this.nodesSolver=new OY(this.body,this.physicsBody,e),this.edgesSolver=new AY(this.body,this.physicsBody,e),this.gravitySolver=new MY(this.body,this.physicsBody,e)):this.options.solver===`hierarchicalRepulsion`?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new kY(this.body,this.physicsBody,e),this.edgesSolver=new jY(this.body,this.physicsBody,e),this.gravitySolver=new MY(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new DY(this.body,this.physicsBody,e),this.edgesSolver=new AY(this.body,this.physicsBody,e),this.gravitySolver=new MY(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit(`fit`,{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit(`fit`))}startSimulation(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit(`_resizeNodes`),this.viewFunction===void 0){var e;this.viewFunction=B(e=this.simulationStep).call(e,this),this.body.emitter.on(`initRedraw`,this.viewFunction),this.body.emitter.emit(`_startRendering`)}}else this.body.emitter.emit(`_redraw`)}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off(`initRedraw`,this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit(`_stopRendering`))}simulationStep(){let e=aN();this.physicsTick(),(aN()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&PL(()=>{this.body.emitter.emit(`stabilized`,{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){let e=1.2;this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/e<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/e))}physicsTick(){this._startStabilizing(),this.stabilized!==!0&&(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0?(this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1):(this.timestep=this.options.timestep,this.physicsStep()),this.stabilized===!0&&this.revert(),this.stabilizationIterations++)}updatePhysicsData(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];let e=this.body.nodes,t=this.body.edges;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[t].id);for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&t[e].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[e].id);for(let e=0;e<this.physicsBody.physicsNodeIndices.length;e++){let t=this.physicsBody.physicsNodeIndices[e];this.physicsBody.forces[t]={x:0,y:0},this.physicsBody.velocities[t]===void 0&&(this.physicsBody.velocities[t]={x:0,y:0})}for(let t in this.physicsBody.velocities)e[t]===void 0&&delete this.physicsBody.velocities[t]}revert(){let e=KM(this.previousStates),t=this.body.nodes,n=this.physicsBody.velocities;this.referenceState={};for(let r=0;r<e.length;r++){let i=e[r];t[i]===void 0?delete this.previousStates[i]:t[i].options.physics===!0&&(this.referenceState[i]={positions:{x:t[i].x,y:t[i].y}},n[i].x=this.previousStates[i].vx,n[i].y=this.previousStates[i].vy,t[i].x=this.previousStates[i].x,t[i].y=this.previousStates[i].y)}}_evaluateStepQuality(){let e,t,n,r=this.body.nodes,i=this.referenceState;for(let a in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,a)&&r[a]!==void 0&&(e=r[a].x-i[a].positions.x,t=r[a].y-i[a].positions.y,n=Math.sqrt(e**2+t**2),n>.3))return!1;return!0}moveNodes(){let e=this.physicsBody.physicsNodeIndices,t=0,n=0;for(let r=0;r<e.length;r++){let i=e[r],a=this._performStep(i);t=Math.max(t,a),n+=a}this.adaptiveTimestepEnabled=n/e.length<5,this.stabilized=t<this.options.minVelocity}calculateComponentVelocity(e,t,n){let r=(t-this.modelOptions.damping*e)/n;e+=r*this.timestep;let i=this.options.maxVelocity||1e9;return Math.abs(e)>i&&(e=e>0?i:-i),e}_performStep(e){let t=this.body.nodes[e],n=this.physicsBody.forces[e];this.options.wind&&(n.x+=this.options.wind.x,n.y+=this.options.wind.y);let r=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:r.x,vy:r.y},t.options.fixed.x===!1?(r.x=this.calculateComponentVelocity(r.x,n.x,t.options.mass),t.x+=r.x*this.timestep):(n.x=0,r.x=0),t.options.fixed.y===!1?(r.y=this.calculateComponentVelocity(r.y,n.y,t.options.mass),t.y+=r.y*this.timestep):(n.y=0,r.y=0),Math.sqrt(r.x**2+r.y**2)}_freezeNodes(){let e=this.body.nodes;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){let n=e[t].options.fixed;this.freezeCache[t]={x:n.x,y:n.y},n.x=!0,n.y=!0}}_restoreFrozenNodes(){let e=this.body.nodes;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!=`number`&&(e=this.options.stabilization.iterations,console.error(`The stabilize method needs a numeric amount of iterations. Switching to default: `,e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit(`_resizeNodes`),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit(`_blockRedraw`),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,PL(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit(`startStabilizing`),this.startedStabilization=!0,!0)}_stabilizationBatch(){let e=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,t=()=>{this.body.emitter.emit(`stabilizationProgress`,{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&t();let n=0;for(;e()&&n<this.options.stabilization.updateInterval;)this.physicsTick(),n++;if(t(),e()){var r;PL(B(r=this._stabilizationBatch).call(r,this),0)}else this._finalizeStabilization()}_finalizeStabilization(){this.body.emitter.emit(`_allowRedraw`),this.options.stabilization.fit===!0&&this.body.emitter.emit(`fit`),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit(`stabilizationIterationsDone`),this.body.emitter.emit(`_requestRedraw`),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}_drawForces(e){for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){let n=this.physicsBody.physicsNodeIndices[t],r=this.body.nodes[n],i=this.physicsBody.forces[n],a=Math.sqrt(i.x**2+i.x**2),o=Math.min(Math.max(5,a),15),s=3*o,c=ZB((180-Math.min(1,Math.max(0,.03*a))*180)/360,1,1),l={x:r.x+20*i.x,y:r.y+20*i.y};e.lineWidth=o,e.strokeStyle=c,e.beginPath(),e.moveTo(r.x,r.y),e.lineTo(l.x,l.y),e.stroke();let u=Math.atan2(i.y,i.x);e.fillStyle=c,pY.draw(e,{type:`arrow`,point:l,angle:u,length:s}),$L(e).call(e)}}},IY=[];for(let e=0;e<256;++e)IY.push((e+256).toString(16).slice(1));function LY(e,t=0){return(IY[e[t+0]]+IY[e[t+1]]+IY[e[t+2]]+IY[e[t+3]]+`-`+IY[e[t+4]]+IY[e[t+5]]+`-`+IY[e[t+6]]+IY[e[t+7]]+`-`+IY[e[t+8]]+IY[e[t+9]]+`-`+IY[e[t+10]]+IY[e[t+11]]+IY[e[t+12]]+IY[e[t+13]]+IY[e[t+14]]+IY[e[t+15]]).toLowerCase()}var RY,zY=new Uint8Array(16);function BY(){if(!RY){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);RY=crypto.getRandomValues.bind(crypto)}return RY(zY)}var VY={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function HY(e,t,n){e||={};let r=e.random??e.rng?.()??BY();if(r.length<16)throw Error(`Random bytes length must be >= 16`);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,LY(r)}function UY(e,t,n){return VY.randomUUID&&!e?VY.randomUUID():HY(e)}var WY=class{constructor(){}static getRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,r=-1e9,i=1e9,a=-1e9,o;if(t.length>0)for(let s=0;s<t.length;s++)o=e[t[s]],i>o.shape.boundingBox.left&&(i=o.shape.boundingBox.left),a<o.shape.boundingBox.right&&(a=o.shape.boundingBox.right),n>o.shape.boundingBox.top&&(n=o.shape.boundingBox.top),r<o.shape.boundingBox.bottom&&(r=o.shape.boundingBox.bottom);return i===1e9&&a===-1e9&&n===1e9&&r===-1e9&&(n=0,r=0,i=0,a=0),{minX:i,maxX:a,minY:n,maxY:r}}static getRangeCore(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,r=-1e9,i=1e9,a=-1e9,o;if(t.length>0)for(let s=0;s<t.length;s++)o=e[t[s]],i>o.x&&(i=o.x),a<o.x&&(a=o.x),n>o.y&&(n=o.y),r<o.y&&(r=o.y);return i===1e9&&a===-1e9&&n===1e9&&r===-1e9&&(n=0,r=0,i=0,a=0),{minX:i,maxX:a,minY:n,maxY:r}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,t){let n={};return t===void 0||t===`node`?(U(n,e.options,!0),n.x=e.x,n.y=e.y,n.amountOfConnections=e.edges.length):U(n,e.options,!0),n}},GY=class extends zJ{constructor(e,t,n,r,i,a){super(e,t,n,r,i,a),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(e){let t=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw Error(`node with id: `+e+` not in current cluster`);if(!t.isCluster)throw Error(`node with id: `+e+` is not a cluster`);delete this.containedNodes[e],W(t.edges,e=>{delete this.containedEdges[e.id]}),W(t.containedNodes,(e,t)=>{this.containedNodes[t]=e}),t.containedNodes={},W(t.containedEdges,(e,t)=>{this.containedEdges[t]=e}),t.containedEdges={},W(t.edges,e=>{W(this.edges,t=>{var n,r;let i=H(n=t.clusteringEdgeReplacingIds).call(n,e.id);i!==-1&&(W(e.clusteringEdgeReplacingIds,e=>{t.clusteringEdgeReplacingIds.push(e),this.body.edges[e].edgeReplacedById=t.id}),uP(r=t.clusteringEdgeReplacingIds).call(r,i,1))})}),t.edges=[]}},KY=class{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},eD(this.options,this.defaultOptions),this.body.emitter.on(`_resetData`,()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,t){e===void 0?e=this._getHubSize():typeof e==`object`&&(t=this._checkOptions(e),e=this._getHubSize());let n=[];for(let t=0;t<this.body.nodeIndices.length;t++){let r=this.body.nodes[this.body.nodeIndices[t]];r.edges.length>=e&&n.push(r.id)}for(let e=0;e<n.length;e++)this.clusterByConnection(n[e],t,!0);this.body.emitter.emit(`_dataChanged`)}cluster(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw Error(`Cannot call clusterByNodeData without a joinCondition function in the options.`);e=this._checkOptions(e);let n={},r={};W(this.body.nodes,(t,i)=>{t.options&&e.joinCondition(t.options)===!0&&(n[i]=t,W(t.edges,e=>{this.clusteredEdges[e.id]===void 0&&(r[e.id]=e)}))}),this._cluster(n,r,e,t)}clusterByEdgeCount(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);let r=[],i={},a,o,s;for(let n=0;n<this.body.nodeIndices.length;n++){let c={},l={},u=this.body.nodeIndices[n],d=this.body.nodes[u];if(i[u]===void 0){s=0,o=[];for(let e=0;e<d.edges.length;e++)a=d.edges[e],this.clusteredEdges[a.id]===void 0&&(a.toId!==a.fromId&&s++,o.push(a));if(s===e){let e=function(e){if(t.joinCondition===void 0||t.joinCondition===null)return!0;let n=WY.cloneOptions(e);return t.joinCondition(n)},n=!0;for(let t=0;t<o.length;t++){a=o[t];let r=this._getConnectedId(a,u);if(e(d))l[a.id]=a,c[u]=d,c[r]=this.body.nodes[r],i[u]=!0;else{n=!1;break}}if(KM(c).length>0&&KM(l).length>0&&n===!0){let e=function(){for(let e=0;e<r.length;++e)for(let t in c)if(r[e].nodes[t]!==void 0)return r[e]}();if(e!==void 0){for(let t in c)e.nodes[t]===void 0&&(e.nodes[t]=c[t]);for(let t in l)e.edges[t]===void 0&&(e.edges[t]=l[t])}else r.push({nodes:c,edges:l})}}}}for(let e=0;e<r.length;e++)this._cluster(r[e].nodes,r[e].edges,t,!1);n===!0&&this.body.emitter.emit(`_dataChanged`)}clusterOutliers(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var n;let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw Error(`No nodeId supplied to clusterByConnection!`);if(this.body.nodes[e]===void 0)throw Error(`The nodeId given to clusterByConnection does not exist!`);let i=this.body.nodes[e];t=this._checkOptions(t,i),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=i.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=i.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=i.options.fixed.x,t.clusterNodeProperties.fixed.y=i.options.fixed.y);let a={},o={},s=i.id,c=WY.cloneOptions(i);a[s]=i;for(let e=0;e<i.edges.length;e++){let n=i.edges[e];if(this.clusteredEdges[n.id]===void 0){let e=this._getConnectedId(n,s);if(this.clusteredNodes[e]===void 0)if(e!==s)if(t.joinCondition===void 0)o[n.id]=n,a[e]=this.body.nodes[e];else{let r=WY.cloneOptions(this.body.nodes[e]);t.joinCondition(c,r)===!0&&(o[n.id]=n,a[e]=this.body.nodes[e])}else o[n.id]=n}}let l=NM(n=KM(a)).call(n,function(e){return a[e].id});for(let e in a){if(!Object.prototype.hasOwnProperty.call(a,e))continue;let t=a[e];for(let e=0;e<t.edges.length;e++){let n=t.edges[e];H(l).call(l,this._getConnectedId(n,t.id))>-1&&(o[n.id]=n)}}this._cluster(a,o,t,r)}_createClusterEdges(e,t,n,r){let i,a,o,s,c,l,u=KM(e),d=[];for(let r=0;r<u.length;r++){a=u[r],o=e[a];for(let r=0;r<o.edges.length;r++)i=o.edges[r],this.clusteredEdges[i.id]===void 0&&(i.toId==i.fromId?t[i.id]=i:i.toId==a?(s=n.id,c=i.fromId,l=c):(s=i.toId,c=n.id,l=s),e[l]===void 0&&d.push({edge:i,fromId:c,toId:s}))}let f=[],p=function(e){for(let t=0;t<f.length;t++){let n=f[t],r=e.fromId===n.fromId&&e.toId===n.toId,i=e.fromId===n.toId&&e.toId===n.fromId;if(r||i)return n}return null};for(let e=0;e<d.length;e++){let t=d[e],n=t.edge,i=p(t);i===null?(i=this._createClusteredEdge(t.fromId,t.toId,n,r),f.push(i)):i.clusteringEdgeReplacingIds.push(n.id),this.body.edges[n.id].edgeReplacedById=i.id,this._backupEdgeOptions(n),n.setOptions({physics:!1})}}_checkOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=[];for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.clusteredNodes[t]!==void 0&&i.push(t);for(let t=0;t<i.length;++t)delete e[i[t]];if(KM(e).length==0||KM(e).length==1&&n.clusterNodeProperties.allowSingleNodeCluster!=1)return;let a=U({},n.clusterNodeProperties);if(n.processProperties!==void 0){let r=[];for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=WY.cloneOptions(e[t]);r.push(n)}let i=[];for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&e.substr(0,12)!==`clusterEdge:`){let n=WY.cloneOptions(t[e],`edge`);i.push(n)}if(a=n.processProperties(a,r,i),!a)throw Error(`The processProperties function does not return properties!`)}a.id===void 0&&(a.id=`cluster:`+UY());let o=a.id;a.label===void 0&&(a.label=`cluster`);let s;a.x===void 0&&(s=this._getClusterPosition(e),a.x=s.x),a.y===void 0&&(s===void 0&&(s=this._getClusterPosition(e)),a.y=s.y),a.id=o;let c=this.body.functions.createNode(a,GY);c.containedNodes=e,c.containedEdges=t,c.clusterEdgeProperties=n.clusterEdgeProperties,this.body.nodes[a.id]=c,this._clusterEdges(e,t,a,n.clusterEdgeProperties),a.id=void 0,r===!0&&this.body.emitter.emit(`_dataChanged`)}_backupEdgeOptions(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}_restoreEdge(e){let t=this.clusteredEdges[e.id];t!==void 0&&(e.setOptions({physics:t.physics}),delete this.clusteredEdges[e.id])}isCluster(e){return this.body.nodes[e]===void 0?(console.error(`Node does not exist.`),!1):this.body.nodes[e].isCluster===!0}_getClusterPosition(e){let t=KM(e),n=e[t[0]].x,r=e[t[0]].x,i=e[t[0]].y,a=e[t[0]].y,o;for(let s=1;s<t.length;s++)o=e[t[s]],n=o.x<n?o.x:n,r=o.x>r?o.x:r,i=o.y<i?o.y:i,a=o.y>a?o.y:a;return{x:.5*(n+r),y:.5*(i+a)}}openCluster(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw Error(`No clusterNodeId supplied to openCluster.`);let r=this.body.nodes[e];if(r===void 0)throw Error(`The clusterNodeId supplied to openCluster does not exist.`);if(r.isCluster!==!0||r.containedNodes===void 0||r.containedEdges===void 0)throw Error(`The node:`+e+` is not a valid cluster.`);let i=this.findNode(e),a=H(i).call(i,e)-1;if(a>=0){let t=i[a];this.body.nodes[t]._openChildCluster(e),delete this.body.nodes[e],n===!0&&this.body.emitter.emit(`_dataChanged`);return}let o=r.containedNodes,s=r.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction==`function`){let e={},n={x:r.x,y:r.y};for(let t in o)if(Object.prototype.hasOwnProperty.call(o,t)){let n=this.body.nodes[t];e[t]={x:n.x,y:n.y}}let i=t.releaseFunction(n,e);for(let e in o)if(Object.prototype.hasOwnProperty.call(o,e)){let t=this.body.nodes[e];i[e]!==void 0&&(t.x=i[e].x===void 0?r.x:i[e].x,t.y=i[e].y===void 0?r.y:i[e].y)}}else W(o,function(e){e.options.fixed.x===!1&&(e.x=r.x),e.options.fixed.y===!1&&(e.y=r.y)});for(let e in o)if(Object.prototype.hasOwnProperty.call(o,e)){let t=this.body.nodes[e];t.vx=r.vx,t.vy=r.vy,t.setOptions({physics:!0}),delete this.clusteredNodes[e]}let c=[];for(let e=0;e<r.edges.length;e++)c.push(r.edges[e]);for(let t=0;t<c.length;t++){let n=c[t],r=this._getConnectedId(n,e),i=this.clusteredNodes[r];for(let e=0;e<n.clusteringEdgeReplacingIds.length;e++){let t=n.clusteringEdgeReplacingIds[e],a=this.body.edges[t];if(a!==void 0)if(i!==void 0){let e=this.body.nodes[i.clusterId];e.containedEdges[a.id]=a,delete s[a.id];let t=a.fromId,n=a.toId;a.toId==r?n=i.clusterId:t=i.clusterId,this._createClusteredEdge(t,n,a,e.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(a)}n.remove()}for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&this._restoreEdge(s[e]);delete this.body.nodes[e],n===!0&&this.body.emitter.emit(`_dataChanged`)}getNodesInCluster(e){let t=[];if(this.isCluster(e)===!0){let n=this.body.nodes[e].containedNodes;for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.push(this.body.nodes[e].id)}return t}findNode(e){let t=[],n=0,r;for(;this.clusteredNodes[e]!==void 0&&n<100;){if(r=this.body.nodes[e],r===void 0)return[];t.push(r.id),e=this.clusteredNodes[e].clusterId,n++}return r=this.body.nodes[e],r===void 0?[]:(t.push(r.id),HN(t).call(t),t)}updateClusteredNode(e,t){if(e===void 0)throw Error(`No clusteredNodeId supplied to updateClusteredNode.`);if(t===void 0)throw Error(`No newOptions supplied to updateClusteredNode.`);if(this.body.nodes[e]===void 0)throw Error(`The clusteredNodeId supplied to updateClusteredNode does not exist.`);this.body.nodes[e].setOptions(t),this.body.emitter.emit(`_dataChanged`)}updateEdge(e,t){if(e===void 0)throw Error(`No startEdgeId supplied to updateEdge.`);if(t===void 0)throw Error(`No newOptions supplied to updateEdge.`);if(this.body.edges[e]===void 0)throw Error(`The startEdgeId supplied to updateEdge does not exist.`);let n=this.getClusteredEdges(e);for(let e=0;e<n.length;e++)this.body.edges[n[e]].setOptions(t);this.body.emitter.emit(`_dataChanged`)}getClusteredEdges(e){let t=[],n=0;for(;e!==void 0&&this.body.edges[e]!==void 0&&n<100;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,n++;return HN(t).call(t),t}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){let t=[e],n=[],r=[],i=0;for(;t.length>0&&i<100;){let e=t.pop();if(e===void 0)continue;let a=this.body.edges[e];if(a===void 0)continue;i++;let o=a.clusteringEdgeReplacingIds;if(o===void 0)r.push(e);else for(let e=0;e<o.length;++e){let r=o[e];H(t).call(t,o)!==-1||H(n).call(n,o)!==-1||t.push(r)}n.push(e)}return r}_getConnectedId(e,t){return e.toId==t?(e.fromId,e.fromId):e.toId}_getHubSize(){let e=0,t=0,n=0,r=0;for(let i=0;i<this.body.nodeIndices.length;i++){let a=this.body.nodes[this.body.nodeIndices[i]];a.edges.length>r&&(r=a.edges.length),e+=a.edges.length,t+=a.edges.length**2,n+=1}e/=n,t/=n;let i=t-e**2,a=Math.floor(e+2*Math.sqrt(i));return a>r&&(a=r),a}_createClusteredEdge(e,t,n,r,i){let a=WY.cloneOptions(n,`edge`);U(a,r),a.from=e,a.to=t,a.id=`clusterEdge:`+UY(),i!==void 0&&U(a,i);let o=this.body.functions.createEdge(a);return o.clusteringEdgeReplacingIds=[n.id],o.connect(),this.body.edges[o.id]=o,o}_clusterEdges(e,t,n,r){if(t instanceof TY){let e=t,n={};n[e.id]=e,t=n}if(e instanceof zJ){let t=e,n={};n[t.id]=t,e=n}if(n==null)throw Error(`_clusterEdges: parameter clusterNode required`);r===void 0&&(r=n.clusterEdgeProperties),this._createClusterEdges(e,t,n,r);for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&this.body.edges[e]!==void 0){let t=this.body.edges[e];this._backupEdgeOptions(t),t.setOptions({physics:!1})}for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.clusteredNodes[t]={clusterId:n.id,node:this.body.nodes[t]},this.body.nodes[t].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;let t=this.clusteredNodes[e];if(t===void 0)return;let n=t.clusterId;if(n!==void 0)return this.body.nodes[n]}_filter(e,t){let n=[];return W(e,e=>{t(e)&&n.push(e)}),n}_updateState(){let e,t=[],n={},r=e=>{W(this.body.nodes,t=>{t.isCluster===!0&&e(t)})};for(e in this.clusteredNodes)Object.prototype.hasOwnProperty.call(this.clusteredNodes,e)&&this.body.nodes[e]===void 0&&t.push(e);r(function(e){for(let n=0;n<t.length;n++)delete e.containedNodes[t[n]]});for(let e=0;e<t.length;e++)delete this.clusteredNodes[t[e]];W(this.clusteredEdges,e=>{let t=this.body.edges[e];(t===void 0||!t.endPointsValid())&&(n[e]=e)}),r(function(e){W(e.containedEdges,(e,t)=>{!e.endPointsValid()&&!n[t]&&(n[t]=t)})}),W(this.body.edges,(e,t)=>{let r=!0,i=e.clusteringEdgeReplacingIds;if(i!==void 0){let e=0;W(i,t=>{let n=this.body.edges[t];n!==void 0&&n.endPointsValid()&&(e+=1)}),r=e>0}(!e.endPointsValid()||!r)&&(n[t]=t)}),r(e=>{W(n,t=>{delete e.containedEdges[t],W(e.edges,(r,i)=>{if(r.id===t){e.edges[i]=null;return}r.clusteringEdgeReplacingIds=this._filter(r.clusteringEdgeReplacingIds,function(e){return!n[e]})}),e.edges=this._filter(e.edges,function(e){return e!==null})})}),W(n,e=>{delete this.clusteredEdges[e]}),W(n,e=>{delete this.body.edges[e]}),W(KM(this.body.edges),e=>{let t=this.body.edges[e],n=this._isClusteredNode(t.fromId)||this._isClusteredNode(t.toId);if(n!==this._isClusteredEdge(t.id))if(n){let e=this._getClusterNodeForNode(t.fromId);e!==void 0&&this._clusterEdges(this.body.nodes[t.fromId],t,e);let n=this._getClusterNodeForNode(t.toId);n!==void 0&&this._clusterEdges(this.body.nodes[t.toId],t,n)}else delete this._clusterEdges[e],this._restoreEdge(t)});let i=!1,a=!0;for(;a;){let e=[];r(function(t){let n=KM(t.containedNodes).length,r=t.options.allowSingleNodeCluster===!0;(r&&n<1||!r&&n<2)&&e.push(t.id)});for(let t=0;t<e.length;++t)this.openCluster(e[t],{},!1);a=e.length>0,i||=a}i&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}},qY=class{constructor(e,t){this.body=e,this.canvas=t,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},eD(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.on(`dragStart`,()=>{this.dragging=!0}),this.body.emitter.on(`dragEnd`,()=>{this.dragging=!1}),this.body.emitter.on(`zoom`,()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=PL(()=>{var e;this.zooming=!1,B(e=this._requestRedraw).call(e,this)()},250)}),this.body.emitter.on(`_resizeNodes`,()=>{this._resizeNodes()}),this.body.emitter.on(`_redraw`,()=>{this.renderingActive===!1&&this._redraw()}),this.body.emitter.on(`_blockRedraw`,()=>{this.allowRedraw=!1}),this.body.emitter.on(`_allowRedraw`,()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on(`_requestRedraw`,B(e=this._requestRedraw).call(e,this)),this.body.emitter.on(`_startRendering`,()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on(`_stopRendering`,()=>{--this.renderRequests,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0}),this.body.emitter.on(`destroy`,()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()})}setOptions(e){e!==void 0&&zB([`hideEdgesOnDrag`,`hideEdgesOnZoom`,`hideNodesOnDrag`],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(B(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit(`setSize`),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit(`initRedraw`),this.redrawRequested=!1;let t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();let n=this.canvas.getContext(),r=this.canvas.frame.canvas.clientWidth,i=this.canvas.frame.canvas.clientHeight;if(n.clearRect(0,0,r,i),this.canvas.frame.clientWidth===0)return;if(n.save(),n.translate(this.body.view.translation.x,this.body.view.translation.y),n.scale(this.body.view.scale,this.body.view.scale),n.beginPath(),this.body.emitter.emit(`beforeDrawing`,n),n.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(n),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){let{drawExternalLabels:r}=this._drawNodes(n,e);t.drawExternalLabels=r}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(n),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(n),n.beginPath(),this.body.emitter.emit(`afterDrawing`,n),n.closePath(),n.restore(),e===!0&&n.clearRect(0,0,r,i)}}_resizeNodes(){this.canvas.setTransform();let e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);let t=this.body.nodes,n;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n=t[r],n.resize(e),n.updateBoundingBox(e,n.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.nodes,r=this.body.nodeIndices,i,a=[],o=[],s=this.canvas.DOMtoCanvas({x:-20,y:-20}),c=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),l={top:s.y,left:s.x,bottom:c.y,right:c.x},u=[];for(let s=0;s<r.length;s++)if(i=n[r[s]],i.hover)o.push(r[s]);else if(i.isSelected())a.push(r[s]);else if(t===!0){let t=i.draw(e);t.drawExternalLabel!=null&&u.push(t.drawExternalLabel)}else if(i.isBoundingBoxOverlappingWith(l)===!0){let t=i.draw(e);t.drawExternalLabel!=null&&u.push(t.drawExternalLabel)}else i.updateBoundingBox(e,i.selected);let d,f=a.length,p=o.length;for(d=0;d<f;d++){i=n[a[d]];let t=i.draw(e);t.drawExternalLabel!=null&&u.push(t.drawExternalLabel)}for(d=0;d<p;d++){i=n[o[d]];let t=i.draw(e);t.drawExternalLabel!=null&&u.push(t.drawExternalLabel)}return{drawExternalLabels:()=>{for(let e of u)e()}}}_drawEdges(e){let t=this.body.edges,n=this.body.edgeIndices;for(let r=0;r<n.length;r++){let i=t[n[r]];i.connected===!0&&i.draw(e)}}_drawArrows(e){let t=this.body.edges,n=this.body.edgeIndices;for(let r=0;r<n.length;r++){let i=t[n[r]];i.connected===!0&&i.drawArrows(e)}}_drawSelectionBox(e){if(this.body.selectionBox.show){e.beginPath();let t=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,n=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;e.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,n),e.fillStyle=`rgba(151, 194, 252, 0.2)`,e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,n),e.strokeStyle=`rgba(151, 194, 252, 1)`,e.stroke()}else e.closePath()}},JY,YY;function XY(){return YY?JY:(YY=1,DL(),JY=R().setInterval,JY)}var ZY,QY;function $Y(){return QY?ZY:(QY=1,ZY=XY(),ZY)}var eX=F($Y());function tX(e,t){t.inputHandler=function(e){e.isFirst&&t(e)},e.on(`hammer.input`,t.inputHandler)}function nX(e,t){return t.inputHandler=function(e){e.isFinal&&t(e)},e.on(`hammer.input`,t.inputHandler)}var rX=class{constructor(e){this.body=e,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:`100%`,width:`100%`},eD(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once(`resize`,e=>{e.width!==0&&(this.body.view.translation.x=e.width*.5),e.height!==0&&(this.body.view.translation.y=e.height*.5)}),this.body.emitter.on(`setSize`,B(e=this.setSize).call(e,this)),this.body.emitter.on(`destroy`,()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&zB([`width`,`height`,`autoResize`],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){let e=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit(`_requestRedraw`)}),{frame:t}=this;e.observe(t),this._cleanupCallbacks.push(()=>{e.unobserve(t)})}else{let e=eX(()=>{this.setSize()===!0&&this.body.emitter.emit(`_requestRedraw`)},1e3);this._cleanupCallbacks.push(()=>{clearInterval(e)})}let e=B(t=this._onResize).call(t,this);window.addEventListener(`resize`,e),this._cleanupCallbacks.push(()=>{window.removeEventListener(`resize`,e)})}}_cleanUp(){var e,t,n;V(e=HN(t=uP(n=this._cleanupCallbacks).call(n,0)).call(t)).call(e,e=>{try{e()}catch(e){console.error(e)}})}_onResize(){this.setSize(),this.body.emitter.emit(`_redraw`)}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){let e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,n=this.cameraState.scale;e!=1&&t!=1?n=this.cameraState.scale*.5*(e+t):e==1?t!=1&&(n=this.cameraState.scale*t):n=this.cameraState.scale*e,this.body.view.scale=n;let r=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),i={x:r.x-this.cameraState.position.x,y:r.y-this.cameraState.position.y};this.body.view.translation.x+=i.x*this.body.view.scale,this.body.view.translation.y+=i.y*this.body.view.scale}}_prepareValue(e){if(typeof e==`number`)return e+`px`;if(typeof e==`string`){if(H(e).call(e,`%`)!==-1||H(e).call(e,`px`)!==-1)return e;if(H(e).call(e,`%`)===-1)return e+`px`}throw Error(`Could not use the value supplied for width or height:`+e)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement(`div`),this.frame.className=`vis-network`,this.frame.style.position=`relative`,this.frame.style.overflow=`hidden`,this.frame.tabIndex=0,this.frame.canvas=document.createElement(`canvas`),this.frame.canvas.style.position=`relative`,this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{let e=document.createElement(`DIV`);e.style.color=`red`,e.style.fontWeight=`bold`,e.style.padding=`10px`,e.innerText=`Error: your browser does not support HTML canvas`,this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new _V(this.frame.canvas),this.hammer.get(`pinch`).set({enable:!0}),this.hammer.get(`pan`).set({threshold:5,direction:_V.DIRECTION_ALL}),tX(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on(`tap`,e=>{this.body.eventListeners.onTap(e)}),this.hammer.on(`doubletap`,e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on(`press`,e=>{this.body.eventListeners.onHold(e)}),this.hammer.on(`panstart`,e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on(`panmove`,e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on(`panend`,e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on(`pinch`,e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener(`wheel`,e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener(`mousemove`,e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener(`contextmenu`,e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new _V(this.frame),nX(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);let n=!1,r=this.frame.canvas.width,i=this.frame.canvas.height,a=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(a),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width=`100%`,this.frame.canvas.style.height=`100%`,this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},n=!0;else{let e=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),t=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==e||this.frame.canvas.height!==t)&&this._getCameraState(a),this.frame.canvas.width!==e&&(this.frame.canvas.width=e,n=!0),this.frame.canvas.height!==t&&(this.frame.canvas.height=t,n=!0)}return n===!0&&(this.body.emitter.emit(`resize`,{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(r/this.pixelRatio),oldHeight:Math.round(i/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,n}getContext(){return this.frame.canvas.getContext(`2d`)}_determinePixelRatio(){let e=this.getContext();if(e===void 0)throw Error(`Could not get canvax context`);let t=1;typeof window<`u`&&(t=window.devicePixelRatio||1);let n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/n}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){let e=this.getContext();if(e===void 0)throw Error(`Could not get canvax context`);e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}};function iX(e,t){let n=eD({nodes:t,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},e??{});if(!_M(n.nodes))throw TypeError(`Nodes has to be an array of ids.`);if(n.nodes.length===0&&(n.nodes=t),!(typeof n.minZoomLevel==`number`&&n.minZoomLevel>0))throw TypeError(`Min zoom level has to be a number higher than zero.`);if(!(typeof n.maxZoomLevel==`number`&&n.minZoomLevel<=n.maxZoomLevel))throw TypeError(`Max zoom level has to be a number higher than min zoom level.`);return n}var aX=class{constructor(e,t){var n,r;this.body=e,this.canvas=t,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction=`easeInOutQuint`,this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on(`fit`,B(n=this.fit).call(n,this)),this.body.emitter.on(`animationFinished`,()=>{this.body.emitter.emit(`_stopRendering`)}),this.body.emitter.on(`unlockNode`,B(r=this.releaseNode).call(r,this))}setOptions(){this.options=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}}fit(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=iX(e,this.body.nodeIndices);let n=this.canvas.frame.canvas.clientWidth,r=this.canvas.frame.canvas.clientHeight,i,a;if(n===0||r===0)a=1,i=WY.getRange(this.body.nodes,e.nodes);else if(t===!0){let t=0;for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this.body.nodes[e].predefinedPosition===!0&&(t+=1);if(t>.5*this.body.nodeIndices.length){this.fit(e,!1);return}i=WY.getRange(this.body.nodes,e.nodes),a=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;let o=Math.min(n/600,r/600);a*=o}else{this.body.emitter.emit(`_resizeNodes`),i=WY.getRange(this.body.nodes,e.nodes);let t=Math.abs(i.maxX-i.minX)*1.1,o=Math.abs(i.maxY-i.minY)*1.1,s=n/t,c=r/o;a=s<=c?s:c}a>e.maxZoomLevel?a=e.maxZoomLevel:a<e.minZoomLevel&&(a=e.minZoomLevel);let o={position:WY.findCenter(i),scale:a,animation:e.animation};this.moveTo(o)}focus(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.body.nodes[e]===void 0?console.error(`Node: `+e+` cannot be found.`):(t.position={x:this.body.nodes[e].x,y:this.body.nodes[e].y},t.lockedOnNode=e,this.moveTo(t))}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!ZU(e.offset.x))throw TypeError(`The option "offset.x" has to be a finite number.`)}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!ZU(e.offset.y))throw TypeError(`The option "offset.y" has to be a finite number.`)}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!ZU(e.position.x))throw TypeError(`The option "position.x" has to be a finite number.`)}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!ZU(e.position.y))throw TypeError(`The option "position.y" has to be a finite number.`)}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw TypeError(`The option "scale" has to be a number greater than zero.`)}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction=`easeInOutQuad`),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;let t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+n.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+n.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var r;this.viewFunction=B(r=this._lockedRedraw).call(r,this),this.body.emitter.on(`initRedraw`,this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit(`_requestRedraw`);else{var i;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=B(i=this._transitionRedraw).call(i,this),this.body.emitter.on(`initRedraw`,this.viewFunction),this.body.emitter.emit(`_startRendering`)}}_lockedRedraw(){let e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:t.x-e.x,y:t.y-e.y},r=this.body.view.translation,i={x:r.x+n.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:r.y+n.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=i}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off(`initRedraw`,this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;let t=iV[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){if(this.body.emitter.off(`initRedraw`,this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var n;this.viewFunction=B(n=this._lockedRedraw).call(n,this),this.body.emitter.on(`initRedraw`,this.viewFunction)}this.body.emitter.emit(`animationFinished`)}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}};function oX(e){var t=e&&e.preventDefault||!1,n=e&&e.container||window,r={},i={keydown:{},keyup:{}},a={},o;for(o=97;o<=122;o++)a[String.fromCharCode(o)]={code:65+(o-97),shift:!1};for(o=65;o<=90;o++)a[String.fromCharCode(o)]={code:o,shift:!0};for(o=0;o<=9;o++)a[``+o]={code:48+o,shift:!1};for(o=1;o<=12;o++)a[`F`+o]={code:111+o,shift:!1};for(o=0;o<=9;o++)a[`num`+o]={code:96+o,shift:!1};a[`num*`]={code:106,shift:!1},a[`num+`]={code:107,shift:!1},a[`num-`]={code:109,shift:!1},a[`num/`]={code:111,shift:!1},a[`num.`]={code:110,shift:!1},a.left={code:37,shift:!1},a.up={code:38,shift:!1},a.right={code:39,shift:!1},a.down={code:40,shift:!1},a.space={code:32,shift:!1},a.enter={code:13,shift:!1},a.shift={code:16,shift:void 0},a.esc={code:27,shift:!1},a.backspace={code:8,shift:!1},a.tab={code:9,shift:!1},a.ctrl={code:17,shift:!1},a.alt={code:18,shift:!1},a.delete={code:46,shift:!1},a.pageup={code:33,shift:!1},a.pagedown={code:34,shift:!1},a[`=`]={code:187,shift:!1},a[`-`]={code:189,shift:!1},a[`]`]={code:221,shift:!1},a[`[`]={code:219,shift:!1};var s=function(e){l(e,`keydown`)},c=function(e){l(e,`keyup`)},l=function(e,n){if(i[n][e.keyCode]!==void 0){for(var r=i[n][e.keyCode],a=0;a<r.length;a++)(r[a].shift===void 0||r[a].shift==1&&e.shiftKey==1||r[a].shift==0&&e.shiftKey==0)&&r[a].fn(e);t==1&&e.preventDefault()}};return r.bind=function(e,t,n){if(n===void 0&&(n=`keydown`),a[e]===void 0)throw Error(`unsupported key: `+e);i[n][a[e].code]===void 0&&(i[n][a[e].code]=[]),i[n][a[e].code].push({fn:t,shift:a[e].shift})},r.bindAll=function(e,t){for(var n in t===void 0&&(t=`keydown`),a)a.hasOwnProperty(n)&&r.bind(n,e,t)},r.getKey=function(e){for(var t in a)if(a.hasOwnProperty(t)&&(e.shiftKey==1&&a[t].shift==1&&e.keyCode==a[t].code||e.shiftKey==0&&a[t].shift==0&&e.keyCode==a[t].code||e.keyCode==a[t].code&&t==`shift`))return t;return`unknown key, currently not supported`},r.unbind=function(e,t,n){if(n===void 0&&(n=`keydown`),a[e]===void 0)throw Error(`unsupported key: `+e);if(t!==void 0){var r=[],o=i[n][a[e].code];if(o!==void 0)for(var s=0;s<o.length;s++)o[s].fn==t&&o[s].shift==a[e].shift||r.push(i[n][a[e].code][s]);i[n][a[e].code]=r}else i[n][a[e].code]=[]},r.reset=function(){i={keydown:{},keyup:{}}},r.destroy=function(){i={keydown:{},keyup:{}},n.removeEventListener(`keydown`,s,!0),n.removeEventListener(`keyup`,c,!0)},n.addEventListener(`keydown`,s,!0),n.addEventListener(`keyup`,c,!0),r}var sX=class{constructor(e,t){this.body=e,this.canvas=t,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on(`activate`,()=>{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on(`deactivate`,()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on(`destroy`,()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}loadNavigationElements(){this.cleanNavigation(),this.navigationDOM={};let e=[`up`,`down`,`left`,`right`,`zoomIn`,`zoomOut`,`zoomExtends`],t=[`_moveUp`,`_moveDown`,`_moveLeft`,`_moveRight`,`_zoomIn`,`_zoomOut`,`_fit`];this.navigationDOM.wrapper=document.createElement(`div`),this.navigationDOM.wrapper.className=`vis-navigation`,this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(let i=0;i<e.length;i++){this.navigationDOM[e[i]]=document.createElement(`div`),this.navigationDOM[e[i]].className=`vis-button vis-`+e[i],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[i]]);let a=new _V(this.navigationDOM[e[i]]);if(t[i]===`_fit`){var n;tX(a,B(n=this._fit).call(n,this))}else{var r;tX(a,B(r=this.bindToRedraw).call(r,this,t[i]))}this.navigationHammers.push(a)}let i=new _V(this.canvas.frame);nX(i,()=>{this._stopMovement()}),this.navigationHammers.push(i),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=B(t=this[e]).call(t,this),this.body.emitter.on(`initRedraw`,this.boundFunctions[e]),this.body.emitter.emit(`_startRendering`)}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off(`initRedraw`,this.boundFunctions[e]),this.body.emitter.emit(`_stopRendering`),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit(`fit`,{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(let e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off(`initRedraw`,this.boundFunctions[e]),this.body.emitter.emit(`_stopRendering`));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){let e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,r=t/e,i=(1-r)*this.canvas.canvasViewCenter.x+n.x*r,a=(1-r)*this.canvas.canvasViewCenter.y+n.y*r;this.body.view.scale=t,this.body.view.translation={x:i,y:a},this.body.emitter.emit(`zoom`,{direction:`+`,scale:this.body.view.scale,pointer:null})}_zoomOut(){let e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,r=t/e,i=(1-r)*this.canvas.canvasViewCenter.x+n.x*r,a=(1-r)*this.canvas.canvasViewCenter.y+n.y*r;this.body.view.scale=t,this.body.view.translation={x:i,y:a},this.body.emitter.emit(`zoom`,{direction:`-`,scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=oX({container:window,preventDefault:!0}):this.keycharm=oX({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C;B(e=this.keycharm).call(e,`up`,()=>{this.bindToRedraw(`_moveUp`)},`keydown`),B(t=this.keycharm).call(t,`down`,()=>{this.bindToRedraw(`_moveDown`)},`keydown`),B(n=this.keycharm).call(n,`left`,()=>{this.bindToRedraw(`_moveLeft`)},`keydown`),B(r=this.keycharm).call(r,`right`,()=>{this.bindToRedraw(`_moveRight`)},`keydown`),B(i=this.keycharm).call(i,`=`,()=>{this.bindToRedraw(`_zoomIn`)},`keydown`),B(a=this.keycharm).call(a,`num+`,()=>{this.bindToRedraw(`_zoomIn`)},`keydown`),B(o=this.keycharm).call(o,`num-`,()=>{this.bindToRedraw(`_zoomOut`)},`keydown`),B(s=this.keycharm).call(s,`-`,()=>{this.bindToRedraw(`_zoomOut`)},`keydown`),B(c=this.keycharm).call(c,`[`,()=>{this.bindToRedraw(`_zoomOut`)},`keydown`),B(l=this.keycharm).call(l,`]`,()=>{this.bindToRedraw(`_zoomIn`)},`keydown`),B(u=this.keycharm).call(u,`pageup`,()=>{this.bindToRedraw(`_zoomIn`)},`keydown`),B(d=this.keycharm).call(d,`pagedown`,()=>{this.bindToRedraw(`_zoomOut`)},`keydown`),B(f=this.keycharm).call(f,`up`,()=>{this.unbindFromRedraw(`_moveUp`)},`keyup`),B(p=this.keycharm).call(p,`down`,()=>{this.unbindFromRedraw(`_moveDown`)},`keyup`),B(m=this.keycharm).call(m,`left`,()=>{this.unbindFromRedraw(`_moveLeft`)},`keyup`),B(h=this.keycharm).call(h,`right`,()=>{this.unbindFromRedraw(`_moveRight`)},`keyup`),B(g=this.keycharm).call(g,`=`,()=>{this.unbindFromRedraw(`_zoomIn`)},`keyup`),B(_=this.keycharm).call(_,`num+`,()=>{this.unbindFromRedraw(`_zoomIn`)},`keyup`),B(v=this.keycharm).call(v,`num-`,()=>{this.unbindFromRedraw(`_zoomOut`)},`keyup`),B(y=this.keycharm).call(y,`-`,()=>{this.unbindFromRedraw(`_zoomOut`)},`keyup`),B(b=this.keycharm).call(b,`[`,()=>{this.unbindFromRedraw(`_zoomOut`)},`keyup`),B(x=this.keycharm).call(x,`]`,()=>{this.unbindFromRedraw(`_zoomIn`)},`keyup`),B(S=this.keycharm).call(S,`pageup`,()=>{this.unbindFromRedraw(`_zoomIn`)},`keyup`),B(C=this.keycharm).call(C,`pagedown`,()=>{this.unbindFromRedraw(`_zoomOut`)},`keyup`)}}},cX=class{constructor(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m,h;this.body=e,this.canvas=t,this.selectionHandler=n,this.navigationHandler=new sX(e,t),this.body.eventListeners.onTap=B(r=this.onTap).call(r,this),this.body.eventListeners.onTouch=B(i=this.onTouch).call(i,this),this.body.eventListeners.onDoubleTap=B(a=this.onDoubleTap).call(a,this),this.body.eventListeners.onHold=B(o=this.onHold).call(o,this),this.body.eventListeners.onDragStart=B(s=this.onDragStart).call(s,this),this.body.eventListeners.onDrag=B(c=this.onDrag).call(c,this),this.body.eventListeners.onDragEnd=B(l=this.onDragEnd).call(l,this),this.body.eventListeners.onMouseWheel=B(u=this.onMouseWheel).call(u,this),this.body.eventListeners.onPinch=B(d=this.onPinch).call(d,this),this.body.eventListeners.onMouseMove=B(f=this.onMouseMove).call(f,this),this.body.eventListeners.onRelease=B(p=this.onRelease).call(p,this),this.body.eventListeners.onContext=B(m=this.onContext).call(m,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=B(h=this.getPointer).call(h,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},eD(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on(`destroy`,()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(BB([`hideEdgesOnDrag`,`hideEdgesOnZoom`,`hideNodesOnDrag`,`keyboard`,`multiselect`,`selectable`,`selectConnectedEdges`],this.options,e),rV(this.options,e,`keyboard`),e.tooltip&&(eD(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=JB(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-UB(this.canvas.frame.canvas),y:e.y-WB(this.canvas.frame.canvas)}}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){let t=this.getPointer(e.center),n=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,n),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent(`click`,e,t)}onDoubleTap(e){let t=this.getPointer(e.center);this.selectionHandler.generateClickEvent(`doubleClick`,e,t)}onHold(e){let t=this.getPointer(e.center),n=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,n),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent(`click`,e,t),this.selectionHandler.generateClickEvent(`hold`,e,t)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){let t=this.getPointer(e.center);this.selectionHandler.generateClickEvent(`release`,e,t),this.touchTime=new Date().valueOf()}}onContext(e){let t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent(`oncontext`,e,t)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){let n=function(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];H(t).call(t,i)===-1&&n.push(i)}return n};return{nodes:n(e.nodes,t.nodes),edges:n(e.edges,t.edges)}}onDragStart(e){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(e);let t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=eD({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;let t=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)}}else if(t!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=t.id,t.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[t.id]}),this.selectionHandler.generateClickEvent(`dragStart`,e,this.drag.pointer);for(let e of this.selectionHandler.getSelectedNodes()){let t={id:e.id,node:e,x:e.x,y:e.y,xFixed:e.options.fixed.x,yFixed:e.options.fixed.y};e.options.fixed.x=!0,e.options.fixed.y=!0,this.drag.selection.push(t)}}else this.selectionHandler.generateClickEvent(`dragStart`,e,this.drag.pointer,void 0,!0)}onDrag(e){if(this.drag.pinched===!0)return;this.body.emitter.emit(`unlockNode`);let t=this.getPointer(e.center),n=this.drag.selection;if(n&&n.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent(`dragging`,e,t);let r=t.x-this.drag.pointer.x,i=t.y-this.drag.pointer.y;V(n).call(n,e=>{let t=e.node;e.xFixed===!1&&(t.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(e.x)+r)),e.yFixed===!1&&(t.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(e.y)+i))}),this.body.emitter.emit(`startSimulation`)}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent(`dragging`,e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.emitter.emit(`_requestRedraw`)}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent(`dragging`,e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}let n=t.x-this.drag.pointer.x,r=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+n,y:this.drag.translation.y+r},this.body.emitter.emit(`_requestRedraw`)}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;let n=this.body.selectionBox.position,r={minX:Math.min(n.start.x,n.end.x),minY:Math.min(n.start.y,n.end.y),maxX:Math.max(n.start.x,n.end.x),maxY:Math.max(n.start.y,n.end.y)},i=kF(t=this.body.nodeIndices).call(t,e=>{let t=this.body.nodes[e];return t.x>=r.minX&&t.x<=r.maxX&&t.y>=r.minY&&t.y<=r.maxY});V(i).call(i,e=>this.selectionHandler.selectObject(this.body.nodes[e]));let a=this.getPointer(e.center);this.selectionHandler.commitAndEmit(a,e),this.selectionHandler.generateClickEvent(`dragEnd`,e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit(`_requestRedraw`)}else{let t=this.drag.selection;t&&t.length?(V(t).call(t,function(e){e.node.options.fixed.x=e.xFixed,e.node.options.fixed.y=e.yFixed}),this.selectionHandler.generateClickEvent(`dragEnd`,e,this.getPointer(e.center)),this.body.emitter.emit(`startSimulation`)):(this.selectionHandler.generateClickEvent(`dragEnd`,e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit(`_requestRedraw`))}}onPinch(e){let t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);let n=this.pinch.scale*e.scale;this.zoom(n,t)}zoom(e,t){if(this.options.zoomView===!0){let n=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let r;this.drag!==void 0&&this.drag.dragging===!0&&(r=this.canvas.DOMtoCanvas(this.drag.pointer));let i=this.body.view.translation,a=e/n,o=(1-a)*t.x+i.x*a,s=(1-a)*t.y+i.y*a;if(this.body.view.scale=e,this.body.view.translation={x:o,y:s},r!=null){let e=this.canvas.canvasToDOM(r);this.drag.pointer.x=e.x,this.drag.pointer.y=e.y}this.body.emitter.emit(`_requestRedraw`),n<e?this.body.emitter.emit(`zoom`,{direction:`+`,scale:this.body.view.scale,pointer:t}):this.body.emitter.emit(`zoom`,{direction:`-`,scale:this.body.view.scale,pointer:t})}}onMouseWheel(e){if(this.options.zoomView===!0){if(e.deltaY!==0){let t=this.body.view.scale;t*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);let n=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(t,n)}e.preventDefault()}}onMouseMove(e){let t=this.getPointer({x:e.clientX,y:e.clientY}),n=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(t),this.popup.hidden===!1&&(n=!0,this.popup.setPosition(t.x+3,t.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),n===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=PL(()=>this._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){let t=this.canvas._XconvertDOMtoCanvas(e.x),n=this.canvas._YconvertDOMtoCanvas(e.y),r={left:t,top:n,right:t,bottom:n},i=this.popupObj===void 0?void 0:this.popupObj.id,a=!1,o=`node`;if(this.popupObj===void 0){let e=this.body.nodeIndices,t=this.body.nodes,n,i=[];for(let o=0;o<e.length;o++)n=t[e[o]],n.isOverlappingWith(r)===!0&&(a=!0,n.getTitle()!==void 0&&i.push(e[o]));i.length>0&&(this.popupObj=t[i[i.length-1]],a=!0)}if(this.popupObj===void 0&&a===!1){let e=this.body.edgeIndices,t=this.body.edges,n,i=[];for(let a=0;a<e.length;a++)n=t[e[a]],n.isOverlappingWith(r)===!0&&n.connected===!0&&n.getTitle()!==void 0&&i.push(e[a]);i.length>0&&(this.popupObj=t[i[i.length-1]],o=`edge`)}this.popupObj===void 0?this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit(`hidePopup`)):this.popupObj.id!==i&&(this.popup===void 0&&(this.popup=new vV(this.canvas.frame)),this.popup.popupTargetType=o,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit(`showPopup`,this.popupObj.id))}_checkHidePopup(e){let t=this.selectionHandler._pointerToPositionObject(e),n=!1;if(this.popup.popupTargetType===`node`){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(n=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),n===!0)){let t=this.selectionHandler.getNodeAt(e);n=t===void 0?!1:t.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(n=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));n===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit(`hidePopup`))}},lX={},uX={},dX;function fX(){return dX?uX:(dX=1,LH()(`Set`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},KH()),uX)}var pX;function mX(){return pX?lX:(pX=1,fX(),lX)}var hX={},gX,_X;function vX(){if(_X)return gX;_X=1;var e=qw(),t=TypeError;return gX=function(n){if(typeof n==`object`&&`size`in n&&`has`in n&&`add`in n&&`delete`in n&&`keys`in n)return n;throw new t(e(n)+` is not a set`)},gX}var yX,bX;function xX(){if(bX)return yX;bX=1;var e=Ew(),t=eU(),n=e(`Set`),r=n.prototype;return yX={Set:n,add:t(`add`,1),has:t(`has`,1),remove:t(`delete`,1),proto:r},yX}var SX,CX;function wX(){if(CX)return SX;CX=1;var e=ew();return SX=function(t,n,r){for(var i=r?t:t.iterator,a=t.next,o,s;!(o=e(a,i)).done;)if(s=n(o.value),s!==void 0)return s},SX}var TX,EX;function DX(){if(EX)return TX;EX=1;var e=wX();return TX=function(t,n,r){return r?e(t.keys(),n,!0):t.forEach(n)},TX}var OX,kX;function AX(){if(kX)return OX;kX=1;var e=xX(),t=DX(),n=e.Set,r=e.add;return OX=function(e){var i=new n;return t(e,function(e){r(i,e)}),i},OX}var jX,MX;function NX(){return MX?jX:(MX=1,jX=function(e){return e.size},jX)}var PX,FX;function IX(){return FX?PX:(FX=1,PX=function(e){return{iterator:e,next:e.next,done:!1}},PX)}var LX,RX;function zX(){if(RX)return LX;RX=1;var e=Xw(),t=$T(),n=ew(),r=fE(),i=IX(),a=`Invalid size`,o=RangeError,s=TypeError,c=Math.max,l=function(t,n){this.set=t,this.size=c(n,0),this.has=e(t.has),this.keys=e(t.keys)};return l.prototype={getIterator:function(){return i(t(n(this.keys,this.set)))},includes:function(e){return n(this.has,this.set,e)}},LX=function(e){t(e);var n=+e.size;if(n!==n)throw new s(a);var i=r(n);if(i<0)throw new o(a);return new l(e,i)},LX}var BX,VX;function HX(){if(VX)return BX;VX=1;var e=vX(),t=xX(),n=AX(),r=NX(),i=zX(),a=DX(),o=wX(),s=t.has,c=t.remove;return BX=function(t){var l=e(this),u=i(t),d=n(l);return r(l)<=u.size?a(l,function(e){u.includes(e)&&c(d,e)}):o(u.getIterator(),function(e){s(d,e)&&c(d,e)}),d},BX}var UX,WX;function GX(){return WX?UX:(WX=1,UX=function(){return!1},UX)}var KX;function qX(){if(KX)return hX;KX=1;var e=z(),t=HX(),n=I();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`difference`,function(e){return e.size===0})||n(function(){var e={size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var n=e++>1;return t.has(1)&&t.clear(),{done:n,value:2}}}}},t=new Set([1,2,3,4]);return t.difference(e).size!==3})},{difference:t}),hX}var JX={},YX,XX;function ZX(){if(XX)return YX;XX=1;var e=vX(),t=xX(),n=NX(),r=zX(),i=DX(),a=wX(),o=t.Set,s=t.add,c=t.has;return YX=function(t){var l=e(this),u=r(t),d=new o;return n(l)>u.size?a(u.getIterator(),function(e){c(l,e)&&s(d,e)}):i(l,function(e){u.includes(e)&&s(d,e)}),d},YX}var QX;function $X(){if(QX)return JX;QX=1;var e=z(),t=I(),n=ZX();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`intersection`,function(e){return e.size===2&&e.has(1)&&e.has(2)})||t(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!==`3,2`})},{intersection:n}),JX}var eZ={},tZ,nZ;function rZ(){if(nZ)return tZ;nZ=1;var e=vX(),t=xX().has,n=NX(),r=zX(),i=DX(),a=wX(),o=OH();return tZ=function(s){var c=e(this),l=r(s);if(n(c)<=l.size)return i(c,function(e){if(l.includes(e))return!1},!0)!==!1;var u=l.getIterator();return a(u,function(e){if(t(c,e))return o(u,`normal`,!1)})!==!1},tZ}var iZ;function aZ(){if(iZ)return eZ;iZ=1;var e=z(),t=rZ();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`isDisjointFrom`,function(e){return!e})},{isDisjointFrom:t}),eZ}var oZ={},sZ,cZ;function lZ(){if(cZ)return sZ;cZ=1;var e=vX(),t=NX(),n=DX(),r=zX();return sZ=function(i){var a=e(this),o=r(i);return t(a)>o.size?!1:n(a,function(e){if(!o.includes(e))return!1},!0)!==!1},sZ}var uZ;function dZ(){if(uZ)return oZ;uZ=1;var e=z(),t=lZ();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`isSubsetOf`,function(e){return e})},{isSubsetOf:t}),oZ}var fZ={},pZ,mZ;function hZ(){if(mZ)return pZ;mZ=1;var e=vX(),t=xX().has,n=NX(),r=zX(),i=wX(),a=OH();return pZ=function(o){var s=e(this),c=r(o);if(n(s)<c.size)return!1;var l=c.getIterator();return i(l,function(e){if(!t(s,e))return a(l,`normal`,!1)})!==!1},pZ}var gZ;function _Z(){if(gZ)return fZ;gZ=1;var e=z(),t=hZ();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`isSupersetOf`,function(e){return!e})},{isSupersetOf:t}),fZ}var vZ={},yZ,bZ;function xZ(){if(bZ)return yZ;bZ=1;var e=vX(),t=xX(),n=AX(),r=zX(),i=wX(),a=t.add,o=t.has,s=t.remove;return yZ=function(t){var c=e(this),l=r(t).getIterator(),u=n(c);return i(l,function(e){o(c,e)?s(u,e):a(u,e)}),u},yZ}var SZ,CZ;function wZ(){return CZ?SZ:(CZ=1,SZ=function(e){try{var t=new Set,n=t[e]({size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},`next`,{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}});return n.size===1&&n.values().next().value===4}catch{return!1}},SZ)}var TZ;function EZ(){if(TZ)return vZ;TZ=1;var e=z(),t=xZ(),n=wZ();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`symmetricDifference`)||!n(`symmetricDifference`)},{symmetricDifference:t}),vZ}var DZ={},OZ,kZ;function AZ(){if(kZ)return OZ;kZ=1;var e=vX(),t=xX().add,n=AX(),r=zX(),i=wX();return OZ=function(a){var o=e(this),s=r(a).getIterator(),c=n(o);return i(s,function(e){t(c,e)}),c},OZ}var jZ;function MZ(){if(jZ)return DZ;jZ=1;var e=z(),t=AZ(),n=wZ();return e({target:`Set`,proto:!0,real:!0,forced:!GX()(`union`)||!n(`union`)},{union:t}),DZ}var NZ,PZ;function FZ(){return PZ?NZ:(PZ=1,Dj(),mX(),qX(),$X(),aZ(),dZ(),_Z(),EZ(),MZ(),dU(),NZ=R().Set,NZ)}var IZ,LZ;function RZ(){if(LZ)return IZ;LZ=1;var e=FZ();return Mj(),IZ=e,IZ}var zZ,BZ;function VZ(){return BZ?zZ:(BZ=1,zZ=RZ(),zZ)}var HZ=F(VZ()),UZ={},WZ={},GZ,KZ;function qZ(){if(KZ)return GZ;KZ=1;var e=L(),t=BH(),n=gH().getWeakData,r=PH(),i=$T(),a=fw(),o=xw(),s=jH(),c=yk(),l=bT(),u=gk(),d=u.set,f=u.getterFor,p=c.find,m=c.findIndex,h=e([].splice),g=0,_=function(e){return e.frozen||=new v},v=function(){this.entries=[]},y=function(e,t){return p(e.entries,function(e){return e[0]===t})};return v.prototype={get:function(e){var t=y(this,e);if(t)return t[1]},has:function(e){return!!y(this,e)},set:function(e,t){var n=y(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=m(this.entries,function(t){return t[0]===e});return~t&&h(this.entries,t,1),!!~t}},GZ={getConstructor:function(e,c,u,p){var m=e(function(e,t){r(e,h),d(e,{type:c,id:g++,frozen:null}),a(t)||s(t,e[p],{that:e,AS_ENTRIES:u})}),h=m.prototype,v=f(c),y=function(e,t,r){var a=v(e),o=n(i(t),!0);return o===!0?_(a).set(t,r):o[a.id]=r,e};return t(h,{delete:function(e){var t=v(this);if(!o(e))return!1;var r=n(e);return r===!0?_(t).delete(e):r&&l(r,t.id)&&delete r[t.id]},has:function(e){var t=v(this);if(!o(e))return!1;var r=n(e);return r===!0?_(t).has(e):r&&l(r,t.id)}}),t(h,u?{get:function(e){var t=v(this);if(o(e)){var r=n(e);if(r===!0)return _(t).get(e);if(r)return r[t.id]}},set:function(e,t){return y(this,e,t)}}:{add:function(e){return y(this,e,!0)}}),m}},GZ}var JZ;function YZ(){if(JZ)return WZ;JZ=1;var e=mH(),t=OC(),n=L(),r=BH(),i=gH(),a=LH(),o=qZ(),s=xw(),c=gk().enforce,l=I(),u=pk(),d=Object,f=Array.isArray,p=d.isExtensible,m=d.isFrozen,h=d.isSealed,g=d.freeze,_=d.seal,v=!t.ActiveXObject&&`ActiveXObject`in t,y,b=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},x=a(`WeakMap`,b,o),S=x.prototype,C=n(S.set),w=function(){return e&&l(function(){var e=g([]);return C(new x,e,1),!m(e)})};if(u)if(v){y=o.getConstructor(b,`WeakMap`,!0),i.enable();var T=n(S.delete),E=n(S.has),D=n(S.get);r(S,{delete:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,T(this,e)||t.frozen.delete(e)}return T(this,e)},has:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,E(this,e)||t.frozen.has(e)}return E(this,e)},get:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,E(this,e)?D(this,e):t.frozen.get(e)}return D(this,e)},set:function(e,t){if(s(e)&&!p(e)){var n=c(this);n.frozen||=new y,E(this,e)?C(this,e,t):n.frozen.set(e,t)}else C(this,e,t);return this}})}else w()&&r(S,{set:function(e,t){var n;return f(e)&&(m(e)?n=g:h(e)&&(n=_)),C(this,e,t),n&&n(e),this}});return WZ}var XZ;function ZZ(){return XZ?UZ:(XZ=1,YZ(),UZ)}var QZ,$Z;function eQ(){return $Z?QZ:($Z=1,Dj(),ZZ(),QZ=R().WeakMap,QZ)}var tQ,nQ;function rQ(){if(nQ)return tQ;nQ=1;var e=eQ();return Mj(),tQ=e,tQ}var iQ,aQ;function oQ(){return aQ?iQ:(aQ=1,iQ=rQ(),iQ)}var sQ=F(oQ());function cQ(e,t,n){lQ(e,t),t.set(e,n)}function lQ(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function uQ(e,t,n){return e.set(dQ(e,t),n),n}function J(e,t){return e.get(dQ(e,t))}function dQ(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function fQ(e,t){let n=new HZ;for(let r of t)e.has(r)||n.add(r);return n}var pQ=new sQ,mQ=new sQ,hQ=class{constructor(){cQ(this,pQ,new HZ),cQ(this,mQ,new HZ)}get size(){return J(mQ,this).size}add(){var e=[...arguments];for(let t of e)J(mQ,this).add(t)}delete(){var e=[...arguments];for(let t of e)J(mQ,this).delete(t)}clear(){J(mQ,this).clear()}getSelection(){return[...J(mQ,this)]}getChanges(){return{added:[...fQ(J(pQ,this),J(mQ,this))],deleted:[...fQ(J(mQ,this),J(pQ,this))],previous:[...new HZ(J(pQ,this))],current:[...new HZ(J(mQ,this))]}}commit(){let e=this.getChanges();uQ(pQ,this,J(mQ,this)),uQ(mQ,this,new HZ(J(pQ,this)));for(let t of e.added)t.select();for(let t of e.deleted)t.unselect();return e}},gQ=new sQ,_Q=new sQ,vQ=new sQ,yQ=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};cQ(this,gQ,new hQ),cQ(this,_Q,new hQ),cQ(this,vQ,void 0),uQ(vQ,this,e)}get sizeNodes(){return J(gQ,this).size}get sizeEdges(){return J(_Q,this).size}getNodes(){return J(gQ,this).getSelection()}getEdges(){return J(_Q,this).getSelection()}addNodes(){J(gQ,this).add(...arguments)}addEdges(){J(_Q,this).add(...arguments)}deleteNodes(e){J(gQ,this).delete(e)}deleteEdges(e){J(_Q,this).delete(e)}clear(){J(gQ,this).clear(),J(_Q,this).clear()}commit(){let e={nodes:J(gQ,this).commit(),edges:J(_Q,this).commit()};var t=[...arguments];return J(vQ,this).call(this,e,...t),e}},bQ=class{constructor(e,t){this.body=e,this.canvas=t,this._selectionAccumulator=new yQ,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},eD(this.options,this.defaultOptions),this.body.emitter.on(`_dataChanged`,()=>{this.updateSelection()})}setOptions(e){e!==void 0&&zB([`multiselect`,`hoverConnectedEdges`,`selectable`,`selectConnectedEdges`],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){let n=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),n!==void 0&&(t=this.selectObject(n)),this.body.emitter.emit(`_requestRedraw`)}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){let n=this.getNodeAt(e)||this.getEdgeAt(e);n!==void 0&&(t=!0,n.isSelected()===!0?this.deselectObject(n):this.selectObject(n),this.body.emitter.emit(`_requestRedraw`))}return t}_initBaseEvent(e,t){let n={};return n.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},n.event=e,n}generateClickEvent(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,a=this._initBaseEvent(t,n);if(i===!0)a.nodes=[],a.edges=[];else{let e=this.getSelection();a.nodes=e.nodes,a.edges=e.edges}r!==void 0&&(a.previousSelection=r),e==`click`&&(a.items=this.getClickedItems(n)),t.controlEdge!==void 0&&(a.controlEdge=t.controlEdge),this.body.emitter.emit(e,a)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e===void 0?!1:(e instanceof zJ?(t===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0)}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){let t=[],n=this.body.nodes;for(let r=0;r<this.body.nodeIndices.length;r++){let i=this.body.nodeIndices[r];n[i].isOverlappingWith(e)&&t.push(i)}return t}_pointerToPositionObject(e){let t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}getNodeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this._pointerToPositionObject(e),r=this._getAllNodesOverlappingWith(n);if(r.length>0)return t===!0?this.body.nodes[r[r.length-1]]:r[r.length-1]}_getEdgesOverlappingWith(e,t){let n=this.body.edges;for(let r=0;r<this.body.edgeIndices.length;r++){let i=this.body.edgeIndices[r];n[i].isOverlappingWith(e)&&t.push(i)}}_getAllEdgesOverlappingWith(e){let t=[];return this._getEdgesOverlappingWith(e,t),t}getEdgeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this.canvas.DOMtoCanvas(e),r=10,i=null,a=this.body.edges;for(let e=0;e<this.body.edgeIndices.length;e++){let t=this.body.edgeIndices[e],o=a[t];if(o.connected){let e=o.from.x,a=o.from.y,s=o.to.x,c=o.to.y,l=o.edgeType.getDistanceToEdge(e,a,s,c,n.x,n.y);l<r&&(i=t,r=l)}}if(i!==null)return t===!0?this.body.edges[i]:i}_addToHover(e){e instanceof zJ?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof zJ?(this._selectionAccumulator.deleteNodes(e),this._selectionAccumulator.deleteEdges(...e.edges)):this._selectionAccumulator.deleteEdges(e)}unselectAll(){this._selectionAccumulator.clear()}getSelectedNodeCount(){return this._selectionAccumulator.sizeNodes}getSelectedEdgeCount(){return this._selectionAccumulator.sizeEdges}_hoverConnectedEdges(e){for(let t=0;t<e.edges.length;t++){let n=e.edges[t];n.hover=!0,this._addToHover(n)}}emitBlurEvent(e,t,n){let r=this._initBaseEvent(e,t);n.hover===!0&&(n.hover=!1,n instanceof zJ?(r.node=n.id,this.body.emitter.emit(`blurNode`,r)):(r.edge=n.id,this.body.emitter.emit(`blurEdge`,r)))}emitHoverEvent(e,t,n){let r=this._initBaseEvent(e,t),i=!1;return n.hover===!1&&(n.hover=!0,this._addToHover(n),i=!0,n instanceof zJ?(r.node=n.id,this.body.emitter.emit(`hoverNode`,r)):(r.edge=n.id,this.body.emitter.emit(`hoverEdge`,r))),i}hoverObject(e,t){let n=this.getNodeAt(t);n===void 0&&(n=this.getEdgeAt(t));let r=!1;for(let i in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,i)&&(n===void 0||n instanceof zJ&&n.id!=i||n instanceof TY)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[i]),delete this.hoverObj.nodes[i],r=!0);for(let i in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,i)&&(r===!0?(this.hoverObj.edges[i].hover=!1,delete this.hoverObj.edges[i]):(n===void 0||n instanceof TY&&n.id!=i||n instanceof zJ&&!n.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[i]),delete this.hoverObj.edges[i],r=!0));if(n!==void 0){let i=KM(this.hoverObj.edges).length,a=KM(this.hoverObj.nodes).length,o=n instanceof TY&&i===0&&a===0,s=n instanceof zJ&&i===0&&a===0;(r||o||s)&&(r=this.emitHoverEvent(e,t,n)),n instanceof zJ&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(n)}r===!0&&this.body.emitter.emit(`_requestRedraw`)}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,t){let n=!1,r=this._selectionAccumulator.commit(),i={nodes:r.nodes.previous,edges:r.edges.previous};r.edges.deleted.length>0&&(this.generateClickEvent(`deselectEdge`,t,e,i),n=!0),r.nodes.deleted.length>0&&(this.generateClickEvent(`deselectNode`,t,e,i),n=!0),r.nodes.added.length>0&&(this.generateClickEvent(`selectNode`,t,e),n=!0),r.edges.added.length>0&&(this.generateClickEvent(`selectEdge`,t,e),n=!0),n===!0&&this.generateClickEvent(`select`,t,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return NM(e=this._selectionAccumulator.getNodes()).call(e,e=>e.id)}getSelectedEdgeIds(){var e;return NM(e=this._selectionAccumulator.getEdges()).call(e,e=>e.id)}setSelection(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw TypeError(`Selection must be an object with nodes and/or edges properties`);if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(let n of e.nodes){let e=this.body.nodes[n];if(!e)throw RangeError(`Node with id "`+n+`" not found`);this.selectObject(e,t.highlightEdges)}if(e.edges)for(let t of e.edges){let e=this.body.edges[t];if(!e)throw RangeError(`Edge with id "`+t+`" not found`);this.selectObject(e)}this.body.emitter.emit(`_requestRedraw`),this._selectionAccumulator.commit()}selectNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw`Selection must be an array with ids`;this.setSelection({nodes:e},{highlightEdges:t})}selectEdges(e){if(!e||e.length===void 0)throw`Selection must be an array with ids`;this.setSelection({edges:e})}updateSelection(){for(let e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(let e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){let t=this.canvas.DOMtoCanvas(e),n=[],r=this.body.nodeIndices,i=this.body.nodes;for(let e=r.length-1;e>=0;e--){let a=i[r[e]].getItemsOnPoint(t);n.push.apply(n,a)}let a=this.body.edgeIndices,o=this.body.edges;for(let e=a.length-1;e>=0;e--){let r=o[a[e]].getItemsOnPoint(t);n.push.apply(n,r)}return n}},xQ={},SQ,CQ;function wQ(){if(CQ)return SQ;CQ=1;var e=iD(),t=Math.floor,n=function(r,i){var a=r.length;if(a<8)for(var o=1,s,c;o<a;){for(c=o,s=r[o];c&&i(r[c-1],s)>0;)r[c]=r[--c];c!==o++&&(r[c]=s)}else for(var l=t(a/2),u=n(e(r,0,l),i),d=n(e(r,l),i),f=u.length,p=d.length,m=0,h=0;m<f||h<p;)r[m+h]=m<f&&h<p?i(u[m],d[h])<=0?u[m++]:d[h++]:m<f?u[m++]:d[h++];return r};return SQ=n,SQ}var TQ,EQ;function DQ(){if(EQ)return TQ;EQ=1;var e=Mw().match(/firefox\/(\d+)/i);return TQ=!!e&&+e[1],TQ}var OQ,kQ;function AQ(){if(kQ)return OQ;kQ=1;var e=Mw();return OQ=/MSIE|Trident/.test(e),OQ}var jQ,MQ;function NQ(){if(MQ)return jQ;MQ=1;var e=Mw().match(/AppleWebKit\/(\d+)\./);return jQ=!!e&&+e[1],jQ}var PQ;function FQ(){if(PQ)return xQ;PQ=1;var e=z(),t=L(),n=Xw(),r=_T(),i=xE(),a=YN(),o=TO(),s=I(),c=wQ(),l=lN(),u=DQ(),d=AQ(),f=Fw(),p=NQ(),m=[],h=t(m.sort),g=t(m.push),_=s(function(){m.sort(void 0)}),v=s(function(){m.sort(null)}),y=l(`sort`),b=!s(function(){if(f)return f<70;if(!(u&&u>3)){if(d)return!0;if(p)return p<603;var e=``,t,n,r,i;for(t=65;t<76;t++){switch(n=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(i=0;i<47;i++)m.push({k:n+i,v:r})}for(m.sort(function(e,t){return t.v-e.v}),i=0;i<m.length;i++)n=m[i].k.charAt(0),e.charAt(e.length-1)!==n&&(e+=n);return e!==`DGBEFHACIJK`}}),x=_||!v||!y||!b,S=function(e){return function(t,n){return n===void 0?-1:t===void 0?1:e===void 0?o(t)>o(n)?1:-1:+e(t,n)||0}};return e({target:`Array`,proto:!0,forced:x},{sort:function(e){e!==void 0&&n(e);var t=r(this);if(b)return e===void 0?h(t):h(t,e);var o=[],s=i(t),l,u;for(u=0;u<s;u++)u in t&&g(o,t[u]);for(c(o,S(e)),l=i(o),u=0;u<l;)t[u]=o[u++];for(;u<s;)a(t,u++);return t}}),xQ}var IQ,LQ;function RQ(){return LQ?IQ:(LQ=1,FQ(),IQ=fD()(`Array`,`sort`),IQ)}var zQ,BQ;function VQ(){if(BQ)return zQ;BQ=1;var e=kw(),t=RQ(),n=Array.prototype;return zQ=function(r){var i=r.sort;return r===n||e(n,r)&&i===n.sort?t:i},zQ}var HQ,UQ;function WQ(){return UQ?HQ:(UQ=1,HQ=VQ(),HQ)}var GQ,KQ;function qQ(){return KQ?GQ:(KQ=1,GQ=WQ(),GQ)}var JQ=F(qQ()),YQ={},XQ,ZQ;function QQ(){if(ZQ)return XQ;ZQ=1;var e=Xw(),t=_T(),n=lw(),r=xE(),i=TypeError,a=`Reduce of empty array with no initial value`,o=function(o){return function(s,c,l,u){var d=t(s),f=n(d),p=r(d);if(e(c),p===0&&l<2)throw new i(a);var m=o?p-1:0,h=o?-1:1;if(l<2)for(;;){if(m in f){u=f[m],m+=h;break}if(m+=h,o?m<0:p<=m)throw new i(a)}for(;o?m>=0:p>m;m+=h)m in f&&(u=c(u,f[m],m,d));return u}};return XQ={left:o(!1),right:o(!0)},XQ}var $Q,e$;function t$(){return e$?$Q:(e$=1,$Q=mL()===`NODE`,$Q)}var n$;function r$(){if(n$)return YQ;n$=1;var e=z(),t=QQ().left,n=lN(),r=Fw();return e({target:`Array`,proto:!0,forced:!t$()&&r>79&&r<83||!n(`reduce`)},{reduce:function(e){var n=arguments.length;return t(this,e,n,n>1?arguments[1]:void 0)}}),YQ}var i$,a$;function o$(){return a$?i$:(a$=1,r$(),i$=fD()(`Array`,`reduce`),i$)}var s$,c$;function l$(){if(c$)return s$;c$=1;var e=kw(),t=o$(),n=Array.prototype;return s$=function(r){var i=r.reduce;return r===n||e(n,r)&&i===n.reduce?t:i},s$}var u$,d$;function f$(){return d$?u$:(d$=1,u$=l$(),u$)}var p$,m$;function h$(){return m$?p$:(m$=1,p$=f$(),p$)}var g$=F(h$()),_$=class{abstract(){throw Error(`Can't instantiate abstract class!`)}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,n),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,t){this.fake_use(e,t),this.abstract()}shift(e,t){this.fake_use(e,t),this.abstract()}},v$=class extends _${constructor(e){super(),this.layout=e}curveType(){return`horizontal`}getPosition(e){return e.x}setPosition(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;n!==void 0&&this.layout.hierarchical.addToOrdering(e,n),e.x=t}getTreeSize(e){let t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}sort(e){JQ(e).call(e,function(e,t){return e.x-t.x})}fix(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}shift(e,t){this.layout.body.nodes[e].x+=t}},y$=class extends _${constructor(e){super(),this.layout=e}curveType(){return`vertical`}getPosition(e){return e.y}setPosition(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;n!==void 0&&this.layout.hierarchical.addToOrdering(e,n),e.y=t}getTreeSize(e){let t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}sort(e){JQ(e).call(e,function(e,t){return e.y-t.y})}fix(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}shift(e,t){this.layout.body.nodes[e].y+=t}},b$={},x$;function S$(){if(x$)return b$;x$=1;var e=z(),t=yk().every;return e({target:`Array`,proto:!0,forced:!lN()(`every`)},{every:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),b$}var C$,w$;function T$(){return w$?C$:(w$=1,S$(),C$=fD()(`Array`,`every`),C$)}var E$,D$;function O$(){if(D$)return E$;D$=1;var e=kw(),t=T$(),n=Array.prototype;return E$=function(r){var i=r.every;return r===n||e(n,r)&&i===n.every?t:i},E$}var k$,A$;function j$(){return A$?k$:(A$=1,k$=O$(),k$)}var M$,N$;function P$(){return N$?M$:(N$=1,M$=j$(),M$)}var F$=F(P$());function I$(e,t){let n=new HZ;return V(e).call(e,e=>{var t;V(t=e.edges).call(t,e=>{e.connected&&n.add(e)})}),V(n).call(n,e=>{let n=e.from.id,r=e.to.id;t[n]??(t[n]=0),(t[r]==null||t[n]>=t[r])&&(t[r]=t[n]+1)}),t}function L$(e){return z$(t=>{var n,r;return F$(n=kF(r=t.edges).call(r,t=>e.has(t.toId))).call(n,e=>e.to===t)},(e,t)=>t>e,`from`,e)}function R$(e){return z$(t=>{var n,r;return F$(n=kF(r=t.edges).call(r,t=>e.has(t.toId))).call(n,e=>e.from===t)},(e,t)=>t<e,`to`,e)}function z$(e,t,n,r){var i;let a=VI(null),o=g$(i=[...lJ(r).call(r)]).call(i,(e,t)=>e+1+t.edges.length,0),s=n+`Id`,c=n===`to`?1:-1;for(let[i,d]of r){if(!r.has(i)||!e(d))continue;a[i]=0;let f=[d],p=0,m;for(;m=f.pop();){var l,u;if(!r.has(i))continue;let e=a[m.id]+c;if(V(l=kF(u=m.edges).call(u,e=>e.connected&&e.to!==e.from&&e[n]!==m&&r.has(e.toId)&&r.has(e.fromId))).call(l,r=>{let i=r[s],o=a[i];(o==null||t(e,o))&&(a[i]=e,f.push(r[n]))}),p>o)return I$(r,a);++p}}return a}var B$=class{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}checkIfTree(){for(let e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){let t={},n=e=>{if(t[e]!==void 0)return t[e];let r=this.levels[e];if(this.childrenReference[e]){let t=this.childrenReference[e];if(t.length>0)for(let e=0;e<t.length;e++)r=Math.max(r,n(t[e]))}return t[e]=r,r};return n(e)}levelDownstream(e,t){this.levels[t.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[t.id]=this.levels[e.id]+1)}setMinLevelToZero(){var e;let t=new xU,n=0,r=JQ(e=[...new HZ(GF(this.levels))]).call(e,(e,t)=>e-t);for(let e of r)t.set(e,n++);for(let e in this.levels)Object.prototype.hasOwnProperty.call(this.levels,e)&&(this.levels[e]=t.get(this.levels[e]))}getTreeSize(e,t){let n=1e9,r=-1e9,i=1e9,a=-1e9;for(let o in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,o)&&this.trees[o]===t){let t=e[o];n=Math.min(t.x,n),r=Math.max(t.x,r),i=Math.min(t.y,i),a=Math.max(t.y,a)}return{min_x:n,max_x:r,min_y:i,max_y:a}}hasSameParent(e,t){let n=this.parentReference[e.id],r=this.parentReference[t.id];if(n===void 0||r===void 0)return!1;for(let e=0;e<n.length;e++)for(let t=0;t<r.length;t++)if(n[e]==r[t])return!0;return!1}inSameSubNetwork(e,t){return this.trees[e.id]===this.trees[t.id]}getLevels(){return KM(this.distributionOrdering)}addToOrdering(e,t){this.distributionOrdering[t]===void 0&&(this.distributionOrdering[t]=[]);let n=!1,r=this.distributionOrdering[t];for(let t in r)if(r[t]===e){n=!0;break}n||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}},V$=class{constructor(e){this.body=e,this._resetRNG(Math.random()+`:`+aN()),this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:`UD`,sortMethod:`hubsize`}},eD(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on(`_dataChanged`,()=>{this.setupHierarchicalLayout()}),this.body.emitter.on(`_dataLoaded`,()=>{this.layoutNetwork()}),this.body.emitter.on(`_resetHierarchicalLayout`,()=>{this.setupHierarchicalLayout()}),this.body.emitter.on(`_adjustEdgesForHierarchicalLayout`,()=>{if(this.options.hierarchical.enabled!==!0)return;let e=this.direction.curveType();this.body.emitter.emit(`_forceDisableDynamicCurves`,e,!1)})}setOptions(e,t){if(e!==void 0){let n=this.options.hierarchical,r=n.enabled;if(zB([`randomSeed`,`improvedLayout`,`clusterThreshold`],this.options,e),rV(this.options,e,`hierarchical`),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),n.enabled===!0)return r===!0&&this.body.emitter.emit(`refresh`,!0),n.direction===`RL`||n.direction===`DU`?n.levelSeparation>0&&(n.levelSeparation*=-1):n.levelSeparation<0&&(n.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit(`_resetHierarchicalLayout`),this.adaptAllOptionsForHierarchicalLayout(t);if(r===!0)return this.body.emitter.emit(`refresh`),U(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=SB(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){let t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:`hierarchicalRepulsion`},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||`barnesHut`):typeof e.physics==`object`?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||`barnesHut`,e.physics.solver=`hierarchicalRepulsion`):e.physics!==!1&&(t.solver=`barnesHut`,e.physics={solver:`hierarchicalRepulsion`});let n=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:`dynamic`}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:`dynamic`}},e.edges.smooth=!1;else if(typeof e.edges.smooth==`boolean`)this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:n};else{let t=e.edges.smooth;t.type!==void 0&&t.type!==`dynamic`&&(n=t.type),this.optionsBackup.edges={smooth:{enabled:t.enabled===void 0?!0:t.enabled,type:t.type===void 0?`dynamic`:t.type,roundness:t.roundness===void 0?.5:t.roundness,forceDirection:t.forceDirection===void 0?!1:t.forceDirection}},e.edges.smooth={enabled:t.enabled===void 0?!0:t.enabled,type:n,roundness:t.roundness===void 0?.5:t.roundness,forceDirection:t.forceDirection===void 0?!1:t.forceDirection}}this.body.emitter.emit(`_forceDisableDynamicCurves`,n)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);let t=e.length+50;for(let n=0;n<e.length;n++){let r=e[n],i=2*Math.PI*this._rng();r.x===void 0&&(r.x=t*Math.cos(i)),r.y===void 0&&(r.y=t*Math.sin(i))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){let e=this.body.nodeIndices,t=0;for(let n=0;n<e.length;n++)this.body.nodes[e[n]].predefinedPosition===!0&&(t+=1);if(t<.5*e.length){let t=0,n=this.options.clusterThreshold,r={clusterNodeProperties:{shape:`ellipse`,label:``,group:``,font:{multi:!1}},clusterEdgeProperties:{label:``,font:{multi:!1},smooth:{enabled:!1}}};if(e.length>n){let i=e.length;for(;e.length>n&&t<=10;){t+=1;let n=e.length;if(t%3==0?this.body.modules.clustering.clusterBridges(r):this.body.modules.clustering.clusterOutliers(r),n==e.length&&t%3!=0){this._declusterAll(),this.body.emitter.emit(`_layoutFailed`),console.info(`This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.`);return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*i)})}t>10&&console.info(`The clustering didn't succeed within the amount of interations allowed, progressing with partial result.`),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();for(let t=0;t<e.length;t++){let n=this.body.nodes[e[t]];n.predefinedPosition===!1&&(n.x+=(.5-this._rng())*70,n.y+=(.5-this._rng())*70)}this._declusterAll(),this.body.emitter.emit(`_repositionBezierNodes`)}}}_shiftToCenter(){let e=WY.getRangeCore(this.body.nodes,this.body.nodeIndices),t=WY.findCenter(e);for(let e=0;e<this.body.nodeIndices.length;e++){let n=this.body.nodes[this.body.nodeIndices[e]];n.x-=t.x,n.y-=t.y}}_declusterAll(){let e=!0;for(;e===!0;){e=!1;for(let t=0;t<this.body.nodeIndices.length;t++)this.body.nodes[this.body.nodeIndices[t]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));e===!0&&this.body.emitter.emit(`_dataChanged`)}}getSeed(){return this.initialRandomSeed}setupHierarchicalLayout(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){let e,t,n=!1,r=!1;for(t in this.lastNodeOnLevel={},this.hierarchical=new B$,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level===void 0?r=!0:(n=!0,this.hierarchical.levels[t]=e.options.level));if(r===!0&&n===!0)throw Error(`To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.`);{if(r===!0){let e=this.options.hierarchical.sortMethod;e===`hubsize`?this._determineLevelsByHubsize():e===`directed`?this._determineLevelsDirected():e===`custom`&&this._determineLevelsCustomCallback()}for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this.hierarchical.ensureLevel(e);let e=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(e),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1,n={},r=()=>{let e=a(),t=0;for(let n=0;n<e.length-1;n++){let r=e[n].max-e[n+1].min;t+=r+this.options.hierarchical.treeSpacing,i(n+1,t)}},i=(e,t)=>{let n=this.hierarchical.trees;for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e&&this.direction.shift(r,t)},a=()=>{let e=[];for(let t=0;t<this.hierarchical.numTrees();t++)e.push(this.direction.getTreeSize(t));return e},o=(e,t)=>{if(!t[e.id]&&(t[e.id]=!0,this.hierarchical.childrenReference[e.id])){let n=this.hierarchical.childrenReference[e.id];if(n.length>0)for(let e=0;e<n.length;e++)o(this.body.nodes[n[e]],t)}},s=function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,r=1e9,i=1e9,a=1e9,o=-1e9;for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s)){let c=e.body.nodes[s],l=e.hierarchical.levels[c.id],u=e.direction.getPosition(c),[d,f]=e._getSpaceAroundNode(c,t);r=Math.min(d,r),i=Math.min(f,i),l<=n&&(a=Math.min(u,a),o=Math.max(u,o))}return[a,o,r,i]},c=(e,t)=>{let n=this.hierarchical.getMaxLevel(e.id),r=this.hierarchical.getMaxLevel(t.id);return Math.min(n,r)},l=(e,t,n)=>{let r=this.hierarchical;for(let i=0;i<t.length;i++){let a=t[i],o=r.distributionOrdering[a];if(o.length>1)for(let t=0;t<o.length-1;t++){let i=o[t],a=o[t+1];r.hasSameParent(i,a)&&r.inSameSubNetwork(i,a)&&e(i,a,n)}}},u=function(n,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=e.direction.getPosition(n),l=e.direction.getPosition(r),u=Math.abs(l-a),d=e.options.hierarchical.nodeSpacing;if(u>d){let a={},l={};o(n,a),o(r,l);let u=c(n,r),f=s(a,u),p=s(l,u),m=f[1],h=p[0],g=p[2];if(Math.abs(m-h)>d){let n=m-h+d;n<-g+d&&(n=-g+d),n<0&&(e._shiftBlock(r.id,n),t=!0,i===!0&&e._centerParent(r))}}},d=(e,r)=>{let i=r.id,a=r.edges,c=this.hierarchical.levels[r.id],l=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,u={},d=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.toId!=t.fromId){let n=t.toId==i?t.from:t.to;u[a[e].id]=n,this.hierarchical.levels[n.id]<c&&d.push(t)}}let f=(e,t)=>{let n=0;for(let r=0;r<t.length;r++)if(u[t[r].id]!==void 0){let i=this.direction.getPosition(u[t[r].id])-e;n+=i/Math.sqrt(i*i+l)}return n},p=(e,t)=>{let n=0;for(let r=0;r<t.length;r++)if(u[t[r].id]!==void 0){let i=this.direction.getPosition(u[t[r].id])-e;n-=l*(i*i+l)**-1.5}return n},m=(e,t)=>{let n=this.direction.getPosition(r),i={};for(let r=0;r<e;r++){let e=f(n,t),a=p(n,t),o=Math.max(-40,Math.min(40,Math.round(e/a)));if(n-=o,i[n]!==void 0)break;i[n]=r}return n},h=e=>{let i=this.direction.getPosition(r);if(n[r.id]===void 0){let e={};o(r,e),n[r.id]=e}let a=s(n[r.id]),c=a[2],l=a[3],u=e-i,d=0;u>0?d=Math.min(u,l-this.options.hierarchical.nodeSpacing):u<0&&(d=-Math.min(-u,c-this.options.hierarchical.nodeSpacing)),d!=0&&(this._shiftBlock(r.id,d),t=!0)},g=e=>{let n=this.direction.getPosition(r),[i,a]=this._getSpaceAroundNode(r),o=e-n,s=n;o>0?s=Math.min(n+(a-this.options.hierarchical.nodeSpacing),e):o<0&&(s=Math.max(n-(i-this.options.hierarchical.nodeSpacing),e)),s!==n&&(this.direction.setPosition(r,s),t=!0)},_=m(e,d);h(_),_=m(e,a),g(_)};this.options.hierarchical.blockShifting===!0&&((e=>{let n=this.hierarchical.getLevels();n=HN(n).call(n);for(let r=0;r<e&&(t=!1,l(u,n,!0),t===!0);r++);})(5),(()=>{for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this._centerParent(this.body.nodes[e])})()),this.options.hierarchical.edgeMinimization===!0&&(e=>{let n=this.hierarchical.getLevels();n=HN(n).call(n);for(let r=0;r<e;r++){t=!1;for(let e=0;e<n.length;e++){let t=n[e],r=this.hierarchical.distributionOrdering[t];for(let e=0;e<r.length;e++)d(1e3,r[e])}if(t!==!0)break}})(20),this.options.hierarchical.parentCentralization===!0&&(()=>{let e=this.hierarchical.getLevels();e=HN(e).call(e);for(let t=0;t<e.length;t++){let n=e[t],r=this.hierarchical.distributionOrdering[n];for(let e=0;e<r.length;e++)this._centerParent(r[e])}})(),r()}_getSpaceAroundNode(e,t){let n=!0;t===void 0&&(n=!1);let r=this.hierarchical.levels[e.id];if(r!==void 0){let i=this.hierarchical.distributionIndex[e.id],a=this.direction.getPosition(e),o=this.hierarchical.distributionOrdering[r],s=1e9,c=1e9;if(i!==0){let e=o[i-1];(n===!0&&t[e.id]===void 0||n===!1)&&(s=a-this.direction.getPosition(e))}if(i!=o.length-1){let e=o[i+1];if(n===!0&&t[e.id]===void 0||n===!1){let t=this.direction.getPosition(e);c=Math.min(c,t-a)}}return[s,c]}else return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){let t=this.hierarchical.parentReference[e.id];for(let e=0;e<t.length;e++){let n=t[e],r=this.body.nodes[n],i=this.hierarchical.childrenReference[n];if(i!==void 0){let e=this._getCenterPosition(i),t=this.direction.getPosition(r),[n,a]=this._getSpaceAroundNode(r),o=t-e;(o<0&&Math.abs(o)<a-this.options.hierarchical.nodeSpacing||o>0&&Math.abs(o)<n-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(r,e)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var t;let r=KM(e[n]);r=this._indexArrayToNodes(r),JQ(t=this.direction).call(t,r);let i=0;for(let e=0;e<r.length;e++){let t=r[e];if(this.positionedNodes[t.id]===void 0){let a=this.options.hierarchical.nodeSpacing,o=a*i;i>0&&(o=this.direction.getPosition(r[e-1])+a),this.direction.setPosition(t,o,n),this._validatePositionAndContinue(t,n,o),i++}}}}_placeBranchNodes(e,t){var n;let r=this.hierarchical.childrenReference[e];if(r===void 0)return;let i=[];for(let e=0;e<r.length;e++)i.push(this.body.nodes[r[e]]);JQ(n=this.direction).call(n,i);for(let n=0;n<i.length;n++){let r=i[n],a=this.hierarchical.levels[r.id];if(a>t&&this.positionedNodes[r.id]===void 0){let t=this.options.hierarchical.nodeSpacing,o;o=n===0?this.direction.getPosition(this.body.nodes[e]):this.direction.getPosition(i[n-1])+t,this.direction.setPosition(r,o,a),this._validatePositionAndContinue(r,a,o)}else return}let a=this._getCenterPosition(i);this.direction.setPosition(this.body.nodes[e],a,t)}_validatePositionAndContinue(e,t,n){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){let r=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(n-r<this.options.hierarchical.nodeSpacing){let i=r+this.options.hierarchical.nodeSpacing-n,a=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(a.withChild,i)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}_indexArrayToNodes(e){let t=[];for(let n=0;n<e.length;n++)t.push(this.body.nodes[e[n]]);return t}_getDistribution(){let e={},t,n;for(t in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,t)){n=this.body.nodes[t];let r=this.hierarchical.levels[t]===void 0?0:this.hierarchical.levels[t];this.direction.fix(n,r),e[r]===void 0&&(e[r]={}),e[r][t]=n}return e}_getActiveEdges(e){let t=[];return W(e.edges,e=>{var n;H(n=this.body.edgeIndices).call(n,e.id)!==-1&&t.push(e)}),t}_getHubSizes(){let e={},t=this.body.nodeIndices;W(t,t=>{let n=this.body.nodes[t],r=this._getActiveEdges(n).length;e[r]=!0});let n=[];return W(e,e=>{n.push(Number(e))}),JQ(n).call(n,function(e,t){return t-e}),n}_determineLevelsByHubsize(){let e=(e,t)=>{this.hierarchical.levelDownstream(e,t)},t=this._getHubSizes();for(let n=0;n<t.length;++n){let r=t[n];if(r===0)break;W(this.body.nodeIndices,t=>{let n=this.body.nodes[t];r===this._getActiveEdges(n).length&&this._crawlNetwork(e,t)})}}_determineLevelsCustomCallback(){this._crawlNetwork((e,t,n)=>{let r=this.hierarchical.levels[e.id];r===void 0&&(r=this.hierarchical.levels[e.id]=1e5),WY.cloneOptions(e,`node`),WY.cloneOptions(t,`node`),WY.cloneOptions(n,`edge`),this.hierarchical.levels[t.id]=r+void 0}),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;let t=g$(e=this.body.nodeIndices).call(e,(e,t)=>(e.set(t,this.body.nodes[t]),e),new xU);this.options.hierarchical.shakeTowards===`roots`?this.hierarchical.levels=R$(t):this.hierarchical.levels=L$(t),this.hierarchical.setMinLevelToZero()}_generateMap(){this._crawlNetwork((e,t)=>{this.hierarchical.levels[t.id]>this.hierarchical.levels[e.id]&&this.hierarchical.addRelation(e.id,t.id)}),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0,n={},r=(t,i)=>{if(n[t.id]===void 0){this.hierarchical.setTreeIndex(t,i),n[t.id]=!0;let a,o=this._getActiveEdges(t);for(let n=0;n<o.length;n++){let s=o[n];s.connected===!0&&(a=s.toId==t.id?s.from:s.to,t.id!=a.id&&(e(t,a,s),r(a,i)))}}};if(t===void 0){let e=0;for(let t=0;t<this.body.nodeIndices.length;t++){let i=this.body.nodeIndices[t];if(n[i]===void 0){let t=this.body.nodes[i];r(t,e),e+=1}}}else{let e=this.body.nodes[t];if(e===void 0){console.error(`Node not found:`,t);return}r(e)}}_shiftBlock(e,t){let n={},r=e=>{if(n[e])return;n[e]=!0,this.direction.shift(e,t);let i=this.hierarchical.childrenReference[e];if(i!==void 0)for(let e=0;e<i.length;e++)r(i[e])};r(e)}_findCommonParent(e,t){let n={},r=(e,t)=>{let n=this.hierarchical.parentReference[t];if(n!==void 0)for(let t=0;t<n.length;t++){let i=n[t];e[i]=!0,r(e,i)}},i=(e,t)=>{let n=this.hierarchical.parentReference[t];if(n!==void 0)for(let r=0;r<n.length;r++){let a=n[r];if(e[a]!==void 0)return{foundParent:a,withChild:t};let o=i(e,a);if(o.foundParent!==null)return o}return{foundParent:null,withChild:t}};return r(n,e),i(n,t)}setDirectionStrategy(){this.options.hierarchical.direction===`UD`||this.options.hierarchical.direction===`DU`?this.direction=new v$(this):this.direction=new y$(this)}_getCenterPosition(e){let t=1e9,n=-1e9;for(let r=0;r<e.length;r++){let i;if(e[r].id!==void 0)i=e[r];else{let t=e[r];i=this.body.nodes[t]}let a=this.direction.getPosition(i);t=Math.min(t,a),n=Math.max(n,a)}return .5*(t+n)}},H$=class{constructor(e,t,n,r){var i,a;this.body=e,this.canvas=t,this.selectionHandler=n,this.interactionHandler=r,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:`dot`,size:6,color:{background:`#ff0000`,border:`#3c3c3c`,highlight:{background:`#07f968`,border:`#3c3c3c`}},borderWidth:2,borderWidthSelected:2}},eD(this.options,this.defaultOptions),this.body.emitter.on(`destroy`,()=>{this._clean()}),this.body.emitter.on(`_dataChanged`,B(i=this._restore).call(i,this)),this.body.emitter.on(`_resetData`,B(a=this._restore).call(a,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,n){t!==void 0&&(t.locale===void 0?this.options.locale=n.locale:this.options.locale=t.locale,t.locales===void 0?this.options.locales=n.locales:this.options.locales=t.locales),e!==void 0&&(typeof e==`boolean`?this.options.enabled=e:(this.options.enabled=!0,U(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display=`block`,this.closeDiv.style.display=`block`,this.editModeDiv.style.display=`none`,this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display=`none`,this.closeDiv.style.display=`none`,this.editModeDiv.style.display=`block`,this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,t;this.editMode=!0,this.manipulationDiv.style.display=`block`,this.closeDiv.style.display=`block`;let n=this.selectionHandler.getSelectedNodeCount(),r=this.selectionHandler.getSelectedEdgeCount(),i=n+r,a=this.options.locales[this.options.locale],o=!1;this.options.addNode!==!1&&(this._createAddNodeButton(a),o=!0),this.options.addEdge!==!1&&(o===!0?this._createSeperator(1):o=!0,this._createAddEdgeButton(a)),n===1&&typeof this.options.editNode==`function`?(o===!0?this._createSeperator(2):o=!0,this._createEditNodeButton(a)):r===1&&n===0&&this.options.editEdge!==!1&&(o===!0?this._createSeperator(3):o=!0,this._createEditEdgeButton(a)),i!==0&&(n>0&&this.options.deleteNode!==!1||n===0&&this.options.deleteEdge!==!1)&&(o===!0&&this._createSeperator(4),this._createDeleteButton(a)),this._bindElementEvents(this.closeDiv,B(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent(`select`,B(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit(`_redraw`)}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode=`addNode`,this.guiEnabled===!0){var t;let e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,B(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent(`click`,B(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();let e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode=`editNode`,typeof this.options.editNode==`function`)if(e.isCluster!==!0){let t=U({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length===2)this.options.editNode(t,e=>{e!=null&&this.inMode===`editNode`&&this.body.data.nodes.getDataSet().update(e),this.showManipulatorToolbar()});else throw Error(`The function for edit does not support two arguments (data, callback)`)}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw Error(`No function has been configured to handle the editing of nodes.`);else this.showManipulatorToolbar()}addEdgeMode(){var e,t,n,r,i;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode=`addEdge`,this.guiEnabled===!0){var a;let e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,B(a=this.toggleEditMode).call(a,this))}this._temporaryBindUI(`onTouch`,B(e=this._handleConnect).call(e,this)),this._temporaryBindUI(`onDragEnd`,B(t=this._finishConnect).call(t,this)),this._temporaryBindUI(`onDrag`,B(n=this._dragControlNode).call(n,this)),this._temporaryBindUI(`onRelease`,B(r=this._finishConnect).call(r,this)),this._temporaryBindUI(`onDragStart`,B(i=this._dragStartEdge).call(i,this)),this._temporaryBindUI(`onHold`,()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode=`editEdge`,typeof this.options.editEdge==`object`&&typeof this.options.editEdge.editWithoutDrag==`function`&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){let e=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(e.from.id,e.to.id);return}if(this.guiEnabled===!0){var e;let t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,B(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,n,r,i;let e=this.body.edges[this.edgeBeingEditedId],a=this._getNewTargetNode(e.from.x,e.from.y),o=this._getNewTargetNode(e.to.x,e.to.y);this.temporaryIds.nodes.push(a.id),this.temporaryIds.nodes.push(o.id),this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id),this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id),this._temporaryBindUI(`onTouch`,B(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI(`onTap`,()=>{}),this._temporaryBindUI(`onHold`,()=>{}),this._temporaryBindUI(`onDragStart`,B(n=this._controlNodeDragStart).call(n,this)),this._temporaryBindUI(`onDrag`,B(r=this._controlNodeDrag).call(r,this)),this._temporaryBindUI(`onDragEnd`,B(i=this._controlNodeDragEnd).call(i,this)),this._temporaryBindUI(`onMouseMove`,()=>{}),this._temporaryBindEvent(`beforeDrawing`,t=>{let n=e.edgeType.findBorderPositions(t);a.selected===!1&&(a.x=n.from.x,a.y=n.from.y),o.selected===!1&&(o.x=n.to.x,o.y=n.to.y)}),this.body.emitter.emit(`_redraw`)}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode=`delete`;let e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds(),n;if(e.length>0){for(let t=0;t<e.length;t++)if(this.body.nodes[e[t]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode==`function`&&(n=this.options.deleteNode)}else t.length>0&&typeof this.options.deleteEdge==`function`&&(n=this.options.deleteEdge);if(typeof n==`function`){let r={nodes:e,edges:t};if(n.length===2)n(r,e=>{e!=null&&this.inMode===`delete`?(this.body.data.edges.getDataSet().remove(e.edges),this.body.data.nodes.getDataSet().remove(e.nodes),this.body.emitter.emit(`startSimulation`),this.showManipulatorToolbar()):(this.body.emitter.emit(`startSimulation`),this.showManipulatorToolbar())});else throw Error(`The function for delete does not support two arguments (data, callback)`)}else this.body.data.edges.getDataSet().remove(t),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit(`startSimulation`),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement(`div`),this.manipulationDiv.className=`vis-manipulation`,this.editMode===!0?this.manipulationDiv.style.display=`block`:this.manipulationDiv.style.display=`none`,this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement(`div`),this.editModeDiv.className=`vis-edit-mode`,this.editMode===!0?this.editModeDiv.style.display=`none`:this.editModeDiv.style.display=`block`,this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0&&(this.closeDiv=document.createElement(`button`),this.closeDiv.className=`vis-close`,this.closeDiv.setAttribute(`aria-label`,this.options.locales[this.options.locale]?.close??this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}_getNewTargetNode(e,t){let n=U({},this.options.controlNodeStyle);n.id=`targetNode`+UY(),n.hidden=!1,n.physics=!1,n.x=e,n.y=t;let r=this.body.functions.createNode(n);return r.shape.boundingBox={left:e,right:e,top:t,bottom:t},r}_createEditButton(){var e;this._clean(),this.manipulationDOM={},PB(this.editModeDiv);let t=this.options.locales[this.options.locale],n=this._createButton(`editMode`,`vis-edit vis-edit-mode`,t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(n),this._bindElementEvents(n,B(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(PB(this.editModeDiv),PB(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit(`restorePhysics`)}_cleanupDOMEventListeners(){for(let t of uP(e=this._domEventListenerCleanupQueue).call(e,0)){var e;t()}}_removeManipulationDOM(){this._clean(),PB(this.manipulationDiv),PB(this.editModeDiv),PB(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM[`seperatorLineDiv`+e]=document.createElement(`div`),this.manipulationDOM[`seperatorLineDiv`+e].className=`vis-separator-line`,this.manipulationDiv.appendChild(this.manipulationDOM[`seperatorLineDiv`+e])}_createAddNodeButton(e){var t;let n=this._createButton(`addNode`,`vis-add`,e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,B(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;let n=this._createButton(`addEdge`,`vis-connect`,e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,B(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;let n=this._createButton(`editNode`,`vis-edit`,e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,B(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;let n=this._createButton(`editEdge`,`vis-edit`,e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,B(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let n;n=this.options.rtl?`vis-delete-rtl`:`vis-delete`;let r=this._createButton(`delete`,n,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,B(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;let n=this._createButton(`back`,`vis-back`,e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,B(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`vis-label`;return this.manipulationDOM[e+`Div`]=document.createElement(`button`),this.manipulationDOM[e+`Div`].className=`vis-button `+t,this.manipulationDOM[e+`Label`]=document.createElement(`div`),this.manipulationDOM[e+`Label`].className=r,this.manipulationDOM[e+`Label`].innerText=n,this.manipulationDOM[e+`Div`].appendChild(this.manipulationDOM[e+`Label`]),this.manipulationDOM[e+`Div`]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement(`div`),this.manipulationDOM.descriptionLabel.className=`vis-none`,this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}_temporaryBindUI(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw Error(`This UI function does not exist. Typo? You tried: `+e+` possible are: `+lL(KM(this.body.eventListeners)))}_unbindTemporaryUIs(){for(let e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e<this.temporaryEventFunctions.length;e++){let t=this.temporaryEventFunctions[e].event,n=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,n)}this.temporaryEventFunctions=[]}_bindElementEvents(e,t){let n=new _V(e,{});tX(n,t),this._domEventListenerCleanupQueue.push(()=>{n.destroy()});let r=e=>{let{keyCode:n,key:r}=e;(r===`Enter`||r===` `||n===13||n===32)&&t()};e.addEventListener(`keyup`,r,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener(`keyup`,r,!1)})}_cleanupTemporaryNodesAndEdges(){for(let n=0;n<this.temporaryIds.edges.length;n++){var e;this.body.edges[this.temporaryIds.edges[n]].disconnect(),delete this.body.edges[this.temporaryIds.edges[n]];let r=H(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[n]);if(r!==-1){var t;uP(t=this.body.edgeIndices).call(t,r,1)}}for(let e=0;e<this.temporaryIds.nodes.length;e++){var n;delete this.body.nodes[this.temporaryIds.nodes[e]];let t=H(n=this.body.nodeIndices).call(n,this.temporaryIds.nodes[e]);if(t!==-1){var r;uP(r=this.body.nodeIndices).call(r,t,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=eD({},this.body.view.translation)}_controlNodeDragStart(){let e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),n=this.body.nodes[this.temporaryIds.nodes[0]],r=this.body.nodes[this.temporaryIds.nodes[1]],i=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;let a=n.isOverlappingWith(t),o=r.isOverlappingWith(t);a===!0?(this.selectedControlNode=n,i.edgeType.from=n):o===!0&&(this.selectedControlNode=r,i.edgeType.to=r),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit(`_redraw`)}_controlNodeDrag(e){this.body.emitter.emit(`disablePhysics`);let t=this.body.functions.getPointer(e.center),n=this.canvas.DOMtoCanvas(t);this.selectedControlNode===void 0?this.interactionHandler.onDrag(e):(this.selectedControlNode.x=n.x,this.selectedControlNode.y=n.y),this.body.emitter.emit(`_redraw`)}_controlNodeDragEnd(e){let t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),r=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();let i=this.selectionHandler._getAllNodesOverlappingWith(n),a;for(let e=i.length-1;e>=0;e--)if(i[e]!==this.selectedControlNode.id){a=this.body.nodes[i[e]];break}if(a!==void 0&&this.selectedControlNode!==void 0)if(a.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let e=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===e.id?this._performEditEdge(a.id,r.to.id):this._performEditEdge(r.from.id,a.id)}else r.updateEdgeType(),this.body.emitter.emit(`restorePhysics`);this.body.emitter.emit(`_redraw`)}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=eD({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;let t=this.lastTouch,n=this.selectionHandler.getNodeAt(t);if(n!==void 0)if(n.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let e=this._getNewTargetNode(n.x,n.y);this.body.nodes[e.id]=e,this.body.nodeIndices.push(e.id);let t=this.body.functions.createEdge({id:`connectionEdge`+UY(),from:n.id,to:e.id,physics:!1,smooth:{enabled:!0,type:`continuous`,roundness:.5}});this.body.edges[t.id]=t,this.body.edgeIndices.push(t.id),this.temporaryIds.nodes.push(e.id),this.temporaryIds.edges.push(t.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){let t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),r;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);let i=this.selectionHandler._getAllNodesOverlappingWith(n),a;for(let e=i.length-1;e>=0;e--){var o;if(H(o=this.temporaryIds.nodes).call(o,i[e])===-1){a=this.body.nodes[i[e]];break}}if(e.controlEdge={from:r,to:a?a.id:void 0},this.selectionHandler.generateClickEvent(`controlNodeDragging`,e,t),this.temporaryIds.nodes[0]!==void 0){let e=this.body.nodes[this.temporaryIds.nodes[0]];e.x=this.canvas._XconvertDOMtoCanvas(t.x),e.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit(`_redraw`)}else this.interactionHandler.onDrag(e)}_finishConnect(e){let t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),r;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);let i=this.selectionHandler._getAllNodesOverlappingWith(n),a;for(let e=i.length-1;e>=0;e--){var o;if(H(o=this.temporaryIds.nodes).call(o,i[e])===-1){a=this.body.nodes[i[e]];break}}this._cleanupTemporaryNodesAndEdges(),a!==void 0&&(a.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[r]!==void 0&&this.body.nodes[a.id]!==void 0&&this._performAddEdge(r,a.id)),e.controlEdge={from:r,to:a?a.id:void 0},this.selectionHandler.generateClickEvent(`controlNodeDragEnd`,e,t),this.body.emitter.emit(`_redraw`)}_dragStartEdge(e){let t=this.lastTouch;this.selectionHandler.generateClickEvent(`dragStart`,e,t,void 0,!0)}_performAddNode(e){let t={id:UY(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:`new`};if(typeof this.options.addNode==`function`)if(this.options.addNode.length===2)this.options.addNode(t,e=>{e!=null&&this.inMode===`addNode`&&this.body.data.nodes.getDataSet().add(e),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),Error(`The function for add does not support two arguments (data,callback)`);else this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()}_performAddEdge(e,t){let n={from:e,to:t};if(typeof this.options.addEdge==`function`)if(this.options.addEdge.length===2)this.options.addEdge(n,e=>{e!=null&&this.inMode===`addEdge`&&(this.body.data.edges.getDataSet().add(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw Error(`The function for connect does not support two arguments (data,callback)`);else this.body.data.edges.getDataSet().add(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){let n={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label},r=this.options.editEdge;if(typeof r==`object`&&(r=r.editWithoutDrag),typeof r==`function`)if(r.length===2)r(n,e=>{e==null||this.inMode!==`editEdge`?(this.body.edges[n.id].updateEdgeType(),this.body.emitter.emit(`_redraw`),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw Error(`The function for edit does not support two arguments (data, callback)`);else this.body.data.edges.getDataSet().update(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},Y=`string`,X=`boolean`,Z=`number`,U$=`array`,Q=`object`,W$=`dom`,G$=`any`,K$=[`arrow`,`bar`,`box`,`circle`,`crow`,`curve`,`diamond`,`image`,`inv_curve`,`inv_triangle`,`triangle`,`vee`],q$={borderWidth:{number:Z},borderWidthSelected:{number:Z,undefined:`undefined`},brokenImage:{string:Y,undefined:`undefined`},chosen:{label:{boolean:X,function:`function`},node:{boolean:X,function:`function`},__type__:{object:Q,boolean:X}},color:{border:{string:Y},background:{string:Y},highlight:{border:{string:Y},background:{string:Y},__type__:{object:Q,string:Y}},hover:{border:{string:Y},background:{string:Y},__type__:{object:Q,string:Y}},__type__:{object:Q,string:Y}},opacity:{number:Z,undefined:`undefined`},fixed:{x:{boolean:X},y:{boolean:X},__type__:{object:Q,boolean:X}},font:{align:{string:Y},color:{string:Y},size:{number:Z},face:{string:Y},background:{string:Y},strokeWidth:{number:Z},strokeColor:{string:Y},vadjust:{number:Z},multi:{boolean:X,string:Y},bold:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},boldital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},ital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},mono:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},__type__:{object:Q,string:Y}},group:{string:Y,number:Z,undefined:`undefined`},heightConstraint:{minimum:{number:Z},valign:{string:Y},__type__:{object:Q,boolean:X,number:Z}},hidden:{boolean:X},icon:{face:{string:Y},code:{string:Y},size:{number:Z},color:{string:Y},weight:{string:Y,number:Z},__type__:{object:Q}},id:{string:Y,number:Z},image:{selected:{string:Y,undefined:`undefined`},unselected:{string:Y,undefined:`undefined`},__type__:{object:Q,string:Y}},imagePadding:{top:{number:Z},right:{number:Z},bottom:{number:Z},left:{number:Z},__type__:{object:Q,number:Z}},label:{string:Y,undefined:`undefined`},labelHighlightBold:{boolean:X},level:{number:Z,undefined:`undefined`},margin:{top:{number:Z},right:{number:Z},bottom:{number:Z},left:{number:Z},__type__:{object:Q,number:Z}},mass:{number:Z},physics:{boolean:X},scaling:{min:{number:Z},max:{number:Z},label:{enabled:{boolean:X},min:{number:Z},max:{number:Z},maxVisible:{number:Z},drawThreshold:{number:Z},__type__:{object:Q,boolean:X}},customScalingFunction:{function:`function`},__type__:{object:Q}},shadow:{enabled:{boolean:X},color:{string:Y},size:{number:Z},x:{number:Z},y:{number:Z},__type__:{object:Q,boolean:X}},shape:{string:[`custom`,`ellipse`,`circle`,`database`,`box`,`text`,`image`,`circularImage`,`diamond`,`dot`,`star`,`triangle`,`triangleDown`,`square`,`icon`,`hexagon`]},ctxRenderer:{function:`function`},shapeProperties:{borderDashes:{boolean:X,array:U$},borderRadius:{number:Z},interpolation:{boolean:X},useImageSize:{boolean:X},useBorderWithImage:{boolean:X},coordinateOrigin:{string:[`center`,`top-left`]},__type__:{object:Q}},size:{number:Z},title:{string:Y,dom:W$,undefined:`undefined`},value:{number:Z,undefined:`undefined`},widthConstraint:{minimum:{number:Z},maximum:{number:Z},__type__:{object:Q,boolean:X,number:Z}},x:{number:Z},y:{number:Z},__type__:{object:Q}},J$={configure:{enabled:{boolean:X},filter:{boolean:X,string:Y,array:U$,function:`function`},container:{dom:W$},showButton:{boolean:X},__type__:{object:Q,boolean:X,string:Y,array:U$,function:`function`}},edges:{arrows:{to:{enabled:{boolean:X},scaleFactor:{number:Z},type:{string:K$},imageHeight:{number:Z},imageWidth:{number:Z},src:{string:Y},__type__:{object:Q,boolean:X}},middle:{enabled:{boolean:X},scaleFactor:{number:Z},type:{string:K$},imageWidth:{number:Z},imageHeight:{number:Z},src:{string:Y},__type__:{object:Q,boolean:X}},from:{enabled:{boolean:X},scaleFactor:{number:Z},type:{string:K$},imageWidth:{number:Z},imageHeight:{number:Z},src:{string:Y},__type__:{object:Q,boolean:X}},__type__:{string:[`from`,`to`,`middle`],object:Q}},endPointOffset:{from:{number:Z},to:{number:Z},__type__:{object:Q,number:Z}},arrowStrikethrough:{boolean:X},background:{enabled:{boolean:X},color:{string:Y},size:{number:Z},dashes:{boolean:X,array:U$},__type__:{object:Q,boolean:X}},chosen:{label:{boolean:X,function:`function`},edge:{boolean:X,function:`function`},__type__:{object:Q,boolean:X}},color:{color:{string:Y},highlight:{string:Y},hover:{string:Y},inherit:{string:[`from`,`to`,`both`],boolean:X},opacity:{number:Z},__type__:{object:Q,string:Y}},dashes:{boolean:X,array:U$},font:{color:{string:Y},size:{number:Z},face:{string:Y},background:{string:Y},strokeWidth:{number:Z},strokeColor:{string:Y},align:{string:[`horizontal`,`top`,`middle`,`bottom`]},vadjust:{number:Z},multi:{boolean:X,string:Y},bold:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},boldital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},ital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},mono:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},__type__:{object:Q,string:Y}},hidden:{boolean:X},hoverWidth:{function:`function`,number:Z},label:{string:Y,undefined:`undefined`},labelHighlightBold:{boolean:X},length:{number:Z,undefined:`undefined`},physics:{boolean:X},scaling:{min:{number:Z},max:{number:Z},label:{enabled:{boolean:X},min:{number:Z},max:{number:Z},maxVisible:{number:Z},drawThreshold:{number:Z},__type__:{object:Q,boolean:X}},customScalingFunction:{function:`function`},__type__:{object:Q}},selectionWidth:{function:`function`,number:Z},selfReferenceSize:{number:Z},selfReference:{size:{number:Z},angle:{number:Z},renderBehindTheNode:{boolean:X},__type__:{object:Q}},shadow:{enabled:{boolean:X},color:{string:Y},size:{number:Z},x:{number:Z},y:{number:Z},__type__:{object:Q,boolean:X}},smooth:{enabled:{boolean:X},type:{string:[`dynamic`,`continuous`,`discrete`,`diagonalCross`,`straightCross`,`horizontal`,`vertical`,`curvedCW`,`curvedCCW`,`cubicBezier`]},roundness:{number:Z},forceDirection:{string:[`horizontal`,`vertical`,`none`],boolean:X},__type__:{object:Q,boolean:X}},title:{string:Y,undefined:`undefined`},width:{number:Z},widthConstraint:{maximum:{number:Z},__type__:{object:Q,boolean:X,number:Z}},value:{number:Z,undefined:`undefined`},__type__:{object:Q}},groups:{useDefaultGroups:{boolean:X},__any__:q$,__type__:{object:Q}},interaction:{dragNodes:{boolean:X},dragView:{boolean:X},hideEdgesOnDrag:{boolean:X},hideEdgesOnZoom:{boolean:X},hideNodesOnDrag:{boolean:X},hover:{boolean:X},keyboard:{enabled:{boolean:X},speed:{x:{number:Z},y:{number:Z},zoom:{number:Z},__type__:{object:Q}},bindToWindow:{boolean:X},autoFocus:{boolean:X},__type__:{object:Q,boolean:X}},multiselect:{boolean:X},navigationButtons:{boolean:X},selectable:{boolean:X},selectConnectedEdges:{boolean:X},hoverConnectedEdges:{boolean:X},tooltipDelay:{number:Z},zoomView:{boolean:X},zoomSpeed:{number:Z},__type__:{object:Q}},layout:{randomSeed:{undefined:`undefined`,number:Z,string:Y},improvedLayout:{boolean:X},clusterThreshold:{number:Z},hierarchical:{enabled:{boolean:X},levelSeparation:{number:Z},nodeSpacing:{number:Z},treeSpacing:{number:Z},blockShifting:{boolean:X},edgeMinimization:{boolean:X},parentCentralization:{boolean:X},direction:{string:[`UD`,`DU`,`LR`,`RL`]},sortMethod:{string:[`hubsize`,`directed`]},shakeTowards:{string:[`leaves`,`roots`]},__type__:{object:Q,boolean:X}},__type__:{object:Q}},manipulation:{enabled:{boolean:X},initiallyActive:{boolean:X},addNode:{boolean:X,function:`function`},addEdge:{boolean:X,function:`function`},editNode:{function:`function`},editEdge:{editWithoutDrag:{function:`function`},__type__:{object:Q,boolean:X,function:`function`}},deleteNode:{boolean:X,function:`function`},deleteEdge:{boolean:X,function:`function`},controlNodeStyle:q$,__type__:{object:Q,boolean:X}},nodes:q$,physics:{enabled:{boolean:X},barnesHut:{theta:{number:Z},gravitationalConstant:{number:Z},centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},damping:{number:Z},avoidOverlap:{number:Z},__type__:{object:Q}},forceAtlas2Based:{theta:{number:Z},gravitationalConstant:{number:Z},centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},damping:{number:Z},avoidOverlap:{number:Z},__type__:{object:Q}},repulsion:{centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},nodeDistance:{number:Z},damping:{number:Z},__type__:{object:Q}},hierarchicalRepulsion:{centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},nodeDistance:{number:Z},damping:{number:Z},avoidOverlap:{number:Z},__type__:{object:Q}},maxVelocity:{number:Z},minVelocity:{number:Z},solver:{string:[`barnesHut`,`repulsion`,`hierarchicalRepulsion`,`forceAtlas2Based`]},stabilization:{enabled:{boolean:X},iterations:{number:Z},updateInterval:{number:Z},onlyDynamicEdges:{boolean:X},fit:{boolean:X},__type__:{object:Q,boolean:X}},timestep:{number:Z},adaptiveTimestep:{boolean:X},wind:{x:{number:Z},y:{number:Z},__type__:{object:Q}},__type__:{object:Q,boolean:X}},autoResize:{boolean:X},clickToUse:{boolean:X},locale:{string:Y},locales:{__any__:{any:G$},__type__:{object:Q}},height:{string:Y},width:{string:Y},__type__:{object:Q}},Y$={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:[`color`,`#2B7CE9`],background:[`color`,`#97C2FC`],highlight:{border:[`color`,`#2B7CE9`],background:[`color`,`#D2E5FF`]},hover:{border:[`color`,`#2B7CE9`],background:[`color`,`#D2E5FF`]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:[`color`,`#343434`],size:[14,0,100,1],face:[`arial`,`verdana`,`tahoma`],background:[`color`,`none`],strokeWidth:[0,0,50,1],strokeColor:[`color`,`#ffffff`]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:[`ellipse`,`box`,`circle`,`database`,`diamond`,`dot`,`square`,`star`,`text`,`triangle`,`triangleDown`,`hexagon`],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:`arrow`},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:`arrow`},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:`arrow`}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:[`color`,`#848484`],highlight:[`color`,`#848484`],hover:[`color`,`#848484`],inherit:[`from`,`to`,`both`,!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:[`color`,`#343434`],size:[14,0,100,1],face:[`arial`,`verdana`,`tahoma`],background:[`color`,`none`],strokeWidth:[2,0,50,1],strokeColor:[`color`,`#ffffff`],align:[`horizontal`,`top`,`middle`,`bottom`]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:[`dynamic`,`continuous`,`discrete`,`diagonalCross`,`straightCross`,`horizontal`,`vertical`,`curvedCW`,`curvedCCW`,`cubicBezier`],forceDirection:[`horizontal`,`vertical`,`none`],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:[`UD`,`DU`,`LR`,`RL`],sortMethod:[`hubsize`,`directed`],shakeTowards:[`leaves`,`roots`]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:[`barnesHut`,`forceAtlas2Based`,`repulsion`,`hierarchicalRepulsion`],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},X$=(e,t,n)=>{var r;return!!(VP(e).call(e,`physics`)&&VP(r=Y$.physics.solver).call(r,t)&&n.physics.solver!==t&&t!==`wind`)},Z$=class{constructor(){}getDistances(e,t,n){let r={},i=e.edges;for(let e=0;e<t.length;e++){let n=t[e],i={};r[n]=i;for(let n=0;n<t.length;n++)i[t[n]]=e==n?0:1e9}for(let e=0;e<n.length;e++){let t=i[n[e]];t.connected===!0&&r[t.fromId]!==void 0&&r[t.toId]!==void 0&&(r[t.fromId][t.toId]=1,r[t.toId][t.fromId]=1)}let a=t.length;for(let e=0;e<a;e++){let n=t[e],i=r[n];for(let e=0;e<a-1;e++){let o=t[e],s=r[o];for(let c=e+1;c<a;c++){let e=t[c],a=r[e],l=Math.min(s[e],s[n]+i[e]);s[e]=l,a[o]=l}}}return r}},Q$=class{constructor(e,t,n){this.body=e,this.springLength=t,this.springConstant=n,this.distanceSolver=new Z$}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(r),this._createK_matrix(r),this._createE_matrix();let i=0,a=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),o=1e9,s=0,c=0,l=0,u=0,d=0;for(;o>.01&&i<a;)for(i+=1,[s,o,c,l]=this._getHighestEnergyNode(n),u=o,d=0;u>1&&d<5;)d+=1,this._moveNode(s,c,l),[u,c,l]=this._getEnergy(s)}_getHighestEnergyNode(e){let t=this.body.nodeIndices,n=this.body.nodes,r=0,i=t[0],a=0,o=0;for(let s=0;s<t.length;s++){let c=t[s];if(n[c].predefinedPosition!==!0||n[c].isCluster===!0&&e===!0||n[c].options.fixed.x!==!0||n[c].options.fixed.y!==!0){let[e,t,n]=this._getEnergy(c);r<e&&(r=e,i=c,a=t,o=n)}}return[i,r,a,o]}_getEnergy(e){let[t,n]=this.E_sums[e];return[Math.sqrt(t**2+n**2),t,n]}_moveNode(e,t,n){let r=this.body.nodeIndices,i=this.body.nodes,a=0,o=0,s=0,c=i[e].x,l=i[e].y,u=this.K_matrix[e],d=this.L_matrix[e];for(let t=0;t<r.length;t++){let n=r[t];if(n!==e){let e=i[n].x,t=i[n].y,r=u[n],f=d[n],p=1/((c-e)**2+(l-t)**2)**1.5;a+=r*(1-f*(l-t)**2*p),o+=r*(f*(c-e)*(l-t)*p),s+=r*(1-f*(c-e)**2*p)}}let f=a,p=o,m=t,h=s,g=n,_=(m/f+g/p)/(p/f-h/p),v=-(p*_+m)/f;i[e].x+=v,i[e].y+=_,this._updateE_matrix(e)}_createL_matrix(e){let t=this.body.nodeIndices,n=this.springLength;this.L_matrix=[];for(let r=0;r<t.length;r++){this.L_matrix[t[r]]={};for(let i=0;i<t.length;i++)this.L_matrix[t[r]][t[i]]=n*e[t[r]][t[i]]}}_createK_matrix(e){let t=this.body.nodeIndices,n=this.springConstant;this.K_matrix=[];for(let r=0;r<t.length;r++){this.K_matrix[t[r]]={};for(let i=0;i<t.length;i++)this.K_matrix[t[r]][t[i]]=n*e[t[r]][t[i]]**-2}}_createE_matrix(){let e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(let t=0;t<e.length;t++)this.E_matrix[e[t]]=[];for(let n=0;n<e.length;n++){let r=e[n],i=t[r].x,a=t[r].y,o=0,s=0;for(let c=n;c<e.length;c++){let l=e[c];if(l!==r){let e=t[l].x,u=t[l].y,d=1/Math.sqrt((i-e)**2+(a-u)**2);this.E_matrix[r][c]=[this.K_matrix[r][l]*(i-e-this.L_matrix[r][l]*(i-e)*d),this.K_matrix[r][l]*(a-u-this.L_matrix[r][l]*(a-u)*d)],this.E_matrix[l][n]=this.E_matrix[r][c],o+=this.E_matrix[r][c][0],s+=this.E_matrix[r][c][1]}}this.E_sums[r]=[o,s]}}_updateE_matrix(e){let t=this.body.nodeIndices,n=this.body.nodes,r=this.E_matrix[e],i=this.K_matrix[e],a=this.L_matrix[e],o=n[e].x,s=n[e].y,c=0,l=0;for(let u=0;u<t.length;u++){let d=t[u];if(d!==e){let e=r[u],t=e[0],f=e[1],p=n[d].x,m=n[d].y,h=1/Math.sqrt((o-p)**2+(s-m)**2),g=i[d]*(o-p-a[d]*(o-p)*h),_=i[d]*(s-m-a[d]*(s-m)*h);r[u]=[g,_],c+=g,l+=_;let v=this.E_sums[d];v[0]+=g-t,v[1]+=_-f}}this.E_sums[e]=[c,l]}};function $(e,t,n){var r,i,a,o;if(!(this instanceof $))throw SyntaxError(`Constructor must be called with the new operator`);this.options={},this.defaultOptions={locale:`en`,locales:$V,clickToUse:!1},eD(this.options,this.defaultOptions),this.body={container:e,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:B(r=this.on).call(r,this),off:B(i=this.off).call(i,this),emit:B(a=this.emit).call(a,this),once:B(o=this.once).call(o,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new nH(()=>this.body.emitter.emit(`_requestRedraw`)),this.groups=new SU,this.canvas=new rX(this.body),this.selectionHandler=new bQ(this.body,this.canvas),this.interactionHandler=new cX(this.body,this.canvas,this.selectionHandler),this.view=new aX(this.body,this.canvas),this.renderer=new qY(this.body,this.canvas),this.physics=new FY(this.body),this.layoutEngine=new V$(this.body),this.clustering=new KY(this.body),this.manipulation=new H$(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new BJ(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new EY(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Q$(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(n),this.setData(t)}VD($.prototype),$.prototype.setOptions=function(e){if(e===null&&(e=void 0),e!==void 0){if(bV.validate(e,J$)===!0&&console.error(`%cErrors have been found in the supplied options object.`,yV),zB([`locale`,`locales`,`clickToUse`],this.options,e),e.locale!==void 0&&(e.locale=eH(e.locales||this.options.locales,e.locale)),e=this.layoutEngine.setOptions(e.layout,e),this.canvas.setOptions(e),this.groups.setOptions(e.groups),this.nodesHandler.setOptions(e.nodes),this.edgesHandler.setOptions(e.edges),this.physics.setOptions(e.physics),this.manipulation.setOptions(e.manipulation,e,this.options),this.interactionHandler.setOptions(e.interaction),this.renderer.setOptions(e.interaction),this.selectionHandler.setOptions(e.interaction),e.groups!==void 0&&this.body.emitter.emit(`refreshNodes`),`configure`in e&&(this.configurator||=new gV(this,this.body.container,Y$,this.canvas.pixelRatio,X$),this.configurator.setOptions(e.configure)),this.configurator&&this.configurator.options.enabled===!0){let e={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};U(e.nodes,this.nodesHandler.options),U(e.edges,this.edgesHandler.options),U(e.layout,this.layoutEngine.options),U(e.interaction,this.selectionHandler.options),U(e.interaction,this.renderer.options),U(e.interaction,this.interactionHandler.options),U(e.manipulation,this.manipulation.options),U(e.physics,this.physics.options),U(e.global,this.canvas.options),U(e.global,this.options),this.configurator.setModuleOptions(e)}e.clickToUse===void 0?this.body.emitter.emit(`activate`):e.clickToUse===!0?this.activator===void 0&&(this.activator=new hV(this.canvas.frame),this.activator.on(`change`,()=>{this.body.emitter.emit(`activate`)})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit(`activate`)),this.canvas.setSize(),this.body.emitter.emit(`startSimulation`)}},$.prototype._updateVisibleIndices=function(){let e=this.body.nodes,t=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&!this.clustering._isClusteredNode(t)&&e[t].options.hidden===!1&&this.body.nodeIndices.push(e[t].id);for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n],i=e[r.fromId],a=e[r.toId],o=i!==void 0&&a!==void 0;!this.clustering._isClusteredEdge(n)&&r.options.hidden===!1&&o&&i.options.hidden===!1&&a.options.hidden===!1&&this.body.edgeIndices.push(r.id)}},$.prototype.bindEventListeners=function(){this.body.emitter.on(`_dataChanged`,()=>{this.edgesHandler._updateState(),this.body.emitter.emit(`_dataUpdated`)}),this.body.emitter.on(`_dataUpdated`,()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit(`startSimulation`),this.body.emitter.emit(`_requestRedraw`)})},$.prototype.setData=function(e){if(this.body.emitter.emit(`resetPhysics`),this.body.emitter.emit(`_resetData`),this.selectionHandler.unselectAll(),e&&e.dot&&(e.nodes||e.edges))throw SyntaxError(`Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.`);if(this.setOptions(e&&e.options),e&&e.dot){console.warn(`The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);`);let t=ZV(e.dot);this.setData(t);return}else if(e&&e.gephi){console.warn(`The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);`);let t=QV(e.gephi);this.setData(t);return}else this.nodesHandler.setData(e&&e.nodes,!0),this.edgesHandler.setData(e&&e.edges,!0);this.body.emitter.emit(`_dataChanged`),this.body.emitter.emit(`_dataLoaded`),this.body.emitter.emit(`initPhysics`)},$.prototype.destroy=function(){this.body.emitter.emit(`destroy`),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&delete this.body.nodes[e];for(let e in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,e)&&delete this.body.edges[e];PB(this.body.container)},$.prototype._updateValueRange=function(e){let t,n,r,i=0;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let a=e[t].getValue();a!==void 0&&(n=n===void 0?a:Math.min(a,n),r=r===void 0?a:Math.max(a,r),i+=a)}if(n!==void 0&&r!==void 0)for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t].setValueRange(n,r,i)},$.prototype.isActive=function(){return!this.activator||this.activator.active},$.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},$.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},$.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},$.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},$.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},$.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},$.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},$.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},$.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},$.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},$.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},$.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},$.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},$.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},$.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},$.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},$.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},$.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},$.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},$.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},$.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},$.prototype.editNodeMode=function(){return console.warn(`Deprecated: Please use editNode instead of editNodeMode.`),this.manipulation.editNode.apply(this.manipulation,arguments)},$.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},$.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},$.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},$.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},$.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},$.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},$.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},$.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},$.prototype.getConnectedNodes=function(e){return this.body.nodes[e]===void 0?this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments):this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments)},$.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},$.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},$.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},$.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},$.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},$.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},$.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},$.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},$.prototype.getNodeAt=function(){let e=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return e!==void 0&&e.id!==void 0?e.id:e},$.prototype.getEdgeAt=function(){let e=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return e!==void 0&&e.id!==void 0?e.id:e},$.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},$.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},$.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},$.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},$.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},$.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},$.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},$.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},$.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},$.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},$.prototype.getOptionsFromConfigurator=function(){let e={};return this.configurator&&(e=this.configurator.getOptions.apply(this.configurator)),e};export{xC as n,$ as t};
|