@baique/pi-web-sky 0.1.39 → 0.1.41
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +7 -12
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +51 -51
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +3 -45
- package/.next/server/app/_global-error/page.js +2 -2
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +3 -3
- package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/agent/[id]/bash-output/route.js +2 -2
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/route.js +2 -2
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/running/route.js +1 -1
- package/.next/server/app/api/app-update/route.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/boards/[id]/reconcile/route.js +1 -0
- package/.next/server/app/api/boards/[id]/reconcile/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/boards/[id]/route.js +1 -1
- package/.next/server/app/api/boards/purge-orphans/route.js +1 -1
- package/.next/server/app/api/boards/reorder/route.js +1 -1
- package/.next/server/app/api/boards/route.js +1 -1
- package/.next/server/app/api/cwd/browse/route.js +1 -1
- package/.next/server/app/api/cwd/validate/route.js +2 -2
- package/.next/server/app/api/default-cwd/route.js +2 -2
- package/.next/server/app/api/file-index/route.js +2 -2
- package/.next/server/app/api/files/[...path]/route.js +3 -3
- package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/git/diff/route.js +1 -1
- package/.next/server/app/api/git/status/route.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/mcp/route.js +1 -1
- package/.next/server/app/api/models/route.js +2 -2
- package/.next/server/app/api/models-config/catalog/route.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/plugins/route.js +2 -2
- package/.next/server/app/api/project-trust/route.js +2 -2
- package/.next/server/app/api/quota/route.js +1 -1
- package/.next/server/app/api/search/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +3 -3
- package/.next/server/app/api/sessions/[id]/context/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/export/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/todos/route.js +2 -2
- package/.next/server/app/api/sessions/route.js +2 -2
- package/.next/server/app/api/skills/check/route.js +1 -1
- package/.next/server/app/api/skills/install/route.js +2 -2
- package/.next/server/app/api/skills/route.js +1 -1
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/skills/update/route.js +1 -1
- package/.next/server/app/api/task-card-questions/[id]/answer/route.js +1 -1
- package/.next/server/app/api/task-card-questions/route.js +1 -1
- package/.next/server/app/api/task-cards/[id]/route.js +1 -1
- package/.next/server/app/api/task-cards/route.js +1 -1
- package/.next/server/app/api/task-scheduler/status/route.js +1 -1
- package/.next/server/app/api/tasks/[id]/board/route.js +1 -1
- package/.next/server/app/api/tasks/[id]/route.js +1 -1
- package/.next/server/app/api/tasks/reorder/route.js +1 -1
- package/.next/server/app/api/tasks/route.js +1 -1
- package/.next/server/app/api/terminal/[id]/events/route.js +2 -2
- package/.next/server/app/api/terminal/[id]/route.js +2 -2
- package/.next/server/app/api/terminal/route.js +2 -2
- package/.next/server/app/api/worktrees/route.js +2 -2
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +5 -5
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/index.segments/_full.segment.rsc +5 -5
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/manifest.webmanifest/route.js +2 -2
- package/.next/server/app/page.js +7 -7
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +7 -12
- package/.next/server/chunks/1094.js +2 -2
- package/.next/server/chunks/1601.js +1 -1
- package/.next/server/chunks/1860.js +1 -1
- package/.next/server/chunks/2075.js +1 -1
- package/.next/server/chunks/2169.js +1 -1
- package/.next/server/chunks/2404.js +1 -1
- package/.next/server/chunks/2524.js +1 -0
- package/.next/server/chunks/3012.js +1 -1
- package/.next/server/chunks/{5760.js → 3379.js} +1 -1
- package/.next/server/chunks/3500.js +1 -1
- package/.next/server/chunks/4226.js +5 -2
- package/.next/server/chunks/4267.js +1 -1
- package/.next/server/chunks/4563.js +1 -1
- package/.next/server/chunks/5318.js +1 -1
- package/.next/server/chunks/542.js +3 -44
- package/.next/server/chunks/5794.js +1 -1
- package/.next/server/chunks/6052.js +1 -1
- package/.next/server/chunks/6253.js +1 -1
- package/.next/server/chunks/6288.js +1 -1
- package/.next/server/chunks/6366.js +1 -1
- package/.next/server/chunks/673.js +1 -1
- package/.next/server/chunks/6916.js +2 -2
- package/.next/server/chunks/7128.js +43 -0
- package/.next/server/chunks/7265.js +2 -2
- package/.next/server/chunks/7799.js +1 -1
- package/.next/server/chunks/8106.js +1 -1
- package/.next/server/chunks/8333.js +1 -1
- package/.next/server/chunks/8604.js +1 -1
- package/.next/server/chunks/861.js +1 -0
- package/.next/server/chunks/8713.js +1 -1
- package/.next/server/chunks/8782.js +2 -2
- package/.next/server/chunks/898.js +1 -1
- package/.next/server/chunks/922.js +2 -2
- package/.next/server/chunks/9280.js +6 -6
- package/.next/server/chunks/9510.js +1 -1
- package/.next/server/instrumentation.js +1 -1
- package/.next/server/instrumentation.js.nft.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{103.23142a67b02246a8.js → 103.6c91a059aa01d92c.js} +2 -2
- package/.next/static/chunks/{1032.12b382a9096ab2a4.js → 1032.9e8f793d46f463f8.js} +1 -1
- package/.next/static/chunks/{1063.775c442bdbeef08b.js → 1063.470df8a037dc8409.js} +1 -1
- package/.next/static/chunks/1a258343.f4fc2c133917ded8.js +2 -0
- package/.next/static/chunks/{1ba63609.b2ae90f43319a29e.js → 1ba63609.569928c7234f832c.js} +1 -1
- package/.next/static/chunks/{2181.ba21239d3ac39f81.js → 2181.b8dda21843ef5e74.js} +1 -1
- package/.next/static/chunks/{2325.23caf22075e51aa5.js → 2325.23e538886331cf64.js} +1 -1
- package/.next/static/chunks/{2356.523277bb8c6bf72a.js → 2356.b7312589c345edec.js} +1 -1
- package/.next/static/chunks/{268.72794ee2773c2060.js → 268.a1d90aca268be18a.js} +1 -1
- package/.next/static/chunks/{2695.6f49435bae1e6f33.js → 2695.5624aa3aae540e87.js} +1 -1
- package/.next/static/chunks/{2703.495a65ed14b2f094.js → 2703.097bc88286733740.js} +1 -1
- package/.next/static/chunks/{2821.934bcf60fbdc28c6.js → 2821.d2392a93d192fe92.js} +1 -1
- package/.next/static/chunks/3308.2cd6f20e6c0f4e92.js +73 -0
- package/.next/static/chunks/{3336.a76f9485fe7cb762.js → 3336.9b1dc9ec3507d64f.js} +1 -1
- package/.next/static/chunks/3546.779d2c7646aa77cc.js +1 -0
- package/.next/static/chunks/{370.8e8f3cf8eb0e29dd.js → 370.cde2a84caa84054f.js} +1 -1
- package/.next/static/chunks/{3716.72bf4c9d7325debd.js → 3716.5bac496cea32ca8f.js} +1 -1
- package/.next/static/chunks/{3995.eca0f5bef1fc3ae5.js → 3995.cd112debcd64c610.js} +1 -1
- package/.next/static/chunks/{4004.74b9bcf5478b1663.js → 4004.a8f79ef62f32aa30.js} +2 -2
- package/.next/static/chunks/{4202.8440832386f023c7.js → 4202.96f5b1beb8b3e3f5.js} +1 -1
- package/.next/static/chunks/{4238.6f102dcbcf2ae339.js → 4238.28efbf9aa0c82d90.js} +1 -1
- package/.next/static/chunks/{4405.7a19458960a1058e.js → 4405.cda46a596a02aef7.js} +1 -1
- package/.next/static/chunks/54a60aa6.5e4421e7afde4de8.js +78 -0
- package/.next/static/chunks/{6121.eb9023b1cbc78ee2.js → 6121.5e650e714b402b6f.js} +1 -1
- package/.next/static/chunks/{6195.1153369f5f8b13a2.js → 6195.1b7f9dc127381bbc.js} +1 -1
- package/.next/static/chunks/6380.d148a8e2c701ad78.js +68 -0
- package/.next/static/chunks/6582.fb2c709abc2c5981.js +1 -0
- package/.next/static/chunks/6be7e44c.00d0163f409986f0.js +1 -0
- package/.next/static/chunks/{7331.2add3c4e125a2dba.js → 7331.4afa66d6353c8e07.js} +1 -1
- package/.next/static/chunks/752.a05a2904b96af4d0.js +1 -0
- package/.next/static/chunks/{8200.a36b9f8c983c6b9e.js → 8200.350d650649b977eb.js} +1 -1
- package/.next/static/chunks/{8885.cf60cac98bf8b70c.js → 8885.2c060cb45c85547b.js} +1 -1
- package/.next/static/chunks/{918.6a9bbe564e4a2d0f.js → 918.593eb466d35cb8ad.js} +1 -1
- package/.next/static/chunks/{9698.4d09a99b9d99f3e5.js → 9698.758755d0387e0e22.js} +2 -2
- package/.next/static/chunks/97.fb73c551e14b3612.js +2 -0
- package/.next/static/chunks/{993e5495.8797001fcfcf2889.js → 993e5495.12cdfbc3af5c79e9.js} +1 -1
- package/.next/static/chunks/{9974.9a0f79beca65e8c4.js → 9974.5ee982e074ad047e.js} +1 -1
- package/.next/static/chunks/app/_global-error/page-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/bash-output/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/agent/running/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/app-update/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/boards/[id]/reconcile/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/boards/[id]/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/boards/purge-orphans/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/boards/reorder/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/boards/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/cwd/browse/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/cwd/validate/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/file-index/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/git/diff/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/git/status/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/home/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/mcp/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/models/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/models-config/catalog/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/plugins/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/project-trust/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/quota/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/search/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/export/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/state/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/todos/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/skills/check/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/skills/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/skills/update/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/task-card-questions/[id]/answer/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/task-card-questions/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/task-cards/[id]/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/task-cards/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/task-scheduler/status/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/tasks/[id]/board/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/tasks/[id]/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/tasks/reorder/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/tasks/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/terminal/[id]/events/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/terminal/[id]/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/terminal/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/api/worktrees/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/{layout-7761e430ed68b347.js → layout-2bec2662143a3d1b.js} +1 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/app/page-e38c6cf3174fa143.js +89 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-bb8f79f321e26750.js +1 -0
- package/.next/static/chunks/webpack-b4924d2a22ad3650.js +1 -0
- package/.next/static/css/0c7244f7214af81f.css +1 -0
- package/.next/static/css/12456255969ac8de.css +31 -0
- package/.next/trace +8 -49
- package/.next/trace-build +1 -1
- package/.next/types/app/api/boards/[id]/{reconcile-task-edges → reconcile}/route.ts +3 -3
- package/.next/types/routes.d.ts +2 -7
- package/.next/types/validator.ts +3 -48
- package/README.md +6 -9
- package/THIRD_PARTY_NOTICES.md +10 -82
- package/bin/pi-web-sky.js +3 -3
- package/lib/board-reconcile-scheduler.ts +56 -0
- package/lib/board-reconcile.test.mjs +252 -0
- package/lib/board-reconcile.ts +421 -0
- package/lib/board-store.test.mjs +26 -4
- package/lib/board-store.ts +44 -6
- package/lib/board-types.ts +7 -2
- package/lib/i18n/messages/en.ts +1 -1
- package/lib/i18n/messages/zh-CN.ts +1 -1
- package/lib/session-delete.ts +5 -0
- package/lib/sqlite-db.ts +13 -1
- package/lib/task-card-store.test.mjs +16 -1
- package/lib/task-card-store.ts +37 -1
- package/lib/task-scheduler.test.mjs +79 -0
- package/lib/task-scheduler.ts +195 -21
- package/lib/yjs-room-server.mjs +139 -0
- package/package.json +12 -9
- package/server.mjs +7 -7
- package/.next/server/app/api/boards/[id]/canvas/route.js +0 -1
- package/.next/server/app/api/boards/[id]/canvas/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/boards/[id]/edges/[eid]/route.js +0 -1
- package/.next/server/app/api/boards/[id]/edges/[eid]/route.js.nft.json +0 -1
- package/.next/server/app/api/boards/[id]/edges/[eid]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/boards/[id]/edges/route.js +0 -1
- package/.next/server/app/api/boards/[id]/edges/route.js.nft.json +0 -1
- package/.next/server/app/api/boards/[id]/edges/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/boards/[id]/nodes/[nid]/route.js +0 -1
- package/.next/server/app/api/boards/[id]/nodes/[nid]/route.js.nft.json +0 -1
- package/.next/server/app/api/boards/[id]/nodes/[nid]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/boards/[id]/nodes/route.js +0 -1
- package/.next/server/app/api/boards/[id]/nodes/route.js.nft.json +0 -1
- package/.next/server/app/api/boards/[id]/nodes/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/boards/[id]/reconcile-task-edges/route.js +0 -1
- package/.next/server/app/api/boards/[id]/reconcile-task-edges/route.js.nft.json +0 -1
- package/.next/server/app/api/boards/[id]/reconcile-task-edges/route_client-reference-manifest.js +0 -1
- package/.next/static/chunks/3308.857c554428b3294e.js +0 -73
- package/.next/static/chunks/333.bf0651c789b2eb33.js +0 -1
- package/.next/static/chunks/5315.dba7515ae6e139ae.js +0 -4
- package/.next/static/chunks/54a60aa6.0e43cde7298ebcb7.js +0 -78
- package/.next/static/chunks/7999.879d5a20e8641752.js +0 -259
- package/.next/static/chunks/app/_global-error/page-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/bash-output/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/agent/running/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/app-update/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/auth/all-providers/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/boards/[id]/canvas/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/boards/[id]/edges/[eid]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/boards/[id]/edges/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/boards/[id]/nodes/[nid]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/boards/[id]/nodes/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/boards/[id]/reconcile-task-edges/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/boards/[id]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/boards/purge-orphans/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/boards/reorder/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/boards/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/cwd/browse/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/cwd/validate/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/file-index/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/git/diff/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/git/status/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/home/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/mcp/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/models/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/models-config/catalog/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/plugins/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/project-trust/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/quota/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/search/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/export/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/state/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/todos/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/skills/check/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/skills/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/skills/update/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/task-card-questions/[id]/answer/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/task-card-questions/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/task-cards/[id]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/task-cards/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/task-scheduler/status/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/tasks/[id]/board/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/tasks/[id]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/tasks/reorder/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/tasks/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/terminal/[id]/events/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/terminal/[id]/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/terminal/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/api/worktrees/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/app/page-2c87c41e7f848f45.js +0 -89
- package/.next/static/chunks/e3e7ddb2.a35db430b3564999.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d6f52627eddf9119.js +0 -1
- package/.next/static/chunks/webpack-4bbf04891e910713.js +0 -1
- package/.next/static/css/80c818c5781fbadc.css +0 -4
- package/.next/static/css/d3a2b5077b52c727.css +0 -1
- package/.next/types/app/api/boards/[id]/canvas/route.ts +0 -353
- package/.next/types/app/api/boards/[id]/edges/[eid]/route.ts +0 -353
- package/.next/types/app/api/boards/[id]/edges/route.ts +0 -353
- package/.next/types/app/api/boards/[id]/nodes/[nid]/route.ts +0 -353
- package/.next/types/app/api/boards/[id]/nodes/route.ts +0 -353
- package/lib/board-search.test.mjs +0 -110
- package/lib/board-search.ts +0 -63
- package/lib/file-explorer-state.test.mjs +0 -63
- package/lib/file-explorer-state.ts +0 -36
- package/lib/sync-room-server.mjs +0 -137
- /package/.next/server/app/api/boards/[id]/{canvas → reconcile}/route.js.nft.json +0 -0
- /package/.next/static/{IzmOG04jJst1VpUvr_fr5 → 8V884w_cp5HEp_rRpjnCR}/_buildManifest.js +0 -0
- /package/.next/static/{IzmOG04jJst1VpUvr_fr5 → 8V884w_cp5HEp_rRpjnCR}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=5318,exports.ids=[5318],exports.modules={38698:function(a,b,c){a.exports=function(a){var b=[function(b,c){b.exports=a},function(a,b,c){"use strict";var d=c(0).layoutBase.LayoutConstants,e=c(0).layoutBase.FDLayoutConstants,f=c(0).CoSEConstants,g=c(0).CoSELayout,h=c(0).CoSENode,i=c(0).layoutBase.PointD,j=c(0).layoutBase.DimensionD,k={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function l(a){this.options=function(a,b){var c={};for(var d in a)c[d]=a[d];for(var d in b)c[d]=b[d];return c}(k,a),m(this.options)}var m=function(a){null!=a.nodeRepulsion&&(f.DEFAULT_REPULSION_STRENGTH=e.DEFAULT_REPULSION_STRENGTH=a.nodeRepulsion),null!=a.idealEdgeLength&&(f.DEFAULT_EDGE_LENGTH=e.DEFAULT_EDGE_LENGTH=a.idealEdgeLength),null!=a.edgeElasticity&&(f.DEFAULT_SPRING_STRENGTH=e.DEFAULT_SPRING_STRENGTH=a.edgeElasticity),null!=a.nestingFactor&&(f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=a.nestingFactor),null!=a.gravity&&(f.DEFAULT_GRAVITY_STRENGTH=e.DEFAULT_GRAVITY_STRENGTH=a.gravity),null!=a.numIter&&(f.MAX_ITERATIONS=e.MAX_ITERATIONS=a.numIter),null!=a.gravityRange&&(f.DEFAULT_GRAVITY_RANGE_FACTOR=e.DEFAULT_GRAVITY_RANGE_FACTOR=a.gravityRange),null!=a.gravityCompound&&(f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=a.gravityCompound),null!=a.gravityRangeCompound&&(f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=a.gravityRangeCompound),null!=a.initialEnergyOnIncremental&&(f.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.DEFAULT_COOLING_FACTOR_INCREMENTAL=a.initialEnergyOnIncremental),"draft"==a.quality?d.QUALITY=0:"proof"==a.quality?d.QUALITY=2:d.QUALITY=1,f.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=a.nodeDimensionsIncludeLabels,f.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=!a.randomize,f.ANIMATE=e.ANIMATE=d.ANIMATE=a.animate,f.TILE=a.tile,f.TILING_PADDING_VERTICAL="function"==typeof a.tilingPaddingVertical?a.tilingPaddingVertical.call():a.tilingPaddingVertical,f.TILING_PADDING_HORIZONTAL="function"==typeof a.tilingPaddingHorizontal?a.tilingPaddingHorizontal.call():a.tilingPaddingHorizontal};l.prototype.run=function(){var a,b,c=this.options;this.idToLNode={};var d=this.layout=new g,e=this;e.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var f=d.newGraphManager();this.gm=f;var h=this.options.eles.nodes(),i=this.options.eles.edges();this.root=f.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(h),d);for(var j=0;j<i.length;j++){var k=i[j],l=this.idToLNode[k.data("source")],m=this.idToLNode[k.data("target")];l!==m&&0==l.getEdgesBetween(m).length&&(f.add(d.newEdge(),l,m).id=k.id())}var n=function(a,b){"number"==typeof a&&(a=b);var c=a.data("id"),d=e.idToLNode[c];return{x:d.getRect().getCenterX(),y:d.getRect().getCenterY()}},o=function f(){for(var g,h=function(){c.fit&&c.cy.fit(c.eles,c.padding),a||(a=!0,e.cy.one("layoutready",c.ready),e.cy.trigger({type:"layoutready",layout:e}))},i=e.options.refresh,j=0;j<i&&!g;j++)g=e.stopped||e.layout.tick();if(g){d.checkLayoutSuccess()&&!d.isSubLayout&&d.doPostLayout(),d.tilingPostLayout&&d.tilingPostLayout(),d.isLayoutFinished=!0,e.options.eles.nodes().positions(n),h(),e.cy.one("layoutstop",e.options.stop),e.cy.trigger({type:"layoutstop",layout:e}),b&&cancelAnimationFrame(b),a=!1;return}var k=e.layout.getPositionsData();c.eles.nodes().positions(function(a,b){if("number"==typeof a&&(a=b),!a.isParent()){for(var c=a.id(),d=k[c],e=a;null==d&&(d=k[e.data("parent")]||k["DummyCompound_"+e.data("parent")],k[c]=d,void 0!=(e=e.parent()[0])););return null!=d?{x:d.x,y:d.y}:{x:a.position("x"),y:a.position("y")}}}),h(),b=requestAnimationFrame(f)};return d.addListener("layoutstarted",function(){"during"===e.options.animate&&(b=requestAnimationFrame(o))}),d.runLayout(),"during"!==this.options.animate&&(e.options.eles.nodes().not(":parent").layoutPositions(e,e.options,n),a=!1),this},l.prototype.getTopMostNodes=function(a){for(var b={},c=0;c<a.length;c++)b[a[c].id()]=!0;return a.filter(function(a,c){"number"==typeof a&&(a=c);for(var d=a.parent()[0];null!=d;){if(b[d.id()])return!1;d=d.parent()[0]}return!0})},l.prototype.processChildrenList=function(a,b,c){for(var d=b.length,e=0;e<d;e++){var f,g,k=b[e],l=k.children(),m=k.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((f=null!=k.outerWidth()&&null!=k.outerHeight()?a.add(new h(c.graphManager,new i(k.position("x")-m.w/2,k.position("y")-m.h/2),new j(parseFloat(m.w),parseFloat(m.h)))):a.add(new h(this.graphManager))).id=k.data("id"),f.paddingLeft=parseInt(k.css("padding")),f.paddingTop=parseInt(k.css("padding")),f.paddingRight=parseInt(k.css("padding")),f.paddingBottom=parseInt(k.css("padding")),this.options.nodeDimensionsIncludeLabels&&k.isParent()){var n=k.boundingBox({includeLabels:!0,includeNodes:!1}).w,o=k.boundingBox({includeLabels:!0,includeNodes:!1}).h,p=k.css("text-halign");f.labelWidth=n,f.labelHeight=o,f.labelPos=p}this.idToLNode[k.data("id")]=f,isNaN(f.rect.x)&&(f.rect.x=0),isNaN(f.rect.y)&&(f.rect.y=0),null!=l&&l.length>0&&(g=c.getGraphManager().add(c.newGraph(),f),this.processChildrenList(g,l,c))}},l.prototype.stop=function(){return this.stopped=!0,this};var n=function(a){a("layout","cose-bilkent",l)};"u">typeof cytoscape&&n(cytoscape),a.exports=n}],c={};function d(a){if(c[a])return c[a].exports;var e=c[a]={i:a,l:!1,exports:{}};return b[a].call(e.exports,e,e.exports,d),e.l=!0,e.exports}return d.m=b,d.c=c,d.i=function(a){return a},d.d=function(a,b,c){d.o(a,b)||Object.defineProperty(a,b,{configurable:!1,enumerable:!0,get:c})},d.n=function(a){var b=a&&a.__esModule?function(){return a.default}:function(){return a};return d.d(b,"a",b),b},d.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},d.p="",d(d.s=1)}(c(92108))},75318:(a,b,c)=>{"use strict";c.r(b),c.d(b,{render:()=>p});var d=c(58715),e=c(95097),f=c(17307),g=c(38698),h=c(69085);function i(a,b){a.forEach(a=>{let c={id:a.id,labelText:a.label,height:a.height,width:a.width,padding:a.padding??0};Object.keys(a).forEach(b=>{["id","label","height","width","padding","x","y"].includes(b)||(c[b]=a[b])}),b.add({group:"nodes",data:c,position:{x:a.x??0,y:a.y??0}})})}function j(a,b){a.forEach(a=>{let c={id:a.id,source:a.start,target:a.end};Object.keys(a).forEach(b=>{["id","start","end"].includes(b)||(c[b]=a[b])}),b.add({group:"edges",data:c})})}function k(a){return new Promise(b=>{let c=(0,h.Ltv)("body").append("div").attr("id","cy").attr("style","display:none"),e=(0,f.A)({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});c.remove(),i(a.nodes,e),j(a.edges,e),e.nodes().forEach(function(a){a.layoutDimensions=()=>{let b=a.data();return{w:b.width,h:b.height}}}),e.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),e.ready(a=>{d.R.info("Cytoscape ready",a),b(e)})})}function l(a){return a.nodes().map(a=>{let b=a.data(),c=a.position(),d={id:b.id,x:c.x,y:c.y};return Object.keys(b).forEach(a=>{"id"!==a&&(d[a]=b[a])}),d})}function m(a){return a.edges().map(a=>{let b=a.data(),c=a._private.rscratch,d={id:b.id,source:b.source,target:b.target,startX:c.startX,startY:c.startY,midX:c.midX,midY:c.midY,endX:c.endX,endY:c.endY};return Object.keys(b).forEach(a=>{["id","source","target"].includes(a)||(d[a]=b[a])}),d})}async function n(a,b){d.R.debug("Starting cose-bilkent layout algorithm");try{o(a);let b=await k(a),c=l(b),e=m(b);return d.R.debug(`Layout completed: ${c.length} nodes, ${e.length} edges`),{nodes:c,edges:e}}catch(a){throw d.R.error("Error in cose-bilkent layout algorithm:",a),a}}function o(a){if(!a)throw Error("Layout data is required");if(!a.config)throw Error("Configuration is required in layout data");if(!a.rootNode)throw Error("Root node is required");if(!a.nodes||!Array.isArray(a.nodes))throw Error("No nodes found in layout data");if(!Array.isArray(a.edges))throw Error("Edges array is required in layout data");return!0}f.A.use(g),(0,e.K)(i,"addNodes"),(0,e.K)(j,"addEdges"),(0,e.K)(k,"createCytoscapeInstance"),(0,e.K)(l,"extractPositionedNodes"),(0,e.K)(m,"extractPositionedEdges"),(0,e.K)(n,"executeCoseBilkentLayout"),(0,e.K)(o,"validateLayoutData");var p=(0,e.K)(async(a,b,{insertCluster:c,insertEdge:d,insertEdgeLabel:e,insertMarkers:f,insertNode:g,log:h,positionEdgeLabel:i},{algorithm:j})=>{let k={},l={},m=b.select("g");f(m,a.markers,a.type,a.diagramId);let o=m.insert("g").attr("class","subgraphs"),p=m.insert("g").attr("class","edgePaths"),q=m.insert("g").attr("class","edgeLabels"),r=m.insert("g").attr("class","nodes");h.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(a.nodes.map(async b=>{if(b.isGroup){let a={...b};l[b.id]=a,k[b.id]=a,await c(o,b)}else{let c={...b};k[b.id]=c;let d=await g(r,b,{config:a.config,dir:a.direction||"TB"}),e=d.node().getBBox();c.width=e.width,c.height=e.height,c.domId=d,h.debug(`Node ${b.id} dimensions: ${e.width}x${e.height}`)}})),h.debug("Running cose-bilkent layout algorithm");let s={...a,nodes:a.nodes.map(a=>{let b=k[a.id];return{...a,width:b.width,height:b.height}})},t=await n(s,a.config);h.debug("Positioning nodes based on layout results"),t.nodes.forEach(a=>{let b=k[a.id];b?.domId&&(b.domId.attr("transform",`translate(${a.x}, ${a.y})`),b.x=a.x,b.y=a.y,h.debug(`Positioned node ${b.id} at center (${a.x}, ${a.y})`))}),t.edges.forEach(b=>{let c=a.edges.find(a=>a.id===b.id);c&&(c.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),h.debug("Inserting and positioning edges"),await Promise.all(a.edges.map(async b=>{await e(q,b);let c=k[b.start??""],f=k[b.end??""];if(c&&f){let e=t.edges.find(a=>a.id===b.id);if(e){h.debug("APA01 positionedEdge",e);let g={...b},j=d(p,g,l,a.type,c,f,a.diagramId);i(g,j)}else{let e={...b,points:[{x:c.x||0,y:c.y||0},{x:f.x||0,y:f.y||0}]},g=d(p,e,l,a.type,c,f,a.diagramId);i(e,g)}}})),h.debug("Cose-bilkent rendering completed")},"render")},92108:function(a,b,c){a.exports=function(a){var b=[function(b,c){b.exports=a},function(a,b,c){"use strict";var d=c(0).FDLayoutConstants;function e(){}for(var f in d)e[f]=d[f];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TREE_REDUCTION_ON_INCREMENTAL=!1,a.exports=e},function(a,b,c){"use strict";var d=c(0).FDLayoutEdge;function e(a,b,c){d.call(this,a,b,c)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},function(a,b,c){"use strict";var d=c(0).LGraph;function e(a,b,c){d.call(this,a,b,c)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},function(a,b,c){"use strict";var d=c(0).LGraphManager;function e(a){d.call(this,a)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},function(a,b,c){"use strict";var d=c(0).FDLayoutNode,e=c(0).IMath;function f(a,b,c,e){d.call(this,a,b,c,e)}for(var g in f.prototype=Object.create(d.prototype),d)f[g]=d[g];f.prototype.move=function(){var a=this.graphManager.getLayout();this.displacementX=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.maxNodeDisplacement*e.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),a.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},f.prototype.propogateDisplacementToChildren=function(a,b){for(var c,d=this.getChild().getNodes(),e=0;e<d.length;e++)null==(c=d[e]).getChild()?(c.moveBy(a,b),c.displacementX+=a,c.displacementY+=b):c.propogateDisplacementToChildren(a,b)},f.prototype.setPred1=function(a){this.pred1=a},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(a){this.next=a},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(a){this.processed=a},f.prototype.isProcessed=function(){return processed},a.exports=f},function(a,b,c){"use strict";var d=c(0).FDLayout,e=c(4),f=c(3),g=c(5),h=c(2),i=c(1),j=c(0).FDLayoutConstants,k=c(0).LayoutConstants,l=c(0).Point,m=c(0).PointD,n=c(0).Layout,o=c(0).Integer,p=c(0).IGeometry,q=c(0).LGraph,r=c(0).Transform;function s(){d.call(this),this.toBeTiled={}}for(var t in s.prototype=Object.create(d.prototype),d)s[t]=d[t];s.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},s.prototype.newGraph=function(a){return new f(null,this.graphManager,a)},s.prototype.newNode=function(a){return new g(this.graphManager,a)},s.prototype.newEdge=function(a){return new h(null,null,a)},s.prototype.initParameters=function(){d.prototype.initParameters.call(this,arguments),this.isSubLayout||(i.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=j.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=j.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=j.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=j.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=j.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=j.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/j.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=j.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},s.prototype.layout=function(){return k.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},s.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(i.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b)}}else{var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},s.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;if(this.totalIterations%j.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=j.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=j.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,d=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,d),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},s.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),b={},c=0;c<a.length;c++){var d=a[c].rect,e=a[c].id;b[e]={id:e,x:d.getCenterX(),y:d.getCenterY(),w:d.width,h:d.height}}return b},s.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var a=!1;if("during"===j.ANIMATE)this.emit("layoutstarted");else{for(;!a;)a=this.tick();this.graphManager.updateBounds()}},s.prototype.calculateNodesToApplyGravitationTo=function(){var a,b,c=[],d=this.graphManager.getGraphs(),e=d.length;for(b=0;b<e;b++)(a=d[b]).updateConnected(),a.isConnected||(c=c.concat(a.getNodes()));return c},s.prototype.createBendpoints=function(){var a=[];a=a.concat(this.graphManager.getAllEdges());var b=new Set;for(f=0;f<a.length;f++){var c=a[f];if(!b.has(c)){var d=c.getSource(),e=c.getTarget();if(d==e)c.getBendpoints().push(new m),c.getBendpoints().push(new m),this.createDummyNodesForBendpoints(c),b.add(c);else{var f,g,h=[];if(h=(h=h.concat(d.getEdgeListToNode(e))).concat(e.getEdgeListToNode(d)),!b.has(h[0])){if(h.length>1)for(g=0;g<h.length;g++){var i=h[g];i.getBendpoints().push(new m),this.createDummyNodesForBendpoints(i)}h.forEach(function(a){b.add(a)})}}}if(b.size==a.length)break}},s.prototype.positionNodesRadially=function(a){for(var b=new l(0,0),c=Math.ceil(Math.sqrt(a.length)),d=0,e=0,f=0,g=new m(0,0),h=0;h<a.length;h++){h%c==0&&(f=0,e=d,0!=h&&(e+=i.DEFAULT_COMPONENT_SEPERATION),d=0);var j=a[h],o=n.findCenterOfTree(j);b.x=f,b.y=e,(g=s.radialLayout(j,o,b)).y>d&&(d=Math.floor(g.y)),f=Math.floor(g.x+i.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(k.WORLD_CENTER_X-g.x/2,k.WORLD_CENTER_Y-g.y/2))},s.radialLayout=function(a,b,c){var d=Math.max(this.maxDiagonalInTree(a),i.DEFAULT_RADIAL_SEPARATION);s.branchRadialLayout(b,null,0,359,0,d);var e=q.calculateBounds(a),f=new r;f.setDeviceOrgX(e.getMinX()),f.setDeviceOrgY(e.getMinY()),f.setWorldOrgX(c.x),f.setWorldOrgY(c.y);for(var g=0;g<a.length;g++)a[g].transform(f);var h=new m(e.getMaxX(),e.getMaxY());return f.inverseTransformPoint(h)},s.branchRadialLayout=function(a,b,c,d,e,f){var g,h=(d-c+1)/2;h<0&&(h+=180);var i=(h+c)%360*p.TWO_PI/360,j=e*Math.cos(i),k=e*Math.sin(i);a.setCenter(j,k);var l=[],m=(l=l.concat(a.getEdges())).length;null!=b&&m--;for(var n=0,o=l.length,q=a.getEdgesBetween(b);q.length>1;){var r=q[0];q.splice(0,1);var t=l.indexOf(r);t>=0&&l.splice(t,1),o--,m--}g=null!=b?(l.indexOf(q[0])+1)%o:0;for(var u=Math.abs(d-c)/m,v=g;n!=m;v=++v%o){var w=l[v].getOtherEnd(a);if(w!=b){var x=(c+n*u)%360,y=(x+u)%360;s.branchRadialLayout(w,a,x,y,e+f,f),n++}}},s.maxDiagonalInTree=function(a){for(var b=o.MIN_VALUE,c=0;c<a.length;c++){var d=a[c].getDiagonal();d>b&&(b=d)}return b},s.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},s.prototype.groupZeroDegreeMembers=function(){var a=this,b={};this.memberGroups={},this.idToDummyNode={};for(var c=[],d=this.graphManager.getAllNodes(),e=0;e<d.length;e++){var f=d[e],h=f.getParent();0!==this.getNodeDegreeWithChildren(f)||void 0!=h.id&&this.getToBeTiled(h)||c.push(f)}for(var e=0;e<c.length;e++){var f=c[e],i=f.getParent().id;void 0===b[i]&&(b[i]=[]),b[i]=b[i].concat(f)}Object.keys(b).forEach(function(c){if(b[c].length>1){var d="DummyCompound_"+c;a.memberGroups[d]=b[c];var e=b[c][0].getParent(),f=new g(a.graphManager);f.id=d,f.paddingLeft=e.paddingLeft||0,f.paddingRight=e.paddingRight||0,f.paddingBottom=e.paddingBottom||0,f.paddingTop=e.paddingTop||0,a.idToDummyNode[d]=f;var h=a.getGraphManager().add(a.newGraph(),f),i=e.getChild();i.add(f);for(var j=0;j<b[c].length;j++){var k=b[c][j];i.remove(k),h.add(k)}}})},s.prototype.clearCompounds=function(){var a={},b={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)b[this.compoundOrder[c].id]=this.compoundOrder[c],a[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(a,b)},s.prototype.clearZeroDegreeMembers=function(){var a=this,b=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var d=a.idToDummyNode[c];b[c]=a.tileNodes(a.memberGroups[c],d.paddingLeft+d.paddingRight),d.rect.width=b[c].width,d.rect.height=b[c].height})},s.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var b=this.compoundOrder[a],c=b.id,d=b.paddingLeft,e=b.paddingTop;this.adjustLocations(this.tiledMemberPack[c],b.rect.x,b.rect.y,d,e)}},s.prototype.repopulateZeroDegreeMembers=function(){var a=this,b=this.tiledZeroDegreePack;Object.keys(b).forEach(function(c){var d=a.idToDummyNode[c],e=d.paddingLeft,f=d.paddingTop;a.adjustLocations(b[c],d.rect.x,d.rect.y,e,f)})},s.prototype.getToBeTiled=function(a){var b=a.id;if(null!=this.toBeTiled[b])return this.toBeTiled[b];var c=a.getChild();if(null==c)return this.toBeTiled[b]=!1,!1;for(var d=c.getNodes(),e=0;e<d.length;e++){var f=d[e];if(this.getNodeDegree(f)>0)return this.toBeTiled[b]=!1,!1;if(null==f.getChild()){this.toBeTiled[f.id]=!1;continue}if(!this.getToBeTiled(f))return this.toBeTiled[b]=!1,!1}return this.toBeTiled[b]=!0,!0},s.prototype.getNodeDegree=function(a){a.id;for(var b=a.getEdges(),c=0,d=0;d<b.length;d++){var e=b[d];e.getSource().id!==e.getTarget().id&&(c+=1)}return c},s.prototype.getNodeDegreeWithChildren=function(a){var b=this.getNodeDegree(a);if(null==a.getChild())return b;for(var c=a.getChild().getNodes(),d=0;d<c.length;d++){var e=c[d];b+=this.getNodeDegreeWithChildren(e)}return b},s.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},s.prototype.fillCompexOrderByDFS=function(a){for(var b=0;b<a.length;b++){var c=a[b];null!=c.getChild()&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},s.prototype.adjustLocations=function(a,b,c,d,e){b+=d,c+=e;for(var f=b,g=0;g<a.rows.length;g++){var h=a.rows[g];b=f;for(var i=0,j=0;j<h.length;j++){var k=h[j];k.rect.x=b,k.rect.y=c,b+=k.rect.width+a.horizontalPadding,k.rect.height>i&&(i=k.rect.height)}c+=i+a.verticalPadding}},s.prototype.tileCompoundMembers=function(a,b){var c=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(d){var e=b[d];c.tiledMemberPack[d]=c.tileNodes(a[d],e.paddingLeft+e.paddingRight),e.rect.width=c.tiledMemberPack[d].width,e.rect.height=c.tiledMemberPack[d].height})},s.prototype.tileNodes=function(a,b){var c={rows:[],rowWidth:[],rowHeight:[],width:0,height:b,verticalPadding:i.TILING_PADDING_VERTICAL,horizontalPadding:i.TILING_PADDING_HORIZONTAL};a.sort(function(a,b){return a.rect.width*a.rect.height>b.rect.width*b.rect.height?-1:+(a.rect.width*a.rect.height<b.rect.width*b.rect.height)});for(var d=0;d<a.length;d++){var e=a[d];0==c.rows.length?this.insertNodeToRow(c,e,0,b):this.canAddHorizontal(c,e.rect.width,e.rect.height)?this.insertNodeToRow(c,e,this.getShortestRowIndex(c),b):this.insertNodeToRow(c,e,c.rows.length,b),this.shiftToLastRow(c)}return c},s.prototype.insertNodeToRow=function(a,b,c,d){c==a.rows.length&&(a.rows.push([]),a.rowWidth.push(d),a.rowHeight.push(0));var e=a.rowWidth[c]+b.rect.width;a.rows[c].length>0&&(e+=a.horizontalPadding),a.rowWidth[c]=e,a.width<e&&(a.width=e);var f=b.rect.height;c>0&&(f+=a.verticalPadding);var g=0;f>a.rowHeight[c]&&(g=a.rowHeight[c],a.rowHeight[c]=f,g=a.rowHeight[c]-g),a.height+=g,a.rows[c].push(b)},s.prototype.getShortestRowIndex=function(a){for(var b=-1,c=Number.MAX_VALUE,d=0;d<a.rows.length;d++)a.rowWidth[d]<c&&(b=d,c=a.rowWidth[d]);return b},s.prototype.getLongestRowIndex=function(a){for(var b=-1,c=5e-324,d=0;d<a.rows.length;d++)a.rowWidth[d]>c&&(b=d,c=a.rowWidth[d]);return b},s.prototype.canAddHorizontal=function(a,b,c){var d,e,f=this.getShortestRowIndex(a);if(f<0)return!0;var g=a.rowWidth[f];if(g+a.horizontalPadding+b<=a.width)return!0;var h=0;return a.rowHeight[f]<c&&f>0&&(h=c+a.verticalPadding-a.rowHeight[f]),d=a.width-g>=b+a.horizontalPadding?(a.height+h)/(g+b+a.horizontalPadding):(a.height+h)/a.width,h=c+a.verticalPadding,(e=a.width<b?(a.height+h)/b:(a.height+h)/a.width)<1&&(e=1/e),d<1&&(d=1/d),d<e},s.prototype.shiftToLastRow=function(a){var b=this.getLongestRowIndex(a),c=a.rowWidth.length-1,d=a.rows[b],e=d[d.length-1],f=e.width+a.horizontalPadding;if(a.width-a.rowWidth[c]>f&&b!=c){d.splice(-1,1),a.rows[c].push(e),a.rowWidth[b]=a.rowWidth[b]-f,a.rowWidth[c]=a.rowWidth[c]+f,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var g=5e-324,h=0;h<d.length;h++)d[h].height>g&&(g=d[h].height);b>0&&(g+=a.verticalPadding);var i=a.rowHeight[b]+a.rowHeight[c];a.rowHeight[b]=g,a.rowHeight[c]<e.height+a.verticalPadding&&(a.rowHeight[c]=e.height+a.verticalPadding);var j=a.rowHeight[b]+a.rowHeight[c];a.height+=j-i,this.shiftToLastRow(a)}},s.prototype.tilingPreLayout=function(){i.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},s.prototype.tilingPostLayout=function(){i.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},s.prototype.reduceTrees=function(){for(var a,b=[],c=!0;c;){var d=this.graphManager.getAllNodes(),e=[];c=!1;for(var f=0;f<d.length;f++)1!=(a=d[f]).getEdges().length||a.getEdges()[0].isInterGraph||null!=a.getChild()||(e.push([a,a.getEdges()[0],a.getOwner()]),c=!0);if(!0==c){for(var g=[],h=0;h<e.length;h++)1==e[h][0].getEdges().length&&(g.push(e[h]),e[h][0].getOwner().remove(e[h][0]));b.push(g),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=b},s.prototype.growTree=function(a){for(var b,c=a.length,d=a[c-1],e=0;e<d.length;e++)b=d[e],this.findPlaceforPrunedNode(b),b[2].add(b[0]),b[2].add(b[1],b[1].source,b[1].target);a.splice(a.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},s.prototype.findPlaceforPrunedNode=function(a){var b,c,d,e,f=a[0],g=(c=f==a[1].source?a[1].target:a[1].source).startX,h=c.finishX,i=c.startY,k=c.finishY,l=[0,0,0,0];if(i>0)for(var m=g;m<=h;m++)l[0]+=this.grid[m][i-1].length+this.grid[m][i].length-1;if(h<this.grid.length-1)for(var m=i;m<=k;m++)l[1]+=this.grid[h+1][m].length+this.grid[h][m].length-1;if(k<this.grid[0].length-1)for(var m=g;m<=h;m++)l[2]+=this.grid[m][k+1].length+this.grid[m][k].length-1;if(g>0)for(var m=i;m<=k;m++)l[3]+=this.grid[g-1][m].length+this.grid[g][m].length-1;for(var n=o.MAX_VALUE,p=0;p<l.length;p++)l[p]<n?(n=l[p],d=1,e=p):l[p]==n&&d++;if(3==d&&0==n)0==l[0]&&0==l[1]&&0==l[2]?b=1:0==l[0]&&0==l[1]&&0==l[3]?b=0:0==l[0]&&0==l[2]&&0==l[3]?b=3:0==l[1]&&0==l[2]&&0==l[3]&&(b=2);else if(2==d&&0==n){var q=Math.floor(2*Math.random());b=0==l[0]&&0==l[1]?+(0!=q):0==l[0]&&0==l[2]?2*(0!=q):0==l[0]&&0==l[3]?3*(0!=q):0==l[1]&&0==l[2]?0==q?1:2:0==l[1]&&0==l[3]?0==q?1:3:0==q?2:3}else if(4==d&&0==n){var q=Math.floor(4*Math.random());b=q}else b=e;0==b?f.setCenter(c.getCenterX(),c.getCenterY()-c.getHeight()/2-j.DEFAULT_EDGE_LENGTH-f.getHeight()/2):1==b?f.setCenter(c.getCenterX()+c.getWidth()/2+j.DEFAULT_EDGE_LENGTH+f.getWidth()/2,c.getCenterY()):2==b?f.setCenter(c.getCenterX(),c.getCenterY()+c.getHeight()/2+j.DEFAULT_EDGE_LENGTH+f.getHeight()/2):f.setCenter(c.getCenterX()-c.getWidth()/2-j.DEFAULT_EDGE_LENGTH-f.getWidth()/2,c.getCenterY())},a.exports=s},function(a,b,c){"use strict";var d={};d.layoutBase=c(0),d.CoSEConstants=c(1),d.CoSEEdge=c(2),d.CoSEGraph=c(3),d.CoSEGraphManager=c(4),d.CoSELayout=c(6),d.CoSENode=c(5),a.exports=d}],c={};function d(a){if(c[a])return c[a].exports;var e=c[a]={i:a,l:!1,exports:{}};return b[a].call(e.exports,e,e.exports,d),e.l=!0,e.exports}return d.m=b,d.c=c,d.i=function(a){return a},d.d=function(a,b,c){d.o(a,b)||Object.defineProperty(a,b,{configurable:!1,enumerable:!0,get:c})},d.n=function(a){var b=a&&a.__esModule?function(){return a.default}:function(){return a};return d.d(b,"a",b),b},d.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},d.p="",d(d.s=7)}(c(97372))},97372:function(a){a.exports=function(){var a=[function(a,b,c){"use strict";function d(){}d.QUALITY=1,d.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,d.DEFAULT_INCREMENTAL=!1,d.DEFAULT_ANIMATION_ON_LAYOUT=!0,d.DEFAULT_ANIMATION_DURING_LAYOUT=!1,d.DEFAULT_ANIMATION_PERIOD=50,d.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,d.DEFAULT_GRAPH_MARGIN=15,d.NODE_DIMENSIONS_INCLUDE_LABELS=!1,d.SIMPLE_NODE_SIZE=40,d.SIMPLE_NODE_HALF_SIZE=d.SIMPLE_NODE_SIZE/2,d.EMPTY_COMPOUND_NODE_SIZE=40,d.MIN_EDGE_LENGTH=1,d.WORLD_BOUNDARY=1e6,d.INITIAL_WORLD_BOUNDARY=d.WORLD_BOUNDARY/1e3,d.WORLD_CENTER_X=1200,d.WORLD_CENTER_Y=900,a.exports=d},function(a,b,c){"use strict";var d=c(2),e=c(8),f=c(9);function g(a,b,c){d.call(this,c),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=c,this.bendpoints=[],this.source=a,this.target=b}for(var h in g.prototype=Object.create(d.prototype),d)g[h]=d[h];g.prototype.getSource=function(){return this.source},g.prototype.getTarget=function(){return this.target},g.prototype.isInterGraph=function(){return this.isInterGraph},g.prototype.getLength=function(){return this.length},g.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},g.prototype.getBendpoints=function(){return this.bendpoints},g.prototype.getLca=function(){return this.lca},g.prototype.getSourceInLca=function(){return this.sourceInLca},g.prototype.getTargetInLca=function(){return this.targetInLca},g.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},g.prototype.getOtherEndInGraph=function(a,b){for(var c=this.getOtherEnd(a),d=b.getGraphManager().getRoot();;){if(c.getOwner()==b)return c;if(c.getOwner()==d)break;c=c.getOwner().getParent()}return null},g.prototype.updateLength=function(){var a=[,,,,];this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],1>Math.abs(this.lengthX)&&(this.lengthX=f.sign(this.lengthX)),1>Math.abs(this.lengthY)&&(this.lengthY=f.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},g.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),1>Math.abs(this.lengthX)&&(this.lengthX=f.sign(this.lengthX)),1>Math.abs(this.lengthY)&&(this.lengthY=f.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},a.exports=g},function(a,b,c){"use strict";a.exports=function(a){this.vGraphObject=a}},function(a,b,c){"use strict";var d=c(2),e=c(10),f=c(13),g=c(0),h=c(16),i=c(4);function j(a,b,c,g){null==c&&null==g&&(g=b),d.call(this,g),null!=a.graphManager&&(a=a.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=a,null!=c&&null!=b?this.rect=new f(b.x,b.y,c.width,c.height):this.rect=new f}for(var k in j.prototype=Object.create(d.prototype),d)j[k]=d[k];j.prototype.getEdges=function(){return this.edges},j.prototype.getChild=function(){return this.child},j.prototype.getOwner=function(){return this.owner},j.prototype.getWidth=function(){return this.rect.width},j.prototype.setWidth=function(a){this.rect.width=a},j.prototype.getHeight=function(){return this.rect.height},j.prototype.setHeight=function(a){this.rect.height=a},j.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},j.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},j.prototype.getCenter=function(){return new i(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},j.prototype.getLocation=function(){return new i(this.rect.x,this.rect.y)},j.prototype.getRect=function(){return this.rect},j.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},j.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},j.prototype.setRect=function(a,b){this.rect.x=a.x,this.rect.y=a.y,this.rect.width=b.width,this.rect.height=b.height},j.prototype.setCenter=function(a,b){this.rect.x=a-this.rect.width/2,this.rect.y=b-this.rect.height/2},j.prototype.setLocation=function(a,b){this.rect.x=a,this.rect.y=b},j.prototype.moveBy=function(a,b){this.rect.x+=a,this.rect.y+=b},j.prototype.getEdgeListToNode=function(a){var b=[],c=this;return c.edges.forEach(function(d){if(d.target==a){if(d.source!=c)throw"Incorrect edge source!";b.push(d)}}),b},j.prototype.getEdgesBetween=function(a){var b=[],c=this;return c.edges.forEach(function(d){if(d.source!=c&&d.target!=c)throw"Incorrect edge source and/or target";(d.target==a||d.source==a)&&b.push(d)}),b},j.prototype.getNeighborsList=function(){var a=new Set,b=this;return b.edges.forEach(function(c){if(c.source==b)a.add(c.target);else{if(c.target!=b)throw"Incorrect incidency!";a.add(c.source)}}),a},j.prototype.withChildren=function(){var a=new Set;if(a.add(this),null!=this.child)for(var b=this.child.getNodes(),c=0;c<b.length;c++)b[c].withChildren().forEach(function(b){a.add(b)});return a},j.prototype.getNoOfChildren=function(){var a=0;if(null==this.child)a=1;else for(var b=this.child.getNodes(),c=0;c<b.length;c++)a+=b[c].getNoOfChildren();return 0==a&&(a=1),a},j.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},j.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},j.prototype.scatter=function(){var a,b,c=-g.INITIAL_WORLD_BOUNDARY,d=g.INITIAL_WORLD_BOUNDARY;a=g.WORLD_CENTER_X+h.nextDouble()*(d-c)+c;var e=-g.INITIAL_WORLD_BOUNDARY,f=g.INITIAL_WORLD_BOUNDARY;b=g.WORLD_CENTER_Y+h.nextDouble()*(f-e)+e,this.rect.x=a,this.rect.y=b},j.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var a=this.getChild();if(a.updateBounds(!0),this.rect.x=a.getLeft(),this.rect.y=a.getTop(),this.setWidth(a.getRight()-a.getLeft()),this.setHeight(a.getBottom()-a.getTop()),g.NODE_DIMENSIONS_INCLUDE_LABELS){var b=a.getRight()-a.getLeft(),c=a.getBottom()-a.getTop();this.labelWidth>b&&(this.rect.x-=(this.labelWidth-b)/2,this.setWidth(this.labelWidth)),this.labelHeight>c&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-c)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-c),this.setHeight(this.labelHeight))}}},j.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},j.prototype.transform=function(a){var b=this.rect.x;b>g.WORLD_BOUNDARY?b=g.WORLD_BOUNDARY:b<-g.WORLD_BOUNDARY&&(b=-g.WORLD_BOUNDARY);var c=this.rect.y;c>g.WORLD_BOUNDARY?c=g.WORLD_BOUNDARY:c<-g.WORLD_BOUNDARY&&(c=-g.WORLD_BOUNDARY);var d=new i(b,c),e=a.inverseTransformPoint(d);this.setLocation(e.x,e.y)},j.prototype.getLeft=function(){return this.rect.x},j.prototype.getRight=function(){return this.rect.x+this.rect.width},j.prototype.getTop=function(){return this.rect.y},j.prototype.getBottom=function(){return this.rect.y+this.rect.height},j.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},a.exports=j},function(a,b,c){"use strict";function d(a,b){null==a&&null==b?(this.x=0,this.y=0):(this.x=a,this.y=b)}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.setX=function(a){this.x=a},d.prototype.setY=function(a){this.y=a},d.prototype.getDifference=function(a){return new DimensionD(this.x-a.x,this.y-a.y)},d.prototype.getCopy=function(){return new d(this.x,this.y)},d.prototype.translate=function(a){return this.x+=a.width,this.y+=a.height,this},a.exports=d},function(a,b,c){"use strict";var d=c(2),e=c(10),f=c(0),g=c(6),h=c(3),i=c(1),j=c(13),k=c(12),l=c(11);function m(a,b,c){d.call(this,c),this.estimatedSize=e.MIN_VALUE,this.margin=f.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=a,null!=b&&b instanceof g?this.graphManager=b:null!=b&&b instanceof Layout&&(this.graphManager=b.graphManager)}for(var n in m.prototype=Object.create(d.prototype),d)m[n]=d[n];m.prototype.getNodes=function(){return this.nodes},m.prototype.getEdges=function(){return this.edges},m.prototype.getGraphManager=function(){return this.graphManager},m.prototype.getParent=function(){return this.parent},m.prototype.getLeft=function(){return this.left},m.prototype.getRight=function(){return this.right},m.prototype.getTop=function(){return this.top},m.prototype.getBottom=function(){return this.bottom},m.prototype.isConnected=function(){return this.isConnected},m.prototype.add=function(a,b,c){if(null==b&&null==c){if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(a)>-1)throw"Node already in graph!";return a.owner=this,this.getNodes().push(a),a}if(!(this.getNodes().indexOf(b)>-1&&this.getNodes().indexOf(c)>-1))throw"Source or target not in graph!";if(b.owner!=c.owner||b.owner!=this)throw"Both owners must be this graph!";return b.owner!=c.owner?null:(a.source=b,a.target=c,a.isInterGraph=!1,this.getEdges().push(a),b.edges.push(a),c!=b&&c.edges.push(a),a)},m.prototype.remove=function(a){if(a instanceof h){if(null==a)throw"Node is null!";if(null==a.owner||a.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var b,c=a.edges.slice(),d=c.length,e=0;e<d;e++)(b=c[e]).isInterGraph?this.graphManager.remove(b):b.source.owner.remove(b);var f=this.nodes.indexOf(a);if(-1==f)throw"Node not in owner node list!";this.nodes.splice(f,1)}else if(a instanceof i){var b=a;if(null==b)throw"Edge is null!";if(null==b.source||null==b.target)throw"Source and/or target is null!";if(null==b.source.owner||null==b.target.owner||b.source.owner!=this||b.target.owner!=this)throw"Source and/or target owner is invalid!";var g=b.source.edges.indexOf(b),j=b.target.edges.indexOf(b);if(!(g>-1&&j>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(g,1),b.target!=b.source&&b.target.edges.splice(j,1);var f=b.source.owner.getEdges().indexOf(b);if(-1==f)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(f,1)}},m.prototype.updateLeftTop=function(){for(var a,b,c,d=e.MAX_VALUE,f=e.MAX_VALUE,g=this.getNodes(),h=g.length,i=0;i<h;i++){var j=g[i];a=j.getTop(),b=j.getLeft(),d>a&&(d=a),f>b&&(f=b)}return d==e.MAX_VALUE?null:(c=void 0!=g[0].getParent().paddingLeft?g[0].getParent().paddingLeft:this.margin,this.left=f-c,this.top=d-c,new k(this.left,this.top))},m.prototype.updateBounds=function(a){for(var b,c,d,f,g,h=e.MAX_VALUE,i=-e.MAX_VALUE,k=e.MAX_VALUE,l=-e.MAX_VALUE,m=this.nodes,n=m.length,o=0;o<n;o++){var p=m[o];a&&null!=p.child&&p.updateBounds(),b=p.getLeft(),c=p.getRight(),d=p.getTop(),f=p.getBottom(),h>b&&(h=b),i<c&&(i=c),k>d&&(k=d),l<f&&(l=f)}var q=new j(h,k,i-h,l-k);h==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),g=void 0!=m[0].getParent().paddingLeft?m[0].getParent().paddingLeft:this.margin,this.left=q.x-g,this.right=q.x+q.width+g,this.top=q.y-g,this.bottom=q.y+q.height+g},m.calculateBounds=function(a){for(var b,c,d,f,g=e.MAX_VALUE,h=-e.MAX_VALUE,i=e.MAX_VALUE,k=-e.MAX_VALUE,l=a.length,m=0;m<l;m++){var n=a[m];b=n.getLeft(),c=n.getRight(),d=n.getTop(),f=n.getBottom(),g>b&&(g=b),h<c&&(h=c),i>d&&(i=d),k<f&&(k=f)}return new j(g,i,h-g,k-i)},m.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},m.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},m.prototype.calcEstimatedSize=function(){for(var a=0,b=this.nodes,c=b.length,d=0;d<c;d++)a+=b[d].calcEstimatedSize();return 0==a?this.estimatedSize=f.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=a/Math.sqrt(this.nodes.length),this.estimatedSize},m.prototype.updateConnected=function(){var a,b,c=this;if(0==this.nodes.length){this.isConnected=!0;return}var d=new l,e=new Set,f=this.nodes[0];for(f.withChildren().forEach(function(a){d.push(a),e.add(a)});0!==d.length;)for(var g=(a=(f=d.shift()).getEdges()).length,h=0;h<g;h++)null==(b=a[h].getOtherEndInGraph(f,this))||e.has(b)||b.withChildren().forEach(function(a){d.push(a),e.add(a)});if(this.isConnected=!1,e.size>=this.nodes.length){var i=0;e.forEach(function(a){a.owner==c&&i++}),i==this.nodes.length&&(this.isConnected=!0)}},a.exports=m},function(a,b,c){"use strict";var d,e=c(1);function f(a){d=c(5),this.layout=a,this.graphs=[],this.edges=[]}f.prototype.addRoot=function(){var a=this.layout.newGraph(),b=this.layout.newNode(null),c=this.add(a,b);return this.setRootGraph(c),this.rootGraph},f.prototype.add=function(a,b,c,d,e){if(null==c&&null==d&&null==e){if(null==a)throw"Graph is null!";if(null==b)throw"Parent node is null!";if(this.graphs.indexOf(a)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(a),null!=a.parent)throw"Already has a parent!";if(null!=b.child)throw"Already has a child!";return a.parent=b,b.child=a,a}e=c,d=b,c=a;var f=d.getOwner(),g=e.getOwner();if(null==f||f.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==g||g.getGraphManager()!=this)throw"Target not in this graph mgr!";if(f==g)return c.isInterGraph=!1,f.add(c,d,e);if(c.isInterGraph=!0,c.source=d,c.target=e,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),null==c.source||null==c.target)throw"Edge source and/or target is null!";if(-1!=c.source.edges.indexOf(c)||-1!=c.target.edges.indexOf(c))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c},f.prototype.remove=function(a){if(a instanceof d){if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(a!=this.rootGraph&&(null==a.parent||a.parent.graphManager!=this))throw"Invalid parent node!";for(var b,c,f=[],g=(f=f.concat(a.getEdges())).length,h=0;h<g;h++)b=f[h],a.remove(b);var i=[];g=(i=i.concat(a.getNodes())).length;for(var h=0;h<g;h++)c=i[h],a.remove(c);a==this.rootGraph&&this.setRootGraph(null);var j=this.graphs.indexOf(a);this.graphs.splice(j,1),a.parent=null}else if(a instanceof e){if(null==(b=a))throw"Edge is null!";if(!b.isInterGraph)throw"Not an inter-graph edge!";if(null==b.source||null==b.target)throw"Source and/or target is null!";if(-1==b.source.edges.indexOf(b)||-1==b.target.edges.indexOf(b))throw"Source and/or target doesn't know this edge!";var j=b.source.edges.indexOf(b);if(b.source.edges.splice(j,1),j=b.target.edges.indexOf(b),b.target.edges.splice(j,1),null==b.source.owner||null==b.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==b.source.owner.getGraphManager().edges.indexOf(b))throw"Not in owner graph manager's edge list!";var j=b.source.owner.getGraphManager().edges.indexOf(b);b.source.owner.getGraphManager().edges.splice(j,1)}},f.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},f.prototype.getGraphs=function(){return this.graphs},f.prototype.getAllNodes=function(){if(null==this.allNodes){for(var a=[],b=this.getGraphs(),c=b.length,d=0;d<c;d++)a=a.concat(b[d].getNodes());this.allNodes=a}return this.allNodes},f.prototype.resetAllNodes=function(){this.allNodes=null},f.prototype.resetAllEdges=function(){this.allEdges=null},f.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},f.prototype.getAllEdges=function(){if(null==this.allEdges){var a=[],b=this.getGraphs();b.length;for(var c=0;c<b.length;c++)a=a.concat(b[c].getEdges());a=a.concat(this.edges),this.allEdges=a}return this.allEdges},f.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},f.prototype.setAllNodesToApplyGravitation=function(a){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=a},f.prototype.getRoot=function(){return this.rootGraph},f.prototype.setRootGraph=function(a){if(a.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=a,null==a.parent&&(a.parent=this.layout.newNode("Root node"))},f.prototype.getLayout=function(){return this.layout},f.prototype.isOneAncestorOfOther=function(a,b){if(null==a||null==b)throw"assert failed";if(a==b)return!0;for(var c,d=a.getOwner();null!=(c=d.getParent());){if(c==b)return!0;if(null==(d=c.getOwner()))break}for(d=b.getOwner();null!=(c=d.getParent());){if(c==a)return!0;if(null==(d=c.getOwner()))break}return!1},f.prototype.calcLowestCommonAncestors=function(){for(var a,b,c,d,e,f=this.getAllEdges(),g=f.length,h=0;h<g;h++){if(b=(a=f[h]).source,c=a.target,a.lca=null,a.sourceInLca=b,a.targetInLca=c,b==c){a.lca=b.getOwner();continue}for(d=b.getOwner();null==a.lca;){for(a.targetInLca=c,e=c.getOwner();null==a.lca;){if(e==d){a.lca=e;break}if(e==this.rootGraph)break;if(null!=a.lca)throw"assert failed";a.targetInLca=e.getParent(),e=a.targetInLca.getOwner()}if(d==this.rootGraph)break;null==a.lca&&(a.sourceInLca=d.getParent(),d=a.sourceInLca.getOwner())}if(null==a.lca)throw"assert failed"}},f.prototype.calcLowestCommonAncestor=function(a,b){if(a==b)return a.getOwner();for(var c=a.getOwner();null!=c;){for(var d=b.getOwner();null!=d;){if(d==c)return d;d=d.getParent().getOwner()}c=c.getParent().getOwner()}return c},f.prototype.calcInclusionTreeDepths=function(a,b){null==a&&null==b&&(a=this.rootGraph,b=1);for(var c,d=a.getNodes(),e=d.length,f=0;f<e;f++)(c=d[f]).inclusionTreeDepth=b,null!=c.child&&this.calcInclusionTreeDepths(c.child,b+1)},f.prototype.includesInvalidEdge=function(){for(var a,b=this.edges.length,c=0;c<b;c++)if(a=this.edges[c],this.isOneAncestorOfOther(a.source,a.target))return!0;return!1},a.exports=f},function(a,b,c){"use strict";var d=c(0);function e(){}for(var f in d)e[f]=d[f];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=3*e.MAX_NODE_DISPLACEMENT_INCREMENTAL,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,a.exports=e},function(a,b,c){"use strict";var d=c(12);function e(){}e.calcSeparationAmount=function(a,b,c,d){if(!a.intersects(b))throw"assert failed";var e=[,,];this.decideDirectionsForOverlappingNodes(a,b,e),c[0]=Math.min(a.getRight(),b.getRight())-Math.max(a.x,b.x),c[1]=Math.min(a.getBottom(),b.getBottom())-Math.max(a.y,b.y),a.getX()<=b.getX()&&a.getRight()>=b.getRight()?c[0]+=Math.min(b.getX()-a.getX(),a.getRight()-b.getRight()):b.getX()<=a.getX()&&b.getRight()>=a.getRight()&&(c[0]+=Math.min(a.getX()-b.getX(),b.getRight()-a.getRight())),a.getY()<=b.getY()&&a.getBottom()>=b.getBottom()?c[1]+=Math.min(b.getY()-a.getY(),a.getBottom()-b.getBottom()):b.getY()<=a.getY()&&b.getBottom()>=a.getBottom()&&(c[1]+=Math.min(a.getY()-b.getY(),b.getBottom()-a.getBottom()));var f=Math.abs((b.getCenterY()-a.getCenterY())/(b.getCenterX()-a.getCenterX()));b.getCenterY()===a.getCenterY()&&b.getCenterX()===a.getCenterX()&&(f=1);var g=f*c[0],h=c[1]/f;c[0]<h?h=c[0]:g=c[1],c[0]=-1*e[0]*(h/2+d),c[1]=-1*e[1]*(g/2+d)},e.decideDirectionsForOverlappingNodes=function(a,b,c){a.getCenterX()<b.getCenterX()?c[0]=-1:c[0]=1,a.getCenterY()<b.getCenterY()?c[1]=-1:c[1]=1},e.getIntersection2=function(a,b,c){var d=a.getCenterX(),e=a.getCenterY(),f=b.getCenterX(),g=b.getCenterY();if(a.intersects(b))return c[0]=d,c[1]=e,c[2]=f,c[3]=g,!0;var h=a.getX(),i=a.getY(),j=a.getRight(),k=a.getX(),l=a.getBottom(),m=a.getRight(),n=a.getWidthHalf(),o=a.getHeightHalf(),p=b.getX(),q=b.getY(),r=b.getRight(),s=b.getX(),t=b.getBottom(),u=b.getRight(),v=b.getWidthHalf(),w=b.getHeightHalf(),x=!1,y=!1;if(d===f)e>g?(c[0]=d,c[1]=i,c[2]=f,c[3]=t):e<g&&(c[0]=d,c[1]=l,c[2]=f,c[3]=q);else if(e===g)d>f?(c[0]=h,c[1]=e,c[2]=r,c[3]=g):d<f&&(c[0]=j,c[1]=e,c[2]=p,c[3]=g);else{var z=a.height/a.width,A=b.height/b.width,B=(g-e)/(f-d),C=void 0,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0;if(-z===B?(d>f?(c[0]=k,c[1]=l):(c[0]=j,c[1]=i),x=!0):z===B&&(d>f?(c[0]=h,c[1]=i):(c[0]=m,c[1]=l),x=!0),-A===B?(f>d?(c[2]=s,c[3]=t):(c[2]=r,c[3]=q),y=!0):A===B&&(f>d?(c[2]=p,c[3]=q):(c[2]=u,c[3]=t),y=!0),x&&y)return!1;if(d>f?e>g?(C=this.getCardinalDirection(z,B,4),D=this.getCardinalDirection(A,B,2)):(C=this.getCardinalDirection(-z,B,3),D=this.getCardinalDirection(-A,B,1)):e>g?(C=this.getCardinalDirection(-z,B,1),D=this.getCardinalDirection(-A,B,3)):(C=this.getCardinalDirection(z,B,2),D=this.getCardinalDirection(A,B,4)),!x)switch(C){case 1:F=i,E=d+-o/B,c[0]=E,c[1]=F;break;case 2:E=m,F=e+n*B,c[0]=E,c[1]=F;break;case 3:F=l,E=d+o/B,c[0]=E,c[1]=F;break;case 4:E=k,F=e+-n*B,c[0]=E,c[1]=F}if(!y)switch(D){case 1:H=q,G=f+-w/B,c[2]=G,c[3]=H;break;case 2:G=u,H=g+v*B,c[2]=G,c[3]=H;break;case 3:H=t,G=f+w/B,c[2]=G,c[3]=H;break;case 4:G=s,H=g+-v*B,c[2]=G,c[3]=H}}return!1},e.getCardinalDirection=function(a,b,c){return a>b?c:1+c%4},e.getIntersection=function(a,b,c,e){if(null==e)return this.getIntersection2(a,b,c);var f=a.x,g=a.y,h=b.x,i=b.y,j=c.x,k=c.y,l=e.x,m=e.y,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0,t=void 0;return(n=i-g,p=f-h,r=h*g-f*i,o=m-k,q=j-l,s=l*k-j*m,0==(t=n*q-o*p))?null:new d((p*s-q*r)/t,(o*r-n*s)/t)},e.angleOfVector=function(a,b,c,d){var e=void 0;return a!==c?(e=Math.atan((d-b)/(c-a)),c<a?e+=Math.PI:d<b&&(e+=this.TWO_PI)):e=d<b?this.ONE_AND_HALF_PI:this.HALF_PI,e},e.doIntersect=function(a,b,c,d){var e=a.x,f=a.y,g=b.x,h=b.y,i=c.x,j=c.y,k=d.x,l=d.y,m=(g-e)*(l-j)-(k-i)*(h-f);if(0===m)return!1;var n=((l-j)*(k-e)+(i-k)*(l-f))/m,o=((f-h)*(k-e)+(g-e)*(l-f))/m;return 0<n&&n<1&&0<o&&o<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,a.exports=e},function(a,b,c){"use strict";function d(){}d.sign=function(a){return a>0?1:a<0?-1:0},d.floor=function(a){return a<0?Math.ceil(a):Math.floor(a)},d.ceil=function(a){return a<0?Math.floor(a):Math.ceil(a)},a.exports=d},function(a,b,c){"use strict";function d(){}d.MAX_VALUE=0x7fffffff,d.MIN_VALUE=-0x80000000,a.exports=d},function(a,b,c){"use strict";var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=function(a){return{value:a,next:null,prev:null}},f=function(a,b,c,d){return null!==a?a.next=b:d.head=b,null!==c?c.prev=b:d.tail=b,b.prev=a,b.next=c,d.length++,b},g=function(a,b){var c=a.prev,d=a.next;return null!==c?c.next=d:b.head=d,null!==d?d.prev=c:b.tail=c,a.prev=a.next=null,b.length--,a};a.exports=function(){function a(b){var c=this;if(!(this instanceof a))throw TypeError("Cannot call a class as a function");this.length=0,this.head=null,this.tail=null,null!=b&&b.forEach(function(a){return c.push(a)})}return d(a,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(a,b){return f(b.prev,e(a),b,this)}},{key:"insertAfter",value:function(a,b){return f(b,e(a),b.next,this)}},{key:"insertNodeBefore",value:function(a,b){return f(b.prev,a,b,this)}},{key:"insertNodeAfter",value:function(a,b){return f(b,a,b.next,this)}},{key:"push",value:function(a){return f(this.tail,e(a),null,this)}},{key:"unshift",value:function(a){return f(null,e(a),this.head,this)}},{key:"remove",value:function(a){return g(a,this)}},{key:"pop",value:function(){return g(this.tail,this).value}},{key:"popNode",value:function(){return g(this.tail,this)}},{key:"shift",value:function(){return g(this.head,this).value}},{key:"shiftNode",value:function(){return g(this.head,this)}},{key:"get_object_at",value:function(a){if(a<=this.length()){for(var b=1,c=this.head;b<a;)c=c.next,b++;return c.value}}},{key:"set_object_at",value:function(a,b){if(a<=this.length()){for(var c=1,d=this.head;c<a;)d=d.next,c++;d.value=b}}}]),a}()},function(a,b,c){"use strict";function d(a,b,c){this.x=null,this.y=null,null==a&&null==b&&null==c?(this.x=0,this.y=0):"number"==typeof a&&"number"==typeof b&&null==c?(this.x=a,this.y=b):"Point"==a.constructor.name&&null==b&&null==c&&(c=a,this.x=c.x,this.y=c.y)}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.getLocation=function(){return new d(this.x,this.y)},d.prototype.setLocation=function(a,b,c){"Point"==a.constructor.name&&null==b&&null==c?(c=a,this.setLocation(c.x,c.y)):"number"==typeof a&&"number"==typeof b&&null==c&&(parseInt(a)==a&&parseInt(b)==b?this.move(a,b):(this.x=Math.floor(a+.5),this.y=Math.floor(b+.5)))},d.prototype.move=function(a,b){this.x=a,this.y=b},d.prototype.translate=function(a,b){this.x+=a,this.y+=b},d.prototype.equals=function(a){return"Point"==a.constructor.name?this.x==a.x&&this.y==a.y:this==a},d.prototype.toString=function(){return new d().constructor.name+"[x="+this.x+",y="+this.y+"]"},a.exports=d},function(a,b,c){"use strict";function d(a,b,c,d){this.x=0,this.y=0,this.width=0,this.height=0,null!=a&&null!=b&&null!=c&&null!=d&&(this.x=a,this.y=b,this.width=c,this.height=d)}d.prototype.getX=function(){return this.x},d.prototype.setX=function(a){this.x=a},d.prototype.getY=function(){return this.y},d.prototype.setY=function(a){this.y=a},d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(a){this.width=a},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(a){this.height=a},d.prototype.getRight=function(){return this.x+this.width},d.prototype.getBottom=function(){return this.y+this.height},d.prototype.intersects=function(a){return!(this.getRight()<a.x||this.getBottom()<a.y||a.getRight()<this.x||a.getBottom()<this.y)},d.prototype.getCenterX=function(){return this.x+this.width/2},d.prototype.getMinX=function(){return this.getX()},d.prototype.getMaxX=function(){return this.getX()+this.width},d.prototype.getCenterY=function(){return this.y+this.height/2},d.prototype.getMinY=function(){return this.getY()},d.prototype.getMaxY=function(){return this.getY()+this.height},d.prototype.getWidthHalf=function(){return this.width/2},d.prototype.getHeightHalf=function(){return this.height/2},a.exports=d},function(a,b,c){"use strict";var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function e(){}e.lastID=0,e.createID=function(a){return e.isPrimitive(a)?a:(null!=a.uniqueID||(a.uniqueID=e.getString(),e.lastID++),a.uniqueID)},e.getString=function(a){return null==a&&(a=e.lastID),"Object#"+a},e.isPrimitive=function(a){var b=void 0===a?"undefined":d(a);return null==a||"object"!=b&&"function"!=b},a.exports=e},function(a,b,c){"use strict";function d(a){if(!Array.isArray(a))return Array.from(a);for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}var e=c(0),f=c(6),g=c(3),h=c(1),i=c(5),j=c(4),k=c(17),l=c(27);function m(a){l.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new f(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=a&&(this.isRemoteUse=a)}m.RANDOM_SEED=1,m.prototype=Object.create(l.prototype),m.prototype.getGraphManager=function(){return this.graphManager},m.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},m.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},m.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},m.prototype.newGraphManager=function(){var a=new f(this);return this.graphManager=a,a},m.prototype.newGraph=function(a){return new i(null,this.graphManager,a)},m.prototype.newNode=function(a){return new g(this.graphManager,a)},m.prototype.newEdge=function(a){return new h(null,null,a)},m.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},m.prototype.runLayout=function(){var a;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),a=!this.checkLayoutSuccess()&&this.layout(),"during"!==e.ANIMATE&&(a&&!this.isSubLayout&&this.doPostLayout(),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,a)},m.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},m.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var a=this.graphManager.getAllEdges(),b=0;b<a.length;b++)a[b];for(var c=this.graphManager.getRoot().getNodes(),b=0;b<c.length;b++)c[b];this.update(this.graphManager.getRoot())}},m.prototype.update=function(a){if(null==a)this.update2();else if(a instanceof g){if(null!=a.getChild())for(var b=a.getChild().getNodes(),c=0;c<b.length;c++)update(b[c]);null!=a.vGraphObject&&a.vGraphObject.update(a)}else a instanceof h?null!=a.vGraphObject&&a.vGraphObject.update(a):a instanceof i&&null!=a.vGraphObject&&a.vGraphObject.update(a)},m.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},m.prototype.transform=function(a){if(void 0==a)this.transform(new j(0,0));else{var b=new k,c=this.graphManager.getRoot().updateLeftTop();if(null!=c){b.setWorldOrgX(a.x),b.setWorldOrgY(a.y),b.setDeviceOrgX(c.x),b.setDeviceOrgY(c.y);for(var d=this.getAllNodes(),e=0;e<d.length;e++)d[e].transform(b)}}},m.prototype.positionNodesRandomly=function(a){if(void 0==a)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var b,c,d=a.getNodes(),e=0;e<d.length;e++)null==(c=(b=d[e]).getChild())||0==c.getNodes().length?b.scatter():(this.positionNodesRandomly(c),b.updateBounds())},m.prototype.getFlatForest=function(){for(var a=[],b=!0,c=this.graphManager.getRoot().getNodes(),e=!0,f=0;f<c.length;f++)null!=c[f].getChild()&&(e=!1);if(!e)return a;var g=new Set,h=[],i=new Map,j=[];for(j=j.concat(c);j.length>0&&b;){for(h.push(j[0]);h.length>0&&b;){var k=h[0];h.splice(0,1),g.add(k);for(var l=k.getEdges(),f=0;f<l.length;f++){var m=l[f].getOtherEnd(k);if(i.get(k)!=m)if(g.has(m)){b=!1;break}else h.push(m),i.set(m,k)}}if(b){var n=[].concat(d(g));a.push(n);for(var f=0;f<n.length;f++){var o=n[f],p=j.indexOf(o);p>-1&&j.splice(p,1)}g=new Set,i=new Map}else a=[]}return a},m.prototype.createDummyNodesForBendpoints=function(a){for(var b=[],c=a.source,d=this.graphManager.calcLowestCommonAncestor(a.source,a.target),e=0;e<a.bendpoints.length;e++){var f=this.newNode(null);f.setRect(new Point(0,0),new Dimension(1,1)),d.add(f);var g=this.newEdge(null);this.graphManager.add(g,c,f),b.add(f),c=f}var g=this.newEdge(null);return this.graphManager.add(g,c,a.target),this.edgeToDummyNodes.set(a,b),a.isInterGraph()?this.graphManager.remove(a):d.remove(a),b},m.prototype.createBendpointsFromDummyNodes=function(){var a=[];a=a.concat(this.graphManager.getAllEdges()),a=[].concat(d(this.edgeToDummyNodes.keys())).concat(a);for(var b=0;b<a.length;b++){var c=a[b];if(c.bendpoints.length>0){for(var e=this.edgeToDummyNodes.get(c),f=0;f<e.length;f++){var g=e[f],h=new j(g.getCenterX(),g.getCenterY()),i=c.bendpoints.get(f);i.x=h.x,i.y=h.y,g.getOwner().remove(g)}this.graphManager.add(c,c.source,c.target)}}},m.transform=function(a,b,c,d){if(void 0==c||void 0==d)return a<=50?(e=9*b/500,f=b/10):(e=9*b/50,f=-8*b),e*a+f;var e,f,g=b;return a<=50?g-=(b-b/c)/50*(50-a):g+=(b*d-b)/50*(a-50),g},m.findCenterOfTree=function(a){var b=[];b=b.concat(a);var c=[],d=new Map,e=!1,f=null;(1==b.length||2==b.length)&&(e=!0,f=b[0]);for(var g=0;g<b.length;g++){var h=b[g],i=h.getNeighborsList().size;d.set(h,h.getNeighborsList().size),1==i&&c.push(h)}var j=[];for(j=j.concat(c);!e;){var k=[];k=k.concat(j),j=[];for(var g=0;g<b.length;g++){var h=b[g],l=b.indexOf(h);l>=0&&b.splice(l,1),h.getNeighborsList().forEach(function(a){if(0>c.indexOf(a)){var b=d.get(a)-1;1==b&&j.push(a),d.set(a,b)}})}c=c.concat(j),(1==b.length||2==b.length)&&(e=!0,f=b[0])}return f},m.prototype.setGraphManager=function(a){this.graphManager=a},a.exports=m},function(a,b,c){"use strict";function d(){}d.seed=1,d.x=0,d.nextDouble=function(){return d.x=1e4*Math.sin(d.seed++),d.x-Math.floor(d.x)},a.exports=d},function(a,b,c){"use strict";var d=c(4);function e(a,b){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(a){this.lworldExtX=a},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(a){this.lworldExtY=a},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},e.prototype.transformX=function(a){var b=0,c=this.lworldExtX;return 0!=c&&(b=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/c),b},e.prototype.transformY=function(a){var b=0,c=this.lworldExtY;return 0!=c&&(b=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/c),b},e.prototype.inverseTransformX=function(a){var b=0,c=this.ldeviceExtX;return 0!=c&&(b=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/c),b},e.prototype.inverseTransformY=function(a){var b=0,c=this.ldeviceExtY;return 0!=c&&(b=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/c),b},e.prototype.inverseTransformPoint=function(a){return new d(this.inverseTransformX(a.x),this.inverseTransformY(a.y))},a.exports=e},function(a,b,c){"use strict";var d=c(15),e=c(7),f=c(0),g=c(8),h=c(9);function i(){d.call(this),this.useSmartIdealEdgeLengthCalculation=e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=e.DEFAULT_EDGE_LENGTH,this.springConstant=e.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=e.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=e.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=e.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*e.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=e.MAX_ITERATIONS}for(var j in i.prototype=Object.create(d.prototype),d)i[j]=d[j];i.prototype.initParameters=function(){d.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},i.prototype.calcIdealEdgeLengths=function(){for(var a,b,c,d,g,h,i=this.getGraphManager().getAllEdges(),j=0;j<i.length;j++)(a=i[j]).idealLength=this.idealEdgeLength,a.isInterGraph&&(c=a.getSource(),d=a.getTarget(),g=a.getSourceInLca().getEstimatedSize(),h=a.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(a.idealLength+=g+h-2*f.SIMPLE_NODE_SIZE),b=a.getLca().getInclusionTreeDepth(),a.idealLength+=e.DEFAULT_EDGE_LENGTH*e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(c.getInclusionTreeDepth()+d.getInclusionTreeDepth()-2*b))},i.prototype.initSpringEmbedder=function(){var a=this.getAllNodes().length;this.incremental?(a>e.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*e.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(a-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-e.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT_INCREMENTAL):(a>e.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(e.COOLING_ADAPTATION_FACTOR,1-(a-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*(1-e.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},i.prototype.calcSpringForces=function(){for(var a,b=this.getAllEdges(),c=0;c<b.length;c++)a=b[c],this.calcSpringForce(a,a.idealLength)},i.prototype.calcRepulsionForces=function(){var a,b,c,d,f,g=!(arguments.length>0)||void 0===arguments[0]||arguments[0],h=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&g&&this.updateGrid(),f=new Set,a=0;a<i.length;a++)c=i[a],this.calculateRepulsionForceOfANode(c,f,g,h),f.add(c);else for(a=0;a<i.length;a++)for(c=i[a],b=a+1;b<i.length;b++)d=i[b],c.getOwner()==d.getOwner()&&this.calcRepulsionForce(c,d)},i.prototype.calcGravitationalForces=function(){for(var a,b=this.getAllNodesToApplyGravitation(),c=0;c<b.length;c++)a=b[c],this.calcGravitationalForce(a)},i.prototype.moveNodes=function(){for(var a=this.getAllNodes(),b=0;b<a.length;b++)a[b].move()},i.prototype.calcSpringForce=function(a,b){var c,d,e,f,g=a.getSource(),h=a.getTarget();if(this.uniformLeafNodeSizes&&null==g.getChild()&&null==h.getChild())a.updateLengthSimple();else if(a.updateLength(),a.isOverlapingSourceAndTarget)return;0!=(c=a.getLength())&&(e=(d=this.springConstant*(c-b))*(a.lengthX/c),f=d*(a.lengthY/c),g.springForceX+=e,g.springForceY+=f,h.springForceX-=e,h.springForceY-=f)},i.prototype.calcRepulsionForce=function(a,b){var c,d,f,i,j,k,l,m=a.getRect(),n=b.getRect(),o=[,,],p=[,,,,];if(m.intersects(n)){g.calcSeparationAmount(m,n,o,e.DEFAULT_EDGE_LENGTH/2),k=2*o[0],l=2*o[1];var q=a.noOfChildren*b.noOfChildren/(a.noOfChildren+b.noOfChildren);a.repulsionForceX-=q*k,a.repulsionForceY-=q*l,b.repulsionForceX+=q*k,b.repulsionForceY+=q*l}else this.uniformLeafNodeSizes&&null==a.getChild()&&null==b.getChild()?(c=n.getCenterX()-m.getCenterX(),d=n.getCenterY()-m.getCenterY()):(g.getIntersection(m,n,p),c=p[2]-p[0],d=p[3]-p[1]),Math.abs(c)<e.MIN_REPULSION_DIST&&(c=h.sign(c)*e.MIN_REPULSION_DIST),Math.abs(d)<e.MIN_REPULSION_DIST&&(d=h.sign(d)*e.MIN_REPULSION_DIST),i=Math.sqrt(f=c*c+d*d),k=(j=this.repulsionConstant*a.noOfChildren*b.noOfChildren/f)*c/i,l=j*d/i,a.repulsionForceX-=k,a.repulsionForceY-=l,b.repulsionForceX+=k,b.repulsionForceY+=l},i.prototype.calcGravitationalForce=function(a){var b,c,d,e,f,g,h,i;c=((b=a.getOwner()).getRight()+b.getLeft())/2,d=(b.getTop()+b.getBottom())/2,e=a.getCenterX()-c,f=a.getCenterY()-d,g=Math.abs(e)+a.getWidth()/2,h=Math.abs(f)+a.getHeight()/2,a.getOwner()==this.graphManager.getRoot()?(g>(i=b.getEstimatedSize()*this.gravityRangeFactor)||h>i)&&(a.gravitationForceX=-this.gravityConstant*e,a.gravitationForceY=-this.gravityConstant*f):(g>(i=b.getEstimatedSize()*this.compoundGravityRangeFactor)||h>i)&&(a.gravitationForceX=-this.gravityConstant*e*this.compoundGravityConstant,a.gravitationForceY=-this.gravityConstant*f*this.compoundGravityConstant)},i.prototype.isConverged=function(){var a,b=!1;return this.totalIterations>this.maxIterations/3&&(b=2>Math.abs(this.totalDisplacement-this.oldTotalDisplacement)),a=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,a||b},i.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},i.prototype.calcNoOfChildrenForAllNodes=function(){for(var a,b=this.graphManager.getAllNodes(),c=0;c<b.length;c++)(a=b[c]).noOfChildren=a.getNoOfChildren()},i.prototype.calcGrid=function(a){var b=0,c=0;b=parseInt(Math.ceil((a.getRight()-a.getLeft())/this.repulsionRange)),c=parseInt(Math.ceil((a.getBottom()-a.getTop())/this.repulsionRange));for(var d=Array(b),e=0;e<b;e++)d[e]=Array(c);for(var e=0;e<b;e++)for(var f=0;f<c;f++)d[e][f]=[];return d},i.prototype.addNodeToGrid=function(a,b,c){var d=0,e=0,f=0,g=0;d=parseInt(Math.floor((a.getRect().x-b)/this.repulsionRange)),e=parseInt(Math.floor((a.getRect().width+a.getRect().x-b)/this.repulsionRange)),f=parseInt(Math.floor((a.getRect().y-c)/this.repulsionRange)),g=parseInt(Math.floor((a.getRect().height+a.getRect().y-c)/this.repulsionRange));for(var h=d;h<=e;h++)for(var i=f;i<=g;i++)this.grid[h][i].push(a),a.setGridCoordinates(d,e,f,g)},i.prototype.updateGrid=function(){var a,b,c=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),a=0;a<c.length;a++)b=c[a],this.addNodeToGrid(b,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},i.prototype.calculateRepulsionForceOfANode=function(a,b,c,d){if(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&c||d){var f,g=new Set;a.surrounding=[];for(var h=this.grid,i=a.startX-1;i<a.finishX+2;i++)for(var j=a.startY-1;j<a.finishY+2;j++)if(!(i<0||j<0||i>=h.length||j>=h[0].length)){for(var k=0;k<h[i][j].length;k++)if(f=h[i][j][k],a.getOwner()==f.getOwner()&&a!=f&&!b.has(f)&&!g.has(f)){var l=Math.abs(a.getCenterX()-f.getCenterX())-(a.getWidth()/2+f.getWidth()/2),m=Math.abs(a.getCenterY()-f.getCenterY())-(a.getHeight()/2+f.getHeight()/2);l<=this.repulsionRange&&m<=this.repulsionRange&&g.add(f)}}a.surrounding=[].concat(function(a){if(!Array.isArray(a))return Array.from(a);for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}(g))}for(i=0;i<a.surrounding.length;i++)this.calcRepulsionForce(a,a.surrounding[i])},i.prototype.calcRepulsionRange=function(){return 0},a.exports=i},function(a,b,c){"use strict";var d=c(1),e=c(7);function f(a,b,c){d.call(this,a,b,c),this.idealLength=e.DEFAULT_EDGE_LENGTH}for(var g in f.prototype=Object.create(d.prototype),d)f[g]=d[g];a.exports=f},function(a,b,c){"use strict";var d=c(3);function e(a,b,c,e){d.call(this,a,b,c,e),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];e.prototype.setGridCoordinates=function(a,b,c,d){this.startX=a,this.finishX=b,this.startY=c,this.finishY=d},a.exports=e},function(a,b,c){"use strict";function d(a,b){this.width=0,this.height=0,null!==a&&null!==b&&(this.height=b,this.width=a)}d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(a){this.width=a},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(a){this.height=a},a.exports=d},function(a,b,c){"use strict";var d=c(14);function e(){this.map={},this.keys=[]}e.prototype.put=function(a,b){var c=d.createID(a);this.contains(c)||(this.map[c]=b,this.keys.push(a))},e.prototype.contains=function(a){return d.createID(a),null!=this.map[a]},e.prototype.get=function(a){var b=d.createID(a);return this.map[b]},e.prototype.keySet=function(){return this.keys},a.exports=e},function(a,b,c){"use strict";var d=c(14);function e(){this.set={}}e.prototype.add=function(a){var b=d.createID(a);this.contains(b)||(this.set[b]=a)},e.prototype.remove=function(a){delete this.set[d.createID(a)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(a){return this.set[d.createID(a)]==a},e.prototype.isEmpty=function(){return 0===this.size()},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(a){for(var b=Object.keys(this.set),c=b.length,d=0;d<c;d++)a.push(this.set[b[d]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(a){for(var b=a.length,c=0;c<b;c++){var d=a[c];this.add(d)}},a.exports=e},function(a,b,c){"use strict";var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=c(11);a.exports=function(){function a(b,c){if(!(this instanceof a))throw TypeError("Cannot call a class as a function");(null!==c||void 0!==c)&&(this.compareFunction=this._defaultCompareFunction);var d=void 0;d=b instanceof e?b.size():b.length,this._quicksort(b,0,d-1)}return d(a,[{key:"_quicksort",value:function(a,b,c){if(b<c){var d=this._partition(a,b,c);this._quicksort(a,b,d),this._quicksort(a,d+1,c)}}},{key:"_partition",value:function(a,b,c){for(var d=this._get(a,b),e=b,f=c;;){for(;this.compareFunction(d,this._get(a,f));)f--;for(;this.compareFunction(this._get(a,e),d);)e++;if(!(e<f))return f;this._swap(a,e,f),e++,f--}}},{key:"_get",value:function(a,b){return a instanceof e?a.get_object_at(b):a[b]}},{key:"_set",value:function(a,b,c){a instanceof e?a.set_object_at(b,c):a[b]=c}},{key:"_swap",value:function(a,b,c){var d=this._get(a,b);this._set(a,b,this._get(a,c)),this._set(a,c,d)}},{key:"_defaultCompareFunction",value:function(a,b){return b>a}}]),a}()},function(a,b,c){"use strict";var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();a.exports=function(){function a(b,c){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,f=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;if(!(this instanceof a))throw TypeError("Cannot call a class as a function");this.sequence1=b,this.sequence2=c,this.match_score=d,this.mismatch_penalty=e,this.gap_penalty=f,this.iMax=b.length+1,this.jMax=c.length+1,this.grid=Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[g][h]=0}this.tracebackGrid=Array(this.iMax);for(var i=0;i<this.iMax;i++){this.tracebackGrid[i]=Array(this.jMax);for(var j=0;j<this.jMax;j++)this.tracebackGrid[i][j]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return d(a,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var a=1;a<this.jMax;a++)this.grid[0][a]=this.grid[0][a-1]+this.gap_penalty,this.tracebackGrid[0][a]=[!1,!1,!0];for(var b=1;b<this.iMax;b++)this.grid[b][0]=this.grid[b-1][0]+this.gap_penalty,this.tracebackGrid[b][0]=[!1,!0,!1];for(var c=1;c<this.iMax;c++)for(var d=1;d<this.jMax;d++){var e=[this.sequence1[c-1]===this.sequence2[d-1]?this.grid[c-1][d-1]+this.match_score:this.grid[c-1][d-1]+this.mismatch_penalty,this.grid[c-1][d]+this.gap_penalty,this.grid[c][d-1]+this.gap_penalty],f=this.arrayAllMaxIndexes(e);this.grid[c][d]=e[f[0]],this.tracebackGrid[c][d]=[f.includes(0),f.includes(1),f.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var a=[];for(a.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});a[0];){var b=a[0],c=this.tracebackGrid[b.pos[0]][b.pos[1]];c[0]&&a.push({pos:[b.pos[0]-1,b.pos[1]-1],seq1:this.sequence1[b.pos[0]-1]+b.seq1,seq2:this.sequence2[b.pos[1]-1]+b.seq2}),c[1]&&a.push({pos:[b.pos[0]-1,b.pos[1]],seq1:this.sequence1[b.pos[0]-1]+b.seq1,seq2:"-"+b.seq2}),c[2]&&a.push({pos:[b.pos[0],b.pos[1]-1],seq1:"-"+b.seq1,seq2:this.sequence2[b.pos[1]-1]+b.seq2}),0===b.pos[0]&&0===b.pos[1]&&this.alignments.push({sequence1:b.seq1,sequence2:b.seq2}),a.shift()}return this.alignments}},{key:"getAllIndexes",value:function(a,b){for(var c=[],d=-1;-1!==(d=a.indexOf(b,d+1));)c.push(d);return c}},{key:"arrayAllMaxIndexes",value:function(a){return this.getAllIndexes(a,Math.max.apply(null,a))}}]),a}()},function(a,b,c){"use strict";var d=function(){};d.FDLayout=c(18),d.FDLayoutConstants=c(7),d.FDLayoutEdge=c(19),d.FDLayoutNode=c(20),d.DimensionD=c(21),d.HashMap=c(22),d.HashSet=c(23),d.IGeometry=c(8),d.IMath=c(9),d.Integer=c(10),d.Point=c(12),d.PointD=c(4),d.RandomSeed=c(16),d.RectangleD=c(13),d.Transform=c(17),d.UniqueIDGeneretor=c(14),d.Quicksort=c(24),d.LinkedList=c(11),d.LGraphObject=c(2),d.LGraph=c(5),d.LEdge=c(1),d.LGraphManager=c(6),d.LNode=c(3),d.Layout=c(15),d.LayoutConstants=c(0),d.NeedlemanWunsch=c(25),a.exports=d},function(a,b,c){"use strict";function d(){this.listeners=[]}var e=d.prototype;e.addListener=function(a,b){this.listeners.push({event:a,callback:b})},e.removeListener=function(a,b){for(var c=this.listeners.length;c>=0;c--){var d=this.listeners[c];d.event===a&&d.callback===b&&this.listeners.splice(c,1)}},e.emit=function(a,b){for(var c=0;c<this.listeners.length;c++){var d=this.listeners[c];a===d.event&&d.callback(b)}},a.exports=d}],b={};function c(d){if(b[d])return b[d].exports;var e=b[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,c),e.l=!0,e.exports}return c.m=a,c.c=b,c.i=function(a){return a},c.d=function(a,b,d){c.o(a,b)||Object.defineProperty(a,b,{configurable:!1,enumerable:!0,get:d})},c.n=function(a){var b=a&&a.__esModule?function(){return a.default}:function(){return a};return c.d(b,"a",b),b},c.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},c.p="",c(c.s=26)}()}};
|
|
1
|
+
exports.id=5318,exports.ids=[5318],exports.modules={38698:function(a,b,c){a.exports=function(a){var b=[function(b,c){b.exports=a},function(a,b,c){"use strict";var d=c(0).layoutBase.LayoutConstants,e=c(0).layoutBase.FDLayoutConstants,f=c(0).CoSEConstants,g=c(0).CoSELayout,h=c(0).CoSENode,i=c(0).layoutBase.PointD,j=c(0).layoutBase.DimensionD,k={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function l(a){this.options=function(a,b){var c={};for(var d in a)c[d]=a[d];for(var d in b)c[d]=b[d];return c}(k,a),m(this.options)}var m=function(a){null!=a.nodeRepulsion&&(f.DEFAULT_REPULSION_STRENGTH=e.DEFAULT_REPULSION_STRENGTH=a.nodeRepulsion),null!=a.idealEdgeLength&&(f.DEFAULT_EDGE_LENGTH=e.DEFAULT_EDGE_LENGTH=a.idealEdgeLength),null!=a.edgeElasticity&&(f.DEFAULT_SPRING_STRENGTH=e.DEFAULT_SPRING_STRENGTH=a.edgeElasticity),null!=a.nestingFactor&&(f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=a.nestingFactor),null!=a.gravity&&(f.DEFAULT_GRAVITY_STRENGTH=e.DEFAULT_GRAVITY_STRENGTH=a.gravity),null!=a.numIter&&(f.MAX_ITERATIONS=e.MAX_ITERATIONS=a.numIter),null!=a.gravityRange&&(f.DEFAULT_GRAVITY_RANGE_FACTOR=e.DEFAULT_GRAVITY_RANGE_FACTOR=a.gravityRange),null!=a.gravityCompound&&(f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=a.gravityCompound),null!=a.gravityRangeCompound&&(f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=a.gravityRangeCompound),null!=a.initialEnergyOnIncremental&&(f.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.DEFAULT_COOLING_FACTOR_INCREMENTAL=a.initialEnergyOnIncremental),"draft"==a.quality?d.QUALITY=0:"proof"==a.quality?d.QUALITY=2:d.QUALITY=1,f.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=a.nodeDimensionsIncludeLabels,f.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=!a.randomize,f.ANIMATE=e.ANIMATE=d.ANIMATE=a.animate,f.TILE=a.tile,f.TILING_PADDING_VERTICAL="function"==typeof a.tilingPaddingVertical?a.tilingPaddingVertical.call():a.tilingPaddingVertical,f.TILING_PADDING_HORIZONTAL="function"==typeof a.tilingPaddingHorizontal?a.tilingPaddingHorizontal.call():a.tilingPaddingHorizontal};l.prototype.run=function(){var a,b,c=this.options;this.idToLNode={};var d=this.layout=new g,e=this;e.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var f=d.newGraphManager();this.gm=f;var h=this.options.eles.nodes(),i=this.options.eles.edges();this.root=f.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(h),d);for(var j=0;j<i.length;j++){var k=i[j],l=this.idToLNode[k.data("source")],m=this.idToLNode[k.data("target")];l!==m&&0==l.getEdgesBetween(m).length&&(f.add(d.newEdge(),l,m).id=k.id())}var n=function(a,b){"number"==typeof a&&(a=b);var c=a.data("id"),d=e.idToLNode[c];return{x:d.getRect().getCenterX(),y:d.getRect().getCenterY()}},o=function f(){for(var g,h=function(){c.fit&&c.cy.fit(c.eles,c.padding),a||(a=!0,e.cy.one("layoutready",c.ready),e.cy.trigger({type:"layoutready",layout:e}))},i=e.options.refresh,j=0;j<i&&!g;j++)g=e.stopped||e.layout.tick();if(g){d.checkLayoutSuccess()&&!d.isSubLayout&&d.doPostLayout(),d.tilingPostLayout&&d.tilingPostLayout(),d.isLayoutFinished=!0,e.options.eles.nodes().positions(n),h(),e.cy.one("layoutstop",e.options.stop),e.cy.trigger({type:"layoutstop",layout:e}),b&&cancelAnimationFrame(b),a=!1;return}var k=e.layout.getPositionsData();c.eles.nodes().positions(function(a,b){if("number"==typeof a&&(a=b),!a.isParent()){for(var c=a.id(),d=k[c],e=a;null==d&&(d=k[e.data("parent")]||k["DummyCompound_"+e.data("parent")],k[c]=d,void 0!=(e=e.parent()[0])););return null!=d?{x:d.x,y:d.y}:{x:a.position("x"),y:a.position("y")}}}),h(),b=requestAnimationFrame(f)};return d.addListener("layoutstarted",function(){"during"===e.options.animate&&(b=requestAnimationFrame(o))}),d.runLayout(),"during"!==this.options.animate&&(e.options.eles.nodes().not(":parent").layoutPositions(e,e.options,n),a=!1),this},l.prototype.getTopMostNodes=function(a){for(var b={},c=0;c<a.length;c++)b[a[c].id()]=!0;return a.filter(function(a,c){"number"==typeof a&&(a=c);for(var d=a.parent()[0];null!=d;){if(b[d.id()])return!1;d=d.parent()[0]}return!0})},l.prototype.processChildrenList=function(a,b,c){for(var d=b.length,e=0;e<d;e++){var f,g,k=b[e],l=k.children(),m=k.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((f=null!=k.outerWidth()&&null!=k.outerHeight()?a.add(new h(c.graphManager,new i(k.position("x")-m.w/2,k.position("y")-m.h/2),new j(parseFloat(m.w),parseFloat(m.h)))):a.add(new h(this.graphManager))).id=k.data("id"),f.paddingLeft=parseInt(k.css("padding")),f.paddingTop=parseInt(k.css("padding")),f.paddingRight=parseInt(k.css("padding")),f.paddingBottom=parseInt(k.css("padding")),this.options.nodeDimensionsIncludeLabels&&k.isParent()){var n=k.boundingBox({includeLabels:!0,includeNodes:!1}).w,o=k.boundingBox({includeLabels:!0,includeNodes:!1}).h,p=k.css("text-halign");f.labelWidth=n,f.labelHeight=o,f.labelPos=p}this.idToLNode[k.data("id")]=f,isNaN(f.rect.x)&&(f.rect.x=0),isNaN(f.rect.y)&&(f.rect.y=0),null!=l&&l.length>0&&(g=c.getGraphManager().add(c.newGraph(),f),this.processChildrenList(g,l,c))}},l.prototype.stop=function(){return this.stopped=!0,this};var n=function(a){a("layout","cose-bilkent",l)};"u">typeof cytoscape&&n(cytoscape),a.exports=n}],c={};function d(a){if(c[a])return c[a].exports;var e=c[a]={i:a,l:!1,exports:{}};return b[a].call(e.exports,e,e.exports,d),e.l=!0,e.exports}return d.m=b,d.c=c,d.i=function(a){return a},d.d=function(a,b,c){d.o(a,b)||Object.defineProperty(a,b,{configurable:!1,enumerable:!0,get:c})},d.n=function(a){var b=a&&a.__esModule?function(){return a.default}:function(){return a};return d.d(b,"a",b),b},d.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},d.p="",d(d.s=1)}(c(92108))},75318:(a,b,c)=>{"use strict";c.r(b),c.d(b,{render:()=>p});var d=c(58715),e=c(95097),f=c(17307),g=c(38698),h=c(92718);function i(a,b){a.forEach(a=>{let c={id:a.id,labelText:a.label,height:a.height,width:a.width,padding:a.padding??0};Object.keys(a).forEach(b=>{["id","label","height","width","padding","x","y"].includes(b)||(c[b]=a[b])}),b.add({group:"nodes",data:c,position:{x:a.x??0,y:a.y??0}})})}function j(a,b){a.forEach(a=>{let c={id:a.id,source:a.start,target:a.end};Object.keys(a).forEach(b=>{["id","start","end"].includes(b)||(c[b]=a[b])}),b.add({group:"edges",data:c})})}function k(a){return new Promise(b=>{let c=(0,h.Ltv)("body").append("div").attr("id","cy").attr("style","display:none"),e=(0,f.A)({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});c.remove(),i(a.nodes,e),j(a.edges,e),e.nodes().forEach(function(a){a.layoutDimensions=()=>{let b=a.data();return{w:b.width,h:b.height}}}),e.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),e.ready(a=>{d.R.info("Cytoscape ready",a),b(e)})})}function l(a){return a.nodes().map(a=>{let b=a.data(),c=a.position(),d={id:b.id,x:c.x,y:c.y};return Object.keys(b).forEach(a=>{"id"!==a&&(d[a]=b[a])}),d})}function m(a){return a.edges().map(a=>{let b=a.data(),c=a._private.rscratch,d={id:b.id,source:b.source,target:b.target,startX:c.startX,startY:c.startY,midX:c.midX,midY:c.midY,endX:c.endX,endY:c.endY};return Object.keys(b).forEach(a=>{["id","source","target"].includes(a)||(d[a]=b[a])}),d})}async function n(a,b){d.R.debug("Starting cose-bilkent layout algorithm");try{o(a);let b=await k(a),c=l(b),e=m(b);return d.R.debug(`Layout completed: ${c.length} nodes, ${e.length} edges`),{nodes:c,edges:e}}catch(a){throw d.R.error("Error in cose-bilkent layout algorithm:",a),a}}function o(a){if(!a)throw Error("Layout data is required");if(!a.config)throw Error("Configuration is required in layout data");if(!a.rootNode)throw Error("Root node is required");if(!a.nodes||!Array.isArray(a.nodes))throw Error("No nodes found in layout data");if(!Array.isArray(a.edges))throw Error("Edges array is required in layout data");return!0}f.A.use(g),(0,e.K)(i,"addNodes"),(0,e.K)(j,"addEdges"),(0,e.K)(k,"createCytoscapeInstance"),(0,e.K)(l,"extractPositionedNodes"),(0,e.K)(m,"extractPositionedEdges"),(0,e.K)(n,"executeCoseBilkentLayout"),(0,e.K)(o,"validateLayoutData");var p=(0,e.K)(async(a,b,{insertCluster:c,insertEdge:d,insertEdgeLabel:e,insertMarkers:f,insertNode:g,log:h,positionEdgeLabel:i},{algorithm:j})=>{let k={},l={},m=b.select("g");f(m,a.markers,a.type,a.diagramId);let o=m.insert("g").attr("class","subgraphs"),p=m.insert("g").attr("class","edgePaths"),q=m.insert("g").attr("class","edgeLabels"),r=m.insert("g").attr("class","nodes");h.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(a.nodes.map(async b=>{if(b.isGroup){let a={...b};l[b.id]=a,k[b.id]=a,await c(o,b)}else{let c={...b};k[b.id]=c;let d=await g(r,b,{config:a.config,dir:a.direction||"TB"}),e=d.node().getBBox();c.width=e.width,c.height=e.height,c.domId=d,h.debug(`Node ${b.id} dimensions: ${e.width}x${e.height}`)}})),h.debug("Running cose-bilkent layout algorithm");let s={...a,nodes:a.nodes.map(a=>{let b=k[a.id];return{...a,width:b.width,height:b.height}})},t=await n(s,a.config);h.debug("Positioning nodes based on layout results"),t.nodes.forEach(a=>{let b=k[a.id];b?.domId&&(b.domId.attr("transform",`translate(${a.x}, ${a.y})`),b.x=a.x,b.y=a.y,h.debug(`Positioned node ${b.id} at center (${a.x}, ${a.y})`))}),t.edges.forEach(b=>{let c=a.edges.find(a=>a.id===b.id);c&&(c.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),h.debug("Inserting and positioning edges"),await Promise.all(a.edges.map(async b=>{await e(q,b);let c=k[b.start??""],f=k[b.end??""];if(c&&f){let e=t.edges.find(a=>a.id===b.id);if(e){h.debug("APA01 positionedEdge",e);let g={...b},j=d(p,g,l,a.type,c,f,a.diagramId);i(g,j)}else{let e={...b,points:[{x:c.x||0,y:c.y||0},{x:f.x||0,y:f.y||0}]},g=d(p,e,l,a.type,c,f,a.diagramId);i(e,g)}}})),h.debug("Cose-bilkent rendering completed")},"render")},92108:function(a,b,c){a.exports=function(a){var b=[function(b,c){b.exports=a},function(a,b,c){"use strict";var d=c(0).FDLayoutConstants;function e(){}for(var f in d)e[f]=d[f];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TREE_REDUCTION_ON_INCREMENTAL=!1,a.exports=e},function(a,b,c){"use strict";var d=c(0).FDLayoutEdge;function e(a,b,c){d.call(this,a,b,c)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},function(a,b,c){"use strict";var d=c(0).LGraph;function e(a,b,c){d.call(this,a,b,c)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},function(a,b,c){"use strict";var d=c(0).LGraphManager;function e(a){d.call(this,a)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},function(a,b,c){"use strict";var d=c(0).FDLayoutNode,e=c(0).IMath;function f(a,b,c,e){d.call(this,a,b,c,e)}for(var g in f.prototype=Object.create(d.prototype),d)f[g]=d[g];f.prototype.move=function(){var a=this.graphManager.getLayout();this.displacementX=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.maxNodeDisplacement*e.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),a.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},f.prototype.propogateDisplacementToChildren=function(a,b){for(var c,d=this.getChild().getNodes(),e=0;e<d.length;e++)null==(c=d[e]).getChild()?(c.moveBy(a,b),c.displacementX+=a,c.displacementY+=b):c.propogateDisplacementToChildren(a,b)},f.prototype.setPred1=function(a){this.pred1=a},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(a){this.next=a},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(a){this.processed=a},f.prototype.isProcessed=function(){return processed},a.exports=f},function(a,b,c){"use strict";var d=c(0).FDLayout,e=c(4),f=c(3),g=c(5),h=c(2),i=c(1),j=c(0).FDLayoutConstants,k=c(0).LayoutConstants,l=c(0).Point,m=c(0).PointD,n=c(0).Layout,o=c(0).Integer,p=c(0).IGeometry,q=c(0).LGraph,r=c(0).Transform;function s(){d.call(this),this.toBeTiled={}}for(var t in s.prototype=Object.create(d.prototype),d)s[t]=d[t];s.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},s.prototype.newGraph=function(a){return new f(null,this.graphManager,a)},s.prototype.newNode=function(a){return new g(this.graphManager,a)},s.prototype.newEdge=function(a){return new h(null,null,a)},s.prototype.initParameters=function(){d.prototype.initParameters.call(this,arguments),this.isSubLayout||(i.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=j.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=j.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=j.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=j.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=j.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=j.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/j.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=j.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},s.prototype.layout=function(){return k.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},s.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(i.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b)}}else{var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},s.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;if(this.totalIterations%j.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=j.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=j.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,d=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,d),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},s.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),b={},c=0;c<a.length;c++){var d=a[c].rect,e=a[c].id;b[e]={id:e,x:d.getCenterX(),y:d.getCenterY(),w:d.width,h:d.height}}return b},s.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var a=!1;if("during"===j.ANIMATE)this.emit("layoutstarted");else{for(;!a;)a=this.tick();this.graphManager.updateBounds()}},s.prototype.calculateNodesToApplyGravitationTo=function(){var a,b,c=[],d=this.graphManager.getGraphs(),e=d.length;for(b=0;b<e;b++)(a=d[b]).updateConnected(),a.isConnected||(c=c.concat(a.getNodes()));return c},s.prototype.createBendpoints=function(){var a=[];a=a.concat(this.graphManager.getAllEdges());var b=new Set;for(f=0;f<a.length;f++){var c=a[f];if(!b.has(c)){var d=c.getSource(),e=c.getTarget();if(d==e)c.getBendpoints().push(new m),c.getBendpoints().push(new m),this.createDummyNodesForBendpoints(c),b.add(c);else{var f,g,h=[];if(h=(h=h.concat(d.getEdgeListToNode(e))).concat(e.getEdgeListToNode(d)),!b.has(h[0])){if(h.length>1)for(g=0;g<h.length;g++){var i=h[g];i.getBendpoints().push(new m),this.createDummyNodesForBendpoints(i)}h.forEach(function(a){b.add(a)})}}}if(b.size==a.length)break}},s.prototype.positionNodesRadially=function(a){for(var b=new l(0,0),c=Math.ceil(Math.sqrt(a.length)),d=0,e=0,f=0,g=new m(0,0),h=0;h<a.length;h++){h%c==0&&(f=0,e=d,0!=h&&(e+=i.DEFAULT_COMPONENT_SEPERATION),d=0);var j=a[h],o=n.findCenterOfTree(j);b.x=f,b.y=e,(g=s.radialLayout(j,o,b)).y>d&&(d=Math.floor(g.y)),f=Math.floor(g.x+i.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(k.WORLD_CENTER_X-g.x/2,k.WORLD_CENTER_Y-g.y/2))},s.radialLayout=function(a,b,c){var d=Math.max(this.maxDiagonalInTree(a),i.DEFAULT_RADIAL_SEPARATION);s.branchRadialLayout(b,null,0,359,0,d);var e=q.calculateBounds(a),f=new r;f.setDeviceOrgX(e.getMinX()),f.setDeviceOrgY(e.getMinY()),f.setWorldOrgX(c.x),f.setWorldOrgY(c.y);for(var g=0;g<a.length;g++)a[g].transform(f);var h=new m(e.getMaxX(),e.getMaxY());return f.inverseTransformPoint(h)},s.branchRadialLayout=function(a,b,c,d,e,f){var g,h=(d-c+1)/2;h<0&&(h+=180);var i=(h+c)%360*p.TWO_PI/360,j=e*Math.cos(i),k=e*Math.sin(i);a.setCenter(j,k);var l=[],m=(l=l.concat(a.getEdges())).length;null!=b&&m--;for(var n=0,o=l.length,q=a.getEdgesBetween(b);q.length>1;){var r=q[0];q.splice(0,1);var t=l.indexOf(r);t>=0&&l.splice(t,1),o--,m--}g=null!=b?(l.indexOf(q[0])+1)%o:0;for(var u=Math.abs(d-c)/m,v=g;n!=m;v=++v%o){var w=l[v].getOtherEnd(a);if(w!=b){var x=(c+n*u)%360,y=(x+u)%360;s.branchRadialLayout(w,a,x,y,e+f,f),n++}}},s.maxDiagonalInTree=function(a){for(var b=o.MIN_VALUE,c=0;c<a.length;c++){var d=a[c].getDiagonal();d>b&&(b=d)}return b},s.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},s.prototype.groupZeroDegreeMembers=function(){var a=this,b={};this.memberGroups={},this.idToDummyNode={};for(var c=[],d=this.graphManager.getAllNodes(),e=0;e<d.length;e++){var f=d[e],h=f.getParent();0!==this.getNodeDegreeWithChildren(f)||void 0!=h.id&&this.getToBeTiled(h)||c.push(f)}for(var e=0;e<c.length;e++){var f=c[e],i=f.getParent().id;void 0===b[i]&&(b[i]=[]),b[i]=b[i].concat(f)}Object.keys(b).forEach(function(c){if(b[c].length>1){var d="DummyCompound_"+c;a.memberGroups[d]=b[c];var e=b[c][0].getParent(),f=new g(a.graphManager);f.id=d,f.paddingLeft=e.paddingLeft||0,f.paddingRight=e.paddingRight||0,f.paddingBottom=e.paddingBottom||0,f.paddingTop=e.paddingTop||0,a.idToDummyNode[d]=f;var h=a.getGraphManager().add(a.newGraph(),f),i=e.getChild();i.add(f);for(var j=0;j<b[c].length;j++){var k=b[c][j];i.remove(k),h.add(k)}}})},s.prototype.clearCompounds=function(){var a={},b={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)b[this.compoundOrder[c].id]=this.compoundOrder[c],a[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(a,b)},s.prototype.clearZeroDegreeMembers=function(){var a=this,b=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var d=a.idToDummyNode[c];b[c]=a.tileNodes(a.memberGroups[c],d.paddingLeft+d.paddingRight),d.rect.width=b[c].width,d.rect.height=b[c].height})},s.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var b=this.compoundOrder[a],c=b.id,d=b.paddingLeft,e=b.paddingTop;this.adjustLocations(this.tiledMemberPack[c],b.rect.x,b.rect.y,d,e)}},s.prototype.repopulateZeroDegreeMembers=function(){var a=this,b=this.tiledZeroDegreePack;Object.keys(b).forEach(function(c){var d=a.idToDummyNode[c],e=d.paddingLeft,f=d.paddingTop;a.adjustLocations(b[c],d.rect.x,d.rect.y,e,f)})},s.prototype.getToBeTiled=function(a){var b=a.id;if(null!=this.toBeTiled[b])return this.toBeTiled[b];var c=a.getChild();if(null==c)return this.toBeTiled[b]=!1,!1;for(var d=c.getNodes(),e=0;e<d.length;e++){var f=d[e];if(this.getNodeDegree(f)>0)return this.toBeTiled[b]=!1,!1;if(null==f.getChild()){this.toBeTiled[f.id]=!1;continue}if(!this.getToBeTiled(f))return this.toBeTiled[b]=!1,!1}return this.toBeTiled[b]=!0,!0},s.prototype.getNodeDegree=function(a){a.id;for(var b=a.getEdges(),c=0,d=0;d<b.length;d++){var e=b[d];e.getSource().id!==e.getTarget().id&&(c+=1)}return c},s.prototype.getNodeDegreeWithChildren=function(a){var b=this.getNodeDegree(a);if(null==a.getChild())return b;for(var c=a.getChild().getNodes(),d=0;d<c.length;d++){var e=c[d];b+=this.getNodeDegreeWithChildren(e)}return b},s.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},s.prototype.fillCompexOrderByDFS=function(a){for(var b=0;b<a.length;b++){var c=a[b];null!=c.getChild()&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},s.prototype.adjustLocations=function(a,b,c,d,e){b+=d,c+=e;for(var f=b,g=0;g<a.rows.length;g++){var h=a.rows[g];b=f;for(var i=0,j=0;j<h.length;j++){var k=h[j];k.rect.x=b,k.rect.y=c,b+=k.rect.width+a.horizontalPadding,k.rect.height>i&&(i=k.rect.height)}c+=i+a.verticalPadding}},s.prototype.tileCompoundMembers=function(a,b){var c=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(d){var e=b[d];c.tiledMemberPack[d]=c.tileNodes(a[d],e.paddingLeft+e.paddingRight),e.rect.width=c.tiledMemberPack[d].width,e.rect.height=c.tiledMemberPack[d].height})},s.prototype.tileNodes=function(a,b){var c={rows:[],rowWidth:[],rowHeight:[],width:0,height:b,verticalPadding:i.TILING_PADDING_VERTICAL,horizontalPadding:i.TILING_PADDING_HORIZONTAL};a.sort(function(a,b){return a.rect.width*a.rect.height>b.rect.width*b.rect.height?-1:+(a.rect.width*a.rect.height<b.rect.width*b.rect.height)});for(var d=0;d<a.length;d++){var e=a[d];0==c.rows.length?this.insertNodeToRow(c,e,0,b):this.canAddHorizontal(c,e.rect.width,e.rect.height)?this.insertNodeToRow(c,e,this.getShortestRowIndex(c),b):this.insertNodeToRow(c,e,c.rows.length,b),this.shiftToLastRow(c)}return c},s.prototype.insertNodeToRow=function(a,b,c,d){c==a.rows.length&&(a.rows.push([]),a.rowWidth.push(d),a.rowHeight.push(0));var e=a.rowWidth[c]+b.rect.width;a.rows[c].length>0&&(e+=a.horizontalPadding),a.rowWidth[c]=e,a.width<e&&(a.width=e);var f=b.rect.height;c>0&&(f+=a.verticalPadding);var g=0;f>a.rowHeight[c]&&(g=a.rowHeight[c],a.rowHeight[c]=f,g=a.rowHeight[c]-g),a.height+=g,a.rows[c].push(b)},s.prototype.getShortestRowIndex=function(a){for(var b=-1,c=Number.MAX_VALUE,d=0;d<a.rows.length;d++)a.rowWidth[d]<c&&(b=d,c=a.rowWidth[d]);return b},s.prototype.getLongestRowIndex=function(a){for(var b=-1,c=5e-324,d=0;d<a.rows.length;d++)a.rowWidth[d]>c&&(b=d,c=a.rowWidth[d]);return b},s.prototype.canAddHorizontal=function(a,b,c){var d,e,f=this.getShortestRowIndex(a);if(f<0)return!0;var g=a.rowWidth[f];if(g+a.horizontalPadding+b<=a.width)return!0;var h=0;return a.rowHeight[f]<c&&f>0&&(h=c+a.verticalPadding-a.rowHeight[f]),d=a.width-g>=b+a.horizontalPadding?(a.height+h)/(g+b+a.horizontalPadding):(a.height+h)/a.width,h=c+a.verticalPadding,(e=a.width<b?(a.height+h)/b:(a.height+h)/a.width)<1&&(e=1/e),d<1&&(d=1/d),d<e},s.prototype.shiftToLastRow=function(a){var b=this.getLongestRowIndex(a),c=a.rowWidth.length-1,d=a.rows[b],e=d[d.length-1],f=e.width+a.horizontalPadding;if(a.width-a.rowWidth[c]>f&&b!=c){d.splice(-1,1),a.rows[c].push(e),a.rowWidth[b]=a.rowWidth[b]-f,a.rowWidth[c]=a.rowWidth[c]+f,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var g=5e-324,h=0;h<d.length;h++)d[h].height>g&&(g=d[h].height);b>0&&(g+=a.verticalPadding);var i=a.rowHeight[b]+a.rowHeight[c];a.rowHeight[b]=g,a.rowHeight[c]<e.height+a.verticalPadding&&(a.rowHeight[c]=e.height+a.verticalPadding);var j=a.rowHeight[b]+a.rowHeight[c];a.height+=j-i,this.shiftToLastRow(a)}},s.prototype.tilingPreLayout=function(){i.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},s.prototype.tilingPostLayout=function(){i.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},s.prototype.reduceTrees=function(){for(var a,b=[],c=!0;c;){var d=this.graphManager.getAllNodes(),e=[];c=!1;for(var f=0;f<d.length;f++)1!=(a=d[f]).getEdges().length||a.getEdges()[0].isInterGraph||null!=a.getChild()||(e.push([a,a.getEdges()[0],a.getOwner()]),c=!0);if(!0==c){for(var g=[],h=0;h<e.length;h++)1==e[h][0].getEdges().length&&(g.push(e[h]),e[h][0].getOwner().remove(e[h][0]));b.push(g),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=b},s.prototype.growTree=function(a){for(var b,c=a.length,d=a[c-1],e=0;e<d.length;e++)b=d[e],this.findPlaceforPrunedNode(b),b[2].add(b[0]),b[2].add(b[1],b[1].source,b[1].target);a.splice(a.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},s.prototype.findPlaceforPrunedNode=function(a){var b,c,d,e,f=a[0],g=(c=f==a[1].source?a[1].target:a[1].source).startX,h=c.finishX,i=c.startY,k=c.finishY,l=[0,0,0,0];if(i>0)for(var m=g;m<=h;m++)l[0]+=this.grid[m][i-1].length+this.grid[m][i].length-1;if(h<this.grid.length-1)for(var m=i;m<=k;m++)l[1]+=this.grid[h+1][m].length+this.grid[h][m].length-1;if(k<this.grid[0].length-1)for(var m=g;m<=h;m++)l[2]+=this.grid[m][k+1].length+this.grid[m][k].length-1;if(g>0)for(var m=i;m<=k;m++)l[3]+=this.grid[g-1][m].length+this.grid[g][m].length-1;for(var n=o.MAX_VALUE,p=0;p<l.length;p++)l[p]<n?(n=l[p],d=1,e=p):l[p]==n&&d++;if(3==d&&0==n)0==l[0]&&0==l[1]&&0==l[2]?b=1:0==l[0]&&0==l[1]&&0==l[3]?b=0:0==l[0]&&0==l[2]&&0==l[3]?b=3:0==l[1]&&0==l[2]&&0==l[3]&&(b=2);else if(2==d&&0==n){var q=Math.floor(2*Math.random());b=0==l[0]&&0==l[1]?+(0!=q):0==l[0]&&0==l[2]?2*(0!=q):0==l[0]&&0==l[3]?3*(0!=q):0==l[1]&&0==l[2]?0==q?1:2:0==l[1]&&0==l[3]?0==q?1:3:0==q?2:3}else if(4==d&&0==n){var q=Math.floor(4*Math.random());b=q}else b=e;0==b?f.setCenter(c.getCenterX(),c.getCenterY()-c.getHeight()/2-j.DEFAULT_EDGE_LENGTH-f.getHeight()/2):1==b?f.setCenter(c.getCenterX()+c.getWidth()/2+j.DEFAULT_EDGE_LENGTH+f.getWidth()/2,c.getCenterY()):2==b?f.setCenter(c.getCenterX(),c.getCenterY()+c.getHeight()/2+j.DEFAULT_EDGE_LENGTH+f.getHeight()/2):f.setCenter(c.getCenterX()-c.getWidth()/2-j.DEFAULT_EDGE_LENGTH-f.getWidth()/2,c.getCenterY())},a.exports=s},function(a,b,c){"use strict";var d={};d.layoutBase=c(0),d.CoSEConstants=c(1),d.CoSEEdge=c(2),d.CoSEGraph=c(3),d.CoSEGraphManager=c(4),d.CoSELayout=c(6),d.CoSENode=c(5),a.exports=d}],c={};function d(a){if(c[a])return c[a].exports;var e=c[a]={i:a,l:!1,exports:{}};return b[a].call(e.exports,e,e.exports,d),e.l=!0,e.exports}return d.m=b,d.c=c,d.i=function(a){return a},d.d=function(a,b,c){d.o(a,b)||Object.defineProperty(a,b,{configurable:!1,enumerable:!0,get:c})},d.n=function(a){var b=a&&a.__esModule?function(){return a.default}:function(){return a};return d.d(b,"a",b),b},d.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},d.p="",d(d.s=7)}(c(97372))},97372:function(a){a.exports=function(){var a=[function(a,b,c){"use strict";function d(){}d.QUALITY=1,d.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,d.DEFAULT_INCREMENTAL=!1,d.DEFAULT_ANIMATION_ON_LAYOUT=!0,d.DEFAULT_ANIMATION_DURING_LAYOUT=!1,d.DEFAULT_ANIMATION_PERIOD=50,d.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,d.DEFAULT_GRAPH_MARGIN=15,d.NODE_DIMENSIONS_INCLUDE_LABELS=!1,d.SIMPLE_NODE_SIZE=40,d.SIMPLE_NODE_HALF_SIZE=d.SIMPLE_NODE_SIZE/2,d.EMPTY_COMPOUND_NODE_SIZE=40,d.MIN_EDGE_LENGTH=1,d.WORLD_BOUNDARY=1e6,d.INITIAL_WORLD_BOUNDARY=d.WORLD_BOUNDARY/1e3,d.WORLD_CENTER_X=1200,d.WORLD_CENTER_Y=900,a.exports=d},function(a,b,c){"use strict";var d=c(2),e=c(8),f=c(9);function g(a,b,c){d.call(this,c),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=c,this.bendpoints=[],this.source=a,this.target=b}for(var h in g.prototype=Object.create(d.prototype),d)g[h]=d[h];g.prototype.getSource=function(){return this.source},g.prototype.getTarget=function(){return this.target},g.prototype.isInterGraph=function(){return this.isInterGraph},g.prototype.getLength=function(){return this.length},g.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},g.prototype.getBendpoints=function(){return this.bendpoints},g.prototype.getLca=function(){return this.lca},g.prototype.getSourceInLca=function(){return this.sourceInLca},g.prototype.getTargetInLca=function(){return this.targetInLca},g.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},g.prototype.getOtherEndInGraph=function(a,b){for(var c=this.getOtherEnd(a),d=b.getGraphManager().getRoot();;){if(c.getOwner()==b)return c;if(c.getOwner()==d)break;c=c.getOwner().getParent()}return null},g.prototype.updateLength=function(){var a=[,,,,];this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],1>Math.abs(this.lengthX)&&(this.lengthX=f.sign(this.lengthX)),1>Math.abs(this.lengthY)&&(this.lengthY=f.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},g.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),1>Math.abs(this.lengthX)&&(this.lengthX=f.sign(this.lengthX)),1>Math.abs(this.lengthY)&&(this.lengthY=f.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},a.exports=g},function(a,b,c){"use strict";a.exports=function(a){this.vGraphObject=a}},function(a,b,c){"use strict";var d=c(2),e=c(10),f=c(13),g=c(0),h=c(16),i=c(4);function j(a,b,c,g){null==c&&null==g&&(g=b),d.call(this,g),null!=a.graphManager&&(a=a.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=a,null!=c&&null!=b?this.rect=new f(b.x,b.y,c.width,c.height):this.rect=new f}for(var k in j.prototype=Object.create(d.prototype),d)j[k]=d[k];j.prototype.getEdges=function(){return this.edges},j.prototype.getChild=function(){return this.child},j.prototype.getOwner=function(){return this.owner},j.prototype.getWidth=function(){return this.rect.width},j.prototype.setWidth=function(a){this.rect.width=a},j.prototype.getHeight=function(){return this.rect.height},j.prototype.setHeight=function(a){this.rect.height=a},j.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},j.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},j.prototype.getCenter=function(){return new i(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},j.prototype.getLocation=function(){return new i(this.rect.x,this.rect.y)},j.prototype.getRect=function(){return this.rect},j.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},j.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},j.prototype.setRect=function(a,b){this.rect.x=a.x,this.rect.y=a.y,this.rect.width=b.width,this.rect.height=b.height},j.prototype.setCenter=function(a,b){this.rect.x=a-this.rect.width/2,this.rect.y=b-this.rect.height/2},j.prototype.setLocation=function(a,b){this.rect.x=a,this.rect.y=b},j.prototype.moveBy=function(a,b){this.rect.x+=a,this.rect.y+=b},j.prototype.getEdgeListToNode=function(a){var b=[],c=this;return c.edges.forEach(function(d){if(d.target==a){if(d.source!=c)throw"Incorrect edge source!";b.push(d)}}),b},j.prototype.getEdgesBetween=function(a){var b=[],c=this;return c.edges.forEach(function(d){if(d.source!=c&&d.target!=c)throw"Incorrect edge source and/or target";(d.target==a||d.source==a)&&b.push(d)}),b},j.prototype.getNeighborsList=function(){var a=new Set,b=this;return b.edges.forEach(function(c){if(c.source==b)a.add(c.target);else{if(c.target!=b)throw"Incorrect incidency!";a.add(c.source)}}),a},j.prototype.withChildren=function(){var a=new Set;if(a.add(this),null!=this.child)for(var b=this.child.getNodes(),c=0;c<b.length;c++)b[c].withChildren().forEach(function(b){a.add(b)});return a},j.prototype.getNoOfChildren=function(){var a=0;if(null==this.child)a=1;else for(var b=this.child.getNodes(),c=0;c<b.length;c++)a+=b[c].getNoOfChildren();return 0==a&&(a=1),a},j.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},j.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},j.prototype.scatter=function(){var a,b,c=-g.INITIAL_WORLD_BOUNDARY,d=g.INITIAL_WORLD_BOUNDARY;a=g.WORLD_CENTER_X+h.nextDouble()*(d-c)+c;var e=-g.INITIAL_WORLD_BOUNDARY,f=g.INITIAL_WORLD_BOUNDARY;b=g.WORLD_CENTER_Y+h.nextDouble()*(f-e)+e,this.rect.x=a,this.rect.y=b},j.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var a=this.getChild();if(a.updateBounds(!0),this.rect.x=a.getLeft(),this.rect.y=a.getTop(),this.setWidth(a.getRight()-a.getLeft()),this.setHeight(a.getBottom()-a.getTop()),g.NODE_DIMENSIONS_INCLUDE_LABELS){var b=a.getRight()-a.getLeft(),c=a.getBottom()-a.getTop();this.labelWidth>b&&(this.rect.x-=(this.labelWidth-b)/2,this.setWidth(this.labelWidth)),this.labelHeight>c&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-c)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-c),this.setHeight(this.labelHeight))}}},j.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},j.prototype.transform=function(a){var b=this.rect.x;b>g.WORLD_BOUNDARY?b=g.WORLD_BOUNDARY:b<-g.WORLD_BOUNDARY&&(b=-g.WORLD_BOUNDARY);var c=this.rect.y;c>g.WORLD_BOUNDARY?c=g.WORLD_BOUNDARY:c<-g.WORLD_BOUNDARY&&(c=-g.WORLD_BOUNDARY);var d=new i(b,c),e=a.inverseTransformPoint(d);this.setLocation(e.x,e.y)},j.prototype.getLeft=function(){return this.rect.x},j.prototype.getRight=function(){return this.rect.x+this.rect.width},j.prototype.getTop=function(){return this.rect.y},j.prototype.getBottom=function(){return this.rect.y+this.rect.height},j.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},a.exports=j},function(a,b,c){"use strict";function d(a,b){null==a&&null==b?(this.x=0,this.y=0):(this.x=a,this.y=b)}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.setX=function(a){this.x=a},d.prototype.setY=function(a){this.y=a},d.prototype.getDifference=function(a){return new DimensionD(this.x-a.x,this.y-a.y)},d.prototype.getCopy=function(){return new d(this.x,this.y)},d.prototype.translate=function(a){return this.x+=a.width,this.y+=a.height,this},a.exports=d},function(a,b,c){"use strict";var d=c(2),e=c(10),f=c(0),g=c(6),h=c(3),i=c(1),j=c(13),k=c(12),l=c(11);function m(a,b,c){d.call(this,c),this.estimatedSize=e.MIN_VALUE,this.margin=f.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=a,null!=b&&b instanceof g?this.graphManager=b:null!=b&&b instanceof Layout&&(this.graphManager=b.graphManager)}for(var n in m.prototype=Object.create(d.prototype),d)m[n]=d[n];m.prototype.getNodes=function(){return this.nodes},m.prototype.getEdges=function(){return this.edges},m.prototype.getGraphManager=function(){return this.graphManager},m.prototype.getParent=function(){return this.parent},m.prototype.getLeft=function(){return this.left},m.prototype.getRight=function(){return this.right},m.prototype.getTop=function(){return this.top},m.prototype.getBottom=function(){return this.bottom},m.prototype.isConnected=function(){return this.isConnected},m.prototype.add=function(a,b,c){if(null==b&&null==c){if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(a)>-1)throw"Node already in graph!";return a.owner=this,this.getNodes().push(a),a}if(!(this.getNodes().indexOf(b)>-1&&this.getNodes().indexOf(c)>-1))throw"Source or target not in graph!";if(b.owner!=c.owner||b.owner!=this)throw"Both owners must be this graph!";return b.owner!=c.owner?null:(a.source=b,a.target=c,a.isInterGraph=!1,this.getEdges().push(a),b.edges.push(a),c!=b&&c.edges.push(a),a)},m.prototype.remove=function(a){if(a instanceof h){if(null==a)throw"Node is null!";if(null==a.owner||a.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var b,c=a.edges.slice(),d=c.length,e=0;e<d;e++)(b=c[e]).isInterGraph?this.graphManager.remove(b):b.source.owner.remove(b);var f=this.nodes.indexOf(a);if(-1==f)throw"Node not in owner node list!";this.nodes.splice(f,1)}else if(a instanceof i){var b=a;if(null==b)throw"Edge is null!";if(null==b.source||null==b.target)throw"Source and/or target is null!";if(null==b.source.owner||null==b.target.owner||b.source.owner!=this||b.target.owner!=this)throw"Source and/or target owner is invalid!";var g=b.source.edges.indexOf(b),j=b.target.edges.indexOf(b);if(!(g>-1&&j>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(g,1),b.target!=b.source&&b.target.edges.splice(j,1);var f=b.source.owner.getEdges().indexOf(b);if(-1==f)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(f,1)}},m.prototype.updateLeftTop=function(){for(var a,b,c,d=e.MAX_VALUE,f=e.MAX_VALUE,g=this.getNodes(),h=g.length,i=0;i<h;i++){var j=g[i];a=j.getTop(),b=j.getLeft(),d>a&&(d=a),f>b&&(f=b)}return d==e.MAX_VALUE?null:(c=void 0!=g[0].getParent().paddingLeft?g[0].getParent().paddingLeft:this.margin,this.left=f-c,this.top=d-c,new k(this.left,this.top))},m.prototype.updateBounds=function(a){for(var b,c,d,f,g,h=e.MAX_VALUE,i=-e.MAX_VALUE,k=e.MAX_VALUE,l=-e.MAX_VALUE,m=this.nodes,n=m.length,o=0;o<n;o++){var p=m[o];a&&null!=p.child&&p.updateBounds(),b=p.getLeft(),c=p.getRight(),d=p.getTop(),f=p.getBottom(),h>b&&(h=b),i<c&&(i=c),k>d&&(k=d),l<f&&(l=f)}var q=new j(h,k,i-h,l-k);h==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),g=void 0!=m[0].getParent().paddingLeft?m[0].getParent().paddingLeft:this.margin,this.left=q.x-g,this.right=q.x+q.width+g,this.top=q.y-g,this.bottom=q.y+q.height+g},m.calculateBounds=function(a){for(var b,c,d,f,g=e.MAX_VALUE,h=-e.MAX_VALUE,i=e.MAX_VALUE,k=-e.MAX_VALUE,l=a.length,m=0;m<l;m++){var n=a[m];b=n.getLeft(),c=n.getRight(),d=n.getTop(),f=n.getBottom(),g>b&&(g=b),h<c&&(h=c),i>d&&(i=d),k<f&&(k=f)}return new j(g,i,h-g,k-i)},m.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},m.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},m.prototype.calcEstimatedSize=function(){for(var a=0,b=this.nodes,c=b.length,d=0;d<c;d++)a+=b[d].calcEstimatedSize();return 0==a?this.estimatedSize=f.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=a/Math.sqrt(this.nodes.length),this.estimatedSize},m.prototype.updateConnected=function(){var a,b,c=this;if(0==this.nodes.length){this.isConnected=!0;return}var d=new l,e=new Set,f=this.nodes[0];for(f.withChildren().forEach(function(a){d.push(a),e.add(a)});0!==d.length;)for(var g=(a=(f=d.shift()).getEdges()).length,h=0;h<g;h++)null==(b=a[h].getOtherEndInGraph(f,this))||e.has(b)||b.withChildren().forEach(function(a){d.push(a),e.add(a)});if(this.isConnected=!1,e.size>=this.nodes.length){var i=0;e.forEach(function(a){a.owner==c&&i++}),i==this.nodes.length&&(this.isConnected=!0)}},a.exports=m},function(a,b,c){"use strict";var d,e=c(1);function f(a){d=c(5),this.layout=a,this.graphs=[],this.edges=[]}f.prototype.addRoot=function(){var a=this.layout.newGraph(),b=this.layout.newNode(null),c=this.add(a,b);return this.setRootGraph(c),this.rootGraph},f.prototype.add=function(a,b,c,d,e){if(null==c&&null==d&&null==e){if(null==a)throw"Graph is null!";if(null==b)throw"Parent node is null!";if(this.graphs.indexOf(a)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(a),null!=a.parent)throw"Already has a parent!";if(null!=b.child)throw"Already has a child!";return a.parent=b,b.child=a,a}e=c,d=b,c=a;var f=d.getOwner(),g=e.getOwner();if(null==f||f.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==g||g.getGraphManager()!=this)throw"Target not in this graph mgr!";if(f==g)return c.isInterGraph=!1,f.add(c,d,e);if(c.isInterGraph=!0,c.source=d,c.target=e,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),null==c.source||null==c.target)throw"Edge source and/or target is null!";if(-1!=c.source.edges.indexOf(c)||-1!=c.target.edges.indexOf(c))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c},f.prototype.remove=function(a){if(a instanceof d){if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(a!=this.rootGraph&&(null==a.parent||a.parent.graphManager!=this))throw"Invalid parent node!";for(var b,c,f=[],g=(f=f.concat(a.getEdges())).length,h=0;h<g;h++)b=f[h],a.remove(b);var i=[];g=(i=i.concat(a.getNodes())).length;for(var h=0;h<g;h++)c=i[h],a.remove(c);a==this.rootGraph&&this.setRootGraph(null);var j=this.graphs.indexOf(a);this.graphs.splice(j,1),a.parent=null}else if(a instanceof e){if(null==(b=a))throw"Edge is null!";if(!b.isInterGraph)throw"Not an inter-graph edge!";if(null==b.source||null==b.target)throw"Source and/or target is null!";if(-1==b.source.edges.indexOf(b)||-1==b.target.edges.indexOf(b))throw"Source and/or target doesn't know this edge!";var j=b.source.edges.indexOf(b);if(b.source.edges.splice(j,1),j=b.target.edges.indexOf(b),b.target.edges.splice(j,1),null==b.source.owner||null==b.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==b.source.owner.getGraphManager().edges.indexOf(b))throw"Not in owner graph manager's edge list!";var j=b.source.owner.getGraphManager().edges.indexOf(b);b.source.owner.getGraphManager().edges.splice(j,1)}},f.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},f.prototype.getGraphs=function(){return this.graphs},f.prototype.getAllNodes=function(){if(null==this.allNodes){for(var a=[],b=this.getGraphs(),c=b.length,d=0;d<c;d++)a=a.concat(b[d].getNodes());this.allNodes=a}return this.allNodes},f.prototype.resetAllNodes=function(){this.allNodes=null},f.prototype.resetAllEdges=function(){this.allEdges=null},f.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},f.prototype.getAllEdges=function(){if(null==this.allEdges){var a=[],b=this.getGraphs();b.length;for(var c=0;c<b.length;c++)a=a.concat(b[c].getEdges());a=a.concat(this.edges),this.allEdges=a}return this.allEdges},f.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},f.prototype.setAllNodesToApplyGravitation=function(a){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=a},f.prototype.getRoot=function(){return this.rootGraph},f.prototype.setRootGraph=function(a){if(a.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=a,null==a.parent&&(a.parent=this.layout.newNode("Root node"))},f.prototype.getLayout=function(){return this.layout},f.prototype.isOneAncestorOfOther=function(a,b){if(null==a||null==b)throw"assert failed";if(a==b)return!0;for(var c,d=a.getOwner();null!=(c=d.getParent());){if(c==b)return!0;if(null==(d=c.getOwner()))break}for(d=b.getOwner();null!=(c=d.getParent());){if(c==a)return!0;if(null==(d=c.getOwner()))break}return!1},f.prototype.calcLowestCommonAncestors=function(){for(var a,b,c,d,e,f=this.getAllEdges(),g=f.length,h=0;h<g;h++){if(b=(a=f[h]).source,c=a.target,a.lca=null,a.sourceInLca=b,a.targetInLca=c,b==c){a.lca=b.getOwner();continue}for(d=b.getOwner();null==a.lca;){for(a.targetInLca=c,e=c.getOwner();null==a.lca;){if(e==d){a.lca=e;break}if(e==this.rootGraph)break;if(null!=a.lca)throw"assert failed";a.targetInLca=e.getParent(),e=a.targetInLca.getOwner()}if(d==this.rootGraph)break;null==a.lca&&(a.sourceInLca=d.getParent(),d=a.sourceInLca.getOwner())}if(null==a.lca)throw"assert failed"}},f.prototype.calcLowestCommonAncestor=function(a,b){if(a==b)return a.getOwner();for(var c=a.getOwner();null!=c;){for(var d=b.getOwner();null!=d;){if(d==c)return d;d=d.getParent().getOwner()}c=c.getParent().getOwner()}return c},f.prototype.calcInclusionTreeDepths=function(a,b){null==a&&null==b&&(a=this.rootGraph,b=1);for(var c,d=a.getNodes(),e=d.length,f=0;f<e;f++)(c=d[f]).inclusionTreeDepth=b,null!=c.child&&this.calcInclusionTreeDepths(c.child,b+1)},f.prototype.includesInvalidEdge=function(){for(var a,b=this.edges.length,c=0;c<b;c++)if(a=this.edges[c],this.isOneAncestorOfOther(a.source,a.target))return!0;return!1},a.exports=f},function(a,b,c){"use strict";var d=c(0);function e(){}for(var f in d)e[f]=d[f];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=3*e.MAX_NODE_DISPLACEMENT_INCREMENTAL,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,a.exports=e},function(a,b,c){"use strict";var d=c(12);function e(){}e.calcSeparationAmount=function(a,b,c,d){if(!a.intersects(b))throw"assert failed";var e=[,,];this.decideDirectionsForOverlappingNodes(a,b,e),c[0]=Math.min(a.getRight(),b.getRight())-Math.max(a.x,b.x),c[1]=Math.min(a.getBottom(),b.getBottom())-Math.max(a.y,b.y),a.getX()<=b.getX()&&a.getRight()>=b.getRight()?c[0]+=Math.min(b.getX()-a.getX(),a.getRight()-b.getRight()):b.getX()<=a.getX()&&b.getRight()>=a.getRight()&&(c[0]+=Math.min(a.getX()-b.getX(),b.getRight()-a.getRight())),a.getY()<=b.getY()&&a.getBottom()>=b.getBottom()?c[1]+=Math.min(b.getY()-a.getY(),a.getBottom()-b.getBottom()):b.getY()<=a.getY()&&b.getBottom()>=a.getBottom()&&(c[1]+=Math.min(a.getY()-b.getY(),b.getBottom()-a.getBottom()));var f=Math.abs((b.getCenterY()-a.getCenterY())/(b.getCenterX()-a.getCenterX()));b.getCenterY()===a.getCenterY()&&b.getCenterX()===a.getCenterX()&&(f=1);var g=f*c[0],h=c[1]/f;c[0]<h?h=c[0]:g=c[1],c[0]=-1*e[0]*(h/2+d),c[1]=-1*e[1]*(g/2+d)},e.decideDirectionsForOverlappingNodes=function(a,b,c){a.getCenterX()<b.getCenterX()?c[0]=-1:c[0]=1,a.getCenterY()<b.getCenterY()?c[1]=-1:c[1]=1},e.getIntersection2=function(a,b,c){var d=a.getCenterX(),e=a.getCenterY(),f=b.getCenterX(),g=b.getCenterY();if(a.intersects(b))return c[0]=d,c[1]=e,c[2]=f,c[3]=g,!0;var h=a.getX(),i=a.getY(),j=a.getRight(),k=a.getX(),l=a.getBottom(),m=a.getRight(),n=a.getWidthHalf(),o=a.getHeightHalf(),p=b.getX(),q=b.getY(),r=b.getRight(),s=b.getX(),t=b.getBottom(),u=b.getRight(),v=b.getWidthHalf(),w=b.getHeightHalf(),x=!1,y=!1;if(d===f)e>g?(c[0]=d,c[1]=i,c[2]=f,c[3]=t):e<g&&(c[0]=d,c[1]=l,c[2]=f,c[3]=q);else if(e===g)d>f?(c[0]=h,c[1]=e,c[2]=r,c[3]=g):d<f&&(c[0]=j,c[1]=e,c[2]=p,c[3]=g);else{var z=a.height/a.width,A=b.height/b.width,B=(g-e)/(f-d),C=void 0,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0;if(-z===B?(d>f?(c[0]=k,c[1]=l):(c[0]=j,c[1]=i),x=!0):z===B&&(d>f?(c[0]=h,c[1]=i):(c[0]=m,c[1]=l),x=!0),-A===B?(f>d?(c[2]=s,c[3]=t):(c[2]=r,c[3]=q),y=!0):A===B&&(f>d?(c[2]=p,c[3]=q):(c[2]=u,c[3]=t),y=!0),x&&y)return!1;if(d>f?e>g?(C=this.getCardinalDirection(z,B,4),D=this.getCardinalDirection(A,B,2)):(C=this.getCardinalDirection(-z,B,3),D=this.getCardinalDirection(-A,B,1)):e>g?(C=this.getCardinalDirection(-z,B,1),D=this.getCardinalDirection(-A,B,3)):(C=this.getCardinalDirection(z,B,2),D=this.getCardinalDirection(A,B,4)),!x)switch(C){case 1:F=i,E=d+-o/B,c[0]=E,c[1]=F;break;case 2:E=m,F=e+n*B,c[0]=E,c[1]=F;break;case 3:F=l,E=d+o/B,c[0]=E,c[1]=F;break;case 4:E=k,F=e+-n*B,c[0]=E,c[1]=F}if(!y)switch(D){case 1:H=q,G=f+-w/B,c[2]=G,c[3]=H;break;case 2:G=u,H=g+v*B,c[2]=G,c[3]=H;break;case 3:H=t,G=f+w/B,c[2]=G,c[3]=H;break;case 4:G=s,H=g+-v*B,c[2]=G,c[3]=H}}return!1},e.getCardinalDirection=function(a,b,c){return a>b?c:1+c%4},e.getIntersection=function(a,b,c,e){if(null==e)return this.getIntersection2(a,b,c);var f=a.x,g=a.y,h=b.x,i=b.y,j=c.x,k=c.y,l=e.x,m=e.y,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0,t=void 0;return(n=i-g,p=f-h,r=h*g-f*i,o=m-k,q=j-l,s=l*k-j*m,0==(t=n*q-o*p))?null:new d((p*s-q*r)/t,(o*r-n*s)/t)},e.angleOfVector=function(a,b,c,d){var e=void 0;return a!==c?(e=Math.atan((d-b)/(c-a)),c<a?e+=Math.PI:d<b&&(e+=this.TWO_PI)):e=d<b?this.ONE_AND_HALF_PI:this.HALF_PI,e},e.doIntersect=function(a,b,c,d){var e=a.x,f=a.y,g=b.x,h=b.y,i=c.x,j=c.y,k=d.x,l=d.y,m=(g-e)*(l-j)-(k-i)*(h-f);if(0===m)return!1;var n=((l-j)*(k-e)+(i-k)*(l-f))/m,o=((f-h)*(k-e)+(g-e)*(l-f))/m;return 0<n&&n<1&&0<o&&o<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,a.exports=e},function(a,b,c){"use strict";function d(){}d.sign=function(a){return a>0?1:a<0?-1:0},d.floor=function(a){return a<0?Math.ceil(a):Math.floor(a)},d.ceil=function(a){return a<0?Math.floor(a):Math.ceil(a)},a.exports=d},function(a,b,c){"use strict";function d(){}d.MAX_VALUE=0x7fffffff,d.MIN_VALUE=-0x80000000,a.exports=d},function(a,b,c){"use strict";var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=function(a){return{value:a,next:null,prev:null}},f=function(a,b,c,d){return null!==a?a.next=b:d.head=b,null!==c?c.prev=b:d.tail=b,b.prev=a,b.next=c,d.length++,b},g=function(a,b){var c=a.prev,d=a.next;return null!==c?c.next=d:b.head=d,null!==d?d.prev=c:b.tail=c,a.prev=a.next=null,b.length--,a};a.exports=function(){function a(b){var c=this;if(!(this instanceof a))throw TypeError("Cannot call a class as a function");this.length=0,this.head=null,this.tail=null,null!=b&&b.forEach(function(a){return c.push(a)})}return d(a,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(a,b){return f(b.prev,e(a),b,this)}},{key:"insertAfter",value:function(a,b){return f(b,e(a),b.next,this)}},{key:"insertNodeBefore",value:function(a,b){return f(b.prev,a,b,this)}},{key:"insertNodeAfter",value:function(a,b){return f(b,a,b.next,this)}},{key:"push",value:function(a){return f(this.tail,e(a),null,this)}},{key:"unshift",value:function(a){return f(null,e(a),this.head,this)}},{key:"remove",value:function(a){return g(a,this)}},{key:"pop",value:function(){return g(this.tail,this).value}},{key:"popNode",value:function(){return g(this.tail,this)}},{key:"shift",value:function(){return g(this.head,this).value}},{key:"shiftNode",value:function(){return g(this.head,this)}},{key:"get_object_at",value:function(a){if(a<=this.length()){for(var b=1,c=this.head;b<a;)c=c.next,b++;return c.value}}},{key:"set_object_at",value:function(a,b){if(a<=this.length()){for(var c=1,d=this.head;c<a;)d=d.next,c++;d.value=b}}}]),a}()},function(a,b,c){"use strict";function d(a,b,c){this.x=null,this.y=null,null==a&&null==b&&null==c?(this.x=0,this.y=0):"number"==typeof a&&"number"==typeof b&&null==c?(this.x=a,this.y=b):"Point"==a.constructor.name&&null==b&&null==c&&(c=a,this.x=c.x,this.y=c.y)}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.getLocation=function(){return new d(this.x,this.y)},d.prototype.setLocation=function(a,b,c){"Point"==a.constructor.name&&null==b&&null==c?(c=a,this.setLocation(c.x,c.y)):"number"==typeof a&&"number"==typeof b&&null==c&&(parseInt(a)==a&&parseInt(b)==b?this.move(a,b):(this.x=Math.floor(a+.5),this.y=Math.floor(b+.5)))},d.prototype.move=function(a,b){this.x=a,this.y=b},d.prototype.translate=function(a,b){this.x+=a,this.y+=b},d.prototype.equals=function(a){return"Point"==a.constructor.name?this.x==a.x&&this.y==a.y:this==a},d.prototype.toString=function(){return new d().constructor.name+"[x="+this.x+",y="+this.y+"]"},a.exports=d},function(a,b,c){"use strict";function d(a,b,c,d){this.x=0,this.y=0,this.width=0,this.height=0,null!=a&&null!=b&&null!=c&&null!=d&&(this.x=a,this.y=b,this.width=c,this.height=d)}d.prototype.getX=function(){return this.x},d.prototype.setX=function(a){this.x=a},d.prototype.getY=function(){return this.y},d.prototype.setY=function(a){this.y=a},d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(a){this.width=a},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(a){this.height=a},d.prototype.getRight=function(){return this.x+this.width},d.prototype.getBottom=function(){return this.y+this.height},d.prototype.intersects=function(a){return!(this.getRight()<a.x||this.getBottom()<a.y||a.getRight()<this.x||a.getBottom()<this.y)},d.prototype.getCenterX=function(){return this.x+this.width/2},d.prototype.getMinX=function(){return this.getX()},d.prototype.getMaxX=function(){return this.getX()+this.width},d.prototype.getCenterY=function(){return this.y+this.height/2},d.prototype.getMinY=function(){return this.getY()},d.prototype.getMaxY=function(){return this.getY()+this.height},d.prototype.getWidthHalf=function(){return this.width/2},d.prototype.getHeightHalf=function(){return this.height/2},a.exports=d},function(a,b,c){"use strict";var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function e(){}e.lastID=0,e.createID=function(a){return e.isPrimitive(a)?a:(null!=a.uniqueID||(a.uniqueID=e.getString(),e.lastID++),a.uniqueID)},e.getString=function(a){return null==a&&(a=e.lastID),"Object#"+a},e.isPrimitive=function(a){var b=void 0===a?"undefined":d(a);return null==a||"object"!=b&&"function"!=b},a.exports=e},function(a,b,c){"use strict";function d(a){if(!Array.isArray(a))return Array.from(a);for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}var e=c(0),f=c(6),g=c(3),h=c(1),i=c(5),j=c(4),k=c(17),l=c(27);function m(a){l.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new f(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=a&&(this.isRemoteUse=a)}m.RANDOM_SEED=1,m.prototype=Object.create(l.prototype),m.prototype.getGraphManager=function(){return this.graphManager},m.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},m.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},m.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},m.prototype.newGraphManager=function(){var a=new f(this);return this.graphManager=a,a},m.prototype.newGraph=function(a){return new i(null,this.graphManager,a)},m.prototype.newNode=function(a){return new g(this.graphManager,a)},m.prototype.newEdge=function(a){return new h(null,null,a)},m.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},m.prototype.runLayout=function(){var a;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),a=!this.checkLayoutSuccess()&&this.layout(),"during"!==e.ANIMATE&&(a&&!this.isSubLayout&&this.doPostLayout(),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,a)},m.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},m.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var a=this.graphManager.getAllEdges(),b=0;b<a.length;b++)a[b];for(var c=this.graphManager.getRoot().getNodes(),b=0;b<c.length;b++)c[b];this.update(this.graphManager.getRoot())}},m.prototype.update=function(a){if(null==a)this.update2();else if(a instanceof g){if(null!=a.getChild())for(var b=a.getChild().getNodes(),c=0;c<b.length;c++)update(b[c]);null!=a.vGraphObject&&a.vGraphObject.update(a)}else a instanceof h?null!=a.vGraphObject&&a.vGraphObject.update(a):a instanceof i&&null!=a.vGraphObject&&a.vGraphObject.update(a)},m.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},m.prototype.transform=function(a){if(void 0==a)this.transform(new j(0,0));else{var b=new k,c=this.graphManager.getRoot().updateLeftTop();if(null!=c){b.setWorldOrgX(a.x),b.setWorldOrgY(a.y),b.setDeviceOrgX(c.x),b.setDeviceOrgY(c.y);for(var d=this.getAllNodes(),e=0;e<d.length;e++)d[e].transform(b)}}},m.prototype.positionNodesRandomly=function(a){if(void 0==a)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var b,c,d=a.getNodes(),e=0;e<d.length;e++)null==(c=(b=d[e]).getChild())||0==c.getNodes().length?b.scatter():(this.positionNodesRandomly(c),b.updateBounds())},m.prototype.getFlatForest=function(){for(var a=[],b=!0,c=this.graphManager.getRoot().getNodes(),e=!0,f=0;f<c.length;f++)null!=c[f].getChild()&&(e=!1);if(!e)return a;var g=new Set,h=[],i=new Map,j=[];for(j=j.concat(c);j.length>0&&b;){for(h.push(j[0]);h.length>0&&b;){var k=h[0];h.splice(0,1),g.add(k);for(var l=k.getEdges(),f=0;f<l.length;f++){var m=l[f].getOtherEnd(k);if(i.get(k)!=m)if(g.has(m)){b=!1;break}else h.push(m),i.set(m,k)}}if(b){var n=[].concat(d(g));a.push(n);for(var f=0;f<n.length;f++){var o=n[f],p=j.indexOf(o);p>-1&&j.splice(p,1)}g=new Set,i=new Map}else a=[]}return a},m.prototype.createDummyNodesForBendpoints=function(a){for(var b=[],c=a.source,d=this.graphManager.calcLowestCommonAncestor(a.source,a.target),e=0;e<a.bendpoints.length;e++){var f=this.newNode(null);f.setRect(new Point(0,0),new Dimension(1,1)),d.add(f);var g=this.newEdge(null);this.graphManager.add(g,c,f),b.add(f),c=f}var g=this.newEdge(null);return this.graphManager.add(g,c,a.target),this.edgeToDummyNodes.set(a,b),a.isInterGraph()?this.graphManager.remove(a):d.remove(a),b},m.prototype.createBendpointsFromDummyNodes=function(){var a=[];a=a.concat(this.graphManager.getAllEdges()),a=[].concat(d(this.edgeToDummyNodes.keys())).concat(a);for(var b=0;b<a.length;b++){var c=a[b];if(c.bendpoints.length>0){for(var e=this.edgeToDummyNodes.get(c),f=0;f<e.length;f++){var g=e[f],h=new j(g.getCenterX(),g.getCenterY()),i=c.bendpoints.get(f);i.x=h.x,i.y=h.y,g.getOwner().remove(g)}this.graphManager.add(c,c.source,c.target)}}},m.transform=function(a,b,c,d){if(void 0==c||void 0==d)return a<=50?(e=9*b/500,f=b/10):(e=9*b/50,f=-8*b),e*a+f;var e,f,g=b;return a<=50?g-=(b-b/c)/50*(50-a):g+=(b*d-b)/50*(a-50),g},m.findCenterOfTree=function(a){var b=[];b=b.concat(a);var c=[],d=new Map,e=!1,f=null;(1==b.length||2==b.length)&&(e=!0,f=b[0]);for(var g=0;g<b.length;g++){var h=b[g],i=h.getNeighborsList().size;d.set(h,h.getNeighborsList().size),1==i&&c.push(h)}var j=[];for(j=j.concat(c);!e;){var k=[];k=k.concat(j),j=[];for(var g=0;g<b.length;g++){var h=b[g],l=b.indexOf(h);l>=0&&b.splice(l,1),h.getNeighborsList().forEach(function(a){if(0>c.indexOf(a)){var b=d.get(a)-1;1==b&&j.push(a),d.set(a,b)}})}c=c.concat(j),(1==b.length||2==b.length)&&(e=!0,f=b[0])}return f},m.prototype.setGraphManager=function(a){this.graphManager=a},a.exports=m},function(a,b,c){"use strict";function d(){}d.seed=1,d.x=0,d.nextDouble=function(){return d.x=1e4*Math.sin(d.seed++),d.x-Math.floor(d.x)},a.exports=d},function(a,b,c){"use strict";var d=c(4);function e(a,b){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(a){this.lworldExtX=a},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(a){this.lworldExtY=a},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},e.prototype.transformX=function(a){var b=0,c=this.lworldExtX;return 0!=c&&(b=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/c),b},e.prototype.transformY=function(a){var b=0,c=this.lworldExtY;return 0!=c&&(b=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/c),b},e.prototype.inverseTransformX=function(a){var b=0,c=this.ldeviceExtX;return 0!=c&&(b=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/c),b},e.prototype.inverseTransformY=function(a){var b=0,c=this.ldeviceExtY;return 0!=c&&(b=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/c),b},e.prototype.inverseTransformPoint=function(a){return new d(this.inverseTransformX(a.x),this.inverseTransformY(a.y))},a.exports=e},function(a,b,c){"use strict";var d=c(15),e=c(7),f=c(0),g=c(8),h=c(9);function i(){d.call(this),this.useSmartIdealEdgeLengthCalculation=e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=e.DEFAULT_EDGE_LENGTH,this.springConstant=e.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=e.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=e.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=e.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*e.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=e.MAX_ITERATIONS}for(var j in i.prototype=Object.create(d.prototype),d)i[j]=d[j];i.prototype.initParameters=function(){d.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},i.prototype.calcIdealEdgeLengths=function(){for(var a,b,c,d,g,h,i=this.getGraphManager().getAllEdges(),j=0;j<i.length;j++)(a=i[j]).idealLength=this.idealEdgeLength,a.isInterGraph&&(c=a.getSource(),d=a.getTarget(),g=a.getSourceInLca().getEstimatedSize(),h=a.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(a.idealLength+=g+h-2*f.SIMPLE_NODE_SIZE),b=a.getLca().getInclusionTreeDepth(),a.idealLength+=e.DEFAULT_EDGE_LENGTH*e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(c.getInclusionTreeDepth()+d.getInclusionTreeDepth()-2*b))},i.prototype.initSpringEmbedder=function(){var a=this.getAllNodes().length;this.incremental?(a>e.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*e.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(a-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-e.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT_INCREMENTAL):(a>e.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(e.COOLING_ADAPTATION_FACTOR,1-(a-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*(1-e.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},i.prototype.calcSpringForces=function(){for(var a,b=this.getAllEdges(),c=0;c<b.length;c++)a=b[c],this.calcSpringForce(a,a.idealLength)},i.prototype.calcRepulsionForces=function(){var a,b,c,d,f,g=!(arguments.length>0)||void 0===arguments[0]||arguments[0],h=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&g&&this.updateGrid(),f=new Set,a=0;a<i.length;a++)c=i[a],this.calculateRepulsionForceOfANode(c,f,g,h),f.add(c);else for(a=0;a<i.length;a++)for(c=i[a],b=a+1;b<i.length;b++)d=i[b],c.getOwner()==d.getOwner()&&this.calcRepulsionForce(c,d)},i.prototype.calcGravitationalForces=function(){for(var a,b=this.getAllNodesToApplyGravitation(),c=0;c<b.length;c++)a=b[c],this.calcGravitationalForce(a)},i.prototype.moveNodes=function(){for(var a=this.getAllNodes(),b=0;b<a.length;b++)a[b].move()},i.prototype.calcSpringForce=function(a,b){var c,d,e,f,g=a.getSource(),h=a.getTarget();if(this.uniformLeafNodeSizes&&null==g.getChild()&&null==h.getChild())a.updateLengthSimple();else if(a.updateLength(),a.isOverlapingSourceAndTarget)return;0!=(c=a.getLength())&&(e=(d=this.springConstant*(c-b))*(a.lengthX/c),f=d*(a.lengthY/c),g.springForceX+=e,g.springForceY+=f,h.springForceX-=e,h.springForceY-=f)},i.prototype.calcRepulsionForce=function(a,b){var c,d,f,i,j,k,l,m=a.getRect(),n=b.getRect(),o=[,,],p=[,,,,];if(m.intersects(n)){g.calcSeparationAmount(m,n,o,e.DEFAULT_EDGE_LENGTH/2),k=2*o[0],l=2*o[1];var q=a.noOfChildren*b.noOfChildren/(a.noOfChildren+b.noOfChildren);a.repulsionForceX-=q*k,a.repulsionForceY-=q*l,b.repulsionForceX+=q*k,b.repulsionForceY+=q*l}else this.uniformLeafNodeSizes&&null==a.getChild()&&null==b.getChild()?(c=n.getCenterX()-m.getCenterX(),d=n.getCenterY()-m.getCenterY()):(g.getIntersection(m,n,p),c=p[2]-p[0],d=p[3]-p[1]),Math.abs(c)<e.MIN_REPULSION_DIST&&(c=h.sign(c)*e.MIN_REPULSION_DIST),Math.abs(d)<e.MIN_REPULSION_DIST&&(d=h.sign(d)*e.MIN_REPULSION_DIST),i=Math.sqrt(f=c*c+d*d),k=(j=this.repulsionConstant*a.noOfChildren*b.noOfChildren/f)*c/i,l=j*d/i,a.repulsionForceX-=k,a.repulsionForceY-=l,b.repulsionForceX+=k,b.repulsionForceY+=l},i.prototype.calcGravitationalForce=function(a){var b,c,d,e,f,g,h,i;c=((b=a.getOwner()).getRight()+b.getLeft())/2,d=(b.getTop()+b.getBottom())/2,e=a.getCenterX()-c,f=a.getCenterY()-d,g=Math.abs(e)+a.getWidth()/2,h=Math.abs(f)+a.getHeight()/2,a.getOwner()==this.graphManager.getRoot()?(g>(i=b.getEstimatedSize()*this.gravityRangeFactor)||h>i)&&(a.gravitationForceX=-this.gravityConstant*e,a.gravitationForceY=-this.gravityConstant*f):(g>(i=b.getEstimatedSize()*this.compoundGravityRangeFactor)||h>i)&&(a.gravitationForceX=-this.gravityConstant*e*this.compoundGravityConstant,a.gravitationForceY=-this.gravityConstant*f*this.compoundGravityConstant)},i.prototype.isConverged=function(){var a,b=!1;return this.totalIterations>this.maxIterations/3&&(b=2>Math.abs(this.totalDisplacement-this.oldTotalDisplacement)),a=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,a||b},i.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},i.prototype.calcNoOfChildrenForAllNodes=function(){for(var a,b=this.graphManager.getAllNodes(),c=0;c<b.length;c++)(a=b[c]).noOfChildren=a.getNoOfChildren()},i.prototype.calcGrid=function(a){var b=0,c=0;b=parseInt(Math.ceil((a.getRight()-a.getLeft())/this.repulsionRange)),c=parseInt(Math.ceil((a.getBottom()-a.getTop())/this.repulsionRange));for(var d=Array(b),e=0;e<b;e++)d[e]=Array(c);for(var e=0;e<b;e++)for(var f=0;f<c;f++)d[e][f]=[];return d},i.prototype.addNodeToGrid=function(a,b,c){var d=0,e=0,f=0,g=0;d=parseInt(Math.floor((a.getRect().x-b)/this.repulsionRange)),e=parseInt(Math.floor((a.getRect().width+a.getRect().x-b)/this.repulsionRange)),f=parseInt(Math.floor((a.getRect().y-c)/this.repulsionRange)),g=parseInt(Math.floor((a.getRect().height+a.getRect().y-c)/this.repulsionRange));for(var h=d;h<=e;h++)for(var i=f;i<=g;i++)this.grid[h][i].push(a),a.setGridCoordinates(d,e,f,g)},i.prototype.updateGrid=function(){var a,b,c=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),a=0;a<c.length;a++)b=c[a],this.addNodeToGrid(b,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},i.prototype.calculateRepulsionForceOfANode=function(a,b,c,d){if(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&c||d){var f,g=new Set;a.surrounding=[];for(var h=this.grid,i=a.startX-1;i<a.finishX+2;i++)for(var j=a.startY-1;j<a.finishY+2;j++)if(!(i<0||j<0||i>=h.length||j>=h[0].length)){for(var k=0;k<h[i][j].length;k++)if(f=h[i][j][k],a.getOwner()==f.getOwner()&&a!=f&&!b.has(f)&&!g.has(f)){var l=Math.abs(a.getCenterX()-f.getCenterX())-(a.getWidth()/2+f.getWidth()/2),m=Math.abs(a.getCenterY()-f.getCenterY())-(a.getHeight()/2+f.getHeight()/2);l<=this.repulsionRange&&m<=this.repulsionRange&&g.add(f)}}a.surrounding=[].concat(function(a){if(!Array.isArray(a))return Array.from(a);for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}(g))}for(i=0;i<a.surrounding.length;i++)this.calcRepulsionForce(a,a.surrounding[i])},i.prototype.calcRepulsionRange=function(){return 0},a.exports=i},function(a,b,c){"use strict";var d=c(1),e=c(7);function f(a,b,c){d.call(this,a,b,c),this.idealLength=e.DEFAULT_EDGE_LENGTH}for(var g in f.prototype=Object.create(d.prototype),d)f[g]=d[g];a.exports=f},function(a,b,c){"use strict";var d=c(3);function e(a,b,c,e){d.call(this,a,b,c,e),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];e.prototype.setGridCoordinates=function(a,b,c,d){this.startX=a,this.finishX=b,this.startY=c,this.finishY=d},a.exports=e},function(a,b,c){"use strict";function d(a,b){this.width=0,this.height=0,null!==a&&null!==b&&(this.height=b,this.width=a)}d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(a){this.width=a},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(a){this.height=a},a.exports=d},function(a,b,c){"use strict";var d=c(14);function e(){this.map={},this.keys=[]}e.prototype.put=function(a,b){var c=d.createID(a);this.contains(c)||(this.map[c]=b,this.keys.push(a))},e.prototype.contains=function(a){return d.createID(a),null!=this.map[a]},e.prototype.get=function(a){var b=d.createID(a);return this.map[b]},e.prototype.keySet=function(){return this.keys},a.exports=e},function(a,b,c){"use strict";var d=c(14);function e(){this.set={}}e.prototype.add=function(a){var b=d.createID(a);this.contains(b)||(this.set[b]=a)},e.prototype.remove=function(a){delete this.set[d.createID(a)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(a){return this.set[d.createID(a)]==a},e.prototype.isEmpty=function(){return 0===this.size()},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(a){for(var b=Object.keys(this.set),c=b.length,d=0;d<c;d++)a.push(this.set[b[d]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(a){for(var b=a.length,c=0;c<b;c++){var d=a[c];this.add(d)}},a.exports=e},function(a,b,c){"use strict";var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=c(11);a.exports=function(){function a(b,c){if(!(this instanceof a))throw TypeError("Cannot call a class as a function");(null!==c||void 0!==c)&&(this.compareFunction=this._defaultCompareFunction);var d=void 0;d=b instanceof e?b.size():b.length,this._quicksort(b,0,d-1)}return d(a,[{key:"_quicksort",value:function(a,b,c){if(b<c){var d=this._partition(a,b,c);this._quicksort(a,b,d),this._quicksort(a,d+1,c)}}},{key:"_partition",value:function(a,b,c){for(var d=this._get(a,b),e=b,f=c;;){for(;this.compareFunction(d,this._get(a,f));)f--;for(;this.compareFunction(this._get(a,e),d);)e++;if(!(e<f))return f;this._swap(a,e,f),e++,f--}}},{key:"_get",value:function(a,b){return a instanceof e?a.get_object_at(b):a[b]}},{key:"_set",value:function(a,b,c){a instanceof e?a.set_object_at(b,c):a[b]=c}},{key:"_swap",value:function(a,b,c){var d=this._get(a,b);this._set(a,b,this._get(a,c)),this._set(a,c,d)}},{key:"_defaultCompareFunction",value:function(a,b){return b>a}}]),a}()},function(a,b,c){"use strict";var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();a.exports=function(){function a(b,c){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,f=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;if(!(this instanceof a))throw TypeError("Cannot call a class as a function");this.sequence1=b,this.sequence2=c,this.match_score=d,this.mismatch_penalty=e,this.gap_penalty=f,this.iMax=b.length+1,this.jMax=c.length+1,this.grid=Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[g][h]=0}this.tracebackGrid=Array(this.iMax);for(var i=0;i<this.iMax;i++){this.tracebackGrid[i]=Array(this.jMax);for(var j=0;j<this.jMax;j++)this.tracebackGrid[i][j]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return d(a,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var a=1;a<this.jMax;a++)this.grid[0][a]=this.grid[0][a-1]+this.gap_penalty,this.tracebackGrid[0][a]=[!1,!1,!0];for(var b=1;b<this.iMax;b++)this.grid[b][0]=this.grid[b-1][0]+this.gap_penalty,this.tracebackGrid[b][0]=[!1,!0,!1];for(var c=1;c<this.iMax;c++)for(var d=1;d<this.jMax;d++){var e=[this.sequence1[c-1]===this.sequence2[d-1]?this.grid[c-1][d-1]+this.match_score:this.grid[c-1][d-1]+this.mismatch_penalty,this.grid[c-1][d]+this.gap_penalty,this.grid[c][d-1]+this.gap_penalty],f=this.arrayAllMaxIndexes(e);this.grid[c][d]=e[f[0]],this.tracebackGrid[c][d]=[f.includes(0),f.includes(1),f.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var a=[];for(a.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});a[0];){var b=a[0],c=this.tracebackGrid[b.pos[0]][b.pos[1]];c[0]&&a.push({pos:[b.pos[0]-1,b.pos[1]-1],seq1:this.sequence1[b.pos[0]-1]+b.seq1,seq2:this.sequence2[b.pos[1]-1]+b.seq2}),c[1]&&a.push({pos:[b.pos[0]-1,b.pos[1]],seq1:this.sequence1[b.pos[0]-1]+b.seq1,seq2:"-"+b.seq2}),c[2]&&a.push({pos:[b.pos[0],b.pos[1]-1],seq1:"-"+b.seq1,seq2:this.sequence2[b.pos[1]-1]+b.seq2}),0===b.pos[0]&&0===b.pos[1]&&this.alignments.push({sequence1:b.seq1,sequence2:b.seq2}),a.shift()}return this.alignments}},{key:"getAllIndexes",value:function(a,b){for(var c=[],d=-1;-1!==(d=a.indexOf(b,d+1));)c.push(d);return c}},{key:"arrayAllMaxIndexes",value:function(a){return this.getAllIndexes(a,Math.max.apply(null,a))}}]),a}()},function(a,b,c){"use strict";var d=function(){};d.FDLayout=c(18),d.FDLayoutConstants=c(7),d.FDLayoutEdge=c(19),d.FDLayoutNode=c(20),d.DimensionD=c(21),d.HashMap=c(22),d.HashSet=c(23),d.IGeometry=c(8),d.IMath=c(9),d.Integer=c(10),d.Point=c(12),d.PointD=c(4),d.RandomSeed=c(16),d.RectangleD=c(13),d.Transform=c(17),d.UniqueIDGeneretor=c(14),d.Quicksort=c(24),d.LinkedList=c(11),d.LGraphObject=c(2),d.LGraph=c(5),d.LEdge=c(1),d.LGraphManager=c(6),d.LNode=c(3),d.Layout=c(15),d.LayoutConstants=c(0),d.NeedlemanWunsch=c(25),a.exports=d},function(a,b,c){"use strict";function d(){this.listeners=[]}var e=d.prototype;e.addListener=function(a,b){this.listeners.push({event:a,callback:b})},e.removeListener=function(a,b){for(var c=this.listeners.length;c>=0;c--){var d=this.listeners[c];d.event===a&&d.callback===b&&this.listeners.splice(c,1)}},e.emit=function(a,b){for(var c=0;c<this.listeners.length;c++){var d=this.listeners[c];a===d.event&&d.callback(b)}},a.exports=d}],b={};function c(d){if(b[d])return b[d].exports;var e=b[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,c),e.l=!0,e.exports}return c.m=a,c.c=b,c.i=function(a){return a},c.d=function(a,b,d){c.o(a,b)||Object.defineProperty(a,b,{configurable:!1,enumerable:!0,get:d})},c.n=function(a){var b=a&&a.__esModule?function(){return a.default}:function(){return a};return c.d(b,"a",b),b},c.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},c.p="",c(c.s=26)}()}};
|
|
@@ -14,49 +14,8 @@ ${c}`,{expandPromptTemplates:!1,source:"rpc"}),await d.waitForIdle();let j=d.get
|
|
|
14
14
|
- asking: AI 在提问等待用户输入
|
|
15
15
|
- normal: 正常运行中(长任务)
|
|
16
16
|
|
|
17
|
-
只输出一行 JSON(不要输出其他文字):{"kind":"sync_server|infinite_loop|rate_limit|error|asking|normal","detail":"简短说明"}`;async function l(a){let b=[`【任务卡 #${a.cardNumber}】${a.cardName}`,`任务描述:${a.taskDescription||"(空)"}`,"\n执行会话最后几条消息:",a.recentMessages||"(无消息)"].join("\n"),c=await j(a.cwd,n,b);return c&&["sync_server","infinite_loop","rate_limit","error","asking","normal"].includes(c.kind)?{kind:c.kind,detail:c.detail??""}:null}d()}catch(a){d(a)}})},
|
|
18
|
-
WHERE ready_status = 'todo' AND (exec_status = 'not_started' OR (exec_status = 'failed' AND retry_count < max_retries))
|
|
19
|
-
AND dispatch_token IS NULL
|
|
20
|
-
ORDER BY priority DESC, number`).all().map(h).filter(m)}function o(a,b){return Number((0,e.Lf)().prepare(`UPDATE task_cards SET dispatch_token = ?1, updated = ?2
|
|
21
|
-
WHERE id = ?3
|
|
22
|
-
AND ready_status = 'todo'
|
|
23
|
-
AND (exec_status = 'not_started' OR (exec_status = 'failed' AND retry_count < max_retries))
|
|
24
|
-
AND dispatch_token IS NULL`).run(b,Date.now(),a).changes)>0}function p(a,b){(0,e.Lf)().prepare("UPDATE task_cards SET dispatch_token = NULL, updated = ?2 WHERE id = ?1 AND dispatch_token = ?3").run(a,Date.now(),b)}function q(){return(0,e.Lf)().prepare("SELECT COUNT(*) AS n FROM task_cards WHERE exec_status = 'running'").get().n}function r(){return(0,e.Lf)().prepare(`SELECT ${i} FROM task_cards WHERE exec_status = 'running' ORDER BY number`).all().map(h)}function s(a){let b=a.map(()=>"?").join(",");return(0,e.Lf)().prepare(`SELECT ${i} FROM task_cards WHERE exec_status IN (${b}) ORDER BY number`).all(...a).map(h)}function t(a){return{...a}}function u(a,b,c){let f=(0,d.randomUUID)(),g=Date.now();return(0,e.Lf)().prepare("INSERT INTO task_card_questions (id, card_id, session_id, question, status, created) VALUES (?, ?, ?, ?, 'pending', ?)").run(f,a,b,c,g),t((0,e.Lf)().prepare("SELECT id, card_id AS cardId, session_id AS sessionId, question, status, answer, created, answered FROM task_card_questions WHERE id = ?").get(f))}function v(){return(0,e.Lf)().prepare(`SELECT q.id, q.card_id AS cardId, q.session_id AS sessionId, q.question, q.status, q.answer, q.created, q.answered
|
|
25
|
-
FROM task_card_questions q
|
|
26
|
-
JOIN task_cards c ON c.id = q.card_id
|
|
27
|
-
WHERE q.status = 'answered' AND c.exec_status = 'waiting_reply'
|
|
28
|
-
AND q.id = (SELECT q2.id FROM task_card_questions q2 WHERE q2.card_id = q.card_id AND q2.status='answered' ORDER BY q2.answered DESC, q2.created DESC LIMIT 1)
|
|
29
|
-
ORDER BY q.answered`).all().map(t)}},57856:(a,b,c)=>{c.d(b,{TQ:()=>e,p1:()=>d});let d=92;function e(a,b=d,c=40){return Object.freeze({terminal:Object.freeze({columns:b,rows:c,kittyProtocolActive:!1}),requestRender:a})}},60542:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{startTaskScheduler:()=>B});var e=c(29021),f=c(55511),g=c(75384),h=c(12144),i=c(69453),j=c(65562),k=c(14916),l=c(48817),m=c(32105),n=a([h,i,m]);[h,i,m]=n.then?(await n)():n;let D=new Map,E=new Map;function o(a){if(a.cwd)return a.cwd;let b=(0,g.v$)(a.boardId);return b&&(0,e.existsSync)(b.projectKey)?b.projectKey:null}async function p(a){if(a.sessionId)try{let b=await (0,i.os)(a.sessionId);if(b)return{...await (0,h.OF)(a.sessionId,b,void 0),created:!1}}catch{}let b=o(a);return b?{...await (0,h.OF)((0,f.randomUUID)(),"",b,{toolNames:k.C1}),created:!0}:null}async function q(a){let b=(0,f.randomUUID)();if(!(0,l.Im)(a.id,b))return console.log(`[task-scheduler] #${a.number} ${a.name} 派发锁被占用,跳过`),!1;let c=null;try{if(!(c=await p(a)))return console.warn(`[task-scheduler] #${a.number} ${a.name} 无可用 cwd,跳过派发`),(0,l.$j)(a.id,b),!1;let d=c;await d.session.send({type:"set_session_name",name:`#${a.number} ${a.name}`});let e=(0,g.v$)(a.boardId);if(e?.taskId&&(0,j.mE)(d.realSessionId,e.taskId),d.session.isRunning())return(0,l.w0)(a.id,{sessionId:d.realSessionId,execStatus:"running"}),r(a,d.session),(0,l.$j)(a.id,b),console.log(`[task-scheduler] #${a.number} ${a.name} 会话忙(复用中),标 running 不重发`),!0;return await d.session.send({type:"prompt",message:function(a){let b=[`【任务卡 #${a.number}】${a.name}`];if(a.description.trim()&&b.push("",a.description.trim()),a.attachments.length>0)for(let c of(b.push("","附件:"),a.attachments))b.push(`- ${c}`);return b.join("\n")}(a)}),(0,l.w0)(a.id,{sessionId:d.realSessionId,execStatus:"running"}),r(a,d.session),(0,l.$j)(a.id,b),console.log(`[task-scheduler] 派发 #${a.number} ${a.name} → session ${d.realSessionId.slice(0,8)}`),!0}catch(d){if(c?.created)try{c.session.destroy()}catch{}return(0,l.$j)(a.id,b),console.error(`[task-scheduler] 派发 #${a.number} ${a.name} 失败:`,d instanceof Error?d.message:d),!1}}function r(a,b){if("function"!=typeof b.onEvent)return;let c=b.onEvent(b=>{if("agent_end"!==b.type)return;c();let d=(0,l.XJ)(a.id);d&&"running"===d.execStatus&&((0,l.w0)(a.id,{execStatus:"review"}),console.log(`[task-scheduler] #${a.number} ${a.name} 执行会话结束(agent_end) → review(待审核)`))})}async function s(){let a=new Set((0,h.HG)()),b=Date.now(),c=0;for(let d of(0,l.BH)()){if(!d.sessionId||a.has(d.sessionId))continue;let e=await (0,m.Wz)(d.sessionId);e&&0!==e.lastActivityMs&&(b-e.lastActivityMs<5e3||((0,l.w0)(d.id,{execStatus:"review"}),console.log(`[task-scheduler] #${d.number} ${d.name} 执行会话已结束 → review(待审核)`),c+=1))}return c}async function t(){await s(),await u(),await y(),await z();let a=0,b=(0,l.CU)(),c=Math.max(0,1-b);if(c<=0)return C({type:"skipped_gate",at:Date.now()}),0;for(let b of(0,l.uZ)().slice(0,c)){if((0,l.CU)()>=1)break;await q(b)&&(a+=1,C({type:"dispatch",cardNumber:b.number,cardName:b.name,at:Date.now()}))}return a}async function u(){let a=0;for(let b of(0,l.Kg)()){let c=(0,l.XJ)(b.cardId);if(c&&"waiting_reply"===c.execStatus&&c.sessionId){if((0,l.CU)()>=1)break;await v(c,b)&&(a+=1,C({type:"resume",cardNumber:c.number,cardName:c.name,at:Date.now()}))}}return a}async function v(a,b){try{let c=await (0,i.os)(a.sessionId);if(!c)return!1;let{session:d}=await (0,h.OF)(a.sessionId,c,void 0);return await d.send({type:"prompt",message:`【用户回答了你的提问】
|
|
17
|
+
只输出一行 JSON(不要输出其他文字):{"kind":"sync_server|infinite_loop|rate_limit|error|asking|normal","detail":"简短说明"}`;async function l(a){let b=[`【任务卡 #${a.cardNumber}】${a.cardName}`,`任务描述:${a.taskDescription||"(空)"}`,"\n执行会话最后几条消息:",a.recentMessages||"(无消息)"].join("\n"),c=await j(a.cwd,n,b);return c&&["sync_server","infinite_loop","rate_limit","error","asking","normal"].includes(c.kind)?{kind:c.kind,detail:c.detail??""}:null}d()}catch(a){d(a)}})},57856:(a,b,c)=>{c.d(b,{TQ:()=>e,p1:()=>d});let d=92;function e(a,b=d,c=40){return Object.freeze({terminal:Object.freeze({columns:b,rows:c,kittyProtocolActive:!1}),requestRender:a})}},60542:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{startTaskScheduler:()=>G});var e=c(29021),f=c(55511),g=c(75384),h=c(47128),i=c(12144),j=c(69453),k=c(65562),l=c(14916),m=c(48817),n=c(32105),o=a([i,j,n]);[i,j,n]=o.then?(await o)():o;let K=new Map,L=new Map;function p(a){if(a.cwd)return a.cwd;let b=(0,g.v$)(a.boardId);return b&&(0,e.existsSync)(b.projectKey)?b.projectKey:null}async function q(a){if(a.sessionId)try{let b=await (0,j.os)(a.sessionId);if(b)return{...await (0,i.OF)(a.sessionId,b,void 0),created:!1}}catch{}let b=p(a);return b?{...await (0,i.OF)((0,f.randomUUID)(),"",b,{toolNames:l.C1}),created:!0}:null}function r(){return globalThis.__piWebInstanceId||(globalThis.__piWebInstanceId=(0,f.randomUUID)()),globalThis.__piWebInstanceId}function s(a,b,c){return!a.owner||a.owner===b||c-a.heartbeat>=12e4}async function t(){let a=r(),b=Date.now(),c=new Set((0,i.HG)()),d=0;for(let e of(0,m.O7)(["review"]))e.sessionId&&c.has(e.sessionId)&&((0,m.w0)(e.id,{execStatus:"running",owner:a,heartbeat:b}),console.log(`[task-scheduler] #${e.number} ${e.name} 自愈:会话仍在跑 → 拉回 running`),d+=1);return d}async function u(a){let b=(0,f.randomUUID)();if(!(0,m.Im)(a.id,b))return console.log(`[task-scheduler] #${a.number} ${a.name} 派发锁被占用,跳过`),!1;let c=null;try{if(!(c=await q(a)))return console.warn(`[task-scheduler] #${a.number} ${a.name} 无可用 cwd,跳过派发`),(0,m.$j)(a.id,b),!1;let d=c;await d.session.send({type:"set_session_name",name:`#${a.number} ${a.name}`});let e=(0,g.v$)(a.boardId);if(e?.taskId&&(0,k.mE)(d.realSessionId,e.taskId),d.session.isRunning())return(0,m.w0)(a.id,{sessionId:d.realSessionId,execStatus:"running",owner:r(),heartbeat:Date.now()}),e?.taskId&&v(a.boardId),w(a,d.session),(0,m.$j)(a.id,b),console.log(`[task-scheduler] #${a.number} ${a.name} 会话忙(复用中),标 running 不重发`),!0;return await d.session.send({type:"prompt",message:function(a){let b=[`【任务卡 #${a.number}】${a.name}`];if(a.description.trim()&&b.push("",a.description.trim()),a.attachments.length>0)for(let c of(b.push("","附件:"),a.attachments))b.push(`- ${c}`);return b.join("\n")}(a)}),(0,m.w0)(a.id,{sessionId:d.realSessionId,execStatus:"running",owner:r(),heartbeat:Date.now()}),e?.taskId&&v(a.boardId),w(a,d.session),(0,m.$j)(a.id,b),console.log(`[task-scheduler] 派发 #${a.number} ${a.name} → session ${d.realSessionId.slice(0,8)}`),!0}catch(d){if(c?.created)try{c.session.destroy()}catch{}return(0,m.$j)(a.id,b),console.error(`[task-scheduler] 派发 #${a.number} ${a.name} 失败:`,d instanceof Error?d.message:d),!1}}function v(a){(0,h.dA)(a).catch(b=>console.warn(`[task-scheduler] reconcile ${a} 异常:`,b?.message??b))}function w(a,b){if("function"!=typeof b.onEvent)return;let c=b.onEvent(b=>{if("agent_end"!==b.type)return;c();let d=(0,m.XJ)(a.id);d&&"running"===d.execStatus&&((0,m.w0)(a.id,{execStatus:"review"}),console.log(`[task-scheduler] #${a.number} ${a.name} 执行会话结束(agent_end) → review(待审核)`))})}async function x(){let a=new Set((0,i.HG)()),b=Date.now(),c=r(),d=0;for(let e of(0,m.BH)()){if(!e.sessionId||!s(e,c,b)||a.has(e.sessionId))continue;let f=await (0,n.Wz)(e.sessionId);f&&0!==f.lastActivityMs&&(b-f.lastActivityMs<5e3||((0,m.w0)(e.id,{execStatus:"review"}),console.log(`[task-scheduler] #${e.number} ${e.name} 执行会话已结束 → review(待审核)`),d+=1))}return d}async function y(){await t(),await x(),await z(),await D(),await E();let a=0,b=(0,m.CU)(),c=Math.max(0,1-b);if(c<=0)return H({type:"skipped_gate",at:Date.now()}),0;for(let b of(0,m.uZ)().slice(0,c)){if((0,m.CU)()>=1)break;await J({kind:"dispatch",cardNumber:b.number,cardName:b.name,at:Date.now()},()=>u(b))&&(a+=1,H({type:"dispatch",cardNumber:b.number,cardName:b.name,at:Date.now()}))}return a}async function z(){let a=r(),b=Date.now(),c=0;for(let d of(0,m.Kg)()){let e=(0,m.XJ)(d.cardId);if(e&&"waiting_reply"===e.execStatus&&e.sessionId&&s(e,a,b)){if((0,m.CU)()>=1)break;await J({kind:"resume",cardNumber:e.number,cardName:e.name,at:Date.now()},()=>A(e,d))&&(c+=1,H({type:"resume",cardNumber:e.number,cardName:e.name,at:Date.now()}))}}return c}async function A(a,b){try{let c=await (0,j.os)(a.sessionId);if(!c)return!1;let{session:d}=await (0,i.OF)(a.sessionId,c,void 0);return await d.send({type:"prompt",message:`【用户回答了你的提问】
|
|
30
18
|
${b.answer}
|
|
31
19
|
|
|
32
|
-
请据此继续完成任务。`}),(0,
|
|
33
|
-
${b.slice(0,500)}`),console.log(`[task-scheduler] #${a.number} → waiting_reply(提问入队)`)}async function y(){let a=Date.now(),b=0;for(let c of(0,l.O7)(["review"])){let d=c.sessionId?await (0,m.Wz)(c.sessionId):null;if(d?.failure){w(c),b+=1;continue}if(!c.sessionId||!d){(0,l.w0)(c.id,{execStatus:"done"}),console.log(`[task-scheduler] #${c.number} 无执行内容 → done`),b+=1;continue}let e=E.get(c.id)??0;if(a-e<3e5)continue;E.set(c.id,a);let f=o(c);if(!f)continue;let g=await (0,m.s4)({cwd:f,cardNumber:c.number,cardName:c.name,taskDescription:c.description,recentMessages:d.recentText});g?.verdict==="done"?((0,l.w0)(c.id,{execStatus:"done"}),console.log(`[task-scheduler] #${c.number} 审核通过 → done(${g.reason})`),b+=1):g?.verdict==="failed"?(w(c),b+=1):g?.verdict==="waiting_reply"?(x(c,d.recentText),b+=1):console.log(`[task-scheduler] #${c.number} 审核未决:${g?g.reason:"AI 判定失败"}(保持 review)`)}return b}async function z(){let a=Date.now(),b=0;for(let c of(0,l.O7)(["running"])){if(!c.sessionId)continue;let d=D.get(c.id)??0;if(a-d<6e5)continue;let e=await (0,m.Wz)(c.sessionId);if(!e||0===e.lastActivityMs||a-e.lastActivityMs<3e5)continue;D.set(c.id,a);let f=o(c);if(!f)continue;let g=await (0,m.bJ)({cwd:f,cardNumber:c.number,cardName:c.name,taskDescription:c.description,recentMessages:e.recentText});if(g)switch(g.kind){case"sync_server":case"infinite_loop":await A(c),b+=1;break;case"rate_limit":console.log(`[task-scheduler] #${c.number} 限流退避,继续观察`);break;case"asking":x(c,e.recentText),b+=1;break;case"error":(0,l.w0)(c.id,{execStatus:"review"}),b+=1}}return b}async function A(a){try{if(a.sessionId){let b=await (0,i.os)(a.sessionId);if(b){let{session:c}=await (0,h.OF)(a.sessionId,b,void 0);await c.send({type:"abort"}),await c.send({type:"prompt",message:"检测到任务卡执行异常(可能是同步开启服务或死循环)。\n请改用 tmux 后台启动服务:tmux new-session -d '命令',不要在前台阻塞等待日志;如为死循环请重新规划步骤后继续。"}),r(a,c)}}(0,l.w0)(a.id,{execStatus:"running"}),console.log(`[task-scheduler] #${a.number} 阻塞处置:abort+tmux 引导,继续运行`)}catch(b){console.error(`[task-scheduler] 阻塞处置失败 #${a.number}:`,b instanceof Error?b.message:b)}}function B(){if(globalThis.__piTaskScheduler)return;let a=!1,b=setInterval(()=>{a||(a=!0,t().catch(a=>{console.error("[task-scheduler] tick error:",a instanceof Error?a.message:a)}).finally(()=>{a=!1}))},1e4);b.unref?.();let c={timer:b,startedAt:Date.now(),lastAction:{type:"none",at:0}};globalThis.__piTaskScheduler=c,console.log("[pi-web] task scheduler started (interval 10000ms, max 1)")}function C(a){globalThis.__piTaskScheduler&&(globalThis.__piTaskScheduler.lastAction=a)}d()}catch(a){d(a)}})},61577:(a,b,c)=>{c.d(b,{o:()=>e});let d=new Set(["off","minimal","low","medium","high","xhigh","max"]);async function e(a,b,c){if(!b.model&&!b.thinkingLevel)return{modelDefaultChanged:!1};let e=!1;if(b.model&&c.model&&b.model.provider===c.model.provider&&b.model.modelId===c.model.modelId&&(a.setDefaultModelAndProvider(c.model.provider,c.model.modelId),e=!0),b.thinkingLevel&&(c.supportsThinking||"off"!==c.thinkingLevel)){var f;let b=(f=c.thinkingLevel,d.has(f))?c.thinkingLevel:void 0;a.setDefaultThinkingLevel(b)}return await a.flush(),{modelDefaultChanged:e}}},62391:(a,b,c)=>{c.d(b,{KI:()=>m});var d=c(79646),e=c(29021),f=c(33873);function g(a){return a&&"win32"===process.platform?(0,f.normalize)(a):a}function h(a){let b=(0,f.normalize)(g(a)),c=(0,f.parse)(b).root.length,d=b.length;for(;d>c&&b[d-1]===f.sep;)d--;return b.slice(0,d)}function i(a,b){if(a===b)return!0;if(!a||!b)return!1;let c=h(a),d=h(b);return"win32"===process.platform?c.toLowerCase()===d.toLowerCase():c===d}let j=(0,c(28354).promisify)(d.execFile);async function k(a,b){let{stdout:c}=await j("git",["-C",a,...b],{timeout:1e4,maxBuffer:1048576,env:{...process.env,LC_ALL:"C"}});return c.trim()}function l(a){try{return(0,e.realpathSync)(a)}catch{return a}}async function m(a){let b,c=(globalThis.__piProjectCache||(globalThis.__piProjectCache=new Map),globalThis.__piProjectCache),d=c.get(a);if(d&&d.expiresAt>Date.now())return d.info;try{if(!(0,e.existsSync)(a))return b=function(a){let b=(0,f.dirname)(a);if(!b.endsWith("-worktrees"))return null;let c=b.slice(0,-10);return c&&(0,e.existsSync)((0,f.join)(c,".git"))?{projectRoot:l(c),branch:(0,f.basename)(a),isWorktree:!0,isTopLevel:!0}:null}(a)??{projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1},c.set(a,{info:b,expiresAt:Date.now()+6e4}),b;let[d,h,j,m]=(await k(a,["rev-parse","--path-format=absolute","--git-common-dir","--git-dir","--show-toplevel","--abbrev-ref","HEAD"])).split("\n").map(a=>a.trim()),[n,o,p]=[d,h,j].map(g),q=l(a),r=i(p,q),s=!i(o,n)&&r,t=s?(0,f.dirname)(n):p;b={projectRoot:r?l(t):a,branch:m&&"HEAD"!==m?m:null,isWorktree:s,isTopLevel:r}}catch{b={projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1}}return c.set(a,{info:b,expiresAt:Date.now()+6e4}),b}},65562:(a,b,c)=>{c.d(b,{mE:()=>e}),c(55511);var d=c(90596);function e(a,b){let c=(0,d.Lf)();if(!(0,d.Lf)().prepare("SELECT id, project_key AS projectKey, name, created, updated, pinned, sort_order AS sortOrder FROM tasks WHERE id = ?").get(b))return!1;let e=Date.now();c.exec("BEGIN");try{c.prepare("INSERT INTO session_meta (session_id, task_id, updated) VALUES (?, ?, ?) ON CONFLICT(session_id) DO UPDATE SET task_id = excluded.task_id, updated = excluded.updated").run(a,b,e),c.prepare("UPDATE tasks SET updated = ? WHERE id = ?").run(e,b),c.exec("COMMIT")}catch(a){throw c.exec("ROLLBACK"),a}return!0}c(75384)},69453:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{O8:()=>v,mD:()=>r,os:()=>u});var e=c(75430),f=c(29021),g=c(79748),h=c(33873),i=c(90596),j=c(7535),k=c(7561),l=c(62391),m=c(9210),n=a([e,m]);async function o(a){let b=[...new Set(a.map(a=>a.cwd).filter(Boolean))],c=new Map;await Promise.all(b.map(async a=>{c.set(a,await (0,l.KI)(a))}));let d=new Set;try{let a=(0,i.Lf)().prepare("SELECT session_id FROM session_meta WHERE pinned = 1").all();d=new Set(a.map(a=>a.session_id))}catch{}return a.map(a=>{let b=a.cwd?c.get(a.cwd):void 0,e=b?.projectRoot??a.cwd;return{...a,projectRoot:e,projectKey:(0,j.z)(e),...b?.branch?{branch:b.branch}:{},...b?.isWorktree?{isWorktree:!0}:{},...b?.isWorktree&&b.branch?{worktreeBranch:b.branch}:{},...d.has(a.id)?{pinned:!0}:{}}})}async function p(){let a=await m.X.scan(),b=new Map;for(let c of a)b.set((0,k.$)(c.path),c.id);let c=a.map(a=>(v(a.id,a.path),{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created.toISOString(),modified:a.modified.toISOString(),messageCount:0,firstMessage:a.firstMessage||"(no messages)",lastReply:a.lastReply||"",parentSessionId:a.parentSessionPath?b.get((0,k.$)(a.parentSessionPath)):void 0,transient:!1}));return o(c)}async function q(a={}){a.force&&r();let b=globalThis.__piSessionListGeneration??0;if(globalThis.__piSessionListCache&&Date.now()-globalThis.__piSessionListCache.ts<w)return globalThis.__piSessionListCache.data;if(globalThis.__piSessionListPromise&&globalThis.__piSessionListPromiseGeneration===b)return globalThis.__piSessionListPromise;let c=p().then(a=>(globalThis.__piSessionListGeneration??0)!==b?q():(globalThis.__piSessionListCache={data:a,ts:Date.now()},a)).finally(()=>{globalThis.__piSessionListPromise===c&&(globalThis.__piSessionListPromise=void 0,globalThis.__piSessionListPromiseGeneration=void 0)});return globalThis.__piSessionListPromise=c,globalThis.__piSessionListPromiseGeneration=b,c}[e,m]=n.then?(await n)():n;let w=3e5;function r(){globalThis.__piSessionListGeneration=(globalThis.__piSessionListGeneration??0)+1,globalThis.__piSessionListCache=void 0}function s(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function t(a){let b,c=(0,h.join)((0,e.getAgentDir)(),"sessions");if(!a||!(0,f.existsSync)(c))return null;let d=`_${a}.jsonl`;try{b=await (0,g.readdir)(c,{withFileTypes:!0})}catch{return null}for(let e of b){let b;if(!e.isDirectory()&&!e.isSymbolicLink())continue;let i=(0,h.join)(c,e.name);try{b=await (0,g.readdir)(i)}catch{continue}let j=b.find(a=>a.endsWith(d));if(!j)continue;let k=(0,h.join)(i,j);try{if(function(a){let b=(0,f.openSync)(a,"r");try{let a=[],c=0,d=!1;for(;c<65536&&!d;){let e=Buffer.allocUnsafe(Math.min(4096,65536-c)),g=(0,f.readSync)(b,e,0,e.length,c);if(0===g)break;let h=e.subarray(0,g),i=h.indexOf(10);a.push(-1===i?h:h.subarray(0,i)),c+=g,d=-1!==i}if(!d&&c>=65536)return null;let e=Buffer.concat(a).toString("utf8").trimEnd();if(!e)return null;try{let a=JSON.parse(e);return"session"===a.type?a:null}catch{return null}}finally{(0,f.closeSync)(b)}}(k)?.id===a)return k}catch{}}return null}async function u(a){let b=s().get(a);if(b)return b;let c=await t(a);return c?(v(a,c),c):(await q(),s().get(a)??null)}function v(a,b){let c=(0,h.normalize)(b),d=(0,k.$)(c),e=s(),f=(globalThis.__piPathToSessionIdCache||(globalThis.__piPathToSessionIdCache=new Map),globalThis.__piPathToSessionIdCache),g=e.get(a),i=g?(0,k.$)(g):void 0,j=f.get(d),l=j?e.get(j):void 0;i&&i!==d&&f.get(i)===a&&f.delete(i),j&&j!==a&&l&&(0,k.$)(l)===d&&e.delete(j),e.set(a,c),f.set(d,a)}d()}catch(a){d(a)}})},75384:(a,b,c)=>{c.d(b,{v$:()=>f}),c(55511);var d=c(90596);c(48817);let e="__running__";function f(a){var b,c;if(a===e)return{id:e,projectKey:"",name:"running",isSystem:!0,taskId:null,sortOrder:0,created:0,updated:0,nodeCount:0};let f=(0,d.Lf)().prepare("SELECT id, project_key AS projectKey, name, is_system AS isSystem, task_id AS taskId, sort_order AS sortOrder, created, updated FROM boards WHERE id = ?").get(a);return f?(b=f.id,c=(0,d.Lf)().prepare("SELECT COUNT(*) AS n FROM board_nodes WHERE board_id = ?").get(b).n,{id:f.id,projectKey:f.projectKey,name:f.name,isSystem:1===f.isSystem,taskId:f.taskId,sortOrder:f.sortOrder,created:f.created,updated:f.updated,nodeCount:c}):void 0}},81186:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Ds:()=>j,J1:()=>h,eD:()=>i});var e=c(75430),f=c(76760),g=a([e]);e=(g.then?(await g)():g)[0];let k="pi-web-project-command-environment",l=`<inline:${k}>`;function h(a={}){let{agentBinDir:b=(0,f.join)((0,e.getAgentDir)(),"bin"),baseEnvironment:c=process.env,localOperations:d=(0,e.createLocalBashOperations)({shellPath:a.shellPath}),platform:g=process.platform}=a;return{exec(a,e,f){var h;let i,j,k,l=(h=function(a,b=process.platform){let c={...a};for(let a of Object.keys(c))(function(a,b){let c="win32"===b?a.toUpperCase():a;return"PORT"===c||"NODE_ENV"===c||c.startsWith("NEXT_")})(a,b)&&delete c[a];return c}(f.env??c,g),i="win32"===g?Object.keys(h).find(a=>"PATH"===a.toUpperCase())??"PATH":"PATH",j="win32"===g?";":":",(k=h[i]??"").split(j).filter(Boolean).includes(b)||(h[i]=[b,k].filter(Boolean).join(j)),h);return d.exec(a,e,{...f,env:l})}}}function i(a){return{name:k,hidden:!0,factory:b=>{let c=(0,e.createBashToolDefinition)(a.cwd);b.registerTool({...c,execute:(b,c,d,f,g)=>(0,e.createBashToolDefinition)(a.cwd,{commandPrefix:a.settings.getShellCommandPrefix(),operations:h({shellPath:a.settings.getShellPath()})}).execute(b,c,d,f,g)})}}}function j(a){let b=a.extensions.findIndex(a=>a.path===l);if(b<0)return a;let c=a.extensions.slice(0,b).find(a=>a.tools.has("bash"));return c?{...a,extensions:a.extensions.filter((a,c)=>c!==b),errors:a.errors.filter(a=>a.path!==l||a.error!==`Tool "bash" conflicts with ${c.path}`)}:a}d()}catch(a){d(a)}})},88250:(a,b,c)=>{c.d(b,{kn:()=>d});function d(){let a=(globalThis.__piModelsCacheState||(globalThis.__piModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__piModelsCacheState);a.generation+=1,a.entries.clear(),a.inFlight.clear()}},90596:(a,b,c)=>{c.d(b,{Lf:()=>g});var d=c(80099),e=c(21820),f=c(33873);function g(){var a;if(globalThis.__piWebDb)return globalThis.__piWebDb;let b=new d.DatabaseSync((0,f.join)(function(){let a=process.env.PI_CODING_AGENT_DIR;if(a){let b=a.startsWith("~")?(0,f.join)((0,e.homedir)(),a.slice(1)):a;return(0,f.normalize)(b)}return(0,f.join)((0,e.homedir)(),".pi","agent")}(),"pi-web.db"));return b.exec("PRAGMA journal_mode = WAL;"),b.exec("PRAGMA foreign_keys = ON;"),(a=b).exec(`
|
|
34
|
-
CREATE TABLE IF NOT EXISTS tasks (
|
|
35
|
-
id TEXT PRIMARY KEY,
|
|
36
|
-
project_key TEXT NOT NULL,
|
|
37
|
-
name TEXT NOT NULL,
|
|
38
|
-
created INTEGER NOT NULL,
|
|
39
|
-
updated INTEGER NOT NULL
|
|
40
|
-
);
|
|
41
|
-
CREATE INDEX IF NOT EXISTS idx_tasks_project ON tasks(project_key);
|
|
42
|
-
|
|
43
|
-
CREATE TABLE IF NOT EXISTS session_meta (
|
|
44
|
-
session_id TEXT PRIMARY KEY,
|
|
45
|
-
task_id TEXT,
|
|
46
|
-
updated INTEGER NOT NULL
|
|
47
|
-
);
|
|
48
|
-
CREATE INDEX IF NOT EXISTS idx_meta_task ON session_meta(task_id);
|
|
49
|
-
|
|
50
|
-
CREATE TABLE IF NOT EXISTS search_state (
|
|
51
|
-
session_id TEXT PRIMARY KEY,
|
|
52
|
-
mtime TEXT NOT NULL,
|
|
53
|
-
title TEXT NOT NULL
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
CREATE VIRTUAL TABLE IF NOT EXISTS session_search USING fts5(
|
|
57
|
-
session_id UNINDEXED,
|
|
58
|
-
title,
|
|
59
|
-
body,
|
|
60
|
-
tokenize = 'trigram'
|
|
61
|
-
);
|
|
62
|
-
`),function(a){let b=a.prepare("PRAGMA user_version").get().user_version;for(let c of h)if(!(c.version<=b)){a.exec("BEGIN");try{for(let b of c.statements)try{a.exec(b)}catch(b){let a=b instanceof Error?b.message:String(b);if(!/duplicate column name/i.test(a))throw b}a.exec(`PRAGMA user_version = ${c.version}`),a.exec("COMMIT"),b=c.version}catch(b){throw a.exec("ROLLBACK"),b}}}(a),globalThis.__piWebDb=b,b}let h=[{version:1,name:"pinned columns",statements:["ALTER TABLE tasks ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;","ALTER TABLE session_meta ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;"]},{version:2,name:"tasks.sort_order",statements:["ALTER TABLE tasks ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0;"]},{version:3,name:"session boards",statements:["CREATE TABLE IF NOT EXISTS boards (\n id TEXT PRIMARY KEY,\n project_key TEXT NOT NULL,\n name TEXT NOT NULL,\n is_system INTEGER NOT NULL DEFAULT 0,\n created INTEGER NOT NULL,\n updated INTEGER NOT NULL\n);","CREATE INDEX IF NOT EXISTS idx_boards_project ON boards(project_key);","CREATE TABLE IF NOT EXISTS board_nodes (\n id TEXT PRIMARY KEY,\n board_id TEXT NOT NULL,\n kind TEXT NOT NULL,\n ref_id TEXT,\n x REAL NOT NULL,\n y REAL NOT NULL,\n w REAL NOT NULL DEFAULT 0,\n h REAL NOT NULL DEFAULT 0,\n expanded INTEGER NOT NULL DEFAULT 0,\n props TEXT NOT NULL DEFAULT '{}',\n created INTEGER NOT NULL,\n updated INTEGER NOT NULL\n);","CREATE INDEX IF NOT EXISTS idx_board_nodes_board ON board_nodes(board_id);","CREATE TABLE IF NOT EXISTS board_edges (\n id TEXT PRIMARY KEY,\n board_id TEXT NOT NULL,\n from_id TEXT NOT NULL,\n to_id TEXT NOT NULL,\n label TEXT,\n color TEXT,\n dashed INTEGER NOT NULL DEFAULT 0,\n created INTEGER NOT NULL,\n updated INTEGER NOT NULL\n);","CREATE INDEX IF NOT EXISTS idx_board_edges_board ON board_edges(board_id);","CREATE TABLE IF NOT EXISTS board_view (\n board_id TEXT PRIMARY KEY,\n camera_x REAL NOT NULL DEFAULT 0,\n camera_y REAL NOT NULL DEFAULT 0,\n camera_z REAL NOT NULL DEFAULT 1,\n updated INTEGER NOT NULL\n);"]},{version:4,name:"boards.sort_order",statements:["ALTER TABLE boards ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0;"]},{version:5,name:"boards.task_id",statements:["ALTER TABLE boards ADD COLUMN task_id TEXT NULL;","CREATE INDEX IF NOT EXISTS idx_boards_task ON boards(task_id);"]},{version:6,name:"boards.task_id unique (防并发重复创建任务看板)",statements:["CREATE UNIQUE INDEX IF NOT EXISTS idx_boards_task_unique ON boards(task_id);"]},{version:7,name:"task cards",statements:["CREATE TABLE IF NOT EXISTS task_cards (\n id TEXT PRIMARY KEY,\n board_id TEXT NOT NULL,\n project_key TEXT NOT NULL,\n number INTEGER NOT NULL,\n name TEXT NOT NULL,\n description TEXT NOT NULL DEFAULT '',\n ready_status TEXT NOT NULL DEFAULT 'draft',\n exec_status TEXT NOT NULL DEFAULT 'not_started',\n priority INTEGER NOT NULL DEFAULT 0,\n due INTEGER,\n attachments TEXT NOT NULL DEFAULT '[]',\n cwd TEXT,\n use_worktree INTEGER NOT NULL DEFAULT 0,\n max_retries INTEGER NOT NULL DEFAULT 3,\n retry_count INTEGER NOT NULL DEFAULT 0,\n session_id TEXT,\n created INTEGER NOT NULL,\n updated INTEGER NOT NULL\n);","CREATE INDEX IF NOT EXISTS idx_task_cards_board ON task_cards(board_id);","CREATE INDEX IF NOT EXISTS idx_task_cards_project ON task_cards(project_key);","CREATE UNIQUE INDEX IF NOT EXISTS idx_task_cards_number ON task_cards(project_key, number);","CREATE INDEX IF NOT EXISTS idx_task_cards_status ON task_cards(ready_status, exec_status);","CREATE TABLE IF NOT EXISTS task_card_links (\n id TEXT PRIMARY KEY,\n card_id TEXT NOT NULL,\n target_card_id TEXT NOT NULL,\n kind TEXT NOT NULL,\n created INTEGER NOT NULL,\n UNIQUE(card_id, target_card_id, kind)\n);","CREATE INDEX IF NOT EXISTS idx_task_links_card ON task_card_links(card_id);","CREATE TABLE IF NOT EXISTS task_card_questions (\n id TEXT PRIMARY KEY,\n card_id TEXT NOT NULL,\n session_id TEXT NOT NULL,\n question TEXT NOT NULL,\n status TEXT NOT NULL DEFAULT 'pending',\n answer TEXT,\n created INTEGER NOT NULL,\n answered INTEGER\n);","CREATE INDEX IF NOT EXISTS idx_task_questions_status ON task_card_questions(status);"]},{version:8,name:"task_cards.dispatch_token (跨进程派发互斥锁)",statements:["ALTER TABLE task_cards ADD COLUMN dispatch_token TEXT NULL;"]}]},96515:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{I:()=>j,p:()=>i});var e=c(75430),f=a([e]);e=(f.then?(await f)():f)[0];let k=new Set(["off","minimal","low","medium","high","xhigh","max"]);function g(a,b){return a.provider===b.provider&&a.id===b.modelId}function h(a,b){let c=a.toLowerCase(),d=b.filter(a=>`${a.provider}/${a.id}`.toLowerCase()===c);return d.length>0?d:b.filter(a=>a.id.toLowerCase()===c)}async function i(a,b){let c=(b??[]).map(a=>a.trim()).filter(Boolean);if(0===c.length)return{visible:await a.getAvailable(),scopedModels:[],thinkingLevelPins:{},warnings:[]};let d=await a.getAvailable();!function(a,b){for(let c of a){if(c.includes("*")||c.includes("?")||c.includes("["))continue;let a=h(c,b);if(0===a.length){let d=c.lastIndexOf(":"),e=d>=0?c.slice(d+1):"";k.has(e)&&(a=h(c.slice(0,d),b))}if(a.length>1){let b=a.map(a=>`${a.provider}/${a.id}`).sort().join(", ");throw Error(`Ambiguous enabledModels entry "${c}" matches multiple models: ${b}. Use provider/modelId.`)}}}(c,d);let{scopedModels:f,diagnostics:g}=await (0,e.resolveModelScopeWithDiagnostics)(c,{getAvailable:async()=>d}),i=g.map(a=>a.message);if(0===f.length)return{visible:d,scopedModels:[],thinkingLevelPins:{},warnings:i};let j={};for(let a of f)a.thinkingLevel&&(j[`${a.model.provider}/${a.model.id}`]=a.thinkingLevel);return{visible:f.map(a=>a.model),scopedModels:f,thinkingLevelPins:j,warnings:i}}function j(a,b={}){let c=b.requestedModel,d=b.defaultModel,e=c?a.visible.find(a=>g(a,c)):void 0;if(c&&!e)throw Error(`Model is not available in the enabled scope: ${c.provider}/${c.modelId}`);let f=e?a.scopedModels.find(a=>a.model===e||g(a.model,{provider:e.provider,modelId:e.id})):void 0,h=!e&&d?a.scopedModels.find(a=>g(a.model,d)):void 0,i=e?void 0:h??a.scopedModels[0],k=e||i||!d?void 0:a.visible.find(a=>g(a,d)),l=e??i?.model??k,m=f??i,n=b.thinkingLevel??m?.thinkingLevel;return{...l?{model:l}:{},...n?{thinkingLevel:n}:{},scopedModels:[...a.scopedModels]}}d()}catch(a){d(a)}})}};
|
|
20
|
+
请据此继续完成任务。`}),(0,m.w0)(a.id,{execStatus:"running",owner:r(),heartbeat:Date.now()}),console.log(`[task-scheduler] 回复续会话 #${a.number} ${a.name}`),!0}catch(b){return console.error(`[task-scheduler] 回复续会话失败 #${a.number}:`,b instanceof Error?b.message:b),!1}}function B(a){let b=a.retryCount+1;b<a.maxRetries?((0,m.w0)(a.id,{execStatus:"not_started",retryCount:b}),console.log(`[task-scheduler] #${a.number} 失败(${b}/${a.maxRetries})→ 待重试`)):((0,m.w0)(a.id,{execStatus:"failed",retryCount:b}),console.log(`[task-scheduler] #${a.number} 失败(${b}/${a.maxRetries})→ failed`))}function C(a,b){(0,m.w0)(a.id,{execStatus:"waiting_reply"}),a.sessionId&&(0,m.hG)(a.id,a.sessionId,`AI 需要你回答后继续任务。
|
|
21
|
+
${b.slice(0,500)}`),console.log(`[task-scheduler] #${a.number} → waiting_reply(提问入队)`)}async function D(){let a=Date.now(),b=r(),c=0;for(let d of(0,m.O7)(["review"])){if(!s(d,b,a))continue;let e=d.sessionId?await (0,n.Wz)(d.sessionId):null;if(e?.failure){B(d),c+=1;continue}if(!d.sessionId||!e){(0,m.w0)(d.id,{execStatus:"done"}),console.log(`[task-scheduler] #${d.number} 无执行内容 → done`),c+=1;continue}let f=L.get(d.id)??0;if(a-f<3e5)continue;L.set(d.id,a);let g=p(d);if(!g)continue;let h=await J({kind:"review",cardNumber:d.number,cardName:d.name,at:Date.now()},()=>(0,n.s4)({cwd:g,cardNumber:d.number,cardName:d.name,taskDescription:d.description,recentMessages:e.recentText}));h?.verdict==="done"?((0,m.w0)(d.id,{execStatus:"done"}),console.log(`[task-scheduler] #${d.number} 审核通过 → done(${h.reason})`),c+=1):h?.verdict==="failed"?(B(d),c+=1):h?.verdict==="waiting_reply"?(C(d,e.recentText),c+=1):console.log(`[task-scheduler] #${d.number} 审核未决:${h?h.reason:"AI 判定失败"}(保持 review)`)}return c}async function E(){let a=Date.now(),b=r(),c=0;for(let d of(0,m.O7)(["running"])){if(!d.sessionId||!s(d,b,a))continue;let e=K.get(d.id)??0;if(a-e<6e5)continue;let f=await (0,n.Wz)(d.sessionId);if(!f||0===f.lastActivityMs||a-f.lastActivityMs<3e5)continue;K.set(d.id,a);let g=p(d);if(!g)continue;let h=await J({kind:"blockcheck",cardNumber:d.number,cardName:d.name,at:Date.now()},()=>(0,n.bJ)({cwd:g,cardNumber:d.number,cardName:d.name,taskDescription:d.description,recentMessages:f.recentText}));if(h)switch(h.kind){case"sync_server":case"infinite_loop":await F(d),c+=1;break;case"rate_limit":console.log(`[task-scheduler] #${d.number} 限流退避,继续观察`);break;case"asking":C(d,f.recentText),c+=1;break;case"error":(0,m.w0)(d.id,{execStatus:"review"}),c+=1}}return c}async function F(a){try{if(a.sessionId){let b=await (0,j.os)(a.sessionId);if(b){let{session:c}=await (0,i.OF)(a.sessionId,b,void 0);await c.send({type:"abort"}),await c.send({type:"prompt",message:"检测到任务卡执行异常(可能是同步开启服务或死循环)。\n请改用 tmux 后台启动服务:tmux new-session -d '命令',不要在前台阻塞等待日志;如为死循环请重新规划步骤后继续。"}),w(a,c)}}(0,m.w0)(a.id,{execStatus:"running"}),console.log(`[task-scheduler] #${a.number} 阻塞处置:abort+tmux 引导,继续运行`)}catch(b){console.error(`[task-scheduler] 阻塞处置失败 #${a.number}:`,b instanceof Error?b.message:b)}}function G(){if(globalThis.__piTaskScheduler)return;let a=!1,b=setInterval(()=>{a||(a=!0,y().catch(a=>{console.error("[task-scheduler] tick error:",a instanceof Error?a.message:a)}).finally(()=>{a=!1}))},1e4);b.unref?.();let c=setInterval(()=>{try{(0,m.tZ)(r())}catch(a){console.error("[task-scheduler] heartbeat error:",a instanceof Error?a.message:a)}},1e4);c.unref?.();let d={timer:b,heartbeatTimer:c,startedAt:Date.now(),lastAction:{type:"none",at:0},activity:null};globalThis.__piTaskScheduler=d,console.log("[pi-web] task scheduler started (interval 10000ms, max 1)")}function H(a){globalThis.__piTaskScheduler&&(globalThis.__piTaskScheduler.lastAction=a)}function I(a){globalThis.__piTaskScheduler&&(globalThis.__piTaskScheduler.activity=a)}async function J(a,b){I(a);try{return await b()}finally{I(null)}}d()}catch(a){d(a)}})},61577:(a,b,c)=>{c.d(b,{o:()=>e});let d=new Set(["off","minimal","low","medium","high","xhigh","max"]);async function e(a,b,c){if(!b.model&&!b.thinkingLevel)return{modelDefaultChanged:!1};let e=!1;if(b.model&&c.model&&b.model.provider===c.model.provider&&b.model.modelId===c.model.modelId&&(a.setDefaultModelAndProvider(c.model.provider,c.model.modelId),e=!0),b.thinkingLevel&&(c.supportsThinking||"off"!==c.thinkingLevel)){var f;let b=(f=c.thinkingLevel,d.has(f))?c.thinkingLevel:void 0;a.setDefaultThinkingLevel(b)}return await a.flush(),{modelDefaultChanged:e}}},62391:(a,b,c)=>{c.d(b,{KI:()=>m});var d=c(79646),e=c(29021),f=c(33873);function g(a){return a&&"win32"===process.platform?(0,f.normalize)(a):a}function h(a){let b=(0,f.normalize)(g(a)),c=(0,f.parse)(b).root.length,d=b.length;for(;d>c&&b[d-1]===f.sep;)d--;return b.slice(0,d)}function i(a,b){if(a===b)return!0;if(!a||!b)return!1;let c=h(a),d=h(b);return"win32"===process.platform?c.toLowerCase()===d.toLowerCase():c===d}let j=(0,c(28354).promisify)(d.execFile);async function k(a,b){let{stdout:c}=await j("git",["-C",a,...b],{timeout:1e4,maxBuffer:1048576,env:{...process.env,LC_ALL:"C"}});return c.trim()}function l(a){try{return(0,e.realpathSync)(a)}catch{return a}}async function m(a){let b,c=(globalThis.__piProjectCache||(globalThis.__piProjectCache=new Map),globalThis.__piProjectCache),d=c.get(a);if(d&&d.expiresAt>Date.now())return d.info;try{if(!(0,e.existsSync)(a))return b=function(a){let b=(0,f.dirname)(a);if(!b.endsWith("-worktrees"))return null;let c=b.slice(0,-10);return c&&(0,e.existsSync)((0,f.join)(c,".git"))?{projectRoot:l(c),branch:(0,f.basename)(a),isWorktree:!0,isTopLevel:!0}:null}(a)??{projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1},c.set(a,{info:b,expiresAt:Date.now()+6e4}),b;let[d,h,j,m]=(await k(a,["rev-parse","--path-format=absolute","--git-common-dir","--git-dir","--show-toplevel","--abbrev-ref","HEAD"])).split("\n").map(a=>a.trim()),[n,o,p]=[d,h,j].map(g),q=l(a),r=i(p,q),s=!i(o,n)&&r,t=s?(0,f.dirname)(n):p;b={projectRoot:r?l(t):a,branch:m&&"HEAD"!==m?m:null,isWorktree:s,isTopLevel:r}}catch{b={projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1}}return c.set(a,{info:b,expiresAt:Date.now()+6e4}),b}},69453:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{O8:()=>v,mD:()=>r,os:()=>u});var e=c(75430),f=c(29021),g=c(79748),h=c(33873),i=c(90596),j=c(7535),k=c(7561),l=c(62391),m=c(9210),n=a([e,m]);async function o(a){let b=[...new Set(a.map(a=>a.cwd).filter(Boolean))],c=new Map;await Promise.all(b.map(async a=>{c.set(a,await (0,l.KI)(a))}));let d=new Set;try{let a=(0,i.Lf)().prepare("SELECT session_id FROM session_meta WHERE pinned = 1").all();d=new Set(a.map(a=>a.session_id))}catch{}return a.map(a=>{let b=a.cwd?c.get(a.cwd):void 0,e=b?.projectRoot??a.cwd;return{...a,projectRoot:e,projectKey:(0,j.z)(e),...b?.branch?{branch:b.branch}:{},...b?.isWorktree?{isWorktree:!0}:{},...b?.isWorktree&&b.branch?{worktreeBranch:b.branch}:{},...d.has(a.id)?{pinned:!0}:{}}})}async function p(){let a=await m.X.scan(),b=new Map;for(let c of a)b.set((0,k.$)(c.path),c.id);let c=a.map(a=>(v(a.id,a.path),{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created.toISOString(),modified:a.modified.toISOString(),messageCount:0,firstMessage:a.firstMessage||"(no messages)",lastReply:a.lastReply||"",parentSessionId:a.parentSessionPath?b.get((0,k.$)(a.parentSessionPath)):void 0,transient:!1}));return o(c)}async function q(a={}){a.force&&r();let b=globalThis.__piSessionListGeneration??0;if(globalThis.__piSessionListCache&&Date.now()-globalThis.__piSessionListCache.ts<w)return globalThis.__piSessionListCache.data;if(globalThis.__piSessionListPromise&&globalThis.__piSessionListPromiseGeneration===b)return globalThis.__piSessionListPromise;let c=p().then(a=>(globalThis.__piSessionListGeneration??0)!==b?q():(globalThis.__piSessionListCache={data:a,ts:Date.now()},a)).finally(()=>{globalThis.__piSessionListPromise===c&&(globalThis.__piSessionListPromise=void 0,globalThis.__piSessionListPromiseGeneration=void 0)});return globalThis.__piSessionListPromise=c,globalThis.__piSessionListPromiseGeneration=b,c}[e,m]=n.then?(await n)():n;let w=3e5;function r(){globalThis.__piSessionListGeneration=(globalThis.__piSessionListGeneration??0)+1,globalThis.__piSessionListCache=void 0}function s(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function t(a){let b,c=(0,h.join)((0,e.getAgentDir)(),"sessions");if(!a||!(0,f.existsSync)(c))return null;let d=`_${a}.jsonl`;try{b=await (0,g.readdir)(c,{withFileTypes:!0})}catch{return null}for(let e of b){let b;if(!e.isDirectory()&&!e.isSymbolicLink())continue;let i=(0,h.join)(c,e.name);try{b=await (0,g.readdir)(i)}catch{continue}let j=b.find(a=>a.endsWith(d));if(!j)continue;let k=(0,h.join)(i,j);try{if(function(a){let b=(0,f.openSync)(a,"r");try{let a=[],c=0,d=!1;for(;c<65536&&!d;){let e=Buffer.allocUnsafe(Math.min(4096,65536-c)),g=(0,f.readSync)(b,e,0,e.length,c);if(0===g)break;let h=e.subarray(0,g),i=h.indexOf(10);a.push(-1===i?h:h.subarray(0,i)),c+=g,d=-1!==i}if(!d&&c>=65536)return null;let e=Buffer.concat(a).toString("utf8").trimEnd();if(!e)return null;try{let a=JSON.parse(e);return"session"===a.type?a:null}catch{return null}}finally{(0,f.closeSync)(b)}}(k)?.id===a)return k}catch{}}return null}async function u(a){let b=s().get(a);if(b)return b;let c=await t(a);return c?(v(a,c),c):(await q(),s().get(a)??null)}function v(a,b){let c=(0,h.normalize)(b),d=(0,k.$)(c),e=s(),f=(globalThis.__piPathToSessionIdCache||(globalThis.__piPathToSessionIdCache=new Map),globalThis.__piPathToSessionIdCache),g=e.get(a),i=g?(0,k.$)(g):void 0,j=f.get(d),l=j?e.get(j):void 0;i&&i!==d&&f.get(i)===a&&f.delete(i),j&&j!==a&&l&&(0,k.$)(l)===d&&e.delete(j),e.set(a,c),f.set(d,a)}d()}catch(a){d(a)}})},81186:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Ds:()=>j,J1:()=>h,eD:()=>i});var e=c(75430),f=c(76760),g=a([e]);e=(g.then?(await g)():g)[0];let k="pi-web-project-command-environment",l=`<inline:${k}>`;function h(a={}){let{agentBinDir:b=(0,f.join)((0,e.getAgentDir)(),"bin"),baseEnvironment:c=process.env,localOperations:d=(0,e.createLocalBashOperations)({shellPath:a.shellPath}),platform:g=process.platform}=a;return{exec(a,e,f){var h;let i,j,k,l=(h=function(a,b=process.platform){let c={...a};for(let a of Object.keys(c))(function(a,b){let c="win32"===b?a.toUpperCase():a;return"PORT"===c||"NODE_ENV"===c||c.startsWith("NEXT_")})(a,b)&&delete c[a];return c}(f.env??c,g),i="win32"===g?Object.keys(h).find(a=>"PATH"===a.toUpperCase())??"PATH":"PATH",j="win32"===g?";":":",(k=h[i]??"").split(j).filter(Boolean).includes(b)||(h[i]=[b,k].filter(Boolean).join(j)),h);return d.exec(a,e,{...f,env:l})}}}function i(a){return{name:k,hidden:!0,factory:b=>{let c=(0,e.createBashToolDefinition)(a.cwd);b.registerTool({...c,execute:(b,c,d,f,g)=>(0,e.createBashToolDefinition)(a.cwd,{commandPrefix:a.settings.getShellCommandPrefix(),operations:h({shellPath:a.settings.getShellPath()})}).execute(b,c,d,f,g)})}}}function j(a){let b=a.extensions.findIndex(a=>a.path===l);if(b<0)return a;let c=a.extensions.slice(0,b).find(a=>a.tools.has("bash"));return c?{...a,extensions:a.extensions.filter((a,c)=>c!==b),errors:a.errors.filter(a=>a.path!==l||a.error!==`Tool "bash" conflicts with ${c.path}`)}:a}d()}catch(a){d(a)}})},88250:(a,b,c)=>{c.d(b,{kn:()=>d});function d(){let a=(globalThis.__piModelsCacheState||(globalThis.__piModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__piModelsCacheState);a.generation+=1,a.entries.clear(),a.inFlight.clear()}},96515:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{I:()=>j,p:()=>i});var e=c(75430),f=a([e]);e=(f.then?(await f)():f)[0];let k=new Set(["off","minimal","low","medium","high","xhigh","max"]);function g(a,b){return a.provider===b.provider&&a.id===b.modelId}function h(a,b){let c=a.toLowerCase(),d=b.filter(a=>`${a.provider}/${a.id}`.toLowerCase()===c);return d.length>0?d:b.filter(a=>a.id.toLowerCase()===c)}async function i(a,b){let c=(b??[]).map(a=>a.trim()).filter(Boolean);if(0===c.length)return{visible:await a.getAvailable(),scopedModels:[],thinkingLevelPins:{},warnings:[]};let d=await a.getAvailable();!function(a,b){for(let c of a){if(c.includes("*")||c.includes("?")||c.includes("["))continue;let a=h(c,b);if(0===a.length){let d=c.lastIndexOf(":"),e=d>=0?c.slice(d+1):"";k.has(e)&&(a=h(c.slice(0,d),b))}if(a.length>1){let b=a.map(a=>`${a.provider}/${a.id}`).sort().join(", ");throw Error(`Ambiguous enabledModels entry "${c}" matches multiple models: ${b}. Use provider/modelId.`)}}}(c,d);let{scopedModels:f,diagnostics:g}=await (0,e.resolveModelScopeWithDiagnostics)(c,{getAvailable:async()=>d}),i=g.map(a=>a.message);if(0===f.length)return{visible:d,scopedModels:[],thinkingLevelPins:{},warnings:i};let j={};for(let a of f)a.thinkingLevel&&(j[`${a.model.provider}/${a.model.id}`]=a.thinkingLevel);return{visible:f.map(a=>a.model),scopedModels:f,thinkingLevelPins:j,warnings:i}}function j(a,b={}){let c=b.requestedModel,d=b.defaultModel,e=c?a.visible.find(a=>g(a,c)):void 0;if(c&&!e)throw Error(`Model is not available in the enabled scope: ${c.provider}/${c.modelId}`);let f=e?a.scopedModels.find(a=>a.model===e||g(a.model,{provider:e.provider,modelId:e.id})):void 0,h=!e&&d?a.scopedModels.find(a=>g(a.model,d)):void 0,i=e?void 0:h??a.scopedModels[0],k=e||i||!d?void 0:a.visible.find(a=>g(a,d)),l=e??i?.model??k,m=f??i,n=b.thinkingLevel??m?.thinkingLevel;return{...l?{model:l}:{},...n?{thinkingLevel:n}:{},scopedModels:[...a.scopedModels]}}d()}catch(a){d(a)}})}};
|