@tickernelz/paperclip-pro-ui 2026.925.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/android-chrome-192x192.png +0 -0
- package/dist/android-chrome-512x512.png +0 -0
- package/dist/announcement-preview.svg +11 -0
- package/dist/apple-touch-icon.png +0 -0
- package/dist/assets/AgentAvatar-BR1Z_L_Z.js +1 -0
- package/dist/assets/AgentIdentity-BgihkjQU.js +1 -0
- package/dist/assets/Agents.production-BsKiBknO.js +2 -0
- package/dist/assets/CompanyActivity.production-Bp4gxpq3.js +1 -0
- package/dist/assets/CompanyExport-BvUhFYBr.js +4 -0
- package/dist/assets/CompanySkills.production-htb9HH0N.js +10 -0
- package/dist/assets/Costs.production-CzulNW6Y.js +1 -0
- package/dist/assets/EmptyState-DOb3I5aU.js +1 -0
- package/dist/assets/MarkdownBody-AdwNLx7A.js +16 -0
- package/dist/assets/MarkdownEditor-B3NYD32f.js +85 -0
- package/dist/assets/OrgChart.production-DbBigpMZ.js +1 -0
- package/dist/assets/PageSkeleton-C-C3Xlc_.js +1 -0
- package/dist/assets/RoutineDetail.production-DJn3YZiR.js +1 -0
- package/dist/assets/RoutineRunVariablesDialog-BkLLbP3a.js +5 -0
- package/dist/assets/Routines.production-BBDkh1yN.js +1 -0
- package/dist/assets/SidebarContext-9UFQ2Pex.js +1 -0
- package/dist/assets/StatusIcon-DMDp_WJw.js +1 -0
- package/dist/assets/abnfDiagram-VCTEODGH-wiE_K2ku.js +1 -0
- package/dist/assets/agents-DrLpWAcm.js +1 -0
- package/dist/assets/apl-MHzTCvfx.js +1 -0
- package/dist/assets/arc-BQ55EiX2.js +1 -0
- package/dist/assets/architecture-7GRP2DOG-B-bRgmfI.js +1 -0
- package/dist/assets/architectureDiagram-5GKGNRK7-BkhBoP5_.js +36 -0
- package/dist/assets/array-CL5Tisss.js +1 -0
- package/dist/assets/asciiarmor-DFLNSgns.js +1 -0
- package/dist/assets/asn1-CfPVWRYE.js +1 -0
- package/dist/assets/asterisk-CJ4OeA7Y.js +1 -0
- package/dist/assets/badge-BLr1M3ne.js +1 -0
- package/dist/assets/blockDiagram-I7D4REHJ-fyVn7r-9.js +129 -0
- package/dist/assets/bot-CET4VfU-.js +1 -0
- package/dist/assets/brainfuck-NEHkmXMc.js +1 -0
- package/dist/assets/button-DCI8NFig.js +1 -0
- package/dist/assets/c4Diagram-7LVT6UL2-BqC3qTZS.js +38 -0
- package/dist/assets/card-BD8MkPAL.js +1 -0
- package/dist/assets/channel-0B5iAV5A.js +1 -0
- package/dist/assets/character-CguPM7IG.js +1 -0
- package/dist/assets/check-C6myARng.js +1 -0
- package/dist/assets/checkbox-CmYq-YMP.js +1 -0
- package/dist/assets/chevron-down-D2wNtbQf.js +1 -0
- package/dist/assets/chevron-right-CU6xIk8W.js +1 -0
- package/dist/assets/chunk-2Q5K7J3B-CkPHWFj-.js +1 -0
- package/dist/assets/chunk-4HAMMTFA-CGGd_Pxz.js +62 -0
- package/dist/assets/chunk-5VM5RSS4-2H3r6wq0.js +15 -0
- package/dist/assets/chunk-75Z2AOVW-BaPl5WA6.js +2 -0
- package/dist/assets/chunk-DU6HZSFF-2P5iNHqg.js +127 -0
- package/dist/assets/chunk-F27PBJKO-Ci7GmRgM.js +1 -0
- package/dist/assets/chunk-FOHPRMQF-7Ogwfo6e.js +153 -0
- package/dist/assets/chunk-GMAD6QVW-BfvaaEBW.js +70 -0
- package/dist/assets/chunk-GVQU2GXP-Cwp_Wpj2.js +1 -0
- package/dist/assets/chunk-IMKFNOWR-BjXu-u1C.js +231 -0
- package/dist/assets/chunk-JWPE2WC7--HEGjv3t.js +1 -0
- package/dist/assets/chunk-L3NEJ4N5-JUd1UqX1.js +1 -0
- package/dist/assets/chunk-OSK3NFVY-DlrxddG-.js +10 -0
- package/dist/assets/chunk-P2QGCYS3-CjqEi3mx.js +1 -0
- package/dist/assets/chunk-POPQ4Y6H-BytmIqFc.js +1 -0
- package/dist/assets/chunk-PWAF6VOD-CR3rNBNB.js +1 -0
- package/dist/assets/chunk-SHT3W25Y-B1Klag0Z.js +168 -0
- package/dist/assets/chunk-SVP7TREG-A4BO1_5v.js +88 -0
- package/dist/assets/chunk-TICWLB2K-B4lRXha0.js +206 -0
- package/dist/assets/chunk-XXDRQBXY-BhrH-9FX.js +1 -0
- package/dist/assets/chunk-Y2CYZVJY-OvsAdhaO.js +1 -0
- package/dist/assets/classDiagram-ZZMXUADV-icHQAbF4.js +1 -0
- package/dist/assets/classDiagram-v2-VYDZK3BY-icHQAbF4.js +1 -0
- package/dist/assets/clike-CIx9nZSv.js +1 -0
- package/dist/assets/clipboard-BZT4l65i.js +1 -0
- package/dist/assets/clojure-DFaIEz5O.js +1 -0
- package/dist/assets/cmake-koz-qBlo.js +1 -0
- package/dist/assets/cobol-Bo8Zw9gB.js +1 -0
- package/dist/assets/coffeescript-CXYzYf-Y.js +1 -0
- package/dist/assets/commonlisp-C4OOCwkD.js +1 -0
- package/dist/assets/company-members-C1IoXITE.js +1 -0
- package/dist/assets/cose-bilkent-JH36ORCC-ShY6JvWh.js +1 -0
- package/dist/assets/createLucideIcon-D-iIM3hK.js +92 -0
- package/dist/assets/crystal-BlJXQDvy.js +1 -0
- package/dist/assets/css-DEZwfVpY.js +1 -0
- package/dist/assets/cynefin-OW5HDTMX-SmJ8tLYh.js +1 -0
- package/dist/assets/cynefinDiagram-5FMLGOSQ-Qp2NNXUx.js +62 -0
- package/dist/assets/cypher-z2oFsVv2.js +1 -0
- package/dist/assets/cytoscape.esm-B68Piqei.js +321 -0
- package/dist/assets/d-Dkt6y7AQ.js +1 -0
- package/dist/assets/dagre-Bnei_7lW.js +1 -0
- package/dist/assets/dagre-GXQ25YYZ-C1bu-Sbk.js +4 -0
- package/dist/assets/defaultLocale-C2Bpu8Ih.js +1 -0
- package/dist/assets/definition-qmfin__X.js +1 -0
- package/dist/assets/diagram-S7CK7UJ4-D0cqRe3j.js +30 -0
- package/dist/assets/diagram-UQ7AKVKN-DdEgR6LR.js +41 -0
- package/dist/assets/diagram-VSXAHHWV-B_APewr5.js +3 -0
- package/dist/assets/diagram-VX7I27RA-B2quR8-z.js +24 -0
- package/dist/assets/diagram-Z3DM3KII-BpQRCt5N.js +24 -0
- package/dist/assets/diff-C60bAYOU.js +1 -0
- package/dist/assets/dist-B0TRtKS8.js +1 -0
- package/dist/assets/dist-B3Uu-urE.js +1 -0
- package/dist/assets/dist-BRrJTSwu.js +1 -0
- package/dist/assets/dist-BX-OCtve.js +7 -0
- package/dist/assets/dist-BXoB5t8y.js +1 -0
- package/dist/assets/dist-BeN6V24C.js +1 -0
- package/dist/assets/dist-Bs8B1orN.js +1 -0
- package/dist/assets/dist-BuzarGBs.js +1 -0
- package/dist/assets/dist-C2jegCUe.js +2 -0
- package/dist/assets/dist-C8CoeHVO.js +6 -0
- package/dist/assets/dist-CBo4NvFW.js +1 -0
- package/dist/assets/dist-CSbL7rtN.js +1 -0
- package/dist/assets/dist-CWrRKmYk.js +1 -0
- package/dist/assets/dist-CXeuJs-w.js +1 -0
- package/dist/assets/dist-Cc3Bt6H4.js +1 -0
- package/dist/assets/dist-Cj4C2HPs.js +1 -0
- package/dist/assets/dist-DCJXgQu0.js +13 -0
- package/dist/assets/dist-DKJ0FdKS.js +1 -0
- package/dist/assets/dist-DZgNtG8a.js +1 -0
- package/dist/assets/dist-DoBOMP6Y.js +1 -0
- package/dist/assets/dist-DpmnjHX9.js +1 -0
- package/dist/assets/dist-DsLYqWnM.js +1 -0
- package/dist/assets/dist-DyyIM2uF.js +3 -0
- package/dist/assets/dist-YH7EZ8d1.js +1 -0
- package/dist/assets/dist-oQmcCiSD.js +1 -0
- package/dist/assets/dist-sLIQSVjm.js +13 -0
- package/dist/assets/dist-xQwUswee.js +1 -0
- package/dist/assets/dockerfile-BttNdtK0.js +1 -0
- package/dist/assets/dtd-CCVZU5Da.js +1 -0
- package/dist/assets/dylan-3pmV5wzs.js +1 -0
- package/dist/assets/ebnf-bm-I2WIh.js +1 -0
- package/dist/assets/ebnfDiagram-PWID7BFC-C9x73jSZ.js +1 -0
- package/dist/assets/ecl-BIv3PrZb.js +1 -0
- package/dist/assets/eiffel-DuLnr4-r.js +1 -0
- package/dist/assets/elm-njbaCU-L.js +1 -0
- package/dist/assets/environments-Cd-g_MmN.js +1 -0
- package/dist/assets/erDiagram-RLTQ6QDP-Dkp7z94L.js +99 -0
- package/dist/assets/erlang-CuhOC2I8.js +1 -0
- package/dist/assets/eventmodeling-NTZA5JFV-CCSRuDgA.js +1 -0
- package/dist/assets/external-link-BKz-OKDG.js +1 -0
- package/dist/assets/factor-CM3-9V3b.js +1 -0
- package/dist/assets/fcl-nWsMJ92o.js +1 -0
- package/dist/assets/file-text-DXa-cUrm.js +1 -0
- package/dist/assets/flowDiagram-HODETNUW-CDvpIOlT.js +1 -0
- package/dist/assets/forth-BQ9HrCVY.js +1 -0
- package/dist/assets/fortran-DHJe28ev.js +1 -0
- package/dist/assets/ganttDiagram-EL5Y4UJY-CJs7mNJX.js +292 -0
- package/dist/assets/gas-ByO0qYMr.js +1 -0
- package/dist/assets/gherkin-CwOmHL5K.js +1 -0
- package/dist/assets/gitGraph-4MIJSDKK-SUTvd_QT.js +1 -0
- package/dist/assets/gitGraphDiagram-WWUBYQGX-ByeD7NPE.js +106 -0
- package/dist/assets/graphlib-DHhK3saS.js +1 -0
- package/dist/assets/groovy-ByXGF8cx.js +1 -0
- package/dist/assets/haskell-CHSpCNOy.js +1 -0
- package/dist/assets/haxe-P2jh68ck.js +1 -0
- package/dist/assets/health-Dc13TJNg.js +1 -0
- package/dist/assets/heartbeats-CY77VTM_.js +1 -0
- package/dist/assets/http-0jwMmfWP.js +1 -0
- package/dist/assets/idl-DTVVj6r5.js +1 -0
- package/dist/assets/index-CWuperHN.css +1 -0
- package/dist/assets/index-ZrmXLuMX.js +733 -0
- package/dist/assets/info-A6RAGUB7-DP8pqSDg.js +1 -0
- package/dist/assets/infoDiagram-27XIBGKW-B6sR9qVK.js +2 -0
- package/dist/assets/init-BXPE0p7i.js +1 -0
- package/dist/assets/input-BkGpMopE.js +1 -0
- package/dist/assets/ishikawaDiagram-5VMMS53U-HFQ3gYGN.js +70 -0
- package/dist/assets/javascript-Cblpdx44.js +1 -0
- package/dist/assets/journeyDiagram-3NMN7TZE-BtoNErTz.js +139 -0
- package/dist/assets/julia-KVJvUu_F.js +1 -0
- package/dist/assets/kanban-definition-UXKFOSKX-Y55yoRj4.js +89 -0
- package/dist/assets/katex-Du_FPwxl.js +257 -0
- package/dist/assets/label-C-aWneNy.js +5 -0
- package/dist/assets/line-CJEZO7lL.js +1 -0
- package/dist/assets/linear-s0r5e4qh.js +1 -0
- package/dist/assets/livescript-DSHsJPcD.js +1 -0
- package/dist/assets/loader-circle-DwlcG9aS.js +1 -0
- package/dist/assets/lua-Vher-70I.js +1 -0
- package/dist/assets/mathematica-CE9SaVsW.js +1 -0
- package/dist/assets/mbox-JGl1Fgvq.js +1 -0
- package/dist/assets/mention-chips-pBjlxGok.js +17 -0
- package/dist/assets/mermaid-parser.core-CHJSk6z0.js +7 -0
- package/dist/assets/mermaid.core-G_BSi0G0.js +42 -0
- package/dist/assets/mindmap-definition-YA3MSWOX-BnlANYwV.js +96 -0
- package/dist/assets/mirc-BGWbO906.js +1 -0
- package/dist/assets/mllike-DuNQsEw8.js +1 -0
- package/dist/assets/model-DL5biheO.js +1 -0
- package/dist/assets/modelica-5XCgKQt8.js +1 -0
- package/dist/assets/mscgen-mVFg19ri.js +1 -0
- package/dist/assets/mumps-C7oS353s.js +1 -0
- package/dist/assets/nginx-DXVlpyCz.js +1 -0
- package/dist/assets/nsis-KFC6hioG.js +1 -0
- package/dist/assets/ntriples-5ckCopnn.js +1 -0
- package/dist/assets/octagon-alert-CTp78pR9.js +1 -0
- package/dist/assets/octave-D1J2QQNt.js +1 -0
- package/dist/assets/ordinal-BJyFM1v8.js +1 -0
- package/dist/assets/oz-CPsllMDD.js +1 -0
- package/dist/assets/packet-AYTQ26CC-DHxu-C4z.js +1 -0
- package/dist/assets/pascal-B-I6JP0Y.js +1 -0
- package/dist/assets/path-D6mommQw.js +1 -0
- package/dist/assets/pegDiagram-XKGWAZYB-CHhCzuLt.js +1 -0
- package/dist/assets/perl-CI8WIWBi.js +1 -0
- package/dist/assets/pie-WAS4IAKB-CP_gIBKD.js +1 -0
- package/dist/assets/pieDiagram-E7YTZNPT-CEGI1j0Q.js +39 -0
- package/dist/assets/pig-FQI0W3S3.js +1 -0
- package/dist/assets/powershell-BAu6x78A.js +1 -0
- package/dist/assets/preload-helper-CceJXRIF.js +1 -0
- package/dist/assets/prod-COP_vZWu.js +495 -0
- package/dist/assets/properties-BKTTDgau.js +1 -0
- package/dist/assets/protobuf-UWh8gh_j.js +1 -0
- package/dist/assets/pug-C20tNwmy.js +1 -0
- package/dist/assets/puppet-BAHVzCkO.js +1 -0
- package/dist/assets/python-C2DOnsac.js +1 -0
- package/dist/assets/q-Cooe-Nh8.js +1 -0
- package/dist/assets/quadrantDiagram-AXDQQJYC-BfVC-A1t.js +7 -0
- package/dist/assets/r-CktBKya9.js +1 -0
- package/dist/assets/radar-RG4KPBEZ-DbvKbV6l.js +1 -0
- package/dist/assets/railroad-74A4TZTK-BPHjMWIu.js +1 -0
- package/dist/assets/railroad-abnf-HS5TGJTU-DKY8xCGL.js +1 -0
- package/dist/assets/railroad-ebnf-LZEXJU2U-DK75GN4x.js +1 -0
- package/dist/assets/railroad-peg-WCYAUIDC-0bHp9JB9.js +1 -0
- package/dist/assets/railroadDiagram-O6MQD6OU-Bwh6snZb.js +1 -0
- package/dist/assets/requirementDiagram-BXWQKSXE-NEvTOdsw.js +84 -0
- package/dist/assets/rolldown-runtime-ZpX3ckPj.js +1 -0
- package/dist/assets/rotate-ccw-BhopZISX.js +1 -0
- package/dist/assets/rough.esm-DnC5Tr1g.js +1 -0
- package/dist/assets/router-BxwR1PwE.js +15 -0
- package/dist/assets/rpm-Csj9nLHl.js +1 -0
- package/dist/assets/ruby-bGx9eo-K.js +1 -0
- package/dist/assets/runtime-IAg0vdY9.js +4137 -0
- package/dist/assets/sankeyDiagram-P5KCCOFB-AvKb1lr-.js +40 -0
- package/dist/assets/sas-Drou_EQ9.js +1 -0
- package/dist/assets/save-D5KpMLil.js +1 -0
- package/dist/assets/scheme-DcjG9bAf.js +1 -0
- package/dist/assets/select-BqqjvKLd.js +1 -0
- package/dist/assets/sequenceDiagram-WJ2MYXX4-BP0QZnHN.js +162 -0
- package/dist/assets/sheet-Z4n6AEBA.js +1 -0
- package/dist/assets/shell-BSKClwid.js +1 -0
- package/dist/assets/sieve-CcvsXPZo.js +1 -0
- package/dist/assets/simple-mode-B79cVo-x.js +1 -0
- package/dist/assets/sizeCapture-INFHLROL-XURNLuv_.js +1 -0
- package/dist/assets/skeleton-BxD7FB8M.js +1 -0
- package/dist/assets/smalltalk-Cmg-4mjQ.js +1 -0
- package/dist/assets/solr-Dj8ahEwG.js +1 -0
- package/dist/assets/sparql-LAJYmgfk.js +1 -0
- package/dist/assets/spreadsheet-B8doD_pL.js +1 -0
- package/dist/assets/sql-C3kWxFGw.js +1 -0
- package/dist/assets/src-Bssc388C.js +1 -0
- package/dist/assets/stateDiagram-D77RDMKH-Ce0Wj7yz.js +1 -0
- package/dist/assets/stateDiagram-v2-MP3YSRHH-CREL-f_f.js +1 -0
- package/dist/assets/stex-CW6K5Nmu.js +1 -0
- package/dist/assets/stylus-BS-Ienrc.js +1 -0
- package/dist/assets/swift-BD82LMDK.js +1 -0
- package/dist/assets/swimlanes-42K2YHIH-CX7zPtNU.js +1 -0
- package/dist/assets/swimlanesDiagram-VR7AAH4N-B22pD4D6.js +8 -0
- package/dist/assets/tabs-Dqn3cNzC.js +1 -0
- package/dist/assets/tcl-RZa1cqc-.js +1 -0
- package/dist/assets/textile-C-BY_OGF.js +1 -0
- package/dist/assets/tiddlywiki-C9bm_Oju.js +1 -0
- package/dist/assets/tiki-DJOT-rFT.js +1 -0
- package/dist/assets/timeline-definition-24CTP7MA-Bw21rjHm.js +120 -0
- package/dist/assets/toml-Civ2fTsu.js +1 -0
- package/dist/assets/treeView-Q6P3EWNA-CzxfDhvq.js +1 -0
- package/dist/assets/treemap-WGGIJYW6-DNWYF4zd.js +1 -0
- package/dist/assets/triangle-alert-DOta-xfM.js +1 -0
- package/dist/assets/troff-Lns35Xcq.js +1 -0
- package/dist/assets/ttcn-7vlxVTUK.js +1 -0
- package/dist/assets/ttcn-cfg-B8qhhp6o.js +1 -0
- package/dist/assets/turtle-DTIS1YQ7.js +1 -0
- package/dist/assets/use-adapter-capabilities-0-4PhK9y.js +1 -0
- package/dist/assets/useHiddenSettings-D9d6LOsg.js +1 -0
- package/dist/assets/vb-BO8UacKu.js +1 -0
- package/dist/assets/vbscript-DWLru3lT.js +1 -0
- package/dist/assets/velocity-BIIn-Nl2.js +1 -0
- package/dist/assets/vennDiagram-4TSXK5OY-BuncstTm.js +34 -0
- package/dist/assets/verilog-BVYlmXGg.js +1 -0
- package/dist/assets/vhdl-Cn8cC8Yb.js +1 -0
- package/dist/assets/wardley-WFR3VGLG-C18JBEVS.js +1 -0
- package/dist/assets/wardleyDiagram-VM6X3IG4-DOHY7xcd.js +78 -0
- package/dist/assets/webidl-ChvzbZ5-.js +1 -0
- package/dist/assets/xquery-BKN7qEbU.js +1 -0
- package/dist/assets/xychartDiagram-S5SC5T6Z-qOWxoNte.js +7 -0
- package/dist/assets/yacas-BG9ha7tU.js +1 -0
- package/dist/assets/z80-CB2cGLew.js +1 -0
- package/dist/assets/zap-gf6Ev631.js +41 -0
- package/dist/brands/adapters/LICENSE +21 -0
- package/dist/brands/adapters/README.md +7 -0
- package/dist/brands/adapters/cursor-dark.svg +1 -0
- package/dist/brands/adapters/cursor.svg +1 -0
- package/dist/brands/adapters/gemini-color.svg +1 -0
- package/dist/brands/adapters/grok-dark.svg +1 -0
- package/dist/brands/adapters/grok.svg +1 -0
- package/dist/brands/adapters/hermesagent-dark.svg +1 -0
- package/dist/brands/adapters/hermesagent.svg +1 -0
- package/dist/brands/adapters/kimi-color-light.svg +1 -0
- package/dist/brands/adapters/kimi-color.svg +1 -0
- package/dist/brands/adapters/pi-dark.svg +1 -0
- package/dist/brands/adapters/pi.svg +1 -0
- package/dist/brands/apps/LOBE-LICENSE +21 -0
- package/dist/brands/apps/agentmail-dark.svg +16 -0
- package/dist/brands/apps/agentmail.svg +17 -0
- package/dist/brands/apps/airtable.svg +1 -0
- package/dist/brands/apps/anthropic-dark.svg +1 -0
- package/dist/brands/apps/anthropic.svg +1 -0
- package/dist/brands/apps/api-key-generic.svg +1 -0
- package/dist/brands/apps/arcade.png +0 -0
- package/dist/brands/apps/asana.svg +12 -0
- package/dist/brands/apps/beehiiv.png +0 -0
- package/dist/brands/apps/bitly.svg +1 -0
- package/dist/brands/apps/box.svg +1 -0
- package/dist/brands/apps/brex-dark.svg +1 -0
- package/dist/brands/apps/brex.svg +1 -0
- package/dist/brands/apps/candid.png +0 -0
- package/dist/brands/apps/clickhouse-dark.svg +1 -0
- package/dist/brands/apps/clickhouse.svg +1 -0
- package/dist/brands/apps/cloudflare.svg +1 -0
- package/dist/brands/apps/cloudinary-dark.svg +1 -0
- package/dist/brands/apps/cloudinary.svg +3 -0
- package/dist/brands/apps/coda.svg +1 -0
- package/dist/brands/apps/composio-dark.svg +11 -0
- package/dist/brands/apps/composio.svg +16 -0
- package/dist/brands/apps/context7-dark.svg +8 -0
- package/dist/brands/apps/context7.svg +8 -0
- package/dist/brands/apps/discord-dark.svg +1 -0
- package/dist/brands/apps/discord.svg +1 -0
- package/dist/brands/apps/egnyte.svg +1 -0
- package/dist/brands/apps/embat.svg +1 -0
- package/dist/brands/apps/executor.png +0 -0
- package/dist/brands/apps/fireflies.svg +76 -0
- package/dist/brands/apps/github-dark.svg +10 -0
- package/dist/brands/apps/github.svg +10 -0
- package/dist/brands/apps/gmail.svg +1 -0
- package/dist/brands/apps/google-calendar.svg +1 -0
- package/dist/brands/apps/google-chat.svg +1 -0
- package/dist/brands/apps/google-docs.svg +1 -0
- package/dist/brands/apps/google-drive.svg +1 -0
- package/dist/brands/apps/google-people.svg +1 -0
- package/dist/brands/apps/google-sheets.svg +1 -0
- package/dist/brands/apps/google-slides.svg +1 -0
- package/dist/brands/apps/google-workspace-search.svg +1 -0
- package/dist/brands/apps/hugging-face.svg +8 -0
- package/dist/brands/apps/imessage-photon.png +0 -0
- package/dist/brands/apps/jam-dev-dark.svg +1 -0
- package/dist/brands/apps/jam-dev.svg +1 -0
- package/dist/brands/apps/jira-dark.svg +1 -0
- package/dist/brands/apps/jira.svg +4 -0
- package/dist/brands/apps/kernel.svg +3 -0
- package/dist/brands/apps/linear-dark.svg +5 -0
- package/dist/brands/apps/linear.svg +5 -0
- package/dist/brands/apps/local-falcon.png +0 -0
- package/dist/brands/apps/make-dark.svg +1 -0
- package/dist/brands/apps/make.svg +1 -0
- package/dist/brands/apps/manifest.json +496 -0
- package/dist/brands/apps/manufact-dark.svg +6 -0
- package/dist/brands/apps/manufact.svg +5 -0
- package/dist/brands/apps/mem0.svg +1 -0
- package/dist/brands/apps/microsoft-teams.svg +68 -0
- package/dist/brands/apps/miro-dark.svg +1 -0
- package/dist/brands/apps/miro.svg +4 -0
- package/dist/brands/apps/mixpanel-dark.svg +1 -0
- package/dist/brands/apps/mixpanel.svg +1 -0
- package/dist/brands/apps/netlify-dark.svg +1 -0
- package/dist/brands/apps/netlify.svg +16 -0
- package/dist/brands/apps/notion-dark.svg +1 -0
- package/dist/brands/apps/notion.svg +1 -0
- package/dist/brands/apps/oauth-generic.svg +1 -0
- package/dist/brands/apps/openai-dark.svg +1 -0
- package/dist/brands/apps/openai.svg +1 -0
- package/dist/brands/apps/openrouter-dark.svg +3 -0
- package/dist/brands/apps/openrouter.svg +3 -0
- package/dist/brands/apps/oreilly.svg +1 -0
- package/dist/brands/apps/pagerduty.svg +4 -0
- package/dist/brands/apps/planetscale-dark.svg +1 -0
- package/dist/brands/apps/planetscale.svg +1 -0
- package/dist/brands/apps/posthog-dark.svg +1 -0
- package/dist/brands/apps/posthog.svg +1 -0
- package/dist/brands/apps/postman.svg +1 -0
- package/dist/brands/apps/railway-dark.svg +1 -0
- package/dist/brands/apps/railway.svg +1 -0
- package/dist/brands/apps/razorpay-dark.svg +1 -0
- package/dist/brands/apps/razorpay.svg +1 -0
- package/dist/brands/apps/resend-dark.svg +1 -0
- package/dist/brands/apps/resend.svg +1 -0
- package/dist/brands/apps/sanity-dark.svg +1 -0
- package/dist/brands/apps/sanity.svg +1 -0
- package/dist/brands/apps/sentry-dark.svg +1 -0
- package/dist/brands/apps/sentry.svg +1 -0
- package/dist/brands/apps/shopify.svg +24 -0
- package/dist/brands/apps/similarweb-dark.svg +1 -0
- package/dist/brands/apps/similarweb.svg +1 -0
- package/dist/brands/apps/slack.png +0 -0
- package/dist/brands/apps/slack.svg +17 -0
- package/dist/brands/apps/stripe.svg +11 -0
- package/dist/brands/apps/supabase.svg +15 -0
- package/dist/brands/apps/telegram.svg +12 -0
- package/dist/brands/apps/ticket-tailor-dark.svg +1 -0
- package/dist/brands/apps/ticket-tailor.svg +1 -0
- package/dist/brands/apps/ticktick.svg +1 -0
- package/dist/brands/apps/todoist.svg +1 -0
- package/dist/brands/apps/vercel-dark.svg +1 -0
- package/dist/brands/apps/vercel.svg +1 -0
- package/dist/brands/apps/webflow.svg +1 -0
- package/dist/brands/apps/wix-dark.svg +12 -0
- package/dist/brands/apps/wix.svg +12 -0
- package/dist/brands/apps/xai-dark.svg +1 -0
- package/dist/brands/apps/xai.svg +1 -0
- package/dist/brands/apps/xero.svg +1 -0
- package/dist/brands/apps/youcom-dark.svg +13 -0
- package/dist/brands/apps/youcom.svg +13 -0
- package/dist/brands/apps/zapier.svg +1 -0
- package/dist/brands/claude-color.svg +17 -0
- package/dist/brands/codex-color.svg +17 -0
- package/dist/brands/opencode-logo-dark-square.svg +18 -0
- package/dist/brands/opencode-logo-light-square.svg +18 -0
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/favicon.svg +9 -0
- package/dist/fonts/InterVariable-Italic.woff2 +0 -0
- package/dist/fonts/InterVariable.woff2 +0 -0
- package/dist/fonts/NOTICE.md +17 -0
- package/dist/index.html +97 -0
- package/dist/paperclip-thinking.svg +17 -0
- package/dist/site.webmanifest +30 -0
- package/dist/sw.js +85 -0
- package/dist/worktree-favicon-16x16.png +0 -0
- package/dist/worktree-favicon-32x32.png +0 -0
- package/dist/worktree-favicon.ico +0 -0
- package/dist/worktree-favicon.svg +9 -0
- package/package.json +22 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
var jf=Object.defineProperty;var v=(t,e)=>jf(t,"name",{value:e,configurable:!0});function Do(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}v(Do,"_arrayLikeToArray");function ec(t){if(Array.isArray(t))return t}v(ec,"_arrayWithHoles");function tc(t){if(Array.isArray(t))return Do(t)}v(tc,"_arrayWithoutHoles");function lr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}v(lr,"_classCallCheck");function rc(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Zl(a.key),a)}}v(rc,"_defineProperties");function vr(t,e,r){return e&&rc(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}v(vr,"_createClass");function Ct(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Uo(t))||e){r&&(t=r);var a=0,n=v(function(){},"F");return{s:n,n:v(function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},"n"),e:v(function(u){throw u},"e"),f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:v(function(){r=r.call(t)},"s"),n:v(function(){var u=r.next();return o=u.done,u},"n"),e:v(function(u){s=!0,i=u},"e"),f:v(function(){try{o||r.return==null||r.return()}finally{if(s)throw i}},"f")}}v(Ct,"_createForOfIteratorHelper");function Xl(t,e,r){return(e=Zl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}v(Xl,"_defineProperty$1");function ac(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}v(ac,"_iterableToArray");function nc(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a,n,i,o,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(a=i.call(r)).done)&&(s.push(a.value),s.length!==e);u=!0);}catch(f){l=!0,n=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw n}}return s}}v(nc,"_iterableToArrayLimit");function ic(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}v(ic,"_nonIterableRest");function oc(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}v(oc,"_nonIterableSpread");function Qe(t,e){return ec(t)||nc(t,e)||Uo(t,e)||ic()}v(Qe,"_slicedToArray");function dn(t){return tc(t)||ac(t)||Uo(t)||oc()}v(dn,"_toConsumableArray");function sc(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}v(sc,"_toPrimitive");function Zl(t){var e=sc(t,"string");return typeof e=="symbol"?e:e+""}v(Zl,"_toPropertyKey");function et(t){"@babel/helpers - typeof";return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(t)}v(et,"_typeof");function Uo(t,e){if(t){if(typeof t=="string")return Do(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Do(t,e):void 0}}v(Uo,"_unsupportedIterableToArray");var Je=typeof window>"u"?null:window,xs=Je?Je.navigator:null;Je&&Je.document;var uc=et(""),Ql=et({}),lc=et(function(){}),vc=typeof HTMLElement>"u"?"undefined":et(HTMLElement),Pa=v(function(e){return e&&e.instanceString&&We(e.instanceString)?e.instanceString():null},"instanceStr"),de=v(function(e){return e!=null&&et(e)==uc},"string"),We=v(function(e){return e!=null&&et(e)===lc},"fn"),Fe=v(function(e){return!Tt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},"array"),Re=v(function(e){return e!=null&&et(e)===Ql&&!Fe(e)&&e.constructor===Object},"plainObject"),fc=v(function(e){return e!=null&&et(e)===Ql},"object"),ae=v(function(e){return e!=null&&et(e)===et(1)&&!isNaN(e)},"number"),Jl=v(function(e){return ae(e)&&Math.floor(e)===e},"integer"),gn=v(function(e){if(vc!=="undefined")return e!=null&&e instanceof HTMLElement},"htmlElement"),Tt=v(function(e){return Aa(e)||jl(e)},"elementOrCollection"),Aa=v(function(e){return Pa(e)==="collection"&&e._private.single},"element"),jl=v(function(e){return Pa(e)==="collection"&&!e._private.single},"collection"),Ko=v(function(e){return Pa(e)==="core"},"core"),ev=v(function(e){return Pa(e)==="stylesheet"},"stylesheet"),cc=v(function(e){return Pa(e)==="event"},"event"),ar=v(function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},"emptyString"),hc=v(function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},"domElement"),dc=v(function(e){return Re(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},"boundingBox"),gc=v(function(e){return fc(e)&&We(e.then)},"promise"),pc=v(function(){return xs&&xs.userAgent.match(/msie|trident|edge/i)},"ms"),Kr=v(function(e,r){r||(r=v(function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")},"keyFn"));var a=v(function(){var i=this,o=arguments,s,u=r.apply(i,o),l=a.cache;return(s=l[u])||(s=l[u]=e.apply(i,o)),s},"memoizedFn");return a.cache={},a},"memoize"),Yo=Kr(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),An=Kr(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),tv=Kr(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Es=v(function(e){return ar(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},"capitalize"),Jt=v(function(e,r){return e.slice(-1*r.length)===r},"endsWith"),je="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",yc="rgb[a]?\\(("+je+"[%]?)\\s*,\\s*("+je+"[%]?)\\s*,\\s*("+je+"[%]?)(?:\\s*,\\s*("+je+"))?\\)",mc="rgb[a]?\\((?:"+je+"[%]?)\\s*,\\s*(?:"+je+"[%]?)\\s*,\\s*(?:"+je+"[%]?)(?:\\s*,\\s*(?:"+je+"))?\\)",bc="hsl[a]?\\(("+je+")\\s*,\\s*("+je+"[%])\\s*,\\s*("+je+"[%])(?:\\s*,\\s*("+je+"))?\\)",wc="hsl[a]?\\((?:"+je+")\\s*,\\s*(?:"+je+"[%])\\s*,\\s*(?:"+je+"[%])(?:\\s*,\\s*(?:"+je+"))?\\)",xc="\\#[0-9a-fA-F]{3}",Ec="\\#[0-9a-fA-F]{6}",rv=v(function(e,r){return e<r?-1:e>r?1:0},"ascending"),Cc=v(function(e,r){return-1*rv(e,r)},"descending"),pe=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var a=e[r];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var o=n[i];t[o]=a[o]}}return t},Tc=v(function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,a,n,i,o=16;return r?(a=parseInt(e[1]+e[1],o),n=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(a=parseInt(e[1]+e[2],o),n=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[a,n,i]}},"hex2tuple"),Sc=v(function(e){var r,a,n,i,o,s,u,l;function f(d,p,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?d+(p-d)*6*y:y<1/2?p:y<2/3?d+(p-d)*(2/3-y)*6:d}v(f,"hue2rgb");var c=new RegExp("^"+bc+"$").exec(e);if(c){if(a=parseInt(c[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(c[2]),n<0||n>100||(n=n/100,i=parseFloat(c[3]),i<0||i>100)||(i=i/100,o=c[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(n===0)s=u=l=Math.round(i*255);else{var h=i<.5?i*(1+n):i+n-i*n,g=2*i-h;s=Math.round(255*f(g,h,a+1/3)),u=Math.round(255*f(g,h,a)),l=Math.round(255*f(g,h,a-1/3))}r=[s,u,l,o]}return r},"hsl2tuple"),Dc=v(function(e){var r,a=new RegExp("^"+yc+"$").exec(e);if(a){r=[];for(var n=[],i=1;i<=3;i++){var o=a[i];if(o[o.length-1]==="%"&&(n[i]=!0),o=parseFloat(o),n[i]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var s=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(s&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;r.push(l)}}return r},"rgb2tuple"),Bc=v(function(e){return kc[e.toLowerCase()]},"colorname2tuple"),av=v(function(e){return(Fe(e)?e:null)||Bc(e)||Tc(e)||Dc(e)||Sc(e)},"color2tuple"),kc={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},nv=v(function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(Re(o))throw Error("Tried to set map with object key");i<a.length-1?(r[o]==null&&(r[o]={}),r=r[o]):r[o]=e.value}},"setMap"),iv=v(function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(Re(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r},"getMap"),Ga=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ra(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}v(Ra,"getDefaultExportFromCjs");var Xn,Cs;function Ma(){if(Cs)return Xn;Cs=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return v(t,"isObject"),Xn=t,Xn}v(Ma,"requireIsObject");var Zn,Ts;function Pc(){return Ts||(Ts=1,Zn=typeof Ga=="object"&&Ga&&Ga.Object===Object&&Ga),Zn}v(Pc,"require_freeGlobal");var Qn,Ss;function Rn(){if(Ss)return Qn;Ss=1;var t=Pc(),e=typeof self=="object"&&self&&self.Object===Object&&self;return Qn=t||e||Function("return this")(),Qn}v(Rn,"require_root");var Jn,Ds;function Ac(){if(Ds)return Jn;Ds=1;var t=Rn(),e=v(function(){return t.Date.now()},"now");return Jn=e,Jn}v(Ac,"requireNow");var jn,Bs;function Rc(){if(Bs)return jn;Bs=1;var t=/\s/;function e(r){for(var a=r.length;a--&&t.test(r.charAt(a)););return a}return v(e,"trimmedEndIndex"),jn=e,jn}v(Rc,"require_trimmedEndIndex");var ei,ks;function Mc(){if(ks)return ei;ks=1;var t=Rc(),e=/^\s+/;function r(a){return a&&a.slice(0,t(a)+1).replace(e,"")}return v(r,"baseTrim"),ei=r,ei}v(Mc,"require_baseTrim");var ti,Ps;function Xo(){return Ps||(Ps=1,ti=Rn().Symbol),ti}v(Xo,"require_Symbol");var ri,As;function Lc(){if(As)return ri;As=1;var t=Xo(),e=Object.prototype,r=e.hasOwnProperty,a=e.toString,n=t?t.toStringTag:void 0;function i(o){var s=r.call(o,n),u=o[n];try{o[n]=void 0;var l=!0}catch{}var f=a.call(o);return l&&(s?o[n]=u:delete o[n]),f}return v(i,"getRawTag"),ri=i,ri}v(Lc,"require_getRawTag");var ai,Rs;function Ic(){if(Rs)return ai;Rs=1;var t=Object.prototype.toString;function e(r){return t.call(r)}return v(e,"objectToString"),ai=e,ai}v(Ic,"require_objectToString");var ni,Ms;function ov(){if(Ms)return ni;Ms=1;var t=Xo(),e=Lc(),r=Ic(),a="[object Null]",n="[object Undefined]",i=t?t.toStringTag:void 0;function o(s){return s==null?s===void 0?n:a:i&&i in Object(s)?e(s):r(s)}return v(o,"baseGetTag"),ni=o,ni}v(ov,"require_baseGetTag");var ii,Ls;function Oc(){if(Ls)return ii;Ls=1;function t(e){return e!=null&&typeof e=="object"}return v(t,"isObjectLike"),ii=t,ii}v(Oc,"requireIsObjectLike");var oi,Is;function La(){if(Is)return oi;Is=1;var t=ov(),e=Oc(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return v(a,"isSymbol"),oi=a,oi}v(La,"requireIsSymbol");var si,Os;function Nc(){if(Os)return si;Os=1;var t=Mc(),e=Ma(),r=La(),a=NaN,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(l){if(typeof l=="number")return l;if(r(l))return a;if(e(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=e(f)?f+"":f}if(typeof l!="string")return l===0?l:+l;l=t(l);var c=i.test(l);return c||o.test(l)?s(l.slice(2),c?2:8):n.test(l)?a:+l}return v(u,"toNumber"),si=u,si}v(Nc,"requireToNumber");var ui,Ns;function zc(){if(Ns)return ui;Ns=1;var t=Ma(),e=Ac(),r=Nc(),a="Expected a function",n=Math.max,i=Math.min;function o(s,u,l){var f,c,h,g,d,p,y=0,m=!1,w=!1,b=!0;if(typeof s!="function")throw new TypeError(a);u=r(u)||0,t(l)&&(m=!!l.leading,w="maxWait"in l,h=w?n(r(l.maxWait)||0,u):h,b="trailing"in l?!!l.trailing:b);function x(A){var L=f,M=c;return f=c=void 0,y=A,g=s.apply(M,L),g}v(x,"invokeFunc");function S(A){return y=A,d=setTimeout(D,u),m?x(A):g}v(S,"leadingEdge");function T(A){var L=A-p,M=A-y,I=u-L;return w?i(I,h-M):I}v(T,"remainingWait");function E(A){var L=A-p,M=A-y;return p===void 0||L>=u||L<0||w&&M>=h}v(E,"shouldInvoke");function D(){var A=e();if(E(A))return B(A);d=setTimeout(D,T(A))}v(D,"timerExpired");function B(A){return d=void 0,b&&f?x(A):(f=c=void 0,g)}v(B,"trailingEdge");function C(){d!==void 0&&clearTimeout(d),y=0,f=p=c=d=void 0}v(C,"cancel");function P(){return d===void 0?g:B(e())}v(P,"flush");function R(){var A=e(),L=E(A);if(f=arguments,c=this,p=A,L){if(d===void 0)return S(p);if(w)return clearTimeout(d),d=setTimeout(D,u),x(p)}return d===void 0&&(d=setTimeout(D,u)),g}return v(R,"debounced"),R.cancel=C,R.flush=P,R}return v(o,"debounce"),ui=o,ui}v(zc,"requireDebounce");var Ia=Ra(zc()),li=Je?Je.performance:null,sv=li&&li.now?function(){return li.now()}:function(){return Date.now()},Fc=(function(){if(Je){if(Je.requestAnimationFrame)return function(t){Je.requestAnimationFrame(t)};if(Je.mozRequestAnimationFrame)return function(t){Je.mozRequestAnimationFrame(t)};if(Je.webkitRequestAnimationFrame)return function(t){Je.webkitRequestAnimationFrame(t)};if(Je.msRequestAnimationFrame)return function(t){Je.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(sv())},1e3/60)}})(),pn=v(function(e){return Fc(e)},"requestAnimationFrame"),$t=sv,br=9261,uv=65599,Vr=5381,lv=v(function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:br,a;a=e.next(),!a.done;)r=r*uv+a.value|0;return r},"hashIterableInts"),wa=v(function(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:br)*uv+e|0},"hashInt"),xa=v(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vr;return(r<<5)+r+e|0},"hashIntAlt"),Vc=v(function(e,r){return e*2097152+r},"combineHashes"),Xt=v(function(e){return e[0]*2097152+e[1]},"combineHashesArray"),Ha=v(function(e,r){return[wa(e[0],r[0]),xa(e[1],r[1])]},"hashArrays"),zs=v(function(e,r){var a={value:0,done:!1},n=0,i=e.length;return lv({next:v(function(){return n<i?a.value=e[n++]:a.done=!0,a},"next")},r)},"hashIntsArray"),Er=v(function(e,r){var a={value:0,done:!1},n=0,i=e.length;return lv({next:v(function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a},"next")},r)},"hashString"),vv=v(function(){return qc(arguments)},"hashStrings"),qc=v(function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=Er(n):r=Er(n,r)}return r},"hashStringsArray");function _c(t,e,r,a,n){var i=n*Math.PI/180;return{x:Math.cos(i)*(t-r)-Math.sin(i)*(e-a)+r,y:Math.sin(i)*(t-r)+Math.cos(i)*(e-a)+a}}v(_c,"rotatePoint");var Gc=v(function(e,r,a,n,i,o){return{x:(e-a)*i+a,y:(r-n)*o+n}},"movePointByBoxAspect");function Hc(t,e,r){if(r===0)return t;var a=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,i=e.w/e.h,o=1/i,s=_c(t.x,t.y,a,n,r),u=Gc(s.x,s.y,a,n,i,o);return{x:u.x,y:u.y}}v(Hc,"rotatePosAndSkewByBox");var Fs=!0,$c=console.warn!=null,Wc=console.trace!=null,Zo=Number.MAX_SAFE_INTEGER||9007199254740991,fv=v(function(){return!0},"trueify"),yn=v(function(){return!1},"falsify"),Vs=v(function(){return 0},"zeroify"),Qo=v(function(){},"noop"),He=v(function(e){throw new Error(e)},"error"),cv=v(function(e){if(e!==void 0)Fs=!!e;else return Fs},"warnings"),Oe=v(function(e){cv()},"warn"),Uc=v(function(e){return pe({},e)},"clone"),Ft=v(function(e){return e==null?e:Fe(e)?e.slice():Re(e)?Uc(e):e},"copy"),Kc=v(function(e){return e.slice()},"copyArray"),hv=v(function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},"uuid"),Yc={},dv=v(function(){return Yc},"staticEmptyObject"),vt=v(function(e){var r=Object.keys(e);return function(a){for(var n={},i=0;i<r.length;i++){var o=r[i],s=a?.[o];n[o]=s===void 0?e[o]:s}return n}},"defaults"),nr=v(function(e,r,a){for(var n=e.length-1;n>=0;n--)e[n]===r&&e.splice(n,1)},"removeFromArray"),Jo=v(function(e){e.splice(0,e.length)},"clearArray"),Xc=v(function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},"push"),yt=v(function(e,r,a){return a&&(r=tv(a,r)),e[r]},"getPrefixedProperty"),zt=v(function(e,r,a,n){a&&(r=tv(a,r)),e[r]=n},"setPrefixedProperty"),Ht=typeof Map<"u"?Map:(function(){function t(){lr(this,t),this._obj={}}return v(t,"ObjectMap"),vr(t,[{key:"set",value:v(function(r,a){return this._obj[r]=a,this},"set")},{key:"delete",value:v(function(r){return this._obj[r]=void 0,this},"_delete")},{key:"clear",value:v(function(){this._obj={}},"clear")},{key:"has",value:v(function(r){return this._obj[r]!==void 0},"has")},{key:"get",value:v(function(r){return this._obj[r]},"get")}])})(),Zc="undefined",Qc=(function(){function t(e){if(lr(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return v(t,"ObjectSet"),vr(t,[{key:"instanceString",value:v(function(){return"set"},"instanceString")},{key:"add",value:v(function(r){var a=this._obj;a[r]!==1&&(a[r]=1,this.size++)},"add")},{key:"delete",value:v(function(r){var a=this._obj;a[r]===1&&(a[r]=0,this.size--)},"_delete")},{key:"clear",value:v(function(){this._obj=Object.create(null)},"clear")},{key:"has",value:v(function(r){return this._obj[r]===1},"has")},{key:"toArray",value:v(function(){var r=this;return Object.keys(this._obj).filter(function(a){return r.has(a)})},"toArray")},{key:"forEach",value:v(function(r,a){return this.toArray().forEach(r,a)},"forEach")}])})(),jr=(typeof Set>"u"?"undefined":et(Set))!==Zc?Set:Qc,Mn=v(function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Ko(e)){He("An element must have a core reference and parameters set");return}var n=r.group;if(n==null&&(r.data&&r.data.source!=null&&r.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){He("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?n==="edges":!!r.pannable,active:!1,classes:new jr,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var o=r.renderedPosition,s=e.pan(),u=e.zoom();i.position={x:(o.x-s.x)/u,y:(o.y-s.y)/u}}var l=[];Fe(r.classes)?l=r.classes:de(r.classes)&&(l=r.classes.split(/\s+/));for(var f=0,c=l.length;f<c;f++){var h=l[f];!h||h===""||i.classes.add(h)}this.createEmitter(),(a===void 0||a)&&this.restore();var g=r.style||r.css;g&&(Oe("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(g))},"Element"),qs=v(function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},v(function(a,n,i){var o;Re(a)&&!Tt(a)&&(o=a,a=o.roots||o.root,n=o.visit,i=o.directed),i=arguments.length===2&&!We(n)?n:i,n=We(n)?n:function(){};for(var s=this._private.cy,u=a=de(a)?this.filter(a):a,l=[],f=[],c={},h={},g={},d=0,p,y=this.byGroup(),m=y.nodes,w=y.edges,b=0;b<u.length;b++){var x=u[b],S=x.id();x.isNode()&&(l.unshift(x),e.bfs&&(g[S]=!0,f.push(x)),h[S]=0)}for(var T=v(function(){var A=e.bfs?l.shift():l.pop(),L=A.id();if(e.dfs){if(g[L])return 0;g[L]=!0,f.push(A)}var M=h[L],I=c[L],O=I!=null?I.source():null,V=I!=null?I.target():null,q=I==null?void 0:A.same(O)?V[0]:O[0],F=n(A,I,q,d++,M);if(F===!0)return p=A,1;if(F===!1)return 1;for(var H=A.connectedEdges().filter(function(re){return(!i||re.source().same(A))&&w.has(re)}),Q=0;Q<H.length;Q++){var U=H[Q],W=U.connectedNodes().filter(function(re){return!re.same(A)&&m.has(re)}),X=W.id();W.length!==0&&!g[X]&&(W=W[0],l.push(W),e.bfs&&(g[X]=!0,f.push(W)),c[X]=U,h[X]=h[L]+1)}},"_loop"),E;l.length!==0&&(E=T(),!(E!==0&&E===1)););for(var D=s.collection(),B=0;B<f.length;B++){var C=f[B],P=c[C.id()];P!=null&&D.push(P),D.push(C)}return{path:s.collection(D),found:s.collection(p)}},"searchFn")},"defineSearch"),Ea={breadthFirstSearch:qs({bfs:!0}),depthFirstSearch:qs({dfs:!0})};Ea.bfs=Ea.breadthFirstSearch;Ea.dfs=Ea.depthFirstSearch;var rn={exports:{}},Jc=rn.exports,_s;function jc(){return _s||(_s=1,(function(t,e){(function(){var r,a,n=Math.floor,i,o,s,u,l,f,c=Math.min,h,g,d,p,y;a=v(function(m,w){return m<w?-1:m>w?1:0},"defaultCmp"),f=v(function(m,w,b,x,S){var T;if(b==null&&(b=0),S==null&&(S=a),b<0)throw new Error("lo must be non-negative");for(x==null&&(x=m.length);b<x;)T=n((b+x)/2),S(w,m[T])<0?x=T:b=T+1;return[].splice.apply(m,[b,b-b].concat(w)),w},"insort"),s=v(function(m,w,b){return b==null&&(b=a),m.push(w),p(m,0,m.length-1,b)},"heappush"),o=v(function(m,w){var b,x;return w==null&&(w=a),b=m.pop(),m.length?(x=m[0],m[0]=b,y(m,0,w)):x=b,x},"heappop"),l=v(function(m,w,b){var x;return b==null&&(b=a),x=m[0],m[0]=w,y(m,0,b),x},"heapreplace"),u=v(function(m,w,b){var x;return b==null&&(b=a),m.length&&b(m[0],w)<0&&(x=[m[0],w],w=x[0],m[0]=x[1],y(m,0,b)),w},"heappushpop"),i=v(function(m,w){var b,x,S,T,E,D;for(w==null&&(w=a),T=(function(){D=[];for(var B=0,C=n(m.length/2);0<=C?B<C:B>C;0<=C?B++:B--)D.push(B);return D}).apply(this).reverse(),E=[],x=0,S=T.length;x<S;x++)b=T[x],E.push(y(m,b,w));return E},"heapify"),d=v(function(m,w,b){var x;if(b==null&&(b=a),x=m.indexOf(w),x!==-1)return p(m,0,x,b),y(m,x,b)},"updateItem"),h=v(function(m,w,b){var x,S,T,E,D;if(b==null&&(b=a),S=m.slice(0,w),!S.length)return S;for(i(S,b),D=m.slice(w),T=0,E=D.length;T<E;T++)x=D[T],u(S,x,b);return S.sort(b).reverse()},"nlargest"),g=v(function(m,w,b){var x,S,T,E,D,B,C,P,R;if(b==null&&(b=a),w*10<=m.length){if(T=m.slice(0,w).sort(b),!T.length)return T;for(S=T[T.length-1],C=m.slice(w),E=0,B=C.length;E<B;E++)x=C[E],b(x,S)<0&&(f(T,x,0,null,b),T.pop(),S=T[T.length-1]);return T}for(i(m,b),R=[],D=0,P=c(w,m.length);0<=P?D<P:D>P;0<=P?++D:--D)R.push(o(m,b));return R},"nsmallest"),p=v(function(m,w,b,x){var S,T,E;for(x==null&&(x=a),S=m[b];b>w;){if(E=b-1>>1,T=m[E],x(S,T)<0){m[b]=T,b=E;continue}break}return m[b]=S},"_siftdown"),y=v(function(m,w,b){var x,S,T,E,D;for(b==null&&(b=a),S=m.length,D=w,T=m[w],x=2*w+1;x<S;)E=x+1,E<S&&!(b(m[x],m[E])<0)&&(x=E),m[w]=m[x],w=x,x=2*w+1;return m[w]=T,p(m,D,w,b)},"_siftup"),r=(function(){m.push=s,m.pop=o,m.replace=l,m.pushpop=u,m.heapify=i,m.updateItem=d,m.nlargest=h,m.nsmallest=g;function m(w){this.cmp=w??a,this.nodes=[]}return v(m,"Heap"),m.prototype.push=function(w){return s(this.nodes,w,this.cmp)},m.prototype.pop=function(){return o(this.nodes,this.cmp)},m.prototype.peek=function(){return this.nodes[0]},m.prototype.contains=function(w){return this.nodes.indexOf(w)!==-1},m.prototype.replace=function(w){return l(this.nodes,w,this.cmp)},m.prototype.pushpop=function(w){return u(this.nodes,w,this.cmp)},m.prototype.heapify=function(){return i(this.nodes,this.cmp)},m.prototype.updateItem=function(w){return d(this.nodes,w,this.cmp)},m.prototype.clear=function(){return this.nodes=[]},m.prototype.empty=function(){return this.nodes.length===0},m.prototype.size=function(){return this.nodes.length},m.prototype.clone=function(){var w=new m;return w.nodes=this.nodes.slice(0),w},m.prototype.toArray=function(){return this.nodes.slice(0)},m.prototype.insert=m.prototype.push,m.prototype.top=m.prototype.peek,m.prototype.front=m.prototype.peek,m.prototype.has=m.prototype.contains,m.prototype.copy=m.prototype.clone,m})(),(function(m,w){return t.exports=w()})(this,function(){return r})}).call(Jc)})(rn)),rn.exports}v(jc,"requireHeap$1");var vi,Gs;function eh(){return Gs||(Gs=1,vi=jc()),vi}v(eh,"requireHeap");var Oa=Ra(eh()),th=vt({root:null,weight:v(function(e){return 1},"weight"),directed:!1}),rh={dijkstra:v(function(e){if(!Re(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=th(e),n=a.root,i=a.weight,o=a.directed,s=this,u=i,l=de(n)?this.filter(n)[0]:n[0],f={},c={},h={},g=this.byGroup(),d=g.nodes,p=g.edges;p.unmergeBy(function(M){return M.isLoop()});for(var y=v(function(I){return f[I.id()]},"getDist"),m=v(function(I,O){f[I.id()]=O,w.updateItem(I)},"setDist"),w=new Oa(function(M,I){return y(M)-y(I)}),b=0;b<d.length;b++){var x=d[b];f[x.id()]=x.same(l)?0:1/0,w.push(x)}for(var S=v(function(I,O){for(var V=(o?I.edgesTo(O):I.edgesWith(O)).intersect(p),q=1/0,F,H=0;H<V.length;H++){var Q=V[H],U=u(Q);(U<q||!F)&&(q=U,F=Q)}return{edge:F,dist:q}},"distBetween");w.size()>0;){var T=w.pop(),E=y(T),D=T.id();if(h[D]=E,E!==1/0)for(var B=T.neighborhood().intersect(d),C=0;C<B.length;C++){var P=B[C],R=P.id(),A=S(T,P),L=E+A.dist;L<y(P)&&(m(P,L),c[R]={node:T,edge:A.edge})}}return{distanceTo:v(function(I){return h[(de(I)?d.filter(I)[0]:I[0]).id()]},"distanceTo"),pathTo:v(function(I){var O=de(I)?d.filter(I)[0]:I[0],V=[],q=O,F=q.id();if(O.length>0)for(V.unshift(O);c[F];){var H=c[F];V.unshift(H.edge),V.unshift(H.node),q=H.node,F=q.id()}return s.spawn(V)},"pathTo")}},"dijkstra")},ah={kruskal:v(function(e){e=e||function(b){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,i=a.length,o=new Array(i),s=a,u=v(function(x){for(var S=0;S<o.length;S++)if(o[S].has(x))return S},"findSetIndex"),l=0;l<i;l++)o[l]=this.spawn(a[l]);for(var f=n.sort(function(b,x){return e(b)-e(x)}),c=0;c<f.length;c++){var h=f[c],g=h.source()[0],d=h.target()[0],p=u(g),y=u(d),m=o[p],w=o[y];p!==y&&(s.merge(h),m.merge(w),o.splice(y,1))}return s},"kruskal")},nh=vt({root:null,goal:null,weight:v(function(e){return 1},"weight"),heuristic:v(function(e){return 0},"heuristic"),directed:!1}),ih={aStar:v(function(e){var r=this.cy(),a=nh(e),n=a.root,i=a.goal,o=a.heuristic,s=a.directed,u=a.weight;n=r.collection(n)[0],i=r.collection(i)[0];var l=n.id(),f=i.id(),c={},h={},g={},d=new Oa(function(F,H){return h[F.id()]-h[H.id()]}),p=new jr,y={},m={},w=v(function(H,Q){d.push(H),p.add(Q)},"addToOpenSet"),b,x,S=v(function(){b=d.pop(),x=b.id(),p.delete(x)},"popFromOpenSet"),T=v(function(H){return p.has(H)},"isInOpenSet");w(n,l),c[l]=0,h[l]=o(n);for(var E=0;d.size()>0;){if(S(),E++,x===f){for(var D=[],B=i,C=f,P=m[C];D.unshift(B),P!=null&&D.unshift(P),B=y[C],B!=null;)C=B.id(),P=m[C];return{found:!0,distance:c[x],path:this.spawn(D),steps:E}}g[x]=!0;for(var R=b._private.edges,A=0;A<R.length;A++){var L=R[A];if(this.hasElementWithId(L.id())&&!(s&&L.data("source")!==x)){var M=L.source(),I=L.target(),O=M.id()!==x?M:I,V=O.id();if(this.hasElementWithId(V)&&!g[V]){var q=c[x]+u(L);if(!T(V)){c[V]=q,h[V]=q+o(O),w(O,V),y[V]=b,m[V]=L;continue}q<c[V]&&(c[V]=q,h[V]=q+o(O),d.updateItem(O),y[V]=b,m[V]=L)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}},"aStar")},oh=vt({weight:v(function(e){return 1},"weight"),directed:!1}),sh={floydWarshall:v(function(e){for(var r=this.cy(),a=oh(e),n=a.weight,i=a.directed,o=n,s=this.byGroup(),u=s.nodes,l=s.edges,f=u.length,c=f*f,h=v(function(H){return u.indexOf(H)},"indexOf"),g=v(function(H){return u[H]},"atIndex"),d=new Array(c),p=0;p<c;p++){var y=p%f;(p-y)/f===y?d[p]=0:d[p]=1/0}for(var m=new Array(c),w=new Array(c),b=0;b<l.length;b++){var x=l[b],S=x.source()[0],T=x.target()[0];if(S!==T){var E=h(S),D=h(T),B=E*f+D,C=o(x);if(d[B]>C&&(d[B]=C,m[B]=D,w[B]=x),!i){var P=D*f+E;!i&&d[P]>C&&(d[P]=C,m[P]=E,w[P]=x)}}}for(var R=0;R<f;R++)for(var A=0;A<f;A++)for(var L=A*f+R,M=0;M<f;M++){var I=A*f+M,O=R*f+M;d[L]+d[O]<d[I]&&(d[I]=d[L]+d[O],m[I]=m[L])}var V=v(function(H){return(de(H)?r.filter(H):H)[0]},"getArgEle"),q=v(function(H){return h(V(H))},"indexOfArgEle");return{distance:v(function(H,Q){var U=q(H),W=q(Q);return d[U*f+W]},"distance"),path:v(function(H,Q){var U=q(H),W=q(Q),X=g(U);if(U===W)return X.collection();if(m[U*f+W]==null)return r.collection();var re=r.collection(),j=U,Z;for(re.merge(X);U!==W;)j=U,U=m[U*f+W],Z=w[j*f+U],re.merge(Z),re.merge(g(U));return re},"path")}},"floydWarshall")},uh=vt({weight:v(function(e){return 1},"weight"),directed:!1,root:null}),lh={bellmanFord:v(function(e){var r=this,a=uh(e),n=a.weight,i=a.directed,o=a.root,s=n,u=this,l=this.cy(),f=this.byGroup(),c=f.edges,h=f.nodes,g=h.length,d=new Ht,p=!1,y=[];o=l.collection(o)[0],c.unmergeBy(function(ve){return ve.isLoop()});for(var m=c.length,w=v(function(ne){var he=d.get(ne.id());return he||(he={},d.set(ne.id(),he)),he},"getInfo"),b=v(function(ne){return(de(ne)?l.$(ne):ne)[0]},"getNodeFromTo"),x=v(function(ne){return w(b(ne)).dist},"distanceTo"),S=v(function(ne){for(var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,ye=b(ne),me=[],ge=ye;;){if(ge==null)return r.spawn();var Se=w(ge),Be=Se.edge,ke=Se.pred;if(me.unshift(ge[0]),ge.same(he)&&me.length>0)break;Be!=null&&me.unshift(Be),ge=ke}return u.spawn(me)},"pathTo"),T=0;T<g;T++){var E=h[T],D=w(E);E.same(o)?D.dist=0:D.dist=1/0,D.pred=null,D.edge=null}for(var B=!1,C=v(function(ne,he,ye,me,ge,Se){var Be=me.dist+Se;Be<ge.dist&&!ye.same(me.edge)&&(ge.dist=Be,ge.pred=ne,ge.edge=ye,B=!0)},"checkForEdgeReplacement"),P=1;P<g;P++){B=!1;for(var R=0;R<m;R++){var A=c[R],L=A.source(),M=A.target(),I=s(A),O=w(L),V=w(M);C(L,M,A,O,V,I),i||C(M,L,A,V,O,I)}if(!B)break}if(B)for(var q=[],F=0;F<m;F++){var H=c[F],Q=H.source(),U=H.target(),W=s(H),X=w(Q).dist,re=w(U).dist;if(X+W<re||!i&&re+W<X)if(p||(Oe("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),e.findNegativeWeightCycles!==!1){var j=[];X+W<re&&j.push(Q),!i&&re+W<X&&j.push(U);for(var Z=j.length,N=0;N<Z;N++){var _=j[N],G=[_];G.push(w(_).edge);for(var te=w(_).pred;G.indexOf(te)===-1;)G.push(te),G.push(w(te).edge),te=w(te).pred;G=G.slice(G.indexOf(te));for(var le=G[0].id(),xe=0,be=2;be<G.length;be+=2)G[be].id()<le&&(le=G[be].id(),xe=be);G=G.slice(xe).concat(G.slice(0,xe)),G.push(G[0]);var De=G.map(function(ve){return ve.id()}).join(",");q.indexOf(De)===-1&&(y.push(u.spawn(G)),q.push(De))}}else break}return{distanceTo:x,pathTo:S,hasNegativeWeightCycle:p,negativeWeightCycles:y}},"bellmanFord")},vh=Math.sqrt(2),fh=v(function(e,r,a){a.length===0&&He("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],o=n[2],s=r[i],u=r[o],l=a,f=l.length-1;f>=0;f--){var c=l[f],h=c[1],g=c[2];(r[h]===s&&r[g]===u||r[h]===u&&r[g]===s)&&l.splice(f,1)}for(var d=0;d<l.length;d++){var p=l[d];p[1]===u?(l[d]=p.slice(),l[d][1]=s):p[2]===u&&(l[d]=p.slice(),l[d][2]=s)}for(var y=0;y<r.length;y++)r[y]===u&&(r[y]=s);return l},"collapse"),fi=v(function(e,r,a,n){for(;a>n;)r=fh(Math.floor(Math.random()*r.length),e,r),a--;return r},"contractUntil"),ch={kargerStein:v(function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(I){return I.isLoop()});var i=a.length,o=n.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/vh);if(i<2){He("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],f=0;f<o;f++){var c=n[f];l.push([f,a.indexOf(c.source()),a.indexOf(c.target())])}for(var h=1/0,g=[],d=new Array(i),p=new Array(i),y=new Array(i),m=v(function(O,V){for(var q=0;q<i;q++)V[q]=O[q]},"copyNodesMap"),w=0;w<=s;w++){for(var b=0;b<i;b++)p[b]=b;var x=fi(p,l.slice(),i,u),S=x.slice();m(p,y);var T=fi(p,x,u,2),E=fi(y,S,u,2);T.length<=E.length&&T.length<h?(h=T.length,g=T,m(p,d)):E.length<=T.length&&E.length<h&&(h=E.length,g=E,m(y,d))}for(var D=this.spawn(g.map(function(I){return n[I[0]]})),B=this.spawn(),C=this.spawn(),P=d[0],R=0;R<d.length;R++){var A=d[R],L=a[R];A===P?B.merge(L):C.merge(L)}var M=v(function(O){var V=e.spawn();return O.forEach(function(q){V.merge(q),q.connectedEdges().forEach(function(F){e.contains(F)&&!D.contains(F)&&V.merge(F)})}),V},"constructComponent");return{cut:D,components:[M(B),M(C)],partition1:B,partition2:C}},"kargerStein")},ci,hh=v(function(e){return{x:e.x,y:e.y}},"copyPosition"),Ln=v(function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},"modelToRenderedPosition"),gv=v(function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},"renderedToModelPosition"),qr=v(function(e){return{x:e[0],y:e[1]}},"array2point"),dh=v(function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.min(o,n))}return n},"min"),gh=v(function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.max(o,n))}return n},"max"),ph=v(function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,o=r;o<a;o++){var s=e[o];isFinite(s)&&(n+=s,i++)}return n/i},"mean"),yh=v(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(r,a):(a<e.length&&e.splice(a,e.length-a),r>0&&e.splice(0,r));for(var s=0,u=e.length-1;u>=0;u--){var l=e[u];o?isFinite(l)||(e[u]=-1/0,s++):e.splice(u,1)}i&&e.sort(function(h,g){return h-g});var f=e.length,c=Math.floor(f/2);return f%2!==0?e[c+1+s]:(e[c-1+s]+e[c+s])/2},"median"),pv=v(function(e,r){return r===0?e:pv(r,e%r)},"gcd"),mh=v(function(e){for(var r=e[0],a=0;a<e.length;a++)if(Jl(e[a]))a>0&&(r=pv(r,e[a]));else return 0;return r},"gcdMultipleZeroIfNonInt"),bh=v(function(e){return Math.PI*e/180},"deg2rad"),$a=v(function(e,r){return Math.atan2(r,e)-Math.PI/2},"getAngleFromDisp"),jo=Math.log2||function(t){return Math.log(t)/Math.log(2)},es=v(function(e){return e>0?1:e<0?-1:0},"signum"),Cr=v(function(e,r){return Math.sqrt(yr(e,r))},"dist"),yr=v(function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},"sqdist"),wh=v(function(e){for(var r=e.length,a=0,n=0;n<r;n++)a+=e[n];for(var i=0;i<r;i++)e[i]=e[i]/a;return e},"inPlaceSumNormalize"),at=v(function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},"qbezierAt"),Hr=v(function(e,r,a,n){return{x:at(e.x,r.x,a.x,n),y:at(e.y,r.y,a.y,n)}},"qbezierPtAt"),xh=v(function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},o=Cr(e,r),s={x:i.x/o,y:i.y/o};return a=a??0,n=n??a*o,{x:e.x+s.x*n,y:e.y+s.y*n}},"lineAt"),Ca=v(function(e,r,a){return Math.max(e,Math.min(a,r))},"bound"),mt=v(function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},"makeBoundingBox"),Eh=v(function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},"copyBoundingBox"),Ch=v(function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},"clearBoundingBox"),Th=v(function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},"updateBoundingBox"),yv=v(function(e,r,a){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},"expandBoundingBoxByPoint"),an=v(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},"expandBoundingBox"),nn=v(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,o;if(r.length===1)a=n=i=o=r[0];else if(r.length===2)a=i=r[0],o=n=r[1];else if(r.length===4){var s=Qe(r,4);a=s[0],n=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},"expandBoundingBoxSides"),Hs=v(function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},"assignBoundingBox"),ts=v(function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},"boundingBoxesIntersect"),jt=v(function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},"inBoundingBox"),$s=v(function(e,r){return jt(e,r.x,r.y)},"pointInBoundingBox"),mv=v(function(e,r){return jt(e,r.x1,r.y1)&&jt(e,r.x2,r.y2)},"boundingBoxInBoundingBox"),Sh=(ci=Math.hypot)!==null&&ci!==void 0?ci:function(t,e){return Math.sqrt(t*t+e*e)};function Dh(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=v(function(D,B){return{x:D.x+B.x,y:D.y+B.y}},"add"),a=v(function(D,B){return{x:D.x-B.x,y:D.y-B.y}},"sub"),n=v(function(D,B){return{x:D.x*B,y:D.y*B}},"scale"),i=v(function(D,B){return D.x*B.y-D.y*B.x},"cross"),o=v(function(D){var B=Sh(D.x,D.y);return B===0?{x:0,y:0}:{x:D.x/B,y:D.y/B}},"normalize"),s=v(function(D){for(var B=0,C=0;C<D.length;C++){var P=D[C],R=D[(C+1)%D.length];B+=P.x*R.y-R.x*P.y}return B/2},"signedArea"),u=v(function(D,B,C,P){var R=a(B,D),A=a(P,C),L=i(R,A);return Math.abs(L)<1e-9?r(D,n(R,.5)):r(D,n(R,i(a(C,D),A)/L))},"intersectLines"),l=t.map(function(E){return{x:E.x,y:E.y}});s(l)<0&&l.reverse();for(var f=l.length,c=[],h=0;h<f;h++){var g=l[h],d=l[(h+1)%f],p=a(d,g),y=o({x:p.y,y:-p.x});c.push(y)}for(var m=c.map(function(E,D){return{p1:r(l[D],n(E,e)),p2:r(l[(D+1)%f],n(E,e))}}),w=[],b=0;b<f;b++){var x=m[(b-1+f)%f],S=m[b],T=u(x.p1,x.p2,S.p1,S.p2);w.push(T)}return w}v(Dh,"inflatePolygon");function Bh(t,e,r,a,n,i){var o=Dh(Nh(t,e,r,a,n),i),s=mt();return o.forEach(function(u){return yv(s,u.x,u.y)}),s}v(Bh,"miterBox");var bv=v(function(e,r,a,n,i,o,s){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?ir(i,o):u,f=i/2,c=o/2;l=Math.min(l,f,c);var h=l!==f,g=l!==c,d;if(h){var p=a-f+l-s,y=n-c-s;if(d=er(e,r,a,n,p,y,a+f-l+s,y,!1),d.length>0)return d}if(g){var m=a+f+s;if(d=er(e,r,a,n,m,n-c+l-s,m,n+c-l+s,!1),d.length>0)return d}if(h){var w=a-f+l-s,b=n+c+s;if(d=er(e,r,a,n,w,b,a+f-l+s,b,!1),d.length>0)return d}if(g){var x=a-f-s;if(d=er(e,r,a,n,x,n-c+l-s,x,n+c-l+s,!1),d.length>0)return d}var S,T=a-f+l,E=n-c+l;if(S=da(e,r,a,n,T,E,l+s),S.length>0&&S[0]<=T&&S[1]<=E)return[S[0],S[1]];var D=a+f-l,B=n-c+l;if(S=da(e,r,a,n,D,B,l+s),S.length>0&&S[0]>=D&&S[1]<=B)return[S[0],S[1]];var C=a+f-l,P=n+c-l;if(S=da(e,r,a,n,C,P,l+s),S.length>0&&S[0]>=C&&S[1]>=P)return[S[0],S[1]];var R=a-f+l,A=n+c-l;return S=da(e,r,a,n,R,A,l+s),S.length>0&&S[0]<=R&&S[1]>=A?[S[0],S[1]]:[]},"roundRectangleIntersectLine"),kh=v(function(e,r,a,n,i,o,s){var u=s,l=Math.min(a,i),f=Math.max(a,i),c=Math.min(n,o),h=Math.max(n,o);return l-u<=e&&e<=f+u&&c-u<=r&&r<=h+u},"inLineVicinity"),Ph=v(function(e,r,a,n,i,o,s,u,l){var f={x1:Math.min(a,s,i)-l,x2:Math.max(a,s,i)+l,y1:Math.min(n,u,o)-l,y2:Math.max(n,u,o)+l};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},"inBezierVicinity"),Ah=v(function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var o=Math.sqrt(i),s=2*e;return[(-r+o)/s,(-r-o)/s]},"solveQuadratic"),Rh=v(function(e,r,a,n,i){var o=1e-5;e===0&&(e=o),r/=e,a/=e,n/=e;var s,u=(3*a-r*r)/9,l=-(27*n)+r*(9*a-2*(r*r)),f,c,h,g,d;if(l/=54,s=u*u*u+l*l,i[1]=0,g=r/3,s>0){c=l+Math.sqrt(s),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),h=l-Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-g+c+h,g+=(c+h)/2,i[4]=i[2]=-g,g=Math.sqrt(3)*(-h+c)/2,i[3]=g,i[5]=-g;return}if(i[5]=i[3]=0,s===0){d=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-g+2*d,i[4]=i[2]=-(d+g);return}u=-u,f=u*u*u,f=Math.acos(l/Math.sqrt(f)),d=2*Math.sqrt(u),i[0]=-g+d*Math.cos(f/3),i[2]=-g+d*Math.cos((f+2*Math.PI)/3),i[4]=-g+d*Math.cos((f+4*Math.PI)/3)},"solveCubic"),Mh=v(function(e,r,a,n,i,o,s,u){var l=1*a*a-4*a*i+2*a*s+4*i*i-4*i*s+s*s+n*n-4*n*o+2*n*u+4*o*o-4*o*u+u*u,f=9*a*i-3*a*a-3*a*s-6*i*i+3*i*s+9*n*o-3*n*n-3*n*u-6*o*o+3*o*u,c=3*a*a-6*a*i+a*s-a*e+2*i*i+2*i*e-s*e+3*n*n-6*n*o+n*u-n*r+2*o*o+2*o*r-u*r,h=1*a*i-a*a+a*e-i*e+n*o-n*n+n*r-o*r,g=[];Rh(l,f,c,h,g);for(var d=1e-7,p=[],y=0;y<6;y+=2)Math.abs(g[y+1])<d&&g[y]>=0&&g[y]<=1&&p.push(g[y]);p.push(1),p.push(0);for(var m=-1,w,b,x,S=0;S<p.length;S++)w=Math.pow(1-p[S],2)*a+2*(1-p[S])*p[S]*i+p[S]*p[S]*s,b=Math.pow(1-p[S],2)*n+2*(1-p[S])*p[S]*o+p[S]*p[S]*u,x=Math.pow(w-e,2)+Math.pow(b-r,2),m>=0?x<m&&(m=x):m=x;return m},"sqdistToQuadraticBezier"),Lh=v(function(e,r,a,n,i,o){var s=[e-a,r-n],u=[i-a,o-n],l=u[0]*u[0]+u[1]*u[1],f=s[0]*s[0]+s[1]*s[1],c=s[0]*u[0]+s[1]*u[1],h=c*c/l;return c<0?f:h>l?(e-i)*(e-i)+(r-o)*(r-o):f-h},"sqdistToFiniteLine"),Et=v(function(e,r,a){for(var n,i,o,s,u,l=0,f=0;f<a.length/2;f++)if(n=a[f*2],i=a[f*2+1],f+1<a.length/2?(o=a[(f+1)*2],s=a[(f+1)*2+1]):(o=a[(f+1-a.length/2)*2],s=a[(f+1-a.length/2)*2+1]),!(n==e&&o==e))if(n>=e&&e>=o||n<=e&&e<=o)u=(e-n)/(o-n)*(s-i)+i,u>r&&l++;else continue;return l%2!==0},"pointInsidePolygonPoints"),Wt=v(function(e,r,a,n,i,o,s,u,l){var f=new Array(a.length),c;u[0]!=null?(c=Math.atan(u[1]/u[0]),u[0]<0?c=c+Math.PI/2:c=-c-Math.PI/2):c=u;for(var h=Math.cos(-c),g=Math.sin(-c),d=0;d<f.length/2;d++)f[d*2]=o/2*(a[d*2]*h-a[d*2+1]*g),f[d*2+1]=s/2*(a[d*2+1]*h+a[d*2]*g),f[d*2]+=n,f[d*2+1]+=i;var p;return l>0?p=mn(bn(f,-l)):p=f,Et(e,r,p)},"pointInsidePolygon"),Ih=v(function(e,r,a,n,i,o,s,u){for(var l=new Array(a.length*2),f=0;f<u.length;f++){var c=u[f];if(l[f*4+0]=c.startX,l[f*4+1]=c.startY,l[f*4+2]=c.stopX,l[f*4+3]=c.stopY,Math.pow(c.cx-e,2)+Math.pow(c.cy-r,2)<=Math.pow(c.radius,2))return!0}return Et(e,r,l)},"pointInsideRoundPolygon"),mn=v(function(e){for(var r=new Array(e.length/2),a,n,i,o,s,u,l,f,c=0;c<e.length/4;c++){a=e[c*4],n=e[c*4+1],i=e[c*4+2],o=e[c*4+3],c<e.length/4-1?(s=e[(c+1)*4],u=e[(c+1)*4+1],l=e[(c+1)*4+2],f=e[(c+1)*4+3]):(s=e[0],u=e[1],l=e[2],f=e[3]);var h=er(a,n,i,o,s,u,l,f,!0);r[c*2]=h[0],r[c*2+1]=h[1]}return r},"joinLines"),bn=v(function(e,r){for(var a=new Array(e.length*2),n,i,o,s,u=0;u<e.length/2;u++){n=e[u*2],i=e[u*2+1],u<e.length/2-1?(o=e[(u+1)*2],s=e[(u+1)*2+1]):(o=e[0],s=e[1]);var l=s-i,f=-(o-n),c=Math.sqrt(l*l+f*f),h=l/c,g=f/c;a[u*4]=n+h*r,a[u*4+1]=i+g*r,a[u*4+2]=o+h*r,a[u*4+3]=s+g*r}return a},"expandPolygon"),Oh=v(function(e,r,a,n,i,o){var s=a-e,u=n-r;s/=i,u/=o;var l=Math.sqrt(s*s+u*u),f=l-1;if(f<0)return[];var c=f/l;return[(a-e)*c+e,(n-r)*c+r]},"intersectLineEllipse"),xr=v(function(e,r,a,n,i,o,s){return e-=i,r-=o,e/=a/2+s,r/=n/2+s,e*e+r*r<=1},"checkInEllipse"),da=v(function(e,r,a,n,i,o,s){var u=[a-e,n-r],l=[e-i,r-o],f=u[0]*u[0]+u[1]*u[1],c=2*(l[0]*u[0]+l[1]*u[1]),h=l[0]*l[0]+l[1]*l[1]-s*s,g=c*c-4*f*h;if(g<0)return[];var d=(-c+Math.sqrt(g))/(2*f),p=(-c-Math.sqrt(g))/(2*f),y=Math.min(d,p),m=Math.max(d,p),w=[];if(y>=0&&y<=1&&w.push(y),m>=0&&m<=1&&w.push(m),w.length===0)return[];var b=w[0]*u[0]+e,x=w[0]*u[1]+r;return w.length>1?w[0]==w[1]?[b,x]:[b,x,w[1]*u[0]+e,w[1]*u[1]+r]:[b,x]},"intersectLineCircle"),hi=v(function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},"midOfThree"),er=v(function(e,r,a,n,i,o,s,u,l){var f=e-i,c=a-e,h=s-i,g=r-o,d=n-r,p=u-o,y=h*g-p*f,m=c*g-d*f,w=p*c-h*d;if(w!==0){var b=y/w,x=m/w,S=.001,T=0-S,E=1+S;return T<=b&&b<=E&&T<=x&&x<=E?[e+b*c,r+b*d]:l?[e+b*c,r+b*d]:[]}else return y===0||m===0?hi(e,a,s)===s?[s,u]:hi(e,a,i)===i?[i,o]:hi(i,s,a)===a?[a,n]:[]:[]},"finiteLinesIntersect"),Nh=v(function(e,r,a,n,i){var o=[],s=n/2,u=i/2,l=r,f=a;o.push({x:l+s*e[0],y:f+u*e[1]});for(var c=1;c<e.length/2;c++)o.push({x:l+s*e[c*2],y:f+u*e[c*2+1]});return o},"transformPoints"),Ta=v(function(e,r,a,n,i,o,s,u){var l=[],f,c=new Array(a.length),h=!0;o==null&&(h=!1);var g;if(h){for(var d=0;d<c.length/2;d++)c[d*2]=a[d*2]*o+n,c[d*2+1]=a[d*2+1]*s+i;u>0?g=mn(bn(c,-u)):g=c}else g=a;for(var p,y,m,w,b=0;b<g.length/2;b++)p=g[b*2],y=g[b*2+1],b<g.length/2-1?(m=g[(b+1)*2],w=g[(b+1)*2+1]):(m=g[0],w=g[1]),f=er(e,r,n,i,p,y,m,w),f.length!==0&&l.push(f[0],f[1]);return l},"polygonIntersectLine"),zh=v(function(e,r,a,n,i,o,s,u,l){var f=[],c,h=new Array(a.length*2);l.forEach(function(w,b){b===0?(h[h.length-2]=w.startX,h[h.length-1]=w.startY):(h[b*4-2]=w.startX,h[b*4-1]=w.startY),h[b*4]=w.stopX,h[b*4+1]=w.stopY,c=da(e,r,n,i,w.cx,w.cy,w.radius),c.length!==0&&f.push(c[0],c[1])});for(var g=0;g<h.length/4;g++)c=er(e,r,n,i,h[g*4],h[g*4+1],h[g*4+2],h[g*4+3],!1),c.length!==0&&f.push(c[0],c[1]);if(f.length>2){for(var d=[f[0],f[1]],p=Math.pow(d[0]-e,2)+Math.pow(d[1]-r,2),y=1;y<f.length/2;y++){var m=Math.pow(f[y*2]-e,2)+Math.pow(f[y*2+1]-r,2);m<=p&&(d[0]=f[y*2],d[1]=f[y*2+1],p=m)}return d}return f},"roundPolygonIntersectLine"),Wa=v(function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),o=(i-a)/i;return o<0&&(o=1e-5),[r[0]+o*n[0],r[1]+o*n[1]]},"shortenIntersection"),pt=v(function(e,r){var a=Bo(e,r);return a=wv(a),a},"generateUnitNgonPointsFitToSquare"),wv=v(function(e){for(var r,a,n=e.length/2,i=1/0,o=1/0,s=-1/0,u=-1/0,l=0;l<n;l++)r=e[2*l],a=e[2*l+1],i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);for(var f=2/(s-i),c=2/(u-o),h=0;h<n;h++)r=e[2*h]=e[2*h]*f,a=e[2*h+1]=e[2*h+1]*c,i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);if(o<-1)for(var g=0;g<n;g++)a=e[2*g+1]=e[2*g+1]+(-1-o);return e},"fitPolygonToSquare"),Bo=v(function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*a+n,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},"generateUnitNgonPoints"),ir=v(function(e,r){return Math.min(e/4,r/4,8)},"getRoundRectangleRadius"),xv=v(function(e,r){return Math.min(e/10,r/10,8)},"getRoundPolygonRadius"),rs=v(function(){return 8},"getCutRectangleCornerLength"),Fh=v(function(e,r,a){return[e-2*r+a,2*(r-e),e]},"bezierPtsToQuadCoeff"),ko=v(function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},"getBarrelCurveConstants");function di(t,e){function r(u){for(var l=[],f=0;f<u.length;f++){var c=u[f],h=u[(f+1)%u.length],g={x:h.x-c.x,y:h.y-c.y},d={x:-g.y,y:g.x},p=Math.sqrt(d.x*d.x+d.y*d.y);l.push({x:d.x/p,y:d.y/p})}return l}v(r,"getAxes");function a(u,l){var f=1/0,c=-1/0,h=Ct(u),g;try{for(h.s();!(g=h.n()).done;){var d=g.value,p=d.x*l.x+d.y*l.y;f=Math.min(f,p),c=Math.max(c,p)}}catch(y){h.e(y)}finally{h.f()}return{min:f,max:c}}v(a,"project");function n(u,l){return!(u.max<l.min||l.max<u.min)}v(n,"overlaps");var i=Ct([].concat(dn(r(t)),dn(r(e)))),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;if(!n(a(t,s),a(e,s)))return!1}}catch(u){i.e(u)}finally{i.f()}return!0}v(di,"satPolygonIntersection");var Vh=vt({dampingFactor:.8,precision:1e-6,iterations:200,weight:v(function(e){return 1},"weight")}),qh={pageRank:v(function(e){for(var r=Vh(e),a=r.dampingFactor,n=r.precision,i=r.iterations,o=r.weight,s=this._private.cy,u=this.byGroup(),l=u.nodes,f=u.edges,c=l.length,h=c*c,g=f.length,d=new Array(h),p=new Array(c),y=(1-a)/c,m=0;m<c;m++){for(var w=0;w<c;w++){var b=m*c+w;d[b]=0}p[m]=0}for(var x=0;x<g;x++){var S=f[x],T=S.data("source"),E=S.data("target");if(T!==E){var D=l.indexOfId(T),B=l.indexOfId(E),C=o(S),P=B*c+D;d[P]+=C,p[D]+=C}}for(var R=1/c+y,A=0;A<c;A++)if(p[A]===0)for(var L=0;L<c;L++){var M=L*c+A;d[M]=R}else for(var I=0;I<c;I++){var O=I*c+A;d[O]=d[O]/p[A]+y}for(var V=new Array(c),q=new Array(c),F,H=0;H<c;H++)V[H]=1;for(var Q=0;Q<i;Q++){for(var U=0;U<c;U++)q[U]=0;for(var W=0;W<c;W++)for(var X=0;X<c;X++){var re=W*c+X;q[W]+=d[re]*V[X]}wh(q),F=V,V=q,q=F;for(var j=0,Z=0;Z<c;Z++){var N=F[Z]-V[Z];j+=N*N}if(j<n)break}return{rank:v(function(G){return G=s.collection(G)[0],V[l.indexOf(G)]},"rank")}},"pageRank")},Ws=vt({root:null,weight:v(function(e){return 1},"weight"),directed:!1,alpha:0}),$r={degreeCentralityNormalized:v(function(e){e=Ws(e);var r=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var f={},c={},h=0,g=0,d=0;d<n;d++){var p=a[d],y=p.id();e.root=p;var m=this.degreeCentrality(e);h<m.indegree&&(h=m.indegree),g<m.outdegree&&(g=m.outdegree),f[y]=m.indegree,c[y]=m.outdegree}return{indegree:v(function(b){return h==0?0:(de(b)&&(b=r.filter(b)),f[b.id()]/h)},"indegree"),outdegree:v(function(b){return g===0?0:(de(b)&&(b=r.filter(b)),c[b.id()]/g)},"outdegree")}}else{for(var i={},o=0,s=0;s<n;s++){var u=a[s];e.root=u;var l=this.degreeCentrality(e);o<l.degree&&(o=l.degree),i[u.id()]=l.degree}return{degree:v(function(b){return o===0?0:(de(b)&&(b=r.filter(b)),i[b.id()]/o)},"degree")}}},"degreeCentralityNormalized"),degreeCentrality:v(function(e){e=Ws(e);var r=this.cy(),a=this,n=e,i=n.root,o=n.weight,s=n.directed,u=n.alpha;if(i=r.collection(i)[0],s){for(var g=i.connectedEdges(),d=g.filter(function(T){return T.target().same(i)&&a.has(T)}),p=g.filter(function(T){return T.source().same(i)&&a.has(T)}),y=d.length,m=p.length,w=0,b=0,x=0;x<d.length;x++)w+=o(d[x]);for(var S=0;S<p.length;S++)b+=o(p[S]);return{indegree:Math.pow(y,1-u)*Math.pow(w,u),outdegree:Math.pow(m,1-u)*Math.pow(b,u)}}else{for(var l=i.connectedEdges().intersection(a),f=l.length,c=0,h=0;h<l.length;h++)c+=o(l[h]);return{degree:Math.pow(f,1-u)*Math.pow(c,u)}}},"degreeCentrality")};$r.dc=$r.degreeCentrality;$r.dcn=$r.degreeCentralityNormalised=$r.degreeCentralityNormalized;var Us=vt({harmonic:!0,weight:v(function(){return 1},"weight"),directed:!1,root:null}),Wr={closenessCentralityNormalized:v(function(e){for(var r=Us(e),a=r.harmonic,n=r.weight,i=r.directed,o=this.cy(),s={},u=0,l=this.nodes(),f=this.floydWarshall({weight:n,directed:i}),c=0;c<l.length;c++){for(var h=0,g=l[c],d=0;d<l.length;d++)if(c!==d){var p=f.distance(g,l[d]);a?h+=1/p:h+=p}a||(h=1/h),u<h&&(u=h),s[g.id()]=h}return{closeness:v(function(m){return u==0?0:(de(m)?m=o.filter(m)[0].id():m=m.id(),s[m]/u)},"closeness")}},"closenessCentralityNormalized"),closenessCentrality:v(function(e){var r=Us(e),a=r.root,n=r.weight,i=r.directed,o=r.harmonic;a=this.filter(a)[0];for(var s=this.dijkstra({root:a,weight:n,directed:i}),u=0,l=this.nodes(),f=0;f<l.length;f++){var c=l[f];if(!c.same(a)){var h=s.distanceTo(c);o?u+=1/h:u+=h}}return o?u:1/u},"closenessCentrality")};Wr.cc=Wr.closenessCentrality;Wr.ccn=Wr.closenessCentralityNormalised=Wr.closenessCentralityNormalized;var _h=vt({weight:null,directed:!1}),Po={betweennessCentrality:v(function(e){for(var r=_h(e),a=r.directed,n=r.weight,i=n!=null,o=this.cy(),s=this.nodes(),u={},l={},f=0,c={set:v(function(b,x){l[b]=x,x>f&&(f=x)},"set"),get:v(function(b){return l[b]},"get")},h=0;h<s.length;h++){var g=s[h],d=g.id();a?u[d]=g.outgoers().nodes():u[d]=g.openNeighborhood().nodes(),c.set(d,0)}for(var p=v(function(){for(var b=s[y].id(),x=[],S={},T={},E={},D=new Oa(function(W,X){return E[W]-E[X]}),B=0;B<s.length;B++){var C=s[B].id();S[C]=[],T[C]=0,E[C]=1/0}for(T[b]=1,E[b]=0,D.push(b);!D.empty();){var P=D.pop();if(x.push(P),i)for(var R=0;R<u[P].length;R++){var A=u[P][R],L=o.getElementById(P),M=void 0;L.edgesTo(A).length>0?M=L.edgesTo(A)[0]:M=A.edgesTo(L)[0];var I=n(M);A=A.id(),E[A]>E[P]+I&&(E[A]=E[P]+I,D.nodes.indexOf(A)<0?D.push(A):D.updateItem(A),T[A]=0,S[A]=[]),E[A]==E[P]+I&&(T[A]=T[A]+T[P],S[A].push(P))}else for(var O=0;O<u[P].length;O++){var V=u[P][O].id();E[V]==1/0&&(D.push(V),E[V]=E[P]+1),E[V]==E[P]+1&&(T[V]=T[V]+T[P],S[V].push(P))}}for(var q={},F=0;F<s.length;F++)q[s[F].id()]=0;for(;x.length>0;){for(var H=x.pop(),Q=0;Q<S[H].length;Q++){var U=S[H][Q];q[U]=q[U]+T[U]/T[H]*(1+q[H])}H!=s[y].id()&&c.set(H,c.get(H)+q[H])}},"_loop"),y=0;y<s.length;y++)p();var m={betweenness:v(function(b){var x=o.collection(b).id();return c.get(x)},"betweenness"),betweennessNormalized:v(function(b){if(f==0)return 0;var x=o.collection(b).id();return c.get(x)/f},"betweennessNormalized")};return m.betweennessNormalised=m.betweennessNormalized,m},"betweennessCentrality")};Po.bc=Po.betweennessCentrality;var Gh=vt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),Hh=v(function(e){return Gh(e)},"setOptions"),$h=v(function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},"getSimilarity"),Wh=v(function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},"addLoops"),Ev=v(function(e,r){for(var a,n=0;n<r;n++){a=0;for(var i=0;i<r;i++)a+=e[i*r+n];for(var o=0;o<r;o++)e[o*r+n]=e[o*r+n]/a}},"normalize"),Uh=v(function(e,r,a){for(var n=new Array(a*a),i=0;i<a;i++){for(var o=0;o<a;o++)n[i*a+o]=0;for(var s=0;s<a;s++)for(var u=0;u<a;u++)n[i*a+u]+=e[i*a+s]*r[s*a+u]}return n},"mmult"),Kh=v(function(e,r,a){for(var n=e.slice(0),i=1;i<a;i++)e=Uh(e,n,r);return e},"expand"),Yh=v(function(e,r,a){for(var n=new Array(r*r),i=0;i<r*r;i++)n[i]=Math.pow(e[i],a);return Ev(n,r),n},"inflate"),Xh=v(function(e,r,a,n){for(var i=0;i<a;i++)if(Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n)!==Math.round(r[i]*Math.pow(10,n))/Math.pow(10,n))return!1;return!0},"hasConverged"),Zh=v(function(e,r,a,n){for(var i=[],o=0;o<r;o++){for(var s=[],u=0;u<r;u++)Math.round(e[o*r+u]*1e3)/1e3>0&&s.push(a[u]);s.length!==0&&i.push(n.collection(s))}return i},"assign"),Qh=v(function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},"isDuplicate"),Jh=v(function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&Qh(e[r],e[a])&&e.splice(a,1);return e},"removeDuplicates"),Ks=v(function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),i=Hh(e),o={},s=0;s<r.length;s++)o[r[s].id()]=s;for(var u=r.length,l=u*u,f=new Array(l),c,h=0;h<l;h++)f[h]=0;for(var g=0;g<a.length;g++){var d=a[g],p=o[d.source().id()],y=o[d.target().id()],m=$h(d,i.attributes);f[p*u+y]+=m,f[y*u+p]+=m}Wh(f,u,i.multFactor),Ev(f,u);for(var w=!0,b=0;w&&b<i.maxIterations;)w=!1,c=Kh(f,u,i.expandFactor),f=Yh(c,u,i.inflateFactor),Xh(f,c,l,4)||(w=!0),b++;var x=Zh(f,u,r,n);return x=Jh(x),x},"markovClustering"),jh={markovClustering:Ks,mcl:Ks},ed=v(function(e){return e},"identity"),Cv=v(function(e,r){return Math.abs(r-e)},"absDiff"),Ys=v(function(e,r,a){return e+Cv(r,a)},"addAbsDiff"),Xs=v(function(e,r,a){return e+Math.pow(a-r,2)},"addSquaredDiff"),td=v(function(e){return Math.sqrt(e)},"sqrt"),rd=v(function(e,r,a){return Math.max(e,Cv(r,a))},"maxAbsDiff"),sa=v(function(e,r,a,n,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:ed,s=n,u,l,f=0;f<e;f++)u=r(f),l=a(f),s=i(s,u,l);return o(s)},"getDistance"),Yr={euclidean:v(function(e,r,a){return e>=2?sa(e,r,a,0,Xs,td):sa(e,r,a,0,Ys)},"euclidean"),squaredEuclidean:v(function(e,r,a){return sa(e,r,a,0,Xs)},"squaredEuclidean"),manhattan:v(function(e,r,a){return sa(e,r,a,0,Ys)},"manhattan"),max:v(function(e,r,a){return sa(e,r,a,-1/0,rd)},"max")};Yr["squared-euclidean"]=Yr.squaredEuclidean;Yr.squaredeuclidean=Yr.squaredEuclidean;function In(t,e,r,a,n,i){var o;return We(t)?o=t:o=Yr[t]||Yr.euclidean,e===0&&We(t)?o(n,i):o(e,r,a,n,i)}v(In,"clusteringDistance");var ad=vt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),as=v(function(e){return ad(e)},"setOptions"),wn=v(function(e,r,a,n,i){var o=i!=="kMedoids"?function(f){return a[f]}:function(f){return n[f](a)},s=v(function(c){return n[c](r)},"getQ"),u=a,l=r;return In(e,n.length,o,s,u,l)},"getDist"),gi=v(function(e,r,a){for(var n=a.length,i=new Array(n),o=new Array(n),s=new Array(r),u=null,l=0;l<n;l++)i[l]=e.min(a[l]).value,o[l]=e.max(a[l]).value;for(var f=0;f<r;f++){u=[];for(var c=0;c<n;c++)u[c]=Math.random()*(o[c]-i[c])+i[c];s[f]=u}return s},"randomCentroids"),Tv=v(function(e,r,a,n,i){for(var o=1/0,s=0,u=0;u<r.length;u++){var l=wn(a,e,r[u],n,i);l<o&&(o=l,s=u)}return s},"classify"),Sv=v(function(e,r,a){for(var n=[],i=null,o=0;o<r.length;o++)i=r[o],a[i.id()]===e&&n.push(i);return n},"buildCluster"),nd=v(function(e,r,a){return Math.abs(r-e)<=a},"haveValuesConverged"),id=v(function(e,r,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)if(Math.abs(e[n][i]-r[n][i])>a)return!1;return!0},"haveMatricesConverged"),od=v(function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},"seenBefore"),Zs=v(function(e,r){var a=new Array(r);if(e.length<50)for(var n=0;n<r;n++){for(var i=e[Math.floor(Math.random()*e.length)];od(i,a,n);)i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var o=0;o<r;o++)a[o]=e[Math.floor(Math.random()*e.length)];return a},"randomMedoids"),Qs=v(function(e,r,a){for(var n=0,i=0;i<r.length;i++)n+=wn("manhattan",r[i],e,a,"kMedoids");return n},"findCost"),sd=v(function(e){var r=this.cy(),a=this.nodes(),n=null,i=as(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=gi(a,i.k,i.attributes)):et(i.testCentroids)==="object"?u=i.testCentroids:u=gi(a,i.k,i.attributes):u=gi(a,i.k,i.attributes);for(var l=!0,f=0;l&&f<i.maxIterations;){for(var c=0;c<a.length;c++)n=a[c],s[n.id()]=Tv(n,u,i.distance,i.attributes,"kMeans");l=!1;for(var h=0;h<i.k;h++){var g=Sv(h,a,s);if(g.length!==0){for(var d=i.attributes.length,p=u[h],y=new Array(d),m=new Array(d),w=0;w<d;w++){m[w]=0;for(var b=0;b<g.length;b++)n=g[b],m[w]+=i.attributes[w](n);y[w]=m[w]/g.length,nd(y[w],p[w],i.sensitivityThreshold)||(l=!0)}u[h]=y,o[h]=r.collection(g)}}f++}return o},"kMeans"),ud=v(function(e){var r=this.cy(),a=this.nodes(),n=null,i=as(e),o=new Array(i.k),s,u={},l,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(et(i.testCentroids)==="object"?s=i.testCentroids:s=Zs(a,i.k)):s=Zs(a,i.k);for(var c=!0,h=0;c&&h<i.maxIterations;){for(var g=0;g<a.length;g++)n=a[g],u[n.id()]=Tv(n,s,i.distance,i.attributes,"kMedoids");c=!1;for(var d=0;d<s.length;d++){var p=Sv(d,a,u);if(p.length!==0){f[d]=Qs(s[d],p,i.attributes);for(var y=0;y<p.length;y++)l=Qs(p[y],p,i.attributes),l<f[d]&&(f[d]=l,s[d]=p[y],c=!0);o[d]=r.collection(p)}}h++}return o},"kMedoids"),ld=v(function(e,r,a,n,i){for(var o,s,u=0;u<r.length;u++)for(var l=0;l<e.length;l++)n[u][l]=Math.pow(a[u][l],i.m);for(var f=0;f<e.length;f++)for(var c=0;c<i.attributes.length;c++){o=0,s=0;for(var h=0;h<r.length;h++)o+=n[h][f]*i.attributes[c](r[h]),s+=n[h][f];e[f][c]=o/s}},"updateCentroids"),vd=v(function(e,r,a,n,i){for(var o=0;o<e.length;o++)r[o]=e[o].slice();for(var s,u,l,f=2/(i.m-1),c=0;c<a.length;c++)for(var h=0;h<n.length;h++){s=0;for(var g=0;g<a.length;g++)u=wn(i.distance,n[h],a[c],i.attributes,"cmeans"),l=wn(i.distance,n[h],a[g],i.attributes,"cmeans"),s+=Math.pow(u/l,f);e[h][c]=1/s}},"updateMembership"),fd=v(function(e,r,a,n){for(var i=new Array(a.k),o=0;o<i.length;o++)i[o]=[];for(var s,u,l=0;l<r.length;l++){s=-1/0,u=-1;for(var f=0;f<r[0].length;f++)r[l][f]>s&&(s=r[l][f],u=f);i[u].push(e[l])}for(var c=0;c<i.length;c++)i[c]=n.collection(i[c]);return i},"assign"),Js=v(function(e){var r=this.cy(),a=this.nodes(),n=as(e),i,o,s,u,l;u=new Array(a.length);for(var f=0;f<a.length;f++)u[f]=new Array(n.k);s=new Array(a.length);for(var c=0;c<a.length;c++)s[c]=new Array(n.k);for(var h=0;h<a.length;h++){for(var g=0,d=0;d<n.k;d++)s[h][d]=Math.random(),g+=s[h][d];for(var p=0;p<n.k;p++)s[h][p]=s[h][p]/g}o=new Array(n.k);for(var y=0;y<n.k;y++)o[y]=new Array(n.attributes.length);l=new Array(a.length);for(var m=0;m<a.length;m++)l[m]=new Array(n.k);for(var w=!0,b=0;w&&b<n.maxIterations;)w=!1,ld(o,a,s,l,n),vd(s,u,o,a,n),id(s,u,n.sensitivityThreshold)||(w=!0),b++;return i=fd(a,s,n,r),{clusters:i,degreeOfMembership:s}},"fuzzyCMeans"),cd={kMeans:sd,kMedoids:ud,fuzzyCMeans:Js,fcm:Js},hd=vt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),dd={single:"min",complete:"max"},gd=v(function(e){var r=hd(e),a=dd[r.linkage];return a!=null&&(r.linkage=a),r},"setOptions"),js=v(function(e,r,a,n,i){for(var o=0,s=1/0,u,l=i.attributes,f=v(function(B,C){return In(i.distance,l.length,function(P){return l[P](B)},function(P){return l[P](C)},B,C)},"getDist"),c=0;c<e.length;c++){var h=e[c].key,g=a[h][n[h]];g<s&&(o=h,s=g)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=r[o],p=r[n[o]],y;i.mode==="dendrogram"?y={left:d,right:p,key:d.key}:y={value:d.value.concat(p.value),key:d.key},e[d.index]=y,e.splice(p.index,1),r[d.key]=y;for(var m=0;m<e.length;m++){var w=e[m];d.key===w.key?u=1/0:i.linkage==="min"?(u=a[d.key][w.key],a[d.key][w.key]>a[p.key][w.key]&&(u=a[p.key][w.key])):i.linkage==="max"?(u=a[d.key][w.key],a[d.key][w.key]<a[p.key][w.key]&&(u=a[p.key][w.key])):i.linkage==="mean"?u=(a[d.key][w.key]*d.size+a[p.key][w.key]*p.size)/(d.size+p.size):i.mode==="dendrogram"?u=f(w.value,d.value):u=f(w.value[0],d.value[0]),a[d.key][w.key]=a[w.key][d.key]=u}for(var b=0;b<e.length;b++){var x=e[b].key;if(n[x]===d.key||n[x]===p.key){for(var S=x,T=0;T<e.length;T++){var E=e[T].key;a[x][E]<a[x][S]&&(S=E)}n[x]=S}e[b].index=b}return d.key=p.key=d.index=p.index=null,!0},"mergeClosest"),_r=v(function(e,r,a){e&&(e.value?r.push(e.value):(e.left&&_r(e.left,r),e.right&&_r(e.right,r)))},"getAllChildren"),Ao=v(function(e,r){if(!e)return"";if(e.left&&e.right){var a=Ao(e.left,r),n=Ao(e.right,r),i=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:i.id()}}),r.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},"buildDendrogram"),Ro=v(function(e,r,a){if(!e)return[];var n=[],i=[],o=[];return r===0?(e.left&&_r(e.left,n),e.right&&_r(e.right,i),o=n.concat(i),[a.collection(o)]):r===1?e.value?[a.collection(e.value)]:(e.left&&_r(e.left,n),e.right&&_r(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=Ro(e.left,r-1,a)),e.right&&(i=Ro(e.right,r-1,a)),n.concat(i))},"buildClustersFromTree"),eu=v(function(e){for(var r=this.cy(),a=this.nodes(),n=gd(e),i=n.attributes,o=v(function(b,x){return In(n.distance,i.length,function(S){return i[S](b)},function(S){return i[S](x)},b,x)},"getDist"),s=[],u=[],l=[],f=[],c=0;c<a.length;c++){var h={value:n.mode==="dendrogram"?a[c]:[a[c]],key:c,index:c};s[c]=h,f[c]=h,u[c]=[],l[c]=0}for(var g=0;g<s.length;g++)for(var d=0;d<=g;d++){var p=void 0;n.mode==="dendrogram"?p=g===d?1/0:o(s[g].value,s[d].value):p=g===d?1/0:o(s[g].value[0],s[d].value[0]),u[g][d]=p,u[d][g]=p,p<u[g][l[g]]&&(l[g]=d)}for(var y=js(s,f,u,l,n);y;)y=js(s,f,u,l,n);var m;return n.mode==="dendrogram"?(m=Ro(s[0],n.dendrogramDepth,r),n.addDendrogram&&Ao(s[0],r)):(m=new Array(s.length),s.forEach(function(w,b){w.key=w.index=null,m[b]=r.collection(w.value)})),m},"hierarchicalClustering"),pd={hierarchicalClustering:eu,hca:eu},yd=vt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),md=v(function(e){var r=e.damping,a=e.preference;.5<=r&&r<1||He("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||ae(a)||He("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a)),yd(e)},"setOptions"),bd=v(function(e,r,a,n){var i=v(function(s,u){return n[u](s)},"attr");return-In(e,n.length,function(o){return i(r,o)},function(o){return i(a,o)},r,a)},"getSimilarity"),wd=v(function(e,r){var a=null;return r==="median"?a=yh(e):r==="mean"?a=ph(e):r==="min"?a=dh(e):r==="max"?a=gh(e):a=r,a},"getPreference"),xd=v(function(e,r,a){for(var n=[],i=0;i<e;i++)r[i*e+i]+a[i*e+i]>0&&n.push(i);return n},"findExemplars"),tu=v(function(e,r,a){for(var n=[],i=0;i<e;i++){for(var o=-1,s=-1/0,u=0;u<a.length;u++){var l=a[u];r[i*e+l]>s&&(o=l,s=r[i*e+l])}o>0&&n.push(o)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},"assignClusters"),Ed=v(function(e,r,a){for(var n=tu(e,r,a),i=0;i<a.length;i++){for(var o=[],s=0;s<n.length;s++)n[s]===a[i]&&o.push(s);for(var u=-1,l=-1/0,f=0;f<o.length;f++){for(var c=0,h=0;h<o.length;h++)c+=r[o[h]*e+o[f]];c>l&&(u=f,l=c)}a[i]=o[u]}return n=tu(e,r,a),n},"assign"),ru=v(function(e){for(var r=this.cy(),a=this.nodes(),n=md(e),i={},o=0;o<a.length;o++)i[a[o].id()]=o;var s,u,l,f,c,h;s=a.length,u=s*s,l=new Array(u);for(var g=0;g<u;g++)l[g]=-1/0;for(var d=0;d<s;d++)for(var p=0;p<s;p++)d!==p&&(l[d*s+p]=bd(n.distance,a[d],a[p],n.attributes));f=wd(l,n.preference);for(var y=0;y<s;y++)l[y*s+y]=f;c=new Array(u);for(var m=0;m<u;m++)c[m]=0;h=new Array(u);for(var w=0;w<u;w++)h[w]=0;for(var b=new Array(s),x=new Array(s),S=new Array(s),T=0;T<s;T++)b[T]=0,x[T]=0,S[T]=0;for(var E=new Array(s*n.minIterations),D=0;D<E.length;D++)E[D]=0;var B;for(B=0;B<n.maxIterations;B++){for(var C=0;C<s;C++){for(var P=-1/0,R=-1/0,A=-1,L=0,M=0;M<s;M++)b[M]=c[C*s+M],L=h[C*s+M]+l[C*s+M],L>=P?(R=P,P=L,A=M):L>R&&(R=L);for(var I=0;I<s;I++)c[C*s+I]=(1-n.damping)*(l[C*s+I]-P)+n.damping*b[I];c[C*s+A]=(1-n.damping)*(l[C*s+A]-R)+n.damping*b[A]}for(var O=0;O<s;O++){for(var V=0,q=0;q<s;q++)b[q]=h[q*s+O],x[q]=Math.max(0,c[q*s+O]),V+=x[q];V-=x[O],x[O]=c[O*s+O],V+=x[O];for(var F=0;F<s;F++)h[F*s+O]=(1-n.damping)*Math.min(0,V-x[F])+n.damping*b[F];h[O*s+O]=(1-n.damping)*(V-x[O])+n.damping*b[O]}for(var H=0,Q=0;Q<s;Q++){var U=h[Q*s+Q]+c[Q*s+Q]>0?1:0;E[B%n.minIterations*s+Q]=U,H+=U}if(H>0&&(B>=n.minIterations-1||B==n.maxIterations-1)){for(var W=0,X=0;X<s;X++){S[X]=0;for(var re=0;re<n.minIterations;re++)S[X]+=E[re*s+X];(S[X]===0||S[X]===n.minIterations)&&W++}if(W===s)break}}for(var j=xd(s,c,h),Z=Ed(s,l,j),N={},_=0;_<j.length;_++)N[j[_]]=[];for(var G=0;G<a.length;G++){var te=Z[i[a[G].id()]];te!=null&&N[te].push(a[G])}for(var le=new Array(j.length),xe=0;xe<j.length;xe++)le[xe]=r.collection(N[j[xe]]);return le},"affinityPropagation"),Cd={affinityPropagation:ru,ap:ru},Td=vt({root:void 0,directed:!1}),Sd={hierholzer:v(function(e){if(!Re(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=Td(e),n=a.root,i=a.directed,o=this,s=!1,u,l,f;n&&(f=de(n)?this.filter(n)[0].id():n[0].id());var c={},h={};i?o.forEach(function(w){var b=w.id();if(w.isNode()){var x=w.indegree(!0),S=w.outdegree(!0),T=x-S,E=S-x;T==1?u?s=!0:u=b:E==1?l?s=!0:l=b:(E>1||T>1)&&(s=!0),c[b]=[],w.outgoers().forEach(function(D){D.isEdge()&&c[b].push(D.id())})}else h[b]=[void 0,w.target().id()]}):o.forEach(function(w){var b=w.id();w.isNode()?(w.degree(!0)%2&&(u?l?s=!0:l=b:u=b),c[b]=[],w.connectedEdges().forEach(function(x){return c[b].push(x.id())})):h[b]=[w.source().id(),w.target().id()]});var g={found:!1,trail:void 0};if(s)return g;if(l&&u)if(i){if(f&&l!=f)return g;f=l}else{if(f&&l!=f&&u!=f)return g;f||(f=l)}else f||(f=o[0].id());var d=v(function(b){for(var x=b,S=[b],T,E,D;c[x].length;)T=c[x].shift(),E=h[T][0],D=h[T][1],x!=D?(c[D]=c[D].filter(function(B){return B!=T}),x=D):!i&&x!=E&&(c[E]=c[E].filter(function(B){return B!=T}),x=E),S.unshift(T),S.unshift(x);return S},"walk"),p=[],y=[];for(y=d(f);y.length!=1;)c[y[0]].length==0?(p.unshift(o.getElementById(y.shift())),p.unshift(o.getElementById(y.shift()))):y=d(y.shift()).concat(y);p.unshift(o.getElementById(y.shift()));for(var m in c)if(c[m].length)return g;return g.found=!0,g.trail=this.spawn(p,!0),g},"hierholzer")},Ua=v(function(){var e=this,r={},a=0,n=0,i=[],o=[],s={},u=v(function(h,g){for(var d=o.length-1,p=[],y=e.spawn();o[d].x!=h||o[d].y!=g;)p.push(o.pop().edge),d--;p.push(o.pop().edge),p.forEach(function(m){var w=m.connectedNodes().intersection(e);y.merge(m),w.forEach(function(b){var x=b.id(),S=b.connectedEdges().intersection(e);y.merge(b),r[x].cutVertex?y.merge(S.filter(function(T){return T.isLoop()})):y.merge(S)})}),i.push(y)},"buildComponent"),l=v(function(h,g,d){h===d&&(n+=1),r[g]={id:a,low:a++,cutVertex:!1};var p=e.getElementById(g).connectedEdges().intersection(e);if(p.size()===0)i.push(e.spawn(e.getElementById(g)));else{var y,m,w,b;p.forEach(function(x){y=x.source().id(),m=x.target().id(),w=y===g?m:y,w!==d&&(b=x.id(),s[b]||(s[b]=!0,o.push({x:g,y:w,edge:x})),w in r?r[g].low=Math.min(r[g].low,r[w].id):(l(h,w,g),r[g].low=Math.min(r[g].low,r[w].low),r[g].id<=r[w].low&&(r[g].cutVertex=!0,u(g,w))))})}},"biconnectedSearch");e.forEach(function(c){if(c.isNode()){var h=c.id();h in r||(n=0,l(h,h),r[h].cutVertex=n>1)}});var f=Object.keys(r).filter(function(c){return r[c].cutVertex}).map(function(c){return e.getElementById(c)});return{cut:e.spawn(f),components:i}},"hopcroftTarjanBiconnected"),Dd={hopcroftTarjanBiconnected:Ua,htbc:Ua,htb:Ua,hopcroftTarjanBiconnectedComponents:Ua},Ka=v(function(){var e=this,r={},a=0,n=[],i=[],o=e.spawn(e),s=v(function(l){if(i.push(l),r[l]={index:a,low:a++,explored:!1},e.getElementById(l).connectedEdges().intersection(e).forEach(function(d){var p=d.target().id();p!==l&&(p in r||s(p),r[p].explored||(r[l].low=Math.min(r[l].low,r[p].low)))}),r[l].index===r[l].low){for(var f=e.spawn();;){var c=i.pop();if(f.merge(e.getElementById(c)),r[c].low=r[l].index,r[c].explored=!0,c===l)break}var h=f.edgesWith(f),g=f.merge(h);n.push(g),o=o.difference(g)}},"stronglyConnectedSearch");return e.forEach(function(u){if(u.isNode()){var l=u.id();l in r||s(l)}}),{cut:o,components:n}},"tarjanStronglyConnected"),Bd={tarjanStronglyConnected:Ka,tsc:Ka,tscc:Ka,tarjanStronglyConnectedComponents:Ka},Dv={};[Ea,rh,ah,ih,sh,lh,ch,qh,$r,Wr,Po,jh,cd,pd,Cd,Sd,Dd,Bd].forEach(function(t){pe(Dv,t)});var Bv=0,kv=1,Pv=2,Lt=v(function(e){if(!(this instanceof Lt))return new Lt(e);this.id="Thenable/1.0.7",this.state=Bv,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))},"api");Lt.prototype={fulfill:v(function(e){return au(this,kv,"fulfillValue",e)},"fulfill"),reject:v(function(e){return au(this,Pv,"rejectReason",e)},"reject"),then:v(function(e,r){var a=this,n=new Lt;return a.onFulfilled.push(iu(e,n,"fulfill")),a.onRejected.push(iu(r,n,"reject")),Av(a),n.proxy},"then")};var au=v(function(e,r,a,n){return e.state===Bv&&(e.state=r,e[a]=n,Av(e)),e},"deliver"),Av=v(function(e){e.state===kv?nu(e,"onFulfilled",e.fulfillValue):e.state===Pv&&nu(e,"onRejected",e.rejectReason)},"execute"),nu=v(function(e,r,a){if(e[r].length!==0){var n=e[r];e[r]=[];var i=v(function(){for(var s=0;s<n.length;s++)n[s](a)},"func");typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},"execute_handlers"),iu=v(function(e,r,a){return function(n){if(typeof e!="function")r[a].call(r,n);else{var i;try{i=e(n)}catch(o){r.reject(o);return}Rv(r,i)}}},"resolver"),Rv=v(function(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var a;if(et(r)==="object"&&r!==null||typeof r=="function")try{a=r.then}catch(i){e.reject(i);return}if(typeof a=="function"){var n=!1;try{a.call(r,function(i){n||(n=!0,i===r?e.reject(new TypeError("circular thenable chain")):Rv(e,i))},function(i){n||(n=!0,e.reject(i))})}catch(i){n||e.reject(i)}return}e.fulfill(r)},"resolve");Lt.all=function(t){return new Lt(function(e,r){for(var a=new Array(t.length),n=0,i=v(function(u,l){a[u]=l,n++,n===t.length&&e(a)},"fulfill"),o=0;o<t.length;o++)(function(s){var u=t[s];u!=null&&u.then!=null?u.then(function(l){i(s,l)},function(l){r(l)}):i(s,u)})(o)})};Lt.resolve=function(t){return new Lt(function(e,r){e(t)})};Lt.reject=function(t){return new Lt(function(e,r){r(t)})};var ea=typeof Promise<"u"?Promise:Lt,Mo=v(function(e,r,a){var n=Ko(e),i=!n,o=this._private=pe({duration:1e3},r,a);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&We(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(n){var u=e.pan();o.startPan={x:u.x,y:u.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},"Animation"),Tr=Mo.prototype;pe(Tr,{instanceString:v(function(){return"animation"},"instanceString"),hook:v(function(){var e=this._private;if(!e.hooked){var r,a=e.target._private.animation;e.queue?r=a.queue:r=a.current,r.push(this),Tt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},"hook"),play:v(function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},"play"),playing:v(function(){return this._private.playing},"playing"),apply:v(function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},"apply"),applying:v(function(){return this._private.applying},"applying"),pause:v(function(){var e=this._private;return e.playing=!1,e.started=!1,this},"pause"),stop:v(function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},"stop"),rewind:v(function(){return this.progress(0)},"rewind"),fastforward:v(function(){return this.progress(1)},"fastforward"),time:v(function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},"time"),progress:v(function(e){var r=this._private,a=r.playing;return e===void 0?r.progress:(a&&this.pause(),r.progress=e,r.started=!1,a&&this.play(),this)},"progress"),completed:v(function(){return this._private.progress===1},"completed"),reverse:v(function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var a=v(function(l,f){var c=e[l];c!=null&&(e[l]=e[f],e[f]=c)},"swap");if(a("zoom","startZoom"),a("pan","startPan"),a("position","startPosition"),e.style)for(var n=0;n<e.style.length;n++){var i=e.style[n],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[n]=s}return r&&this.play(),this},"reverse"),promise:v(function(e){var r=this._private,a;switch(e){case"frame":a=r.frames;break;default:case"complete":case"completed":a=r.completes}return new ea(function(n,i){a.push(function(){n()})})},"promise")});Tr.complete=Tr.completed;Tr.run=Tr.play;Tr.running=Tr.playing;var kd={animated:v(function(){return v(function(){var r=this,a=r.length!==void 0?r:[r];if(!(this._private.cy||this).styleEnabled())return!1;var n=a[0];if(n)return n._private.animation.current.length>0},"animatedImpl")},"animated"),clearQueue:v(function(){return v(function(){var r=this,a=r.length!==void 0?r:[r];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<a.length;n++){var i=a[n];i._private.animation.queue=[]}return this},"clearQueueImpl")},"clearQueue"),delay:v(function(){return v(function(r,a){return(this._private.cy||this).styleEnabled()?this.animate({delay:r,duration:r,complete:a}):this},"delayImpl")},"delay"),delayAnimation:v(function(){return v(function(r,a){return(this._private.cy||this).styleEnabled()?this.animation({delay:r,duration:r,complete:a}):this},"delayAnimationImpl")},"delayAnimation"),animation:v(function(){return v(function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this,u=!i,l=!u;if(!s.styleEnabled())return this;var f=s.style();if(r=pe({},r,a),Object.keys(r).length===0)return new Mo(o[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200}if(l&&(r.style=f.getPropsList(r.style||r.css),r.css=void 0),l&&r.renderedPosition!=null){var c=r.renderedPosition,h=s.pan(),g=s.zoom();r.position=gv(c,g,h)}if(u&&r.panBy!=null){var d=r.panBy,p=s.pan();r.pan={x:p.x+d.x,y:p.y+d.y}}var y=r.center||r.centre;if(u&&y!=null){var m=s.getCenterPan(y.eles,r.zoom);m!=null&&(r.pan=m)}if(u&&r.fit!=null){var w=r.fit,b=s.getFitViewport(w.eles||w.boundingBox,w.padding);b!=null&&(r.pan=b.pan,r.zoom=b.zoom)}if(u&&Re(r.zoom)){var x=s.getZoomedViewport(r.zoom);x!=null?(x.zoomed&&(r.zoom=x.zoom),x.panned&&(r.pan=x.pan)):r.zoom=null}return new Mo(o[0],r)},"animationImpl")},"animation"),animate:v(function(){return v(function(r,a){var n=this,i=n.length!==void 0?n:[n];if(!(this._private.cy||this).styleEnabled())return this;a&&(r=pe({},r,a));for(var o=0;o<i.length;o++){var s=i[o],u=s.animated()&&(r.queue===void 0||r.queue);s.animation(r,u?{queue:!0}:void 0).play()}return this},"animateImpl")},"animate"),stop:v(function(){return v(function(r,a){var n=this,i=n.length!==void 0?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var s=0;s<i.length;s++){for(var u=i[s]._private,l=u.animation.current,f=0;f<l.length;f++){var c=l[f]._private;a&&(c.duration=0)}r&&(u.animation.queue=[]),a||(u.animation.current=[])}return o.notify("draw"),this},"stopImpl")},"stop")},pi,ou;function On(){return ou||(ou=1,pi=Array.isArray),pi}v(On,"requireIsArray");var yi,su;function Pd(){if(su)return yi;su=1;var t=On(),e=La(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function n(i,o){if(t(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:a.test(i)||!r.test(i)||o!=null&&i in Object(o)}return v(n,"isKey"),yi=n,yi}v(Pd,"require_isKey");var mi,uu;function Ad(){if(uu)return mi;uu=1;var t=ov(),e=Ma(),r="[object AsyncFunction]",a="[object Function]",n="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var u=t(s);return u==a||u==n||u==r||u==i}return v(o,"isFunction"),mi=o,mi}v(Ad,"requireIsFunction");var bi,lu;function Rd(){return lu||(lu=1,bi=Rn()["__core-js_shared__"]),bi}v(Rd,"require_coreJsData");var wi,vu;function Md(){if(vu)return wi;vu=1;var t=Rd(),e=(function(){var a=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})();function r(a){return!!e&&e in a}return v(r,"isMasked"),wi=r,wi}v(Md,"require_isMasked");var xi,fu;function Ld(){if(fu)return xi;fu=1;var t=Function.prototype.toString;function e(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return v(e,"toSource"),xi=e,xi}v(Ld,"require_toSource");var Ei,cu;function Id(){if(cu)return Ei;cu=1;var t=Ad(),e=Md(),r=Ma(),a=Ld(),n=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,l=s.hasOwnProperty,f=RegExp("^"+u.call(l).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function c(h){return!r(h)||e(h)?!1:(t(h)?f:i).test(a(h))}return v(c,"baseIsNative"),Ei=c,Ei}v(Id,"require_baseIsNative");var Ci,hu;function Od(){if(hu)return Ci;hu=1;function t(e,r){return e?.[r]}return v(t,"getValue"),Ci=t,Ci}v(Od,"require_getValue");var Ti,du;function ns(){if(du)return Ti;du=1;var t=Id(),e=Od();function r(a,n){var i=e(a,n);return t(i)?i:void 0}return v(r,"getNative"),Ti=r,Ti}v(ns,"require_getNative");var Si,gu;function Nn(){return gu||(gu=1,Si=ns()(Object,"create")),Si}v(Nn,"require_nativeCreate");var Di,pu;function Nd(){if(pu)return Di;pu=1;var t=Nn();function e(){this.__data__=t?t(null):{},this.size=0}return v(e,"hashClear"),Di=e,Di}v(Nd,"require_hashClear");var Bi,yu;function zd(){if(yu)return Bi;yu=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return v(t,"hashDelete"),Bi=t,Bi}v(zd,"require_hashDelete");var ki,mu;function Fd(){if(mu)return ki;mu=1;var t=Nn(),e="__lodash_hash_undefined__",r=Object.prototype.hasOwnProperty;function a(n){var i=this.__data__;if(t){var o=i[n];return o===e?void 0:o}return r.call(i,n)?i[n]:void 0}return v(a,"hashGet"),ki=a,ki}v(Fd,"require_hashGet");var Pi,bu;function Vd(){if(bu)return Pi;bu=1;var t=Nn(),e=Object.prototype.hasOwnProperty;function r(a){var n=this.__data__;return t?n[a]!==void 0:e.call(n,a)}return v(r,"hashHas"),Pi=r,Pi}v(Vd,"require_hashHas");var Ai,wu;function qd(){if(wu)return Ai;wu=1;var t=Nn(),e="__lodash_hash_undefined__";function r(a,n){var i=this.__data__;return this.size+=this.has(a)?0:1,i[a]=t&&n===void 0?e:n,this}return v(r,"hashSet"),Ai=r,Ai}v(qd,"require_hashSet");var Ri,xu;function _d(){if(xu)return Ri;xu=1;var t=Nd(),e=zd(),r=Fd(),a=Vd(),n=qd();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return v(i,"Hash"),i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,Ri=i,Ri}v(_d,"require_Hash");var Mi,Eu;function Gd(){if(Eu)return Mi;Eu=1;function t(){this.__data__=[],this.size=0}return v(t,"listCacheClear"),Mi=t,Mi}v(Gd,"require_listCacheClear");var Li,Cu;function Mv(){if(Cu)return Li;Cu=1;function t(e,r){return e===r||e!==e&&r!==r}return v(t,"eq"),Li=t,Li}v(Mv,"requireEq");var Ii,Tu;function zn(){if(Tu)return Ii;Tu=1;var t=Mv();function e(r,a){for(var n=r.length;n--;)if(t(r[n][0],a))return n;return-1}return v(e,"assocIndexOf"),Ii=e,Ii}v(zn,"require_assocIndexOf");var Oi,Su;function Hd(){if(Su)return Oi;Su=1;var t=zn(),e=Array.prototype.splice;function r(a){var n=this.__data__,i=t(n,a);return i<0?!1:(i==n.length-1?n.pop():e.call(n,i,1),--this.size,!0)}return v(r,"listCacheDelete"),Oi=r,Oi}v(Hd,"require_listCacheDelete");var Ni,Du;function $d(){if(Du)return Ni;Du=1;var t=zn();function e(r){var a=this.__data__,n=t(a,r);return n<0?void 0:a[n][1]}return v(e,"listCacheGet"),Ni=e,Ni}v($d,"require_listCacheGet");var zi,Bu;function Wd(){if(Bu)return zi;Bu=1;var t=zn();function e(r){return t(this.__data__,r)>-1}return v(e,"listCacheHas"),zi=e,zi}v(Wd,"require_listCacheHas");var Fi,ku;function Ud(){if(ku)return Fi;ku=1;var t=zn();function e(r,a){var n=this.__data__,i=t(n,r);return i<0?(++this.size,n.push([r,a])):n[i][1]=a,this}return v(e,"listCacheSet"),Fi=e,Fi}v(Ud,"require_listCacheSet");var Vi,Pu;function Kd(){if(Pu)return Vi;Pu=1;var t=Gd(),e=Hd(),r=$d(),a=Wd(),n=Ud();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return v(i,"ListCache"),i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,Vi=i,Vi}v(Kd,"require_ListCache");var qi,Au;function Yd(){return Au||(Au=1,qi=ns()(Rn(),"Map")),qi}v(Yd,"require_Map");var _i,Ru;function Xd(){if(Ru)return _i;Ru=1;var t=_d(),e=Kd(),r=Yd();function a(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return v(a,"mapCacheClear"),_i=a,_i}v(Xd,"require_mapCacheClear");var Gi,Mu;function Zd(){if(Mu)return Gi;Mu=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return v(t,"isKeyable"),Gi=t,Gi}v(Zd,"require_isKeyable");var Hi,Lu;function Fn(){if(Lu)return Hi;Lu=1;var t=Zd();function e(r,a){var n=r.__data__;return t(a)?n[typeof a=="string"?"string":"hash"]:n.map}return v(e,"getMapData"),Hi=e,Hi}v(Fn,"require_getMapData");var $i,Iu;function Qd(){if(Iu)return $i;Iu=1;var t=Fn();function e(r){var a=t(this,r).delete(r);return this.size-=a?1:0,a}return v(e,"mapCacheDelete"),$i=e,$i}v(Qd,"require_mapCacheDelete");var Wi,Ou;function Jd(){if(Ou)return Wi;Ou=1;var t=Fn();function e(r){return t(this,r).get(r)}return v(e,"mapCacheGet"),Wi=e,Wi}v(Jd,"require_mapCacheGet");var Ui,Nu;function jd(){if(Nu)return Ui;Nu=1;var t=Fn();function e(r){return t(this,r).has(r)}return v(e,"mapCacheHas"),Ui=e,Ui}v(jd,"require_mapCacheHas");var Ki,zu;function eg(){if(zu)return Ki;zu=1;var t=Fn();function e(r,a){var n=t(this,r),i=n.size;return n.set(r,a),this.size+=n.size==i?0:1,this}return v(e,"mapCacheSet"),Ki=e,Ki}v(eg,"require_mapCacheSet");var Yi,Fu;function tg(){if(Fu)return Yi;Fu=1;var t=Xd(),e=Qd(),r=Jd(),a=jd(),n=eg();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return v(i,"MapCache"),i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,Yi=i,Yi}v(tg,"require_MapCache");var Xi,Vu;function rg(){if(Vu)return Xi;Vu=1;var t=tg(),e="Expected a function";function r(a,n){if(typeof a!="function"||n!=null&&typeof n!="function")throw new TypeError(e);var i=v(function(){var o=arguments,s=n?n.apply(this,o):o[0],u=i.cache;if(u.has(s))return u.get(s);var l=a.apply(this,o);return i.cache=u.set(s,l)||u,l},"memoized");return i.cache=new(r.Cache||t),i}return v(r,"memoize"),r.Cache=t,Xi=r,Xi}v(rg,"requireMemoize");var Zi,qu;function ag(){if(qu)return Zi;qu=1;var t=rg(),e=500;function r(a){var n=t(a,function(o){return i.size===e&&i.clear(),o}),i=n.cache;return n}return v(r,"memoizeCapped"),Zi=r,Zi}v(ag,"require_memoizeCapped");var Qi,_u;function Lv(){if(_u)return Qi;_u=1;var t=ag(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g;return Qi=t(function(a){var n=[];return a.charCodeAt(0)===46&&n.push(""),a.replace(e,function(i,o,s,u){n.push(s?u.replace(r,"$1"):o||i)}),n}),Qi}v(Lv,"require_stringToPath");var Ji,Gu;function Iv(){if(Gu)return Ji;Gu=1;function t(e,r){for(var a=-1,n=e==null?0:e.length,i=Array(n);++a<n;)i[a]=r(e[a],a,e);return i}return v(t,"arrayMap"),Ji=t,Ji}v(Iv,"require_arrayMap");var ji,Hu;function ng(){if(Hu)return ji;Hu=1;var t=Xo(),e=Iv(),r=On(),a=La(),n=t?t.prototype:void 0,i=n?n.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return e(s,o)+"";if(a(s))return i?i.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return v(o,"baseToString"),ji=o,ji}v(ng,"require_baseToString");var eo,$u;function Ov(){if($u)return eo;$u=1;var t=ng();function e(r){return r==null?"":t(r)}return v(e,"toString"),eo=e,eo}v(Ov,"requireToString");var to,Wu;function Nv(){if(Wu)return to;Wu=1;var t=On(),e=Pd(),r=Lv(),a=Ov();function n(i,o){return t(i)?i:e(i,o)?[i]:r(a(i))}return v(n,"castPath"),to=n,to}v(Nv,"require_castPath");var ro,Uu;function is(){if(Uu)return ro;Uu=1;var t=La();function e(r){if(typeof r=="string"||t(r))return r;var a=r+"";return a=="0"&&1/r==-1/0?"-0":a}return v(e,"toKey"),ro=e,ro}v(is,"require_toKey");var ao,Ku;function ig(){if(Ku)return ao;Ku=1;var t=Nv(),e=is();function r(a,n){n=t(n,a);for(var i=0,o=n.length;a!=null&&i<o;)a=a[e(n[i++])];return i&&i==o?a:void 0}return v(r,"baseGet"),ao=r,ao}v(ig,"require_baseGet");var no,Yu;function og(){if(Yu)return no;Yu=1;var t=ig();function e(r,a,n){var i=r==null?void 0:t(r,a);return i===void 0?n:i}return v(e,"get"),no=e,no}v(og,"requireGet");var sg=Ra(og()),io,Xu;function ug(){if(Xu)return io;Xu=1;var t=ns();return io=(function(){try{var e=t(Object,"defineProperty");return e({},"",{}),e}catch{}})(),io}v(ug,"require_defineProperty");var oo,Zu;function lg(){if(Zu)return oo;Zu=1;var t=ug();function e(r,a,n){a=="__proto__"&&t?t(r,a,{configurable:!0,enumerable:!0,value:n,writable:!0}):r[a]=n}return v(e,"baseAssignValue"),oo=e,oo}v(lg,"require_baseAssignValue");var so,Qu;function vg(){if(Qu)return so;Qu=1;var t=lg(),e=Mv(),r=Object.prototype.hasOwnProperty;function a(n,i,o){var s=n[i];(!(r.call(n,i)&&e(s,o))||o===void 0&&!(i in n))&&t(n,i,o)}return v(a,"assignValue"),so=a,so}v(vg,"require_assignValue");var uo,Ju;function fg(){if(Ju)return uo;Ju=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(a,n){var i=typeof a;return n=n??t,!!n&&(i=="number"||i!="symbol"&&e.test(a))&&a>-1&&a%1==0&&a<n}return v(r,"isIndex"),uo=r,uo}v(fg,"require_isIndex");var lo,ju;function cg(){if(ju)return lo;ju=1;var t=vg(),e=Nv(),r=fg(),a=Ma(),n=is();function i(o,s,u,l){if(!a(o))return o;s=e(s,o);for(var f=-1,c=s.length,h=c-1,g=o;g!=null&&++f<c;){var d=n(s[f]),p=u;if(d==="__proto__"||d==="constructor"||d==="prototype")return o;if(f!=h){var y=g[d];p=l?l(y,d,g):void 0,p===void 0&&(p=a(y)?y:r(s[f+1])?[]:{})}t(g,d,p),g=g[d]}return o}return v(i,"baseSet"),lo=i,lo}v(cg,"require_baseSet");var vo,el;function hg(){if(el)return vo;el=1;var t=cg();function e(r,a,n){return r==null?r:t(r,a,n)}return v(e,"set"),vo=e,vo}v(hg,"requireSet");var dg=Ra(hg()),fo,tl;function gg(){if(tl)return fo;tl=1;function t(e,r){var a=-1,n=e.length;for(r||(r=Array(n));++a<n;)r[a]=e[a];return r}return v(t,"copyArray"),fo=t,fo}v(gg,"require_copyArray");var co,rl;function pg(){if(rl)return co;rl=1;var t=Iv(),e=gg(),r=On(),a=La(),n=Lv(),i=is(),o=Ov();function s(u){return r(u)?t(u,i):a(u)?[u]:e(n(o(u)))}return v(s,"toPath"),co=s,co}v(pg,"requireToPath");var yg=Ra(pg()),mg={data:v(function(e){return e=pe({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:v(function(a){},"beforeGet"),beforeSet:v(function(a,n){},"beforeSet"),onSet:v(function(a){},"onSet"),canSet:v(function(a){return!0},"canSet")},e),v(function(a,n){var i=e,o=this,s=o.length!==void 0,u=s?o:[o],l=s?o[0]:o;if(de(a)){var f=a.indexOf(".")!==-1&&yg(a);if(i.allowGetting&&n===void 0){var c;return l&&(i.beforeGet(l),f&&l._private[i.field][a]===void 0?c=sg(l._private[i.field],f):c=l._private[i.field][a]),c}else if(i.allowSetting&&n!==void 0&&!i.immutableKeys[a]){var h=Xl({},a,n);i.beforeSet(o,h);for(var g=0,d=u.length;g<d;g++){var p=u[g];i.canSet(p)&&(f&&l._private[i.field][a]===void 0?dg(p._private[i.field],f,n):p._private[i.field][a]=n)}i.updateStyle&&o.updateStyle(),i.onSet(o),i.settingTriggersEvent&&o[i.triggerFnName](i.settingEvent)}}else if(i.allowSetting&&Re(a)){var y=a,m,w,b=Object.keys(y);i.beforeSet(o,y);for(var x=0;x<b.length;x++)if(m=b[x],w=y[m],!i.immutableKeys[m])for(var S=0;S<u.length;S++){var T=u[S];i.canSet(T)&&(T._private[i.field][m]=w)}i.updateStyle&&o.updateStyle(),i.onSet(o),i.settingTriggersEvent&&o[i.triggerFnName](i.settingEvent)}else if(i.allowBinding&&We(a)){var E=a;o.on(i.bindingEvent,E)}else if(i.allowGetting&&a===void 0){var D;return l&&(i.beforeGet(l),D=l._private[i.field]),D}return o},"dataImpl")},"data"),removeData:v(function(e){return e=pe({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),v(function(a){var n=e,i=this,o=i.length!==void 0?i:[i];if(de(a)){for(var s=a.split(/\s+/),u=s.length,l=0;l<u;l++){var f=s[l];if(!ar(f)&&!n.immutableKeys[f])for(var c=0,h=o.length;c<h;c++)o[c]._private[n.field][f]=void 0}n.triggerEvent&&i[n.triggerFnName](n.event)}else if(a===void 0){for(var g=0,d=o.length;g<d;g++)for(var p=o[g]._private[n.field],y=Object.keys(p),m=0;m<y.length;m++){var w=y[m];n.immutableKeys[w]||(p[w]=void 0)}n.triggerEvent&&i[n.triggerFnName](n.event)}return i},"removeDataImpl")},"removeData")},bg={eventAliasesOn:v(function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(a,n){var i=this,o=Array.prototype.slice.call(arguments,0);return new ea(function(s,u){var l=o.concat([v(function(h){i.off.apply(i,f),s(h)},"callback")]),f=l.concat([]);i.on.apply(i,l)})}},"eventAliasesOn")},Ie={};[kd,mg,bg].forEach(function(t){pe(Ie,t)});var wg={animate:Ie.animate(),animation:Ie.animation(),animated:Ie.animated(),clearQueue:Ie.clearQueue(),delay:Ie.delay(),delayAnimation:Ie.delayAnimation(),stop:Ie.stop()},on={classes:v(function(e){var r=this;if(e===void 0){var a=[];return r[0]._private.classes.forEach(function(g){return a.push(g)}),a}else Fe(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],i=new jr(e),o=0;o<r.length;o++){for(var s=r[o],u=s._private,l=u.classes,f=!1,c=0;c<e.length;c++){var h=e[c];if(!l.has(h)){f=!0;break}}f||(f=l.size!==e.length),f&&(u.classes=i,n.push(s))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),r},"classes"),addClass:v(function(e){return this.toggleClass(e,!0)},"addClass"),hasClass:v(function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},"hasClass"),toggleClass:v(function(e,r){Fe(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=r===void 0,i=[],o=0,s=a.length;o<s;o++)for(var u=a[o],l=u._private.classes,f=!1,c=0;c<e.length;c++){var h=e[c],g=l.has(h),d=!1;r||n&&!g?(l.add(h),d=!0):(!r||n&&g)&&(l.delete(h),d=!0),!f&&d&&(i.push(u),f=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),a},"toggleClass"),removeClass:v(function(e){return this.toggleClass(e,!1)},"removeClass"),flashClass:v(function(e,r){var a=this;if(r==null)r=250;else if(r===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},r),a},"flashClass")};on.className=on.classNames=on.classes;var Ae={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:je,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ae.variable="(?:[\\w-.]|(?:\\\\"+Ae.metaChar+"))+";Ae.className="(?:[\\w-]|(?:\\\\"+Ae.metaChar+"))+";Ae.value=Ae.string+"|"+Ae.number;Ae.id=Ae.variable;(function(){var t=Ae.comparatorOp.split("|"),e,r;for(r=0;r<t.length;r++)e=t[r],Ae.comparatorOp+="|@"+e;for(t=Ae.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(Ae.comparatorOp+="|\\!"+e)})();var ze=v(function(){return{checks:[]}},"newQuery"),ue={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Lo=[{selector:":selected",matches:v(function(e){return e.selected()},"matches")},{selector:":unselected",matches:v(function(e){return!e.selected()},"matches")},{selector:":selectable",matches:v(function(e){return e.selectable()},"matches")},{selector:":unselectable",matches:v(function(e){return!e.selectable()},"matches")},{selector:":locked",matches:v(function(e){return e.locked()},"matches")},{selector:":unlocked",matches:v(function(e){return!e.locked()},"matches")},{selector:":visible",matches:v(function(e){return e.visible()},"matches")},{selector:":hidden",matches:v(function(e){return!e.visible()},"matches")},{selector:":transparent",matches:v(function(e){return e.transparent()},"matches")},{selector:":grabbed",matches:v(function(e){return e.grabbed()},"matches")},{selector:":free",matches:v(function(e){return!e.grabbed()},"matches")},{selector:":removed",matches:v(function(e){return e.removed()},"matches")},{selector:":inside",matches:v(function(e){return!e.removed()},"matches")},{selector:":grabbable",matches:v(function(e){return e.grabbable()},"matches")},{selector:":ungrabbable",matches:v(function(e){return!e.grabbable()},"matches")},{selector:":animated",matches:v(function(e){return e.animated()},"matches")},{selector:":unanimated",matches:v(function(e){return!e.animated()},"matches")},{selector:":parent",matches:v(function(e){return e.isParent()},"matches")},{selector:":childless",matches:v(function(e){return e.isChildless()},"matches")},{selector:":child",matches:v(function(e){return e.isChild()},"matches")},{selector:":orphan",matches:v(function(e){return e.isOrphan()},"matches")},{selector:":nonorphan",matches:v(function(e){return e.isChild()},"matches")},{selector:":compound",matches:v(function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()},"matches")},{selector:":loop",matches:v(function(e){return e.isLoop()},"matches")},{selector:":simple",matches:v(function(e){return e.isSimple()},"matches")},{selector:":active",matches:v(function(e){return e.active()},"matches")},{selector:":inactive",matches:v(function(e){return!e.active()},"matches")},{selector:":backgrounding",matches:v(function(e){return e.backgrounding()},"matches")},{selector:":nonbackgrounding",matches:v(function(e){return!e.backgrounding()},"matches")}].sort(function(t,e){return Cc(t.selector,e.selector)}),xg=(function(){for(var t={},e,r=0;r<Lo.length;r++)e=Lo[r],t[e.selector]=e.matches;return t})(),Eg=v(function(e,r){return xg[e](r)},"stateSelectorMatches"),Cg="("+Lo.map(function(t){return t.selector}).join("|")+")",Rr=v(function(e){return e.replace(new RegExp("\\\\("+Ae.metaChar+")","g"),function(r,a){return a})},"cleanMetaChars"),Zt=v(function(e,r,a){e[e.length-1]=a},"replaceLastQuery"),Io=[{name:"group",query:!0,regex:"("+Ae.group+")",populate:v(function(e,r,a){var n=Qe(a,1)[0];r.checks.push({type:ue.GROUP,value:n==="*"?n:n+"s"})},"populate")},{name:"state",query:!0,regex:Cg,populate:v(function(e,r,a){var n=Qe(a,1)[0];r.checks.push({type:ue.STATE,value:n})},"populate")},{name:"id",query:!0,regex:"\\#("+Ae.id+")",populate:v(function(e,r,a){var n=Qe(a,1)[0];r.checks.push({type:ue.ID,value:Rr(n)})},"populate")},{name:"className",query:!0,regex:"\\.("+Ae.className+")",populate:v(function(e,r,a){var n=Qe(a,1)[0];r.checks.push({type:ue.CLASS,value:Rr(n)})},"populate")},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ae.variable+")\\s*\\]",populate:v(function(e,r,a){var n=Qe(a,1)[0];r.checks.push({type:ue.DATA_EXIST,field:Rr(n)})},"populate")},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ae.variable+")\\s*("+Ae.comparatorOp+")\\s*("+Ae.value+")\\s*\\]",populate:v(function(e,r,a){var n=Qe(a,3),i=n[0],o=n[1],s=n[2];new RegExp("^"+Ae.string+"$").exec(s)!=null?s=s.substring(1,s.length-1):s=parseFloat(s),r.checks.push({type:ue.DATA_COMPARE,field:Rr(i),operator:o,value:s})},"populate")},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ae.boolOp+")\\s*("+Ae.variable+")\\s*\\]",populate:v(function(e,r,a){var n=Qe(a,2),i=n[0],o=n[1];r.checks.push({type:ue.DATA_BOOL,field:Rr(o),operator:i})},"populate")},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ae.meta+")\\s*("+Ae.comparatorOp+")\\s*("+Ae.number+")\\s*\\]\\]",populate:v(function(e,r,a){var n=Qe(a,3),i=n[0],o=n[1],s=n[2];r.checks.push({type:ue.META_COMPARE,field:Rr(i),operator:o,value:parseFloat(s)})},"populate")},{name:"nextQuery",separator:!0,regex:Ae.separator,populate:v(function(e,r){var a=e.currentSubject,n=e.edgeCount,i=e.compoundCount,o=e[e.length-1];return a!=null&&(o.subject=a,e.currentSubject=null),o.edgeCount=n,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]=ze()},"populate")},{name:"directedEdge",separator:!0,regex:Ae.directedEdge,populate:v(function(e,r){if(e.currentSubject==null){var a=ze(),n=r,i=ze();return a.checks.push({type:ue.DIRECTED_EDGE,source:n,target:i}),Zt(e,r,a),e.edgeCount++,i}else{var o=ze(),s=r,u=ze();return o.checks.push({type:ue.NODE_SOURCE,source:s,target:u}),Zt(e,r,o),e.edgeCount++,u}},"populate")},{name:"undirectedEdge",separator:!0,regex:Ae.undirectedEdge,populate:v(function(e,r){if(e.currentSubject==null){var a=ze(),n=r,i=ze();return a.checks.push({type:ue.UNDIRECTED_EDGE,nodes:[n,i]}),Zt(e,r,a),e.edgeCount++,i}else{var o=ze(),s=r,u=ze();return o.checks.push({type:ue.NODE_NEIGHBOR,node:s,neighbor:u}),Zt(e,r,o),u}},"populate")},{name:"child",separator:!0,regex:Ae.child,populate:v(function(e,r){if(e.currentSubject==null){var a=ze(),n=ze(),i=e[e.length-1];return a.checks.push({type:ue.CHILD,parent:i,child:n}),Zt(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var o=ze(),s=e[e.length-1],u=ze(),l=ze(),f=ze(),c=ze();return o.checks.push({type:ue.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:ue.TRUE}],c.checks.push({type:ue.TRUE}),u.checks.push({type:ue.PARENT,parent:c,child:f}),Zt(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var h=ze(),g=ze(),d=[{type:ue.PARENT,parent:h,child:g}];return h.checks=r.checks,r.checks=d,e.compoundCount++,g}},"populate")},{name:"descendant",separator:!0,regex:Ae.descendant,populate:v(function(e,r){if(e.currentSubject==null){var a=ze(),n=ze(),i=e[e.length-1];return a.checks.push({type:ue.DESCENDANT,ancestor:i,descendant:n}),Zt(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var o=ze(),s=e[e.length-1],u=ze(),l=ze(),f=ze(),c=ze();return o.checks.push({type:ue.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:ue.TRUE}],c.checks.push({type:ue.TRUE}),u.checks.push({type:ue.ANCESTOR,ancestor:c,descendant:f}),Zt(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var h=ze(),g=ze(),d=[{type:ue.ANCESTOR,ancestor:h,descendant:g}];return h.checks=r.checks,r.checks=d,e.compoundCount++,g}},"populate")},{name:"subject",modifier:!0,regex:Ae.subject,populate:v(function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Oe("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var a=e[e.length-1].checks[0],n=a==null?null:a.type;n===ue.DIRECTED_EDGE?a.type=ue.NODE_TARGET:n===ue.UNDIRECTED_EDGE&&(a.type=ue.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)},"populate")}];Io.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var Tg=v(function(e){for(var r,a,n,i=0;i<Io.length;i++){var o=Io[i],s=o.name,u=e.match(o.regexObj);if(u!=null){a=u,r=o,n=s;var l=u[0];e=e.substring(l.length);break}}return{expr:r,match:a,name:n,remaining:e}},"consumeExpr"),Sg=v(function(e){var r=e.match(/^\s+/);if(r){var a=r[0];e=e.substring(a.length)}return e},"consumeWhitespace"),Dg={parse:v(function(e){var r=this,a=r.inputText=e,n=r[0]=ze();for(r.length=1,a=Sg(a);;){var i=Tg(a);if(i.expr==null)return Oe("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(r,n,o);if(s===!1)return!1;if(s!=null&&(n=s),a=i.remaining,a.match(/^\s*$/))break}var u=r[r.length-1];r.currentSubject!=null&&(u.subject=r.currentSubject),u.edgeCount=r.edgeCount,u.compoundCount=r.compoundCount;for(var l=0;l<r.length;l++){var f=r[l];if(f.compoundCount>0&&f.edgeCount>0)return Oe("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return Oe("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&Oe("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},"parse"),toString:v(function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=v(function(f){return f??""},"clean"),r=v(function(f){return de(f)?'"'+f+'"':e(f)},"cleanVal"),a=v(function(f){return" "+f+" "},"space"),n=v(function(f,c){var h=f.type,g=f.value;switch(h){case ue.GROUP:var d=e(g);return d.substring(0,d.length-1);case ue.DATA_COMPARE:var p=f.field,y=f.operator;return"["+p+a(e(y))+r(g)+"]";case ue.DATA_BOOL:var m=f.operator,w=f.field;return"["+e(m)+w+"]";case ue.DATA_EXIST:return"["+f.field+"]";case ue.META_COMPARE:var b=f.operator;return"[["+f.field+a(e(b))+r(g)+"]]";case ue.STATE:return g;case ue.ID:return"#"+g;case ue.CLASS:return"."+g;case ue.PARENT:case ue.CHILD:return i(f.parent,c)+a(">")+i(f.child,c);case ue.ANCESTOR:case ue.DESCENDANT:return i(f.ancestor,c)+" "+i(f.descendant,c);case ue.COMPOUND_SPLIT:var x=i(f.left,c),S=i(f.subject,c),T=i(f.right,c);return x+(x.length>0?" ":"")+S+T;case ue.TRUE:return""}},"checkToString"),i=v(function(f,c){return f.checks.reduce(function(h,g,d){return h+(c===f&&d===0?"$":"")+n(g,c)},"")},"queryToString"),o="",s=0;s<this.length;s++){var u=this[s];o+=i(u,u.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},"toString")},zv=v(function(e,r,a){var n,i=de(e),o=ae(e),s=de(a),u,l,f=!1,c=!1,h=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),c=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(i||s||f)&&(u=!i&&!o?"":""+e,l=""+a),f&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),r){case"*=":n=u.indexOf(l)>=0;break;case"$=":n=u.indexOf(l,u.length-l.length)>=0;break;case"^=":n=u.indexOf(l)===0;break;case"=":n=e===a;break;case">":h=!0,n=e>a;break;case">=":h=!0,n=e>=a;break;case"<":h=!0,n=e<a;break;case"<=":h=!0,n=e<=a;break;default:n=!1}return c&&(e!=null||!h)&&(n=!n),n},"valCmp"),Bg=v(function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},"boolCmp"),kg=v(function(e){return e!==void 0},"existCmp"),os=v(function(e,r){return e.data(r)},"data"),Pg=v(function(e,r){return e[r]()},"meta"),Ye=[],Ge=v(function(e,r){return e.checks.every(function(a){return Ye[a.type](a,r)})},"matches");Ye[ue.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};Ye[ue.STATE]=function(t,e){var r=t.value;return Eg(r,e)};Ye[ue.ID]=function(t,e){var r=t.value;return e.id()===r};Ye[ue.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};Ye[ue.META_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return zv(Pg(e,r),a,n)};Ye[ue.DATA_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return zv(os(e,r),a,n)};Ye[ue.DATA_BOOL]=function(t,e){var r=t.field,a=t.operator;return Bg(os(e,r),a)};Ye[ue.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,kg(os(e,r))};Ye[ue.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],a=t.nodes[1],n=e.source(),i=e.target();return Ge(r,n)&&Ge(a,i)||Ge(a,n)&&Ge(r,i)};Ye[ue.NODE_NEIGHBOR]=function(t,e){return Ge(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Ge(t.neighbor,r)})};Ye[ue.DIRECTED_EDGE]=function(t,e){return Ge(t.source,e.source())&&Ge(t.target,e.target())};Ye[ue.NODE_SOURCE]=function(t,e){return Ge(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Ge(t.target,r)})};Ye[ue.NODE_TARGET]=function(t,e){return Ge(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Ge(t.source,r)})};Ye[ue.CHILD]=function(t,e){return Ge(t.child,e)&&Ge(t.parent,e.parent())};Ye[ue.PARENT]=function(t,e){return Ge(t.parent,e)&&e.children().some(function(r){return Ge(t.child,r)})};Ye[ue.DESCENDANT]=function(t,e){return Ge(t.descendant,e)&&e.ancestors().some(function(r){return Ge(t.ancestor,r)})};Ye[ue.ANCESTOR]=function(t,e){return Ge(t.ancestor,e)&&e.descendants().some(function(r){return Ge(t.descendant,r)})};Ye[ue.COMPOUND_SPLIT]=function(t,e){return Ge(t.subject,e)&&Ge(t.left,e)&&Ge(t.right,e)};Ye[ue.TRUE]=function(){return!0};Ye[ue.COLLECTION]=function(t,e){return t.value.has(e)};Ye[ue.FILTER]=function(t,e){var r=t.value;return r(e)};var Ag={matches:v(function(e){for(var r=this,a=0;a<r.length;a++){var n=r[a];if(Ge(n,e))return!0}return!1},"matches"),filter:v(function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===ue.ID)return e.getElementById(r[0].checks[0].value).collection();var a=v(function(i){for(var o=0;o<r.length;o++){var s=r[o];if(Ge(s,i))return!0}return!1},"selectorFunction");return r.text()==null&&(a=v(function(){return!0},"selectorFunction")),e.filter(a)},"filter")},or=v(function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||de(e)&&e.match(/^\s*$/)||(Tt(e)?this.addQuery({checks:[{type:ue.COLLECTION,value:e.collection()}]}):We(e)?this.addQuery({checks:[{type:ue.FILTER,value:e}]}):de(e)?this.parse(e)||(this.invalid=!0):He("A selector must be created from a string; found "))},"Selector"),sr=or.prototype;[Dg,Ag].forEach(function(t){return pe(sr,t)});sr.text=function(){return this.inputText};sr.size=function(){return this.length};sr.eq=function(t){return this[t]};sr.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};sr.addQuery=function(t){this[this.length++]=t};sr.selector=sr.toString;var tr={allAre:v(function(e){var r=new or(e);return this.every(function(a){return r.matches(a)})},"allAre"),is:v(function(e){var r=new or(e);return this.some(function(a){return r.matches(a)})},"is"),some:v(function(e,r){for(var a=0;a<this.length;a++)if(r?e.apply(r,[this[a],a,this]):e(this[a],a,this))return!0;return!1},"some"),every:v(function(e,r){for(var a=0;a<this.length;a++)if(!(r?e.apply(r,[this[a],a,this]):e(this[a],a,this)))return!1;return!0},"every"),same:v(function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length;return r!==e.length?!1:r===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},"same"),anySame:v(function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},"anySame"),allAreNeighbors:v(function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(a){return r.hasElementWithId(a.id())})},"allAreNeighbors"),contains:v(function(e){e=this.cy().collection(e);var r=this;return e.every(function(a){return r.hasElementWithId(a.id())})},"contains")};tr.allAreNeighbours=tr.allAreNeighbors;tr.has=tr.contains;tr.equal=tr.equals=tr.same;var kt=v(function(e,r){return v(function(n,i,o,s){var u=n,l=this,f;if(u==null?f="":Tt(u)&&u.length===1&&(f=u.id()),l.length===1&&f){var c=l[0]._private,h=c.traversalCache=c.traversalCache||{},g=h[r]=h[r]||[],d=Er(f),p=g[d];return p||(g[d]=e.call(l,n,i,o,s))}else return e.call(l,n,i,o,s)},"traversalCache")},"cache"),Xr={parent:v(function(e){var r=[];if(this.length===1){var a=this[0]._private.parent;if(a)return a}for(var n=0;n<this.length;n++){var i=this[n]._private.parent;i&&r.push(i)}return this.spawn(r,!0).filter(e)},"parent"),parents:v(function(e){for(var r=[],a=this.parent();a.nonempty();){for(var n=0;n<a.length;n++){var i=a[n];r.push(i)}a=a.parent()}return this.spawn(r,!0).filter(e)},"parents"),commonAncestors:v(function(e){for(var r,a=0;a<this.length;a++){var n=this[a].parents();r=r||n,r=r.intersect(n)}return r.filter(e)},"commonAncestors"),orphans:v(function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},"orphans"),nonorphans:v(function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},"nonorphans"),children:kt(function(t){for(var e=[],r=0;r<this.length;r++)for(var a=this[r]._private.children,n=0;n<a.length;n++)e.push(a[n]);return this.spawn(e,!0).filter(t)},"children"),siblings:v(function(e){return this.parent().children().not(this).filter(e)},"siblings"),isParent:v(function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},"isParent"),isChildless:v(function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},"isChildless"),isChild:v(function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},"isChild"),isOrphan:v(function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},"isOrphan"),descendants:v(function(e){var r=[];function a(n){for(var i=0;i<n.length;i++){var o=n[i];r.push(o),o.children().nonempty()&&a(o.children())}}return v(a,"add"),a(this.children()),this.spawn(r,!0).filter(e)},"descendants")};function ss(t,e,r,a){for(var n=[],i=new jr,o=t.cy().hasCompoundNodes(),s=0;s<t.length;s++){var u=t[s];r?n.push(u):o&&a(n,i,u)}for(;n.length>0;){var l=n.shift();e(l),i.add(l.id()),o&&a(n,i,l)}return t}v(ss,"forEachCompound");function Fv(t,e,r){if(r.isParent())for(var a=r._private.children,n=0;n<a.length;n++){var i=a[n];e.has(i.id())||t.push(i)}}v(Fv,"addChildren");Xr.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ss(this,t,e,Fv)};function Vv(t,e,r){if(r.isChild()){var a=r._private.parent;e.has(a.id())||t.push(a)}}v(Vv,"addParent");Xr.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ss(this,t,e,Vv)};function Rg(t,e,r){Vv(t,e,r),Fv(t,e,r)}v(Rg,"addParentAndChildren");Xr.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ss(this,t,e,Rg)};Xr.ancestors=Xr.parents;var xn=qv={data:Ie.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Ie.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ie.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ie.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ie.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ie.removeData({field:"rscratch",triggerEvent:!1}),id:v(function(){var e=this[0];if(e)return e._private.data.id},"id")},qv;xn.attr=xn.data;xn.removeAttr=xn.removeData;var Mg=qv,Vn={};function ho(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var a=0,n=r[0],i=n._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(a+=t(n,s))}return a}else return}}v(ho,"defineDegreeFunction");pe(Vn,{degree:ho(function(t,e){return e.source().same(e.target())?2:1}),indegree:ho(function(t,e){return e.target().same(t)?1:0}),outdegree:ho(function(t,e){return e.source().same(t)?1:0})});function Mr(t,e){return function(r){for(var a,n=this.nodes(),i=0;i<n.length;i++){var o=n[i][t](r);o!==void 0&&(a===void 0||e(o,a))&&(a=o)}return a}}v(Mr,"defineDegreeBoundsFunction");pe(Vn,{minDegree:Mr("degree",function(t,e){return t<e}),maxDegree:Mr("degree",function(t,e){return t>e}),minIndegree:Mr("indegree",function(t,e){return t<e}),maxIndegree:Mr("indegree",function(t,e){return t>e}),minOutdegree:Mr("outdegree",function(t,e){return t<e}),maxOutdegree:Mr("outdegree",function(t,e){return t>e})});pe(Vn,{totalDegree:v(function(e){for(var r=0,a=this.nodes(),n=0;n<a.length;n++)r+=a[n].degree(e);return r},"totalDegree")});var Mt,_v,Gv=v(function(e,r,a){for(var n=0;n<e.length;n++){var i=e[n];if(!i.locked()){var o=i._private.position,s={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,a),i.dirtyBoundingBoxCache()}}},"beforePositionSet"),al={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:v(function(e){e.updateCompoundBounds()},"beforeGet"),beforeSet:v(function(e,r){Gv(e,r,!1)},"beforeSet"),onSet:v(function(e){e.dirtyCompoundBoundsCache()},"onSet"),canSet:v(function(e){return!e.locked()},"canSet")};Mt=_v={position:Ie.data(al),silentPosition:Ie.data(pe({},al,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:v(function(e,r){Gv(e,r,!0)},"beforeSet"),onSet:v(function(e){e.dirtyCompoundBoundsCache()},"onSet")})),positions:v(function(e,r){if(Re(e))r?this.silentPosition(e):this.position(e);else if(We(e)){var a=e,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=a(o,i))&&(r?o.silentPosition(s):o.position(s))}n.endBatch()}return this},"positions"),silentPositions:v(function(e){return this.positions(e,!0)},"silentPositions"),shift:v(function(e,r,a){var n;if(Re(e)?(n={x:ae(e.x)?e.x:0,y:ae(e.y)?e.y:0},a=r):de(e)&&ae(r)&&(n={x:0,y:0},n[e]=r),n!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var u=s.position(),l={x:u.x+n.x,y:u.y+n.y};a?s.silentPosition(l):s.position(l)}}i.endBatch()}return this},"shift"),silentShift:v(function(e,r){return Re(e)?this.shift(e,!0):de(e)&&ae(r)&&this.shift(e,r,!0),this},"silentShift"),renderedPosition:v(function(e,r){var a=this[0],n=this.cy(),i=n.zoom(),o=n.pan(),s=Re(e)?e:void 0,u=s!==void 0||r!==void 0&&de(e);if(a&&a.isNode())if(u)for(var l=0;l<this.length;l++){var f=this[l];r!==void 0?f.position(e,(r-o[e])/i):s!==void 0&&f.position(gv(s,i,o))}else return s=Ln(a.position(),i,o),e===void 0?s:s[e];else if(!u)return;return this},"renderedPosition"),relativePosition:v(function(e,r){var a=this[0],n=this.cy(),i=Re(e)?e:void 0,o=i!==void 0||r!==void 0&&de(e),s=n.hasCompoundNodes();if(a&&a.isNode())if(o)for(var u=0;u<this.length;u++){var l=this[u],f=s?l.parent():null,c=f&&f.length>0,h=c;c&&(f=f[0]);var g=h?f.position():{x:0,y:0};r!==void 0?l.position(e,r+g[e]):i!==void 0&&l.position({x:i.x+g.x,y:i.y+g.y})}else{var d=a.position(),p=s?a.parent():null,y=p&&p.length>0,m=y;y&&(p=p[0]);var w=m?p.position():{x:0,y:0};return i={x:d.x-w.x,y:d.y-w.y},e===void 0?i:i[e]}else if(!o)return;return this},"relativePosition")};Mt.modelPosition=Mt.point=Mt.position;Mt.modelPositions=Mt.points=Mt.positions;Mt.renderedPoint=Mt.renderedPosition;Mt.relativePoint=Mt.relativePosition;var Lg=_v,Zr=v(function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},"labelHalign"),Qr=v(function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},"labelValign"),Ig=v(function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},"labelJustification"),pa=fr={},fr;fr.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),i=e.x1*a+n.x,o=e.x2*a+n.x,s=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:i,x2:o,y1:s,y2:u,w:o-i,h:u-s}};fr.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var a=r._private;a.compoundBoundsClean=!1,a.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};fr.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(o){if(!o.isParent())return;var s=o._private,u=o.children(),l=o.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},c=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),h=s.position;(c.w===0||c.h===0)&&(c={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},c.x1=h.x-c.w/2,c.x2=h.x+c.w/2,c.y1=h.y-c.h/2,c.y2=h.y+c.h/2);function g(B,C,P){var R=0,A=0,L=C+P;return B>0&&L>0&&(R=C/L*B,A=P/L*B),{biasDiff:R,biasComplementDiff:A}}v(g,"computeBiasValues");function d(B,C,P,R){if(P.units==="%")switch(R){case"width":return B>0?P.pfValue*B:0;case"height":return C>0?P.pfValue*C:0;case"average":return B>0&&C>0?P.pfValue*(B+C)/2:0;case"min":return B>0&&C>0?B>C?P.pfValue*C:P.pfValue*B:0;case"max":return B>0&&C>0?B>C?P.pfValue*B:P.pfValue*C:0;default:return 0}else return P.units==="px"?P.pfValue:0}v(d,"computePaddingValues");var p=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(p=p*100/f.width.val);var y=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(y=y*100/f.width.val);var m=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(m=m*100/f.height.val);var w=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(w=w*100/f.height.val);var b=g(f.width.val-c.w,p,y),x=b.biasDiff,S=b.biasComplementDiff,T=g(f.height.val-c.h,m,w),E=T.biasDiff,D=T.biasComplementDiff;s.autoPadding=d(c.w,c.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(c.w,f.width.val),h.x=(-x+c.x1+c.x2+S)/2,s.autoHeight=Math.max(c.h,f.height.val),h.y=(-E+c.y1+c.y2+D)/2}v(r,"update");for(var a=0;a<this.length;a++){var n=this[a],i=n._private;(!i.compoundBoundsClean||t)&&(r(n),e.batching()||(i.compoundBoundsClean=!0))}return this};var Bt=v(function(e){return e===1/0||e===-1/0?0:e},"noninf"),Rt=v(function(e,r,a,n,i){n-r===0||i-a===0||r==null||a==null||n==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=n>e.x2?n:e.x2,e.y1=a<e.y1?a:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},"updateBounds"),Qt=v(function(e,r){return r==null?e:Rt(e,r.x1,r.y1,r.x2,r.y2)},"updateBoundsFromBox"),ua=v(function(e,r,a){return yt(e,r,a)},"prefixedProperty"),Ya=v(function(e,r,a){if(!r.cy().headless()){var n=r._private,i=n.rstyle,o=i.arrowWidth/2,s=r.pstyle(a+"-arrow-shape").value,u,l;if(s!=="none"){a==="source"?(u=i.srcX,l=i.srcY):a==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var f=n.arrowBounds=n.arrowBounds||{},c=f[a]=f[a]||{};c.x1=u-o,c.y1=l-o,c.x2=u+o,c.y2=l+o,c.w=c.x2-c.x1,c.h=c.y2-c.y1,an(c,1),Rt(e,c.x1,c.y1,c.x2,c.y2)}}},"updateBoundsFromArrow"),go=v(function(e,r,a){if(!r.cy().headless()){var n;a?n=a+"-":n="";var i=r._private,o=i.rstyle;if(r.pstyle(n+"label").strValue){var s=r.pstyle("text-halign"),u=r.pstyle("text-valign"),l=ua(o,"labelWidth",a),f=ua(o,"labelHeight",a),c=ua(o,"labelX",a),h=ua(o,"labelY",a),g=r.pstyle(n+"text-margin-x").pfValue,d=r.pstyle(n+"text-margin-y").pfValue,p=r.isEdge(),y=r.pstyle(n+"text-rotation"),m=r.pstyle("text-outline-width").pfValue,w=r.pstyle("text-border-width").pfValue/2,b=r.pstyle("text-background-padding").pfValue,x=2,S=f,T=l,E=T/2,D=S/2,B,C,P,R;if(p)B=c-E,C=c+E,P=h-D,R=h+D;else{switch(Zr(s.value)){case"left":B=c-T,C=c;break;case"center":B=c-E,C=c+E;break;case"right":B=c,C=c+T}switch(Qr(u.value)){case"top":P=h-S,R=h;break;case"center":P=h-D,R=h+D;break;case"bottom":P=h,R=h+S}}var A=g-Math.max(m,w)-b-x,L=g+Math.max(m,w)+b+x,M=d-Math.max(m,w)-b-x,I=d+Math.max(m,w)+b+x;B+=A,C+=L,P+=M,R+=I;var O=a||"main",V=i.labelBounds,q=V[O]=V[O]||{};q.x1=B,q.y1=P,q.x2=C,q.y2=R,q.w=C-B,q.h=R-P,q.leftPad=A,q.rightPad=L,q.topPad=M,q.botPad=I;var F=p&&y.strValue==="autorotate",H=y.pfValue!=null&&y.pfValue!==0;if(F||H){var Q=F?ua(i.rstyle,"labelAngle",a):y.pfValue,U=Math.cos(Q),W=Math.sin(Q),X=(B+C)/2,re=(P+R)/2;if(!p){switch(Zr(s.value)){case"left":X=C;break;case"right":X=B}switch(Qr(u.value)){case"top":re=R;break;case"bottom":re=P}}var j=v(function(be,De){return be=be-X,De=De-re,{x:be*U-De*W+X,y:be*W+De*U+re}},"rotate"),Z=j(B,P),N=j(B,R),_=j(C,P),G=j(C,R);B=Math.min(Z.x,N.x,_.x,G.x),C=Math.max(Z.x,N.x,_.x,G.x),P=Math.min(Z.y,N.y,_.y,G.y),R=Math.max(Z.y,N.y,_.y,G.y)}var te=O+"Rot",le=V[te]=V[te]||{};le.x1=B,le.y1=P,le.x2=C,le.y2=R,le.w=C-B,le.h=R-P,Rt(e,B,P,C,R),Rt(i.labelBounds.all,B,P,C,R)}return e}},"updateBoundsFromLabel"),nl=v(function(e,r){if(!r.cy().headless()){var a=r.pstyle("outline-opacity").value,n=r.pstyle("outline-width").value+r.pstyle("outline-offset").value;Hv(e,r,a,n,"outside",n/2)}},"updateBoundsFromOutline"),Hv=v(function(e,r,a,n,i,o){if(!(a===0||n<=0||i==="inside")){var s=r.cy().renderer(),u=s.nodeShapes[s.getNodeShape(r)];if(u){var l=r.position(),f=l.x,c=l.y,h=r.width(),g=r.height();u.hasMiterBounds?(i==="center"&&(n/=2),Qt(e,u.miterBounds(f,c,h,g,n))):o!=null&&o>0&&nn(e,[o,o,o,o])}}},"updateBoundsFromMiter"),Og=v(function(e,r){if(!r.cy().headless()){var a=r.pstyle("border-opacity").value,n=r.pstyle("border-width").pfValue,i=r.pstyle("border-position").value;Hv(e,r,a,n,i)}},"updateBoundsFromMiterBorder"),Ng=v(function(e,r){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),o=mt(),s=e._private,u=e.isNode(),l=e.isEdge(),f,c,h,g,d,p,y=s.rstyle,m=u&&n?e.pstyle("bounds-expansion").pfValue:[0],w=v(function(G){return G.pstyle("display").value!=="none"},"isDisplayed"),b=!n||w(e)&&(!l||w(e.source())&&w(e.target()));if(b){var x=0,S=0;n&&r.includeOverlays&&(x=e.pstyle("overlay-opacity").value,x!==0&&(S=e.pstyle("overlay-padding").value));var T=0,E=0;n&&r.includeUnderlays&&(T=e.pstyle("underlay-opacity").value,T!==0&&(E=e.pstyle("underlay-padding").value));var D=Math.max(S,E),B=0,C=0;if(n&&(B=e.pstyle("width").pfValue,C=B/2),u&&r.includeNodes){var P=e.position();d=P.x,p=P.y;var R=e.outerWidth()/2,A=e.outerHeight()/2;f=d-R,c=d+R,h=p-A,g=p+A,Rt(o,f,h,c,g),n&&nl(o,e),n&&r.includeOutlines&&!i&&nl(o,e),n&&Og(o,e)}else if(l&&r.includeEdges)if(n&&!i){var L=e.pstyle("curve-style").strValue;if(f=Math.min(y.srcX,y.midX,y.tgtX),c=Math.max(y.srcX,y.midX,y.tgtX),h=Math.min(y.srcY,y.midY,y.tgtY),g=Math.max(y.srcY,y.midY,y.tgtY),f-=C,c+=C,h-=C,g+=C,Rt(o,f,h,c,g),L==="haystack"){var M=y.haystackPts;if(M&&M.length===2){if(f=M[0].x,h=M[0].y,c=M[1].x,g=M[1].y,f>c){var I=f;f=c,c=I}if(h>g){var O=h;h=g,g=O}Rt(o,f-C,h-C,c+C,g+C)}}else if(L==="bezier"||L==="unbundled-bezier"||Jt(L,"segments")||Jt(L,"taxi")){var V;switch(L){case"bezier":case"unbundled-bezier":V=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":V=y.linePts}if(V!=null)for(var q=0;q<V.length;q++){var F=V[q];f=F.x-C,c=F.x+C,h=F.y-C,g=F.y+C,Rt(o,f,h,c,g)}}}else{var H=e.source().position(),Q=e.target().position();if(f=H.x,c=Q.x,h=H.y,g=Q.y,f>c){var U=f;f=c,c=U}if(h>g){var W=h;h=g,g=W}f-=C,c+=C,h-=C,g+=C,Rt(o,f,h,c,g)}if(n&&r.includeEdges&&l&&(Ya(o,e,"mid-source"),Ya(o,e,"mid-target"),Ya(o,e,"source"),Ya(o,e,"target")),n&&e.pstyle("ghost").value==="yes"){var X=e.pstyle("ghost-offset-x").pfValue,re=e.pstyle("ghost-offset-y").pfValue;Rt(o,o.x1+X,o.y1+re,o.x2+X,o.y2+re)}var j=s.bodyBounds=s.bodyBounds||{};Hs(j,o),nn(j,m),an(j,1),n&&(f=o.x1,c=o.x2,h=o.y1,g=o.y2,Rt(o,f-D,h-D,c+D,g+D));var Z=s.overlayBounds=s.overlayBounds||{};Hs(Z,o),nn(Z,m),an(Z,1);var N=s.labelBounds=s.labelBounds||{};N.all!=null?Ch(N.all):N.all=mt(),n&&r.includeLabels&&(r.includeMainLabels&&go(o,e,null),l&&(r.includeSourceLabels&&go(o,e,"source"),r.includeTargetLabels&&go(o,e,"target")))}return o.x1=Bt(o.x1),o.y1=Bt(o.y1),o.x2=Bt(o.x2),o.y2=Bt(o.y2),o.w=Bt(o.x2-o.x1),o.h=Bt(o.y2-o.y1),o.w>0&&o.h>0&&b&&(nn(o,m),an(o,1)),o},"boundingBoxImpl"),$v=v(function(e){var r=0,a=v(function(o){return(o?1:0)<<r++},"tf"),n=0;return n+=a(e.incudeNodes),n+=a(e.includeEdges),n+=a(e.includeLabels),n+=a(e.includeMainLabels),n+=a(e.includeSourceLabels),n+=a(e.includeTargetLabels),n+=a(e.includeOverlays),n+=a(e.includeOutlines),n},"getKey"),Wv=v(function(e){var r=v(function(s){return Math.round(s)},"r");if(e.isEdge()){var a=e.source().position(),n=e.target().position();return zs([r(a.x),r(a.y),r(n.x),r(n.y)])}else{var i=e.position();return zs([r(i.x),r(i.y)])}},"getBoundingBoxPosKey"),il=v(function(e,r){var a=e._private,n,i=e.isEdge(),o=(r==null?ol:$v(r))===ol;if(a.bbCache==null?(n=Ng(e,Sa),a.bbCache=n,a.bbCachePosKey=Wv(e)):n=a.bbCache,!o){var s=e.isNode();n=mt(),(r.includeNodes&&s||r.includeEdges&&!s)&&(r.includeOverlays?Qt(n,a.overlayBounds):Qt(n,a.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?Qt(n,a.labelBounds.all):(r.includeMainLabels&&Qt(n,a.labelBounds.mainRot),r.includeSourceLabels&&Qt(n,a.labelBounds.sourceRot),r.includeTargetLabels&&Qt(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},"cachedBoundingBoxImpl"),Sa={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},ol=$v(Sa),sl=vt(Sa);fr.boundingBox=function(t){var e,r=t===void 0||t.useCache===void 0||t.useCache===!0,a=Kr(function(l){var f=l._private;return f.bbCache==null||f.styleDirty||f.bbCachePosKey!==Wv(l)},function(l){return l.id()});if(r&&this.length===1&&!a(this[0]))t===void 0?t=Sa:t=sl(t),e=il(this[0],t);else{e=mt(),t=t||Sa;var n=sl(t),i=this,o=i.cy().styleEnabled();this.edges().forEach(a),this.nodes().forEach(a),o&&this.recalculateRenderedStyle(r),this.updateCompoundBounds(!r);for(var s=0;s<i.length;s++){var u=i[s];a(u)&&u.dirtyBoundingBoxCache(),Qt(e,il(u,n))}}return e.x1=Bt(e.x1),e.y1=Bt(e.y1),e.x2=Bt(e.x2),e.y2=Bt(e.y2),e.w=Bt(e.x2-e.x1),e.h=Bt(e.y2-e.y1),e};fr.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};fr.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),a=r.hasCompoundNodes(),n=r.collection();if(a&&(n=e.filter(function(l){return l.isParent()}),e=e.not(n)),Re(t)){var i=t;t=v(function(){return i},"fn")}var o=v(function(f,c){return f._private.bbAtOldPos=t(f,c)},"storeOldPos"),s=v(function(f){return f._private.bbAtOldPos},"getOldPos");r.startBatch(),e.forEach(o).silentPositions(t),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var u=Eh(this.boundingBox({useCache:!1}));return e.silentPositions(s),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),r.endBatch(),u};pa.boundingbox=pa.bb=pa.boundingBox;pa.renderedBoundingbox=pa.renderedBoundingBox;var zg=fr,Xa=Na={},Na,Uv=v(function(e){e.uppercaseName=Es(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Es(e.outerName),Xa[e.name]=v(function(){var a=this[0],n=a._private,i=n.cy._private.styleEnabled;if(a)if(i){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var o=a.pstyle(e.name);return o.strValue==="label"?(a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0):o.pfValue}else return 1},"dimImpl"),Xa["outer"+e.uppercaseName]=v(function(){var a=this[0],n=a._private.cy._private.styleEnabled;if(a)if(n){var i=a[e.name](),o=a.pstyle("border-position").value,s;o==="center"?s=a.pstyle("border-width").pfValue:o==="outside"?s=2*a.pstyle("border-width").pfValue:s=0;var u=2*a.padding();return i+s+u}else return 1},"outerDimImpl"),Xa["rendered"+e.uppercaseName]=v(function(){var a=this[0];if(a)return a[e.name]()*this.cy().zoom()},"renderedDimImpl"),Xa["rendered"+e.uppercaseOuterName]=v(function(){var a=this[0];if(a)return a[e.outerName]()*this.cy().zoom()},"renderedOuterDimImpl")},"defineDimFns");Uv({name:"width"});Uv({name:"height"});Na.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};Na.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};Na.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var Fg=Na,Vg=v(function(e,r){if(e.isEdge()&&e.takesUpSpace())return r(e)},"ifEdge"),qg=v(function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy();return Ln(r(e),a.zoom(),a.pan())}},"ifEdgeRenderedPosition"),_g=v(function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy(),n=a.pan(),i=a.zoom();return r(e).map(function(o){return Ln(o,i,n)})}},"ifEdgeRenderedPositions"),ul={controlPoints:{get:v(function(e){return e.renderer().getControlPoints(e)},"controlPoints"),mult:!0},segmentPoints:{get:v(function(e){return e.renderer().getSegmentPoints(e)},"segmentPoints"),mult:!0},sourceEndpoint:{get:v(function(e){return e.renderer().getSourceEndpoint(e)},"sourceEndpoint")},targetEndpoint:{get:v(function(e){return e.renderer().getTargetEndpoint(e)},"targetEndpoint")},midpoint:{get:v(function(e){return e.renderer().getEdgeMidpoint(e)},"midpoint")}},Gg=v(function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},"renderedName"),Hg=pe({},Lg,zg,Fg,Object.keys(ul).reduce(function(t,e){var r=ul[e],a=Gg(e);return t[e]=function(){return Vg(this,r.get)},r.mult?t[a]=function(){return _g(this,r.get)}:t[a]=function(){return qg(this,r.get)},t},{})),Kv=v(function(e,r){this.recycle(e,r)},"Event");function la(){return!1}v(la,"returnFalse");function Za(){return!0}v(Za,"returnTrue");Kv.prototype={instanceString:v(function(){return"event"},"instanceString"),recycle:v(function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=la,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Za:la):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var a=this.position,n=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:a.x*n+i.x,y:a.y*n+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},"recycle"),preventDefault:v(function(){this.isDefaultPrevented=Za;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},"preventDefault"),stopPropagation:v(function(){this.isPropagationStopped=Za;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},"stopPropagation"),stopImmediatePropagation:v(function(){this.isImmediatePropagationStopped=Za,this.stopPropagation()},"stopImmediatePropagation"),isDefaultPrevented:la,isPropagationStopped:la,isImmediatePropagationStopped:la};var Yv=/^([^.]+)(\.(?:[^.]+))?$/,$g=".*",Xv={qualifierCompare:v(function(e,r){return e===r},"qualifierCompare"),eventMatches:v(function(){return!0},"eventMatches"),addEventFields:v(function(){},"addEventFields"),callbackContext:v(function(e){return e},"callbackContext"),beforeEmit:v(function(){},"beforeEmit"),afterEmit:v(function(){},"afterEmit"),bubble:v(function(){return!1},"bubble"),parent:v(function(){return null},"parent"),context:null},ll=Object.keys(Xv),Wg={};function qn(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wg,e=arguments.length>1?arguments[1]:void 0,r=0;r<ll.length;r++){var a=ll[r];this[a]=t[a]||Xv[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}v(qn,"Emitter");var ur=qn.prototype,Zv=v(function(e,r,a,n,i,o,s){We(n)&&(i=n,n=null),s&&(o==null?o=s:o=pe({},o,s));for(var u=Fe(a)?a:a.split(/\s+/),l=0;l<u.length;l++){var f=u[l];if(!ar(f)){var c=f.match(Yv);if(c){var h=c[1];if(r(e,f,h,c[2]?c[2]:null,n,i,o)===!1)break}}}},"forEachEvent"),vl=v(function(e,r){return e.addEventFields(e.context,r),new Kv(r.type,r)},"makeEventObj"),Ug=v(function(e,r,a){if(cc(a)){r(e,a);return}else if(Re(a)){r(e,vl(e,a));return}for(var n=Fe(a)?a:a.split(/\s+/),i=0;i<n.length;i++){var o=n[i];if(!ar(o)){var s=o.match(Yv);if(s){var u=s[1];r(e,vl(e,{type:u,namespace:s[2]?s[2]:null,target:e.context}))}}}},"forEachEventObj");ur.on=ur.addListener=function(t,e,r,a,n){return Zv(this,function(i,o,s,u,l,f,c){We(f)&&i.listeners.push({event:o,callback:f,type:s,namespace:u,qualifier:l,conf:c})},t,e,r,a,n),this};ur.one=function(t,e,r,a){return this.on(t,e,r,a,{one:!0})};ur.removeListener=ur.off=function(t,e,r,a){var n=this;this.emitting!==0&&(this.listeners=Kc(this.listeners));for(var i=this.listeners,o=v(function(l){var f=i[l];Zv(n,function(c,h,g,d,p,y){if((f.type===g||t==="*")&&(!d&&f.namespace!==".*"||f.namespace===d)&&(!p||c.qualifierCompare(f.qualifier,p))&&(!y||f.callback===y))return i.splice(l,1),!1},t,e,r,a)},"_loop"),s=i.length-1;s>=0;s--)o(s);return this};ur.removeAllListeners=function(){return this.removeListener("*")};ur.emit=ur.trigger=function(t,e,r){var a=this.listeners,n=a.length;return this.emitting++,Fe(e)||(e=[e]),Ug(this,function(i,o){r!=null&&(a=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],n=a.length);for(var s=v(function(){var f=a[u];if(f.type===o.type&&(!f.namespace||f.namespace===o.namespace||f.namespace===$g)&&i.eventMatches(i.context,f,o)){var c=[o];e!=null&&Xc(c,e),i.beforeEmit(i.context,f,o),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(d){return d!==f}));var h=i.callbackContext(i.context,f,o),g=f.callback.apply(h,c);i.afterEmit(i.context,f,o),g===!1&&(o.stopPropagation(),o.preventDefault())}},"_loop2"),u=0;u<n;u++)s();i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},t),this.emitting--,this};var Kg={qualifierCompare:v(function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},"qualifierCompare"),eventMatches:v(function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&Aa(a.target)&&n.matches(a.target):!0},"eventMatches"),addEventFields:v(function(e,r){r.cy=e.cy(),r.target=e},"addEventFields"),callbackContext:v(function(e,r,a){return r.qualifier!=null?a.target:e},"callbackContext"),beforeEmit:v(function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},"beforeEmit"),bubble:v(function(){return!0},"bubble"),parent:v(function(e){return e.isChild()?e.parent():e.cy()},"parent")},Qa=v(function(e){return de(e)?new or(e):e},"argSelector"),Qv={createEmitter:v(function(){for(var e=0;e<this.length;e++){var r=this[e],a=r._private;a.emitter||(a.emitter=new qn(Kg,r))}return this},"createEmitter"),emitter:v(function(){return this._private.emitter},"emitter"),on:v(function(e,r,a){for(var n=Qa(r),i=0;i<this.length;i++)this[i].emitter().on(e,n,a);return this},"on"),removeListener:v(function(e,r,a){for(var n=Qa(r),i=0;i<this.length;i++)this[i].emitter().removeListener(e,n,a);return this},"removeListener"),removeAllListeners:v(function(){for(var e=0;e<this.length;e++)this[e].emitter().removeAllListeners();return this},"removeAllListeners"),one:v(function(e,r,a){for(var n=Qa(r),i=0;i<this.length;i++)this[i].emitter().one(e,n,a);return this},"one"),once:v(function(e,r,a){for(var n=Qa(r),i=0;i<this.length;i++)this[i].emitter().on(e,n,a,{once:!0,onceCollection:this})},"once"),emit:v(function(e,r){for(var a=0;a<this.length;a++)this[a].emitter().emit(e,r);return this},"emit"),emitAndNotify:v(function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this},"emitAndNotify")};Ie.eventAliasesOn(Qv);var Jv={nodes:v(function(e){return this.filter(function(r){return r.isNode()}).filter(e)},"nodes"),edges:v(function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},"edges"),byGroup:v(function(){for(var e=this.spawn(),r=this.spawn(),a=0;a<this.length;a++){var n=this[a];n.isNode()?e.push(n):r.push(n)}return{nodes:e,edges:r}},"byGroup"),filter:v(function(e,r){if(e===void 0)return this;if(de(e)||Tt(e))return new or(e).filter(this);if(We(e)){for(var a=this.spawn(),n=this,i=0;i<n.length;i++){var o=n[i];(r?e.apply(r,[o,i,n]):e(o,i,n))&&a.push(o)}return a}return this.spawn()},"filter"),not:v(function(e){if(e){de(e)&&(e=this.filter(e));for(var r=this.spawn(),a=0;a<this.length;a++){var n=this[a];e.has(n)||r.push(n)}return r}else return this},"not"),absoluteComplement:v(function(){return this.cy().mutableElements().not(this)},"absoluteComplement"),intersect:v(function(e){if(de(e)){var r=e;return this.filter(r)}for(var a=this.spawn(),n=this,i=e,o=this.length<e.length,s=o?n:i,u=o?i:n,l=0;l<s.length;l++){var f=s[l];u.has(f)&&a.push(f)}return a},"intersect"),xor:v(function(e){var r=this._private.cy;de(e)&&(e=r.$(e));var a=this.spawn(),n=this,i=e,o=v(function(u,l){for(var f=0;f<u.length;f++){var c=u[f],h=c._private.data.id;l.hasElementWithId(h)||a.push(c)}},"add");return o(n,i),o(i,n),a},"xor"),diff:v(function(e){var r=this._private.cy;de(e)&&(e=r.$(e));var a=this.spawn(),n=this.spawn(),i=this.spawn(),o=this,s=e,u=v(function(f,c,h){for(var g=0;g<f.length;g++){var d=f[g],p=d._private.data.id;c.hasElementWithId(p)?i.merge(d):h.push(d)}},"add");return u(o,s,a),u(s,o,n),{left:a,right:n,both:i}},"diff"),add:v(function(e){var r=this._private.cy;if(!e)return this;if(de(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i];this.has(o)||n.push(o)}return n},"add"),merge:v(function(e){var r=this._private,a=r.cy;if(!e)return this;if(e&&de(e)){var n=e;e=a.mutableElements().filter(n)}for(var i=r.map,o=0;o<e.length;o++){var s=e[o],u=s._private.data.id;if(!i.has(u)){var l=this.length++;this[l]=s,i.set(u,{ele:s,index:l})}}return this},"merge"),unmergeAt:v(function(e){var r=this[e].id(),a=this._private.map;this[e]=void 0,a.delete(r);var n=e===this.length-1;if(this.length>1&&!n){var i=this.length-1,o=this[i],s=o._private.data.id;this[i]=void 0,this[e]=o,a.set(s,{ele:o,index:e})}return this.length--,this},"unmergeAt"),unmergeOne:v(function(e){e=e[0];var r=this._private,a=e._private.data.id,n=r.map.get(a);if(!n)return this;var i=n.index;return this.unmergeAt(i),this},"unmergeOne"),unmerge:v(function(e){var r=this._private.cy;if(!e)return this;if(e&&de(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=0;n<e.length;n++)this.unmergeOne(e[n]);return this},"unmerge"),unmergeBy:v(function(e){for(var r=this.length-1;r>=0;r--){var a=this[r];e(a)&&this.unmergeAt(r)}return this},"unmergeBy"),map:v(function(e,r){for(var a=[],n=this,i=0;i<n.length;i++){var o=n[i],s=r?e.apply(r,[o,i,n]):e(o,i,n);a.push(s)}return a},"map"),reduce:v(function(e,r){for(var a=r,n=this,i=0;i<n.length;i++)a=e(a,n[i],i,n);return a},"reduce"),max:v(function(e,r){for(var a=-1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=r?e.apply(r,[s,o,i]):e(s,o,i);u>a&&(a=u,n=s)}return{value:a,ele:n}},"max"),min:v(function(e,r){for(var a=1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=r?e.apply(r,[s,o,i]):e(s,o,i);u<a&&(a=u,n=s)}return{value:a,ele:n}},"min")},Me=Jv;Me.u=Me["|"]=Me["+"]=Me.union=Me.or=Me.add;Me["\\"]=Me["!"]=Me["-"]=Me.difference=Me.relativeComplement=Me.subtract=Me.not;Me.n=Me["&"]=Me["."]=Me.and=Me.intersection=Me.intersect;Me["^"]=Me["(+)"]=Me["(-)"]=Me.symmetricDifference=Me.symdiff=Me.xor;Me.fnFilter=Me.filterFn=Me.stdFilter=Me.filter;Me.complement=Me.abscomp=Me.absoluteComplement;var Yg={isNode:v(function(){return this.group()==="nodes"},"isNode"),isEdge:v(function(){return this.group()==="edges"},"isEdge"),isLoop:v(function(){return this.isEdge()&&this.source()[0]===this.target()[0]},"isLoop"),isSimple:v(function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},"isSimple"),group:v(function(){var e=this[0];if(e)return e._private.group},"group")},jv=v(function(e,r){var a=e.cy().hasCompoundNodes();function n(l){var f=l.pstyle("z-compound-depth");return f.value==="auto"?a?l.zDepth():0:f.value==="bottom"?-1:f.value==="top"?Zo:0}v(n,"getDepth");var i=n(e)-n(r);if(i!==0)return i;function o(l){return l.pstyle("z-index-compare").value==="auto"&&l.isNode()?1:0}v(o,"getEleDepth");var s=o(e)-o(r);if(s!==0)return s;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},"zIndexSort"),En={forEach:v(function(e,r){if(We(e))for(var a=this.length,n=0;n<a;n++){var i=this[n];if((r?e.apply(r,[i,n,this]):e(i,n,this))===!1)break}return this},"forEach"),toArray:v(function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},"toArray"),slice:v(function(e,r){var a=[],n=this.length;r==null&&(r=n),e==null&&(e=0),e<0&&(e=n+e),r<0&&(r=n+r);for(var i=e;i>=0&&i<r&&i<n;i++)a.push(this[i]);return this.spawn(a)},"slice"),size:v(function(){return this.length},"size"),eq:v(function(e){return this[e]||this.spawn()},"eq"),first:v(function(){return this[0]||this.spawn()},"first"),last:v(function(){return this[this.length-1]||this.spawn()},"last"),empty:v(function(){return this.length===0},"empty"),nonempty:v(function(){return!this.empty()},"nonempty"),sort:v(function(e){if(!We(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},"sort"),sortByZIndex:v(function(){return this.sort(jv)},"sortByZIndex"),zDepth:v(function(){var e=this[0];if(e){var r=e._private;if(r.group==="nodes"){var a=r.data.parent?e.parents().size():0;return e.isParent()?a:Zo-1}else{var n=r.source,i=r.target,o=n.zDepth(),s=i.zDepth();return Math.max(o,s,0)}}},"zDepth")};En.each=En.forEach;v((function(){var e="undefined";(typeof Symbol>"u"?"undefined":et(Symbol))!=e&&et(Symbol.iterator)!=e&&(En[Symbol.iterator]=function(){var r=this,a={value:void 0,done:!1},n=0,i=this.length;return Xl({next:v(function(){return n<i?a.value=r[n++]:(a.value=void 0,a.done=!0),a},"next")},Symbol.iterator,function(){return this})})}),"defineSymbolIterator")();var Xg=vt({nodeDimensionsIncludeLabels:!1}),sn={layoutDimensions:v(function(e){e=Xg(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var a=this.boundingBox();r={w:a.w,h:a.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},"layoutDimensions"),layoutPositions:v(function(e,r,a){var n=this.nodes().filter(function(b){return!b.isParent()}),i=this.cy(),o=r.eles,s=v(function(x){return x.id()},"getMemoizeKey"),u=Kr(a,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=v(function(x,S,T){var E={x:S.x1+S.w/2,y:S.y1+S.h/2},D={x:(T.x-E.x)*x,y:(T.y-E.y)*x};return{x:E.x+D.x,y:E.y+D.y}},"calculateSpacing"),f=r.spacingFactor&&r.spacingFactor!==1,c=v(function(){if(!f)return null;for(var x=mt(),S=0;S<n.length;S++){var T=n[S],E=u(T,S);yv(x,E.x,E.y)}return x},"spacingBb")(),h=Kr(function(b,x){var S=u(b,x);return f&&(S=l(Math.abs(r.spacingFactor),c,S)),r.transform!=null&&(S=r.transform(b,S)),S},s);if(r.animate){for(var g=0;g<n.length;g++){var d=n[g],p=h(d,g);if(r.animateFilter==null||r.animateFilter(d,g)){var y=d.animation({position:p,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(y)}else d.position(p)}if(r.fit){var m=i.animation({fit:{boundingBox:o.boundingBoxAt(h),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(m)}else if(r.zoom!==void 0&&r.pan!==void 0){var w=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}e.animations.forEach(function(b){return b.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),ea.all(e.animations.map(function(b){return b.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else n.positions(h),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},"layoutPositions"),layout:v(function(e){return this.cy().makeLayout(pe({},e,{eles:this}))},"layout")};sn.createLayout=sn.makeLayout=sn.layout;function ef(t,e,r){var a=r._private,n=a.styleCache=a.styleCache||[],i;return(i=n[t])!=null||(i=n[t]=e(r)),i}v(ef,"styleCache");function Cn(t,e){return t=Er(t),v(function(a){return ef(t,e,a)},"cachedStyleFunction")}v(Cn,"cacheStyleFunction");function _n(t,e){t=Er(t);var r=v(function(n){return e.call(n)},"selfFn");return v(function(){var n=this[0];if(n)return ef(t,r,n)},"cachedPrototypeStyleFunction")}v(_n,"cachePrototypeStyleFunction");var ut={recalculateRenderedStyle:v(function(e){var r=this.cy(),a=r.renderer(),n=r.styleEnabled();return a&&n&&a.recalculateRenderedStyle(this,e),this},"recalculateRenderedStyle"),dirtyStyleCache:v(function(){var e=this.cy(),r=v(function(i){return i._private.styleCache=null},"dirty");if(e.hasCompoundNodes()){var a=this.spawnSelf().merge(this.descendants()).merge(this.parents());a.merge(a.connectedEdges()),a.forEach(r)}else this.forEach(function(n){r(n),n.connectedEdges().forEach(r)});return this},"dirtyStyleCache"),updateStyle:v(function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching())return r._private.batchStyleEles.merge(this),this;var a=r.hasCompoundNodes(),n=this;e=!!(e||e===void 0),a&&(n=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var i=n;return e?i.emitAndNotify("style"):i.emit("style"),n.forEach(function(o){return o._private.styleDirty=!0}),this},"updateStyle"),cleanStyle:v(function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var a=this[r];a._private.styleDirty&&(a._private.styleDirty=!1,e.style().apply(a))}},"cleanStyle"),parsedStyle:v(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){a._private.styleDirty&&(a._private.styleDirty=!1,n.style().apply(a));var i=a._private.style[e];return i??(r?n.style().getDefaultProperty(e):null)}},"parsedStyle"),numericStyle:v(function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var a=r.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},"numericStyle"),numericStyleUnits:v(function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},"numericStyleUnits"),renderedStyle:v(function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=this[0];if(a)return r.style().getRenderedStyle(a,e)},"renderedStyle"),style:v(function(e,r){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(Re(e)){var o=e;i.applyBypass(this,o,n),this.emitAndNotify("style")}else if(de(e))if(r===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},"style"),removeStyle:v(function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,n=r.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var s=i[o];n.removeAllBypasses(s,a)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var l=i[u];n.removeBypasses(l,e,a)}}return this.emitAndNotify("style"),this},"removeStyle"),show:v(function(){return this.css("display","element"),this},"show"),hide:v(function(){return this.css("display","none"),this},"hide"),effectiveOpacity:v(function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),a=this[0];if(a){var n=a._private,i=a.pstyle("opacity").value;if(!r)return i;var o=n.data.parent?a.parents():null;if(o)for(var s=0;s<o.length;s++)i=o[s].pstyle("opacity").value*i;return i}},"effectiveOpacity"),transparent:v(function(){if(!this.cy().styleEnabled())return!1;var e=this[0],r=e.cy().hasCompoundNodes();if(e)return r?e.effectiveOpacity()===0:e.pstyle("opacity").value===0},"transparent"),backgrounding:v(function(){return this.cy().styleEnabled()?!!this[0]._private.backgrounding:!1},"backgrounding")};function po(t,e){var r=t._private.data.parent?t.parents():null;if(r)for(var a=0;a<r.length;a++){var n=r[a];if(!e(n))return!1}return!0}v(po,"checkCompound");function us(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,a=t.parentOk||t.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var i=this[0],o=n.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||po(i,a);var u=s.source,l=s.target;return r(u)&&(!o||po(u,r))&&(u===l||r(l)&&(!o||po(l,r)))}}}v(us,"defineDerivedStateFunction");var Ur=Cn("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});ut.takesUpSpace=_n("takesUpSpace",us({ok:Ur}));ut.interactive=_n("interactive",us({ok:Cn("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Ur(t)}),parentOk:Cn("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Ur(t)}),edgeOkViaNode:Ur}));ut.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};ut.visible=_n("visible",us({ok:Cn("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Ur(t)}),edgeOkViaNode:Ur}));ut.hidden=function(){var t=this[0];if(t)return!t.visible()};ut.isBundledBezier=_n("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});ut.bypass=ut.css=ut.style;ut.renderedCss=ut.renderedStyle;ut.removeBypass=ut.removeCss=ut.removeStyle;ut.pstyle=ut.parsedStyle;var rr={};function fl(t){return function(){var e=arguments,r=[];if(e.length===2){var a=e[0],n=e[1];this.on(t.event,a,n)}else if(e.length===1&&We(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Fe(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var u=this[s],l=!t.ableField||u._private[t.ableField],f=u._private[t.field]!=t.value;if(t.overrideAble){var c=t.overrideAble(u);if(c!==void 0&&(l=c,!c))return this}l&&(u._private[t.field]=t.value,f&&r.push(u))}var h=this.spawn(r);h.updateStyle(),h.emit(t.event),o&&h.emit(o)}return this}}v(fl,"defineSwitchFunction");function ta(t){rr[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},rr[t.on]=fl({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),rr[t.off]=fl({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}v(ta,"defineSwitchSet");ta({field:"locked",overrideField:v(function(e){return e.cy().autolock()?!0:void 0},"overrideField"),on:"lock",off:"unlock"});ta({field:"grabbable",overrideField:v(function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},"overrideField"),on:"grabify",off:"ungrabify"});ta({field:"selected",ableField:"selectable",overrideAble:v(function(e){return e.cy().autounselectify()?!1:void 0},"overrideAble"),on:"select",off:"unselect"});ta({field:"selectable",overrideField:v(function(e){return e.cy().autounselectify()?!1:void 0},"overrideField"),on:"selectify",off:"unselectify"});rr.deselect=rr.unselect;rr.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};ta({field:"active",on:"activate",off:"unactivate"});ta({field:"pannable",on:"panify",off:"unpanify"});rr.inactive=function(){var t=this[0];if(t)return!t._private.active};var ht={},cl=v(function(e){return v(function(a){for(var n=this,i=[],o=0;o<n.length;o++){var s=n[o];if(s.isNode()){for(var u=!1,l=s.connectedEdges(),f=0;f<l.length;f++){var c=l[f],h=c.source(),g=c.target();if(e.noIncomingEdges&&g===s&&h!==s||e.noOutgoingEdges&&h===s&&g!==s){u=!0;break}}u||i.push(s)}}return this.spawn(i,!0).filter(a)},"dagExtremityImpl")},"defineDagExtremity"),hl=v(function(e){return function(r){for(var a=this,n=[],i=0;i<a.length;i++){var o=a[i];if(o.isNode())for(var s=o.connectedEdges(),u=0;u<s.length;u++){var l=s[u],f=l.source(),c=l.target();e.outgoing&&f===o?(n.push(l),n.push(c)):e.incoming&&c===o&&(n.push(l),n.push(f))}}return this.spawn(n,!0).filter(r)}},"defineDagOneHop"),dl=v(function(e){return function(r){for(var a=this,n=[],i={};;){var o=e.outgoing?a.outgoers():a.incomers();if(o.length===0)break;for(var s=!1,u=0;u<o.length;u++){var l=o[u],f=l.id();i[f]||(i[f]=!0,n.push(l),s=!0)}if(!s)break;a=o}return this.spawn(n,!0).filter(r)}},"defineDagAllHops");ht.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};pe(ht,{roots:cl({noIncomingEdges:!0}),leaves:cl({noOutgoingEdges:!0}),outgoers:kt(hl({outgoing:!0}),"outgoers"),successors:dl({outgoing:!0}),incomers:kt(hl({incoming:!0}),"incomers"),predecessors:dl({})});pe(ht,{neighborhood:kt(function(t){for(var e=[],r=this.nodes(),a=0;a<r.length;a++)for(var n=r[a],i=n.connectedEdges(),o=0;o<i.length;o++){var s=i[o],u=s.source(),l=s.target(),f=n===u?l:u;f.length>0&&e.push(f[0]),e.push(s[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:v(function(e){return this.neighborhood().add(this).filter(e)},"closedNeighborhood"),openNeighborhood:v(function(e){return this.neighborhood(e)},"openNeighborhood")});ht.neighbourhood=ht.neighborhood;ht.closedNeighbourhood=ht.closedNeighborhood;ht.openNeighbourhood=ht.openNeighborhood;pe(ht,{source:kt(v(function(e){var r=this[0],a;return r&&(a=r._private.source||r.cy().collection()),a&&e?a.filter(e):a},"sourceImpl"),"source"),target:kt(v(function(e){var r=this[0],a;return r&&(a=r._private.target||r.cy().collection()),a&&e?a.filter(e):a},"targetImpl"),"target"),sources:gl({attr:"source"}),targets:gl({attr:"target"})});function gl(t){return v(function(r){for(var a=[],n=0;n<this.length;n++){var i=this[n]._private[t.attr];i&&a.push(i)}return this.spawn(a,!0).filter(r)},"sourceImpl")}v(gl,"defineSourceFunction");pe(ht,{edgesWith:kt(pl(),"edgesWith"),edgesTo:kt(pl({thisIsSrc:!0}),"edgesTo")});function pl(t){return v(function(r){var a=[],n=this._private.cy,i=t||{};de(r)&&(r=n.$(r));for(var o=0;o<r.length;o++)for(var s=r[o]._private.edges,u=0;u<s.length;u++){var l=s[u],f=l._private.data,c=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),h=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target);(c||h)&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!c||i.thisIsTgt&&!h)||a.push(l))}return this.spawn(a,!0)},"edgesWithImpl")}v(pl,"defineEdgesWithFunction");pe(ht,{connectedEdges:kt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];if(n.isNode())for(var i=n._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:kt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];n.isEdge()&&(e.push(n.source()[0]),e.push(n.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:kt(yl(),"parallelEdges"),codirectedEdges:kt(yl({codirected:!0}),"codirectedEdges")});function yl(t){return t=pe({},{codirected:!1},t),v(function(r){for(var a=[],n=this.edges(),i=t,o=0;o<n.length;o++)for(var s=n[o]._private,u=s.source,l=u._private.data.id,f=s.data.target,c=u._private.edges,h=0;h<c.length;h++){var g=c[h],d=g._private.data,p=d.target,y=d.source,m=p===f&&y===l,w=l===p&&f===y;(i.codirected&&m||!i.codirected&&(m||w))&&a.push(g)}return this.spawn(a,!0).filter(r)},"parallelEdgesImpl")}v(yl,"defineParallelEdgesFunction");pe(ht,{components:v(function(e){var r=this,a=r.cy(),n=a.collection(),i=e==null?r.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=v(function(f,c){n.merge(f),i.unmerge(f),c.merge(f)},"visitInComponent");if(i.empty())return r.spawn();var u=v(function(){var f=a.collection();o.push(f);var c=i[0];s(c,f),r.bfs({directed:!1,roots:c,visit:v(function(g){return s(g,f)},"visit")}),f.forEach(function(h){h.connectedEdges().forEach(function(g){r.has(g)&&f.has(g.source())&&f.has(g.target())&&f.merge(g)})})},"_loop");do u();while(i.length>0);return o},"components"),component:v(function(){var e=this[0];return e.cy().mutableElements().components(e)[0]},"component")});ht.componentsOf=ht.components;var lt=v(function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){He("A collection must have a reference to the core");return}var i=new Ht,o=!1;if(!r)r=[];else if(r.length>0&&Re(r[0])&&!Aa(r[0])){o=!0;for(var s=[],u=new jr,l=0,f=r.length;l<f;l++){var c=r[l];c.data==null&&(c.data={});var h=c.data;if(h.id==null)h.id=hv();else if(e.hasElementWithId(h.id)||u.has(h.id))continue;var g=new Mn(e,c,!1);s.push(g),u.add(h.id)}r=s}this.length=0;for(var d=0,p=r.length;d<p;d++){var y=r[d][0];if(y!=null){var m=y._private.data.id;(!a||!i.has(m))&&(a&&i.set(m,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(w){this.lazyMap=w},rebuildMap:v(function(){for(var b=this.lazyMap=new Ht,x=this.eles,S=0;S<x.length;S++){var T=x[S];b.set(T.id(),{index:S,ele:T})}},"rebuildMap")},a&&(this._private.map=i),o&&!n&&this.restore()},"Collection"),_e=Mn.prototype=lt.prototype=Object.create(Array.prototype);_e.instanceString=function(){return"collection"};_e.spawn=function(t,e){return new lt(this.cy(),t,e)};_e.spawnSelf=function(){return this.spawn(this)};_e.cy=function(){return this._private.cy};_e.renderer=function(){return this._private.cy.renderer()};_e.element=function(){return this[0]};_e.collection=function(){return jl(this)?this:new lt(this._private.cy,[this])};_e.unique=function(){return new lt(this._private.cy,this,!0)};_e.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};_e.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new lt(e)};_e.$id=_e.getElementById;_e.poolIndex=function(){var t=this._private.cy._private.elements,e=this[0]._private.data.id;return t._private.map.get(e).index};_e.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};_e.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};_e.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var a=e._private;if(Re(t)){if(r.startBatch(),t.data){e.data(t.data);var n=a.data;if(e.isEdge()){var i=!1,o={},s=t.data.source,u=t.data.target;s!=null&&s!=n.source&&(o.source=""+s,i=!0),u!=null&&u!=n.target&&(o.target=""+u,i=!0),i&&(e=e.move(o))}else{var l="parent"in t.data,f=t.data.parent;l&&(f!=null||n.parent!=null)&&f!=n.parent&&(f===void 0&&(f=null),f!=null&&(f=""+f),e=e.move({parent:f}))}}t.position&&e.position(t.position);var c=v(function(p,y,m){var w=t[p];w!=null&&w!==a[p]&&(w?e[y]():e[m]())},"checkSwitch");return c("removed","remove","restore"),c("selected","select","unselect"),c("selectable","selectify","unselectify"),c("locked","lock","unlock"),c("grabbable","grabify","ungrabify"),c("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var h={data:Ft(a.data),position:Ft(a.position),group:a.group,removed:a.removed,selected:a.selected,selectable:a.selectable,locked:a.locked,grabbable:a.grabbable,pannable:a.pannable,classes:null};h.classes="";var g=0;return a.classes.forEach(function(d){return h.classes+=g++===0?d:" "+d}),h}}};_e.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e].json();t.push(r)}return t};_e.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var a=new Mn(t,this[r].json(),!1);e.push(a)}return new lt(t,e)};_e.copy=_e.clone;_e.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=r.cy(),n=a._private,i=[],o=[],s,u=0,l=r.length;u<l;u++){var f=r[u];e&&!f.removed()||(f.isNode()?i.push(f):o.push(f))}s=i.concat(o);var c,h=v(function(){s.splice(c,1),c--},"removeFromElements");for(c=0;c<s.length;c++){var g=s[c],d=g._private,p=d.data;if(g.clearTraversalCache(),!(!e&&!d.removed)){if(p.id===void 0)p.id=hv();else if(ae(p.id))p.id=""+p.id;else if(ar(p.id)||!de(p.id)){He("Can not create element with invalid string ID `"+p.id+"`"),h();continue}else if(a.hasElementWithId(p.id)){He("Can not create second element with ID `"+p.id+"`"),h();continue}}var y=p.id;if(g.isNode()){var m=d.position;m.x==null&&(m.x=0),m.y==null&&(m.y=0)}if(g.isEdge()){for(var w=g,b=["source","target"],x=b.length,S=!1,T=0;T<x;T++){var E=b[T],D=p[E];ae(D)&&(D=p[E]=""+p[E]),D==null||D===""?(He("Can not create edge `"+y+"` with unspecified "+E),S=!0):a.hasElementWithId(D)||(He("Can not create edge `"+y+"` with nonexistent "+E+" `"+D+"`"),S=!0)}if(S){h();continue}var B=a.getElementById(p.source),C=a.getElementById(p.target);B.same(C)?B._private.edges.push(w):(B._private.edges.push(w),C._private.edges.push(w)),w._private.source=B,w._private.target=C}d.map=new Ht,d.map.set(y,{ele:g,index:0}),d.removed=!1,e&&a.addToPool(g)}for(var P=0;P<i.length;P++){var R=i[P],A=R._private.data;ae(A.parent)&&(A.parent=""+A.parent);var L=A.parent;if(L!=null||R._private.parent){var M=R._private.parent?a.collection().merge(R._private.parent):a.getElementById(L);if(M.empty())A.parent=void 0;else if(M[0].removed())Oe("Node added with missing parent, reference to parent removed"),A.parent=void 0,R._private.parent=null;else{for(var I=!1,O=M;!O.empty();){if(R.same(O)){I=!0,A.parent=void 0;break}O=O.parent()}I||(M[0]._private.children.push(R),R._private.parent=M[0],n.hasCompoundNodes=!0)}}}if(s.length>0){for(var V=s.length===r.length?r:new lt(a,s),q=0;q<V.length;q++){var F=V[q];F.isNode()||(F.parallelEdges().clearTraversalCache(),F.source().clearTraversalCache(),F.target().clearTraversalCache())}var H;n.hasCompoundNodes?H=a.collection().merge(V).merge(V.connectedNodes()).merge(V.parent()):H=V,H.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?V.emitAndNotify("add"):e&&V.emit("add")}return r};_e.removed=function(){var t=this[0];return t&&t._private.removed};_e.inside=function(){var t=this[0];return t&&!t._private.removed};_e.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=[],n={},i=r._private.cy;function o(A){for(var L=A._private.edges,M=0;M<L.length;M++)u(L[M])}v(o,"addConnectedEdges");function s(A){for(var L=A._private.children,M=0;M<L.length;M++)u(L[M])}v(s,"addChildren");function u(A){var L=n[A.id()];e&&A.removed()||L||(n[A.id()]=!0,A.isNode()?(a.push(A),o(A),s(A)):a.unshift(A))}v(u,"add");for(var l=0,f=r.length;l<f;l++){var c=r[l];u(c)}function h(A,L){var M=A._private.edges;nr(M,L),A.clearTraversalCache()}v(h,"removeEdgeRef");function g(A){A.clearTraversalCache()}v(g,"removeParallelRef");var d=[];d.ids={};function p(A,L){L=L[0],A=A[0];var M=A._private.children,I=A.id();nr(M,L),L._private.parent=null,d.ids[I]||(d.ids[I]=!0,d.push(A))}v(p,"removeChildRef"),r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(a);for(var y=0;y<a.length;y++){var m=a[y];if(m.isEdge()){var w=m.source()[0],b=m.target()[0];h(w,m),h(b,m);for(var x=m.parallelEdges(),S=0;S<x.length;S++){var T=x[S];g(T),T.isBundledBezier()&&T.dirtyBoundingBoxCache()}}else{var E=m.parent();E.length!==0&&p(E,m)}e&&(m._private.removed=!0)}var D=i._private.elements;i._private.hasCompoundNodes=!1;for(var B=0;B<D.length;B++)if(D[B].isParent()){i._private.hasCompoundNodes=!0;break}var C=new lt(this.cy(),a);C.size()>0&&(t?C.emitAndNotify("remove"):e&&C.emit("remove"));for(var P=0;P<d.length;P++){var R=d[P];(!e||!R.removed())&&R.updateStyle()}return C};_e.move=function(t){var e=this._private.cy,r=this,a=!1,n=!1,i=v(function(g){return g==null?g:""+g},"toString");if(t.source!==void 0||t.target!==void 0){var o=i(t.source),s=i(t.target),u=o!=null&&e.hasElementWithId(o),l=s!=null&&e.hasElementWithId(s);(u||l)&&(e.batch(function(){r.remove(a,n),r.emitAndNotify("moveout");for(var h=0;h<r.length;h++){var g=r[h],d=g._private.data;g.isEdge()&&(u&&(d.source=o),l&&(d.target=s))}r.restore(a,n)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var f=i(t.parent);if(f===null||e.hasElementWithId(f)){var c=f===null?void 0:f;e.batch(function(){var h=r.remove(a,n);h.emitAndNotify("moveout");for(var g=0;g<r.length;g++){var d=r[g],p=d._private.data;d.isNode()&&(p.parent=c)}h.restore(a,n)}),r.emitAndNotify("move")}}return this};[Dv,wg,on,tr,Xr,Mg,Vn,Hg,Qv,Jv,Yg,En,sn,ut,rr,ht].forEach(function(t){pe(_e,t)});var Zg={add:v(function(e){var r,a=this;if(Tt(e)){var n=e;if(n._private.cy===a)r=n.restore();else{for(var i=[],o=0;o<n.length;o++){var s=n[o];i.push(s.json())}r=new lt(a,i)}}else if(Fe(e))r=new lt(a,e);else if(Re(e)&&(Fe(e.nodes)||Fe(e.edges))){for(var u=e,l=[],f=["nodes","edges"],c=0,h=f.length;c<h;c++){var g=f[c],d=u[g];if(Fe(d))for(var p=0,y=d.length;p<y;p++){var m=pe({group:g},d[p]);l.push(m)}}r=new lt(a,l)}else r=new Mn(a,e).collection();return r},"add"),remove:v(function(e){if(!Tt(e)){if(de(e)){var r=e;e=this.$(r)}}return e.remove()},"remove")};function Qg(t,e,r,a){var n=4,i=.001,o=1e-7,s=10,u=11,l=1/(u-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var c=0;c<4;++c)if(typeof arguments[c]!="number"||isNaN(arguments[c])||!isFinite(arguments[c]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var h=f?new Float32Array(u):new Array(u);function g(C,P){return 1-3*P+3*C}v(g,"A");function d(C,P){return 3*P-6*C}v(d,"B");function p(C){return 3*C}v(p,"C");function y(C,P,R){return((g(P,R)*C+d(P,R))*C+p(P))*C}v(y,"calcBezier");function m(C,P,R){return 3*g(P,R)*C*C+2*d(P,R)*C+p(P)}v(m,"getSlope");function w(C,P){for(var R=0;R<n;++R){var A=m(P,t,r);if(A===0)return P;var L=y(P,t,r)-C;P-=L/A}return P}v(w,"newtonRaphsonIterate");function b(){for(var C=0;C<u;++C)h[C]=y(C*l,t,r)}v(b,"calcSampleValues");function x(C,P,R){var A,L,M=0;do L=P+(R-P)/2,A=y(L,t,r)-C,A>0?R=L:P=L;while(Math.abs(A)>o&&++M<s);return L}v(x,"binarySubdivide");function S(C){for(var P=0,R=1,A=u-1;R!==A&&h[R]<=C;++R)P+=l;--R;var L=(C-h[R])/(h[R+1]-h[R]),M=P+L*l,I=m(M,t,r);return I>=i?w(C,M):I===0?M:x(C,P,P+l)}v(S,"getTForX");var T=!1;function E(){T=!0,(t!==e||r!==a)&&b()}v(E,"precompute");var D=v(function(P){return T||E(),t===e&&r===a?P:P===0?0:P===1?1:y(S(P),e,a)},"f");D.getControlPoints=function(){return[{x:t,y:e},{x:r,y:a}]};var B="generateBezier("+[t,e,r,a]+")";return D.toString=function(){return B},D}v(Qg,"generateCubicBezier");var Jg=(function(){function t(a){return-a.tension*a.x-a.friction*a.v}v(t,"springAccelerationForState");function e(a,n,i){var o={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:o.v,dv:t(o)}}v(e,"springEvaluateStateWithDerivative");function r(a,n){var i={dx:a.v,dv:t(a)},o=e(a,n*.5,i),s=e(a,n*.5,o),u=e(a,n,s),l=1/6*(i.dx+2*(o.dx+s.dx)+u.dx),f=1/6*(i.dv+2*(o.dv+s.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+f*n,a}return v(r,"springIntegrateState"),v(function a(n,i,o){var s={x:-1,v:0,tension:null,friction:null},u=[0],l=0,f=1/1e4,c=16/1e3,h,g,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,o=o||null,s.tension=n,s.friction=i,h=o!==null,h?(l=a(n,i),g=l/o*c):g=c;d=r(d||s,g),u.push(1+d.x),l+=16,Math.abs(d.x)>f&&Math.abs(d.v)>f;);return h?function(p){return u[p*(u.length-1)|0]}:l},"springRK4Factory")})(),qe=v(function(e,r,a,n){var i=Qg(e,r,a,n);return function(o,s,u){return o+(s-o)*i(u)}},"cubicBezier"),un={linear:v(function(e,r,a){return e+(r-e)*a},"linear"),ease:qe(.25,.1,.25,1),"ease-in":qe(.42,0,1,1),"ease-out":qe(0,0,.58,1),"ease-in-out":qe(.42,0,.58,1),"ease-in-sine":qe(.47,0,.745,.715),"ease-out-sine":qe(.39,.575,.565,1),"ease-in-out-sine":qe(.445,.05,.55,.95),"ease-in-quad":qe(.55,.085,.68,.53),"ease-out-quad":qe(.25,.46,.45,.94),"ease-in-out-quad":qe(.455,.03,.515,.955),"ease-in-cubic":qe(.55,.055,.675,.19),"ease-out-cubic":qe(.215,.61,.355,1),"ease-in-out-cubic":qe(.645,.045,.355,1),"ease-in-quart":qe(.895,.03,.685,.22),"ease-out-quart":qe(.165,.84,.44,1),"ease-in-out-quart":qe(.77,0,.175,1),"ease-in-quint":qe(.755,.05,.855,.06),"ease-out-quint":qe(.23,1,.32,1),"ease-in-out-quint":qe(.86,0,.07,1),"ease-in-expo":qe(.95,.05,.795,.035),"ease-out-expo":qe(.19,1,.22,1),"ease-in-out-expo":qe(1,0,0,1),"ease-in-circ":qe(.6,.04,.98,.335),"ease-out-circ":qe(.075,.82,.165,1),"ease-in-out-circ":qe(.785,.135,.15,.86),spring:v(function(e,r,a){if(a===0)return un.linear;var n=Jg(e,r,a);return function(i,o,s){return i+(o-i)*n(s)}},"spring"),"cubic-bezier":qe};function ml(t,e,r,a,n){if(a===1||e===r)return r;var i=n(e,r,a);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}v(ml,"getEasedValue");function bl(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}v(bl,"getValue");function Lr(t,e,r,a,n){var i=n!=null?n.type:null;r<0?r=0:r>1&&(r=1);var o=bl(t,n),s=bl(e,n);if(ae(o)&&ae(s))return ml(i,o,s,r,a);if(Fe(o)&&Fe(s)){for(var u=[],l=0;l<s.length;l++){var f=o[l],c=s[l];if(f!=null&&c!=null){var h=ml(i,f,c,r,a);u.push(h)}else u.push(c)}return u}}v(Lr,"ease");function jg(t,e,r,a){var n=!a,i=t._private,o=e._private,s=o.easing,u=o.startTime,l=(a?t:t.cy()).style();if(!o.easingImpl)if(s==null)o.easingImpl=un.linear;else{var f;de(s)?f=l.parse("transition-timing-function",s).value:f=s;var c,h;de(f)?(c=f,h=[]):(c=f[1],h=f.slice(2).map(function(O){return+O})),h.length>0?(c==="spring"&&h.push(o.duration),o.easingImpl=un[c].apply(null,h)):o.easingImpl=un[c]}var g=o.easingImpl,d;if(o.duration===0?d=1:d=(r-u)/o.duration,o.applying&&(d=o.progress),d<0?d=0:d>1&&(d=1),o.delay==null){var p=o.startPosition,y=o.position;if(y&&n&&!t.locked()){var m={};va(p.x,y.x)&&(m.x=Lr(p.x,y.x,d,g)),va(p.y,y.y)&&(m.y=Lr(p.y,y.y,d,g)),t.position(m)}var w=o.startPan,b=o.pan,x=i.pan,S=b!=null&&a;S&&(va(w.x,b.x)&&(x.x=Lr(w.x,b.x,d,g)),va(w.y,b.y)&&(x.y=Lr(w.y,b.y,d,g)),t.emit("pan"));var T=o.startZoom,E=o.zoom,D=E!=null&&a;D&&(va(T,E)&&(i.zoom=Ca(i.minZoom,Lr(T,E,d,g),i.maxZoom)),t.emit("zoom")),(S||D)&&t.emit("viewport");var B=o.style;if(B&&B.length>0&&n){for(var C=0;C<B.length;C++){var P=B[C],R=P.name,A=P,L=o.startStyle[R],M=l.properties[L.name],I=Lr(L,A,d,g,M);l.overrideBypass(t,R,I)}t.emit("style")}}return o.progress=d,d}v(jg,"step$1");function va(t,e){return t==null||e==null?!1:ae(t)&&ae(e)?!0:!!(t&&e)}v(va,"valid");function ep(t,e,r,a){var n=e._private;n.started=!0,n.startTime=r-n.progress*n.duration}v(ep,"startAnimation");function wl(t,e){var r=e._private.aniEles,a=[];function n(f,c){var h=f._private,g=h.animation.current,d=h.animation.queue,p=!1;if(g.length===0){var y=d.shift();y&&g.push(y)}for(var m=v(function(T){for(var E=T.length-1;E>=0;E--){var D=T[E];D()}T.splice(0,T.length)},"callbacks"),w=g.length-1;w>=0;w--){var b=g[w],x=b._private;if(x.stopped){g.splice(w,1),x.hooked=!1,x.playing=!1,x.started=!1,m(x.frames);continue}!x.playing&&!x.applying||(x.playing&&x.applying&&(x.applying=!1),x.started||ep(f,b,t),jg(f,b,t,c),x.applying&&(x.applying=!1),m(x.frames),x.step!=null&&x.step(t),b.completed()&&(g.splice(w,1),x.hooked=!1,x.playing=!1,x.started=!1,m(x.completes)),p=!0)}return!c&&g.length===0&&d.length===0&&a.push(f),p}v(n,"stepOne");for(var i=!1,o=0;o<r.length;o++){var s=r[o],u=n(s);i=i||u}var l=n(e,!0);(i||l)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(a),e.emit("step")}v(wl,"stepAll");var tp={animate:Ie.animate(),animation:Ie.animation(),animated:Ie.animated(),clearQueue:Ie.clearQueue(),delay:Ie.delay(),delayAnimation:Ie.delayAnimation(),stop:Ie.stop(),addToAnimationPool:v(function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},"addToAnimationPool"),stopAnimationLoop:v(function(){this._private.animationsRunning=!1},"stopAnimationLoop"),startAnimationLoop:v(function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&pn(v(function(i){wl(i,e),r()},"animationStep"))}v(r,"headlessStep");var a=e.renderer();a&&a.beforeRender?a.beforeRender(v(function(i,o){wl(o,e)},"rendererAnimationStep"),a.beforeRenderPriorities.animations):r()},"startAnimationLoop")},rp={qualifierCompare:v(function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},"qualifierCompare"),eventMatches:v(function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&Aa(a.target)&&n.matches(a.target):!0},"eventMatches"),addEventFields:v(function(e,r){r.cy=e,r.target=e},"addEventFields"),callbackContext:v(function(e,r,a){return r.qualifier!=null?a.target:e},"callbackContext")},Ja=v(function(e){return de(e)?new or(e):e},"argSelector"),tf={createEmitter:v(function(){var e=this._private;return e.emitter||(e.emitter=new qn(rp,this)),this},"createEmitter"),emitter:v(function(){return this._private.emitter},"emitter"),on:v(function(e,r,a){return this.emitter().on(e,Ja(r),a),this},"on"),removeListener:v(function(e,r,a){return this.emitter().removeListener(e,Ja(r),a),this},"removeListener"),removeAllListeners:v(function(){return this.emitter().removeAllListeners(),this},"removeAllListeners"),one:v(function(e,r,a){return this.emitter().one(e,Ja(r),a),this},"one"),once:v(function(e,r,a){return this.emitter().one(e,Ja(r),a),this},"once"),emit:v(function(e,r){return this.emitter().emit(e,r),this},"emit"),emitAndNotify:v(function(e,r){return this.emit(e),this.notify(e,r),this},"emitAndNotify")};Ie.eventAliasesOn(tf);var Oo={png:v(function(e){var r=this._private.renderer;return e=e||{},r.png(e)},"png"),jpg:v(function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)},"jpg")};Oo.jpeg=Oo.jpg;var ln={layout:v(function(e){var r=this;if(e==null){He("Layout options must be specified to make a layout");return}if(e.name==null){He("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){He("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;return de(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$(),new n(pe({},e,{cy:r,eles:i}))},"layout")};ln.createLayout=ln.makeLayout=ln.layout;var ap={notify:v(function(e,r){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();r!=null&&n.merge(r);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},"notify"),notifications:v(function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},"notifications"),noNotifications:v(function(e){this.notifications(!1),e(),this.notifications(!0)},"noNotifications"),batching:v(function(){return this._private.batchCount>0},"batching"),startBatch:v(function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},"startBatch"),endBatch:v(function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?r.notify(a):r.notify(a,n)})}return this},"endBatch"),batch:v(function(e){return this.startBatch(),e(),this.endBatch(),this},"batch"),batchData:v(function(e){var r=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n<a.length;n++){var i=a[n],o=e[i];r.getElementById(i).data(o)}})},"batchData")},np=vt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),No={renderTo:v(function(e,r,a,n){return this._private.renderer.renderTo(e,r,a,n),this},"renderTo"),renderer:v(function(){return this._private.renderer},"renderer"),forceRender:v(function(){return this.notify("draw"),this},"forceRender"),resize:v(function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},"resize"),initRenderer:v(function(e){var r=this,a=r.extension("renderer",e.name);if(a==null){He("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Oe("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=np(e);n.cy=r,r._private.renderer=new a(n),this.notify("init")},"initRenderer"),destroyRenderer:v(function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},"destroyRenderer"),onRender:v(function(e){return this.on("render",e)},"onRender"),offRender:v(function(e){return this.off("render",e)},"offRender")};No.invalidateDimensions=No.resize;var vn={collection:v(function(e,r){return de(e)?this.$(e):Tt(e)?e.collection():Fe(e)?(r||(r={}),new lt(this,e,r.unique,r.removed)):new lt(this)},"collection"),nodes:v(function(e){var r=this.$(function(a){return a.isNode()});return e?r.filter(e):r},"nodes"),edges:v(function(e){var r=this.$(function(a){return a.isEdge()});return e?r.filter(e):r},"edges"),$:v(function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},"$"),mutableElements:v(function(){return this._private.elements},"mutableElements")};vn.elements=vn.filter=vn.$;var it={},ya="t",ip="f";it.apply=function(t){for(var e=this,r=e._private.cy.collection(),a=0;a<t.length;a++){var n=t[a],i=e.getContextMeta(n);if(!i.empty){var o=e.getContextStyle(i),s=e.applyContextStyle(i,o,n);n._private.appliedInitStyle?e.updateTransitions(n,s.diffProps):n._private.appliedInitStyle=!0,e.updateStyleHints(n)&&r.push(n)}}return r};it.getPropertiesDiff=function(t,e){var r=this,a=r._private.propDiffs=r._private.propDiffs||{},n=t+"-"+e,i=a[n];if(i)return i;for(var o=[],s={},u=0;u<r.length;u++){var l=r[u],f=t[u]===ya,c=e[u]===ya,h=f!==c,g=l.mappedProperties.length>0;if(h||c&&g){var d=void 0;h&&g||h?d=l.properties:g&&(d=l.mappedProperties);for(var p=0;p<d.length;p++){for(var y=d[p],m=y.name,w=!1,b=u+1;b<r.length;b++){var x=r[b];if(e[b]===ya&&(w=x.properties[y.name]!=null,w))break}!s[m]&&!w&&(s[m]=!0,o.push(m))}}}return a[n]=o,o};it.getContextMeta=function(t){for(var e=this,r="",a,n=t._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i];o.selector&&o.selector.matches(t)?r+=ya:r+=ip}return a=e.getPropertiesDiff(n,r),t._private.styleCxtKey=r,{key:r,diffPropNames:a,empty:a.length===0}};it.getContextStyle=function(t){var e=t.key,r=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];for(var n={_private:{key:e}},i=0;i<r.length;i++){var o=r[i];if(e[i]===ya)for(var s=0;s<o.properties.length;s++){var u=o.properties[s];n[u.name]=u}}return a[e]=n,n};it.applyContextStyle=function(t,e,r){for(var a=this,n=t.diffPropNames,i={},o=a.types,s=0;s<n.length;s++){var u=n[s],l=e[u],f=r.pstyle(u);if(!l)if(f)f.bypass?l={name:u,deleteBypassed:!0}:l={name:u,delete:!0};else continue;if(f!==l){if(l.mapped===o.fn&&f!=null&&f.mapping!=null&&f.mapping.value===l.value){var c=f.mapping;if((c.fnValue=l.value(r))===c.prevFnValue)continue}var h=i[u]={prev:f};a.applyParsedProperty(r,l),h.next=r.pstyle(u),h.next&&h.next.bypass&&(h.next=h.next.bypassed)}}return{diffProps:i}};it.updateStyleHints=function(t){var e=t._private,r=this,a=r.propertyGroupNames,n=r.propertyGroupKeys,i=v(function(N,_,G){return r.getPropertiesHash(N,_,G)},"propHash"),o=e.styleKey;if(t.removed())return!1;var s=e.group==="nodes",u=t._private.style;a=Object.keys(u);for(var l=0;l<n.length;l++){var f=n[l];e.styleKeys[f]=[br,Vr]}for(var c=v(function(N,_){return e.styleKeys[_][0]=wa(N,e.styleKeys[_][0])},"updateGrKey1"),h=v(function(N,_){return e.styleKeys[_][1]=xa(N,e.styleKeys[_][1])},"updateGrKey2"),g=v(function(N,_){c(N,_),h(N,_)},"updateGrKey"),d=v(function(N,_){for(var G=0;G<N.length;G++){var te=N.charCodeAt(G);c(te,_),h(te,_)}},"updateGrKeyWStr"),p=2e9,y=v(function(N){return-128<N&&N<128&&Math.floor(N)!==N?p-(N*1024|0):N},"cleanNum"),m=0;m<a.length;m++){var w=a[m],b=u[w];if(b!=null){var x=this.properties[w],S=x.type,T=x.groupKey,E=void 0;x.hashOverride!=null?E=x.hashOverride(t,b):b.pfValue!=null&&(E=b.pfValue);var D=x.enums==null?b.value:null,B=E!=null,C=B||D!=null,P=b.units;S.number&&C&&!S.multiple?(g(y(B?E:D),T),!B&&P!=null&&d(P,T)):d(b.strValue,T)}}for(var R=[br,Vr],A=0;A<n.length;A++){var L=n[A],M=e.styleKeys[L];R[0]=wa(M[0],R[0]),R[1]=xa(M[1],R[1])}e.styleKey=Vc(R[0],R[1]);var I=e.styleKeys;e.labelDimsKey=Xt(I.labelDimensions);var O=i(t,["label"],I.labelDimensions);if(e.labelKey=Xt(O),e.labelStyleKey=Xt(Ha(I.commonLabel,O)),!s){var V=i(t,["source-label"],I.labelDimensions);e.sourceLabelKey=Xt(V),e.sourceLabelStyleKey=Xt(Ha(I.commonLabel,V));var q=i(t,["target-label"],I.labelDimensions);e.targetLabelKey=Xt(q),e.targetLabelStyleKey=Xt(Ha(I.commonLabel,q))}if(s){var F=e.styleKeys,H=F.nodeBody,Q=F.nodeBorder,U=F.nodeOutline,W=F.backgroundImage,X=F.compound,re=F.pie,j=F.stripe;e.nodeKey=Xt([H,Q,U,W,X,re,j].filter(function(Z){return Z!=null}).reduce(Ha,[br,Vr])),e.hasPie=re!=null&&re[0]!==br&&re[1]!==Vr,e.hasStripe=j!=null&&j[0]!==br&&j[1]!==Vr}return o!==e.styleKey};it.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};it.applyParsedProperty=function(t,e){var r=this,a=e,n=t._private.style,i,o=r.types,s=r.properties[a.name].type,u=a.bypass,l=n[a.name],f=l&&l.bypass,c=t._private,h="mapping",g=v(function(U){return U==null?null:U.pfValue!=null?U.pfValue:U.value},"getVal"),d=v(function(){var U=g(l),W=g(a);r.checkTriggers(t,a.name,U,W)},"checkTriggers");if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(a=e=this.parse(e.name,"bezier",u)),a.delete)return n[a.name]=void 0,d(),!0;if(a.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,d(),!0):!1:(d(),!0);if(a.deleteBypass)return l?l.bypass?(n[a.name]=l.bypassed,d(),!0):!1:(d(),!0);var p=v(function(){Oe("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")},"printMappingErr");switch(a.mapped){case o.mapData:for(var y=a.field.split("."),m=c.data,w=0;w<y.length&&m;w++){var b=y[w];m=m[b]}if(m==null)return p(),!1;var x;if(ae(m)){var S=a.fieldMax-a.fieldMin;S===0?x=0:x=(m-a.fieldMin)/S}else return Oe("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+m+"` for `"+t.id()+"` is non-numeric)"),!1;if(x<0?x=0:x>1&&(x=1),s.color){var T=a.valueMin[0],E=a.valueMax[0],D=a.valueMin[1],B=a.valueMax[1],C=a.valueMin[2],P=a.valueMax[2],R=a.valueMin[3]==null?1:a.valueMin[3],A=a.valueMax[3]==null?1:a.valueMax[3],L=[Math.round(T+(E-T)*x),Math.round(D+(B-D)*x),Math.round(C+(P-C)*x),Math.round(R+(A-R)*x)];i={bypass:a.bypass,name:a.name,value:L,strValue:"rgb("+L[0]+", "+L[1]+", "+L[2]+")"}}else if(s.number){var M=a.valueMin+(a.valueMax-a.valueMin)*x;i=this.parse(a.name,M,a.bypass,h)}else return!1;if(!i)return p(),!1;i.mapping=a,a=i;break;case o.data:for(var I=a.field.split("."),O=c.data,V=0;V<I.length&&O;V++){var q=I[V];O=O[q]}if(O!=null&&(i=this.parse(a.name,O,a.bypass,h)),!i)return p(),!1;i.mapping=a,a=i;break;case o.fn:var F=a.value,H=a.fnValue!=null?a.fnValue:F(t);if(a.prevFnValue=H,H==null)return Oe("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(a.name,H,a.bypass,h),!i)return Oe("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=Ft(a),a=i;break;case void 0:break;default:return!1}return u?(f?a.bypassed=l.bypassed:a.bypassed=l,n[a.name]=a):f?l.bypassed=a:n[a.name]=a,d(),!0};it.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var a=t[r];if(this.clearStyleHints(a),a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),!e)a._private.style={};else for(var n=a._private.style,i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],u=n[s];u!=null&&(u.bypass?u.bypassed=null:n[s]=null)}}};it.update=function(){this._private.cy.mutableElements().updateStyle()};it.updateTransitions=function(t,e){var r=this,a=t._private,n=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,o=t.pstyle("transition-delay").pfValue;if(n.length>0&&i>0){for(var s={},u=!1,l=0;l<n.length;l++){var f=n[l],c=t.pstyle(f),h=e[f];if(h){var g=h.prev,d=h.next!=null?h.next:c,p=!1,y=void 0,m=1e-6;g&&(ae(g.pfValue)&&ae(d.pfValue)?(p=d.pfValue-g.pfValue,y=g.pfValue+m*p):ae(g.value)&&ae(d.value)?(p=d.value-g.value,y=g.value+m*p):Fe(g.value)&&Fe(d.value)&&(p=g.value[0]!==d.value[0]||g.value[1]!==d.value[1]||g.value[2]!==d.value[2],y=g.strValue),p&&(s[f]=d.strValue,this.applyBypass(t,f,y),u=!0))}}if(!u)return;a.transitioning=!0,new ea(function(w){o>0?t.delayAnimation(o).play().promise().then(w):w()}).then(function(){return t.animation({style:s,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1)};it.checkTrigger=function(t,e,r,a,n,i){var o=this.properties[e],s=n(o);t.removed()||s!=null&&s(r,a,t)&&i(o)};it.checkZOrderTrigger=function(t,e,r,a){var n=this;this.checkTrigger(t,e,r,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",t)})};it.checkBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBounds},function(n){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};it.checkConnectedEdgesBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBoundsOfConnectedEdges},function(n){t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};it.checkParallelEdgesBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBoundsOfParallelEdges},function(n){t.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};it.checkTriggers=function(t,e,r,a){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,a),this.checkBoundsTrigger(t,e,r,a),this.checkConnectedEdgesBoundsTrigger(t,e,r,a),this.checkParallelEdgesBoundsTrigger(t,e,r,a)};var za={};za.applyBypass=function(t,e,r,a){var n=this,i=[],o=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var s=0;s<n.properties.length;s++){var u=n.properties[s].name,l=this.parse(u,r,!0);l&&i.push(l)}}else if(de(e)){var f=this.parse(e,r,!0);f&&i.push(f)}else if(Re(e)){var c=e;a=r;for(var h=Object.keys(c),g=0;g<h.length;g++){var d=h[g],p=c[d];if(p===void 0&&(p=c[An(d)]),p!==void 0){var y=this.parse(d,p,!0);y&&i.push(y)}}}else return!1;if(i.length===0)return!1;for(var m=!1,w=0;w<t.length;w++){for(var b=t[w],x={},S=void 0,T=0;T<i.length;T++){var E=i[T];if(a){var D=b.pstyle(E.name);S=x[E.name]={prev:D}}m=this.applyParsedProperty(b,Ft(E))||m,a&&(S.next=b.pstyle(E.name))}m&&this.updateStyleHints(b),a&&this.updateTransitions(b,x,o)}return m};za.overrideBypass=function(t,e,r){e=Yo(e);for(var a=0;a<t.length;a++){var n=t[a],i=n._private.style[e],o=this.properties[e].type,s=o.color,u=o.mutiple,l=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(n,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),s?i.strValue="rgb("+r.join(",")+")":u?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(n)),this.checkTriggers(n,e,l,r)}};za.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};za.removeBypasses=function(t,e,r){for(var a=!0,n=0;n<t.length;n++){for(var i=t[n],o={},s=0;s<e.length;s++){var u=e[s],l=this.properties[u],f=i.pstyle(l.name);if(!(!f||!f.bypass)){var c=this.parse(u,"",!0),h=o[l.name]={prev:f};this.applyParsedProperty(i,c),h.next=i.pstyle(l.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,o,a)}};var ls={};ls.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};ls.containerCss=function(t){var e=this._private.cy,r=e.container(),a=e.window();if(a&&r&&a.getComputedStyle)return a.getComputedStyle(r).getPropertyValue(t)};var Vt={};Vt.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};Vt.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var a={},n=0;n<r.properties.length;n++){var i=r.properties[n],o=r.getStylePropertyValue(t,i.name,e);o!=null&&(a[i.name]=o,a[An(i.name)]=o)}return a}};Vt.getIndexedStyle=function(t,e,r,a){var n=t.pstyle(e)[r][a];return n??t.cy().style().getDefaultProperty(e)[r][0]};Vt.getStylePropertyValue=function(t,e,r){var a=this;if(t=t[0],t){var n=a.properties[e];n.alias&&(n=n.pointsTo);var i=n.type,o=t.pstyle(n.name);if(o){var s=o.value,u=o.units,l=o.strValue;if(r&&i.number&&s!=null&&ae(s)){var f=t.cy().zoom(),c=v(function(p){return p*f},"getRenderedValue"),h=v(function(p,y){return c(p)+y},"getValueStringWithUnits"),g=Fe(s);return(g?u.every(function(d){return d!=null}):u!=null)?g?s.map(function(d,p){return h(d,u[p])}).join(" "):h(s,u):g?s.map(function(d){return de(d)?d:""+c(d)}).join(" "):""+c(s)}else if(l!=null)return l}return null}};Vt.getAnimationStartStyle=function(t,e){for(var r={},a=0;a<e.length;a++){var n=e[a].name,i=t.pstyle(n);i!==void 0&&(Re(i)?i=this.parse(n,i.strValue):i=this.parse(n,i)),i&&(r[n]=i)}return r};Vt.getPropsList=function(t){var e=this,r=[],a=t,n=e.properties;if(a)for(var i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],u=a[s],l=n[s]||n[Yo(s)],f=this.parse(l.name,u);f&&r.push(f)}return r};Vt.getNonDefaultPropertiesHash=function(t,e,r){var a=r.slice(),n,i,o,s,u,l;for(u=0;u<e.length;u++)if(n=e[u],i=t.pstyle(n,!1),i!=null)if(i.pfValue!=null)a[0]=wa(s,a[0]),a[1]=xa(s,a[1]);else for(o=i.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),a[0]=wa(s,a[0]),a[1]=xa(s,a[1]);return a};Vt.getPropertiesHash=Vt.getNonDefaultPropertiesHash;var Gn={};Gn.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var a=t[r],n=a.selector,i=a.style||a.css,o=Object.keys(i);e.selector(n);for(var s=0;s<o.length;s++){var u=o[s],l=i[u];e.css(u,l)}}return e};Gn.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};Gn.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],a=r.selector,n=r.properties,i={},o=0;o<n.length;o++){var s=n[o];i[s.name]=s.strValue}t.push({selector:a?a.toString():"core",style:i})}return t};var vs={};vs.appendFromString=function(t){var e=this,r=this,a=""+t,n,i,o;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){a.length>n.length?a=a.substr(n.length):a=""}v(s,"removeSelAndBlockFromRemaining");function u(){i.length>o.length?i=i.substr(o.length):i=""}for(v(u,"removePropAndValFromRem");!a.match(/^\s*$/);){var l=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){Oe("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=l[0];var f=l[1];if(f!=="core"&&new or(f).invalid){Oe("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),s();continue}var c=l[2],h=!1;i=c;for(var g=[];!i.match(/^\s*$/);){var d=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!d){Oe("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),h=!0;break}o=d[0];var p=d[1],y=d[2];if(!e.properties[p]){Oe("Skipping property: Invalid property name in: "+o),u();continue}if(!r.parse(p,y)){Oe("Skipping property: Invalid property definition in: "+o),u();continue}g.push({name:p,val:y}),u()}if(h){s();break}r.selector(f);for(var m=0;m<g.length;m++){var w=g[m];r.css(w.name,w.val)}s()}return r};vs.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var Ze={};(function(){var t=je,e=mc,r=wc,a=xc,n=Ec,i=v(function(_){return"^"+_+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},"data"),o=v(function(_){var G=t+"|\\w+|"+e+"|"+r+"|"+a+"|"+n;return"^"+_+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+G+")\\s*\\,\\s*("+G+")\\)$"},"mapData"),s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Ze.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","top-inside","center","bottom","bottom-inside"]},halign:{enums:["left","left-inside","center","right","right-inside"]},justification:{enums:["left","center","right","auto"]},textMetrics:{enums:["font","glyph"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:v(function(_,G){switch(_.length){case 2:return G[0]!=="deg"&&G[0]!=="rad"&&G[1]!=="deg"&&G[1]!=="rad";case 1:return de(_[0])||G[0]==="deg"||G[0]==="rad";default:return!1}},"validate")},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:v(function(_){var G=_.length;return G===1||G===2||G===4},"validate")}};var u={zeroNonZero:v(function(_,G){return(_==null||G==null)&&_!==G||_==0&&G!=0?!0:_!=0&&G==0},"zeroNonZero"),any:v(function(_,G){return _!=G},"any"),emptyNonEmpty:v(function(_,G){var te=ar(_),le=ar(G);return te&&!le||!te&&le},"emptyNonEmpty")},l=Ze.types,f=[{name:"label",type:l.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any}],c=[{name:"source-label",type:l.text,triggersBounds:u.any},{name:"source-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:l.size,triggersBounds:u.any}],h=[{name:"target-label",type:l.text,triggersBounds:u.any},{name:"target-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:l.size,triggersBounds:u.any}],g=[{name:"font-family",type:l.fontFamily,triggersBounds:u.any},{name:"font-style",type:l.fontStyle,triggersBounds:u.any},{name:"font-weight",type:l.fontWeight,triggersBounds:u.any},{name:"font-size",type:l.size,triggersBounds:u.any},{name:"text-transform",type:l.textTransform,triggersBounds:u.any},{name:"text-wrap",type:l.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:l.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:l.size,triggersBounds:u.any},{name:"text-outline-width",type:l.size,triggersBounds:u.any},{name:"line-height",type:l.positiveNumber,triggersBounds:u.any}],d=[{name:"text-valign",type:l.valign,triggersBounds:u.any},{name:"text-halign",type:l.halign,triggersBounds:u.any},{name:"color",type:l.color},{name:"text-outline-color",type:l.color},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-background-padding",type:l.size,triggersBounds:u.any},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size,triggersBounds:u.any},{name:"text-border-style",type:l.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:l.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:l.justification},{name:"text-metrics",type:l.textMetrics},{name:"box-select-labels",type:l.bool,triggersBounds:u.any}],p=[{name:"events",type:l.bool,triggersZOrder:u.any},{name:"text-events",type:l.bool,triggersZOrder:u.any},{name:"box-selection",type:l.boxSelection,triggersZOrder:u.any}],y=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:u.any,triggersBoundsOfParallelEdges:v(function(_,G,te){return _===G?!1:te.pstyle("curve-style").value==="bezier"},"triggersBoundsOfParallelEdges")},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.number,triggersZOrder:u.any}],m=[{name:"overlay-padding",type:l.size,triggersBounds:u.any},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:l.cornerRadius}],w=[{name:"underlay-padding",type:l.size,triggersBounds:u.any},{name:"underlay-color",type:l.color},{name:"underlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:l.cornerRadius}],b=[{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"transition-timing-function",type:l.easing}],x=v(function(_,G){return G.value==="label"?-_.poolIndex():G.pfValue},"nodeSizeHashOverride"),S=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:x},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:x},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:l.cornerRadius},{name:"background-color",type:l.color},{name:"background-fill",type:l.fill},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"background-gradient-stop-colors",type:l.colors},{name:"background-gradient-stop-positions",type:l.percentages},{name:"background-gradient-direction",type:l.gradientDirection},{name:"padding",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:l.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:l.boundsExpansion,triggersBounds:u.any}],T=[{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size,triggersBounds:u.any},{name:"border-style",type:l.borderStyle},{name:"border-cap",type:l.lineCap},{name:"border-join",type:l.lineJoin},{name:"border-dash-pattern",type:l.numbers},{name:"border-dash-offset",type:l.number},{name:"border-position",type:l.linePosition}],E=[{name:"outline-color",type:l.color},{name:"outline-opacity",type:l.zeroOneNumber},{name:"outline-width",type:l.size,triggersBounds:u.any},{name:"outline-style",type:l.borderStyle},{name:"outline-offset",type:l.size,triggersBounds:u.any}],D=[{name:"background-image",type:l.urls},{name:"background-image-crossorigin",type:l.bgCrossOrigin},{name:"background-image-opacity",type:l.zeroOneNumbers},{name:"background-image-containment",type:l.bgContainment},{name:"background-image-smoothing",type:l.bools},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-width-relative-to",type:l.bgRelativeTo},{name:"background-height-relative-to",type:l.bgRelativeTo},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"background-offset-x",type:l.bgPos},{name:"background-offset-y",type:l.bgPos}],B=[{name:"position",type:l.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:l.size,triggersBounds:u.any},{name:"min-width-bias-left",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:l.size,triggersBounds:u.any},{name:"min-height-bias-top",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:l.sizeMaybePercent,triggersBounds:u.any}],C=[{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"line-fill",type:l.fill},{name:"line-cap",type:l.lineCap},{name:"line-opacity",type:l.zeroOneNumber},{name:"line-dash-pattern",type:l.numbers},{name:"line-dash-offset",type:l.number},{name:"line-outline-width",type:l.size},{name:"line-outline-color",type:l.color},{name:"line-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelEdges:v(function(_,G){return _===G?!1:_==="bezier"||G==="bezier"},"triggersBoundsOfParallelEdges")},{name:"haystack-radius",type:l.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:l.size,triggersBounds:u.any},{name:"control-point-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-radii",type:l.numbers,triggersBounds:u.any},{name:"radius-type",type:l.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:l.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:l.size,triggersBounds:u.any},{name:"taxi-direction",type:l.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:l.number,triggersBounds:u.any},{name:"edge-distances",type:l.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:l.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:l.angle,triggersBounds:u.any},{name:"loop-sweep",type:l.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:l.size,triggersBounds:u.any},{name:"target-distance-from-node",type:l.size,triggersBounds:u.any}],P=[{name:"ghost",type:l.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:l.zeroOneNumber}],R=[{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}],A=[];Ze.pieBackgroundN=16,A.push({name:"pie-size",type:l.sizeMaybePercent}),A.push({name:"pie-hole",type:l.sizeMaybePercent}),A.push({name:"pie-start-angle",type:l.angle});for(var L=1;L<=Ze.pieBackgroundN;L++)A.push({name:"pie-"+L+"-background-color",type:l.color}),A.push({name:"pie-"+L+"-background-size",type:l.percent}),A.push({name:"pie-"+L+"-background-opacity",type:l.zeroOneNumber});var M=[];Ze.stripeBackgroundN=16,M.push({name:"stripe-size",type:l.sizeMaybePercent}),M.push({name:"stripe-direction",type:l.axisDirectionPrimary});for(var I=1;I<=Ze.stripeBackgroundN;I++)M.push({name:"stripe-"+I+"-background-color",type:l.color}),M.push({name:"stripe-"+I+"-background-size",type:l.percent}),M.push({name:"stripe-"+I+"-background-opacity",type:l.zeroOneNumber});var O=[],V=Ze.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill},{name:"arrow-width",type:l.arrowWidth}].forEach(function(N){V.forEach(function(_){var G=_+"-"+N.name,te=N.type,le=N.triggersBounds;O.push({name:G,type:te,triggersBounds:le})})},{});var q=Ze.properties=[].concat(p,b,y,m,w,P,d,g,f,c,h,S,T,E,D,A,M,B,C,O,R),F=Ze.propertyGroups={behavior:p,transition:b,visibility:y,overlay:m,underlay:w,ghost:P,commonLabel:d,labelDimensions:g,mainLabel:f,sourceLabel:c,targetLabel:h,nodeBody:S,nodeBorder:T,nodeOutline:E,backgroundImage:D,pie:A,stripe:M,compound:B,edgeLine:C,edgeArrow:O,core:R},H=Ze.propertyGroupNames={};(Ze.propertyGroupKeys=Object.keys(F)).forEach(function(N){H[N]=F[N].map(function(_){return _.name}),F[N].forEach(function(_){return _.groupKey=N})});var Q=Ze.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Ze.propertyNames=q.map(function(N){return N.name});for(var U=0;U<q.length;U++){var W=q[U];q[W.name]=W}for(var X=0;X<Q.length;X++){var re=Q[X],j=q[re.pointsTo],Z={name:re.name,alias:!0,pointsTo:j};q.push(Z),q[re.name]=Z}})();Ze.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};Ze.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=pe({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","text-metrics":"font","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(s,u){for(var l=1;l<=Ze.pieBackgroundN;l++){var f=u.name.replace("{{i}}",l);s[f]=u.value}return s},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(s,u){for(var l=1;l<=Ze.stripeBackgroundN;l++){var f=u.name.replace("{{i}}",l);s[f]=u.value}return s},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(s,u){return Ze.arrowPrefixes.forEach(function(l){var f=l+"-"+u.name;s[f]=u.value}),s},{})),r={},a=0;a<this.properties.length;a++){var n=this.properties[a];if(!n.pointsTo){var i=n.name,o=e[i];r[i]=this.parse(i,o)}}return t.defaultProperties=r,t.defaultProperties};Ze.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Hn={};Hn.parse=function(t,e,r,a){var n=this;if(We(e))return n.parseImplWarn(t,e,r,a);var i=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,o=r?"t":"f",s=vv(t,""+e,o,i),u=n.propCache=n.propCache||[],l;return(l=u[s])||(l=u[s]=n.parseImplWarn(t,e,r,a)),(r||a==="mapping")&&(l=Ft(l),l&&(l.value=Ft(l.value))),l};Hn.parseImplWarn=function(t,e,r,a){var n=this.parseImpl(t,e,r,a);return!n&&e!=null&&Oe("The style property `".concat(t,": ").concat(e,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&e==="label"&&Oe("The style value of `label` is deprecated for `"+n.name+"`"),n};Hn.parseImpl=function(t,e,r,a){var n=this;t=Yo(t);var i=n.properties[t],o=e,s=n.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var u=de(e);u&&(e=e.trim());var l=i.type;if(!l)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(We(e))return{name:t,value:e,strValue:"fn",mapped:s.fn,bypass:r};var f,c;if(!(!u||a||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(s.data.regex).exec(e))){if(r)return!1;var h=s.data;return{name:t,value:f,strValue:""+e,mapped:h,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(c=new RegExp(s.mapData.regex).exec(e))){if(r||l.multiple)return!1;var g=s.mapData;if(!(l.color||l.number))return!1;var d=this.parse(t,c[4]);if(!d||d.mapped)return!1;var p=this.parse(t,c[5]);if(!p||p.mapped)return!1;if(d.pfValue===p.pfValue||d.strValue===p.strValue)return Oe("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+d.strValue+"`"),this.parse(t,d.strValue);if(l.color){var y=d.value,m=p.value;if(y[0]===m[0]&&y[1]===m[1]&&y[2]===m[2]&&(y[3]===m[3]||(y[3]==null||y[3]===1)&&(m[3]==null||m[3]===1)))return!1}return{name:t,value:c,strValue:""+e,mapped:g,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:d.value,valueMax:p.value,bypass:r}}}if(l.multiple&&a!=="multiple"){var w;if(u?w=e.split(/\s+/):Fe(e)?w=e:w=[e],l.evenMultiple&&w.length%2!==0)return null;for(var b=[],x=[],S=[],T="",E=!1,D=0;D<w.length;D++){var B=n.parse(t,w[D],r,"multiple");E=E||de(B.value),b.push(B.value),S.push(B.pfValue!=null?B.pfValue:B.value),x.push(B.units),T+=(D>0?" ":"")+B.strValue}return l.validate&&!l.validate(b,x)?null:l.singleEnum&&E?b.length===1&&de(b[0])?{name:t,value:b[0],strValue:b[0],bypass:r}:null:{name:t,value:b,pfValue:S,strValue:T,bypass:r,units:x}}var C=v(function(){for(var j=0;j<l.enums.length;j++)if(l.enums[j]===e)return{name:t,value:e,strValue:""+e,bypass:r};return null},"checkEnums");if(l.number){var P,R="px";if(l.units&&(P=l.units),l.implicitUnits&&(R=l.implicitUnits),!l.unitless)if(u){var A="px|em"+(l.allowPercent?"|\\%":"");P&&(A=P);var L=e.match("^("+je+")("+A+")?$");L&&(e=L[1],P=L[2]||R)}else(!P||l.implicitUnits)&&(P=R);if(e=parseFloat(e),isNaN(e)&&l.enums===void 0)return null;if(isNaN(e)&&l.enums!==void 0)return e=o,C();if(l.integer&&!Jl(e)||l.min!==void 0&&(e<l.min||l.strictMin&&e===l.min)||l.max!==void 0&&(e>l.max||l.strictMax&&e===l.max))return null;var M={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return l.unitless||P!=="px"&&P!=="em"?M.pfValue=e:M.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(M.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(M.pfValue=P==="rad"?e:bh(e)),P==="%"&&(M.pfValue=e/100),M}else if(l.propList){var I=[],O=""+e;if(O!=="none"){for(var V=O.split(/\s*,\s*|\s+/),q=0;q<V.length;q++){var F=V[q].trim();n.properties[F]?I.push(F):Oe("`"+F+"` is not a valid property name")}if(I.length===0)return null}return{name:t,value:I,strValue:I.length===0?"none":I.join(" "),bypass:r}}else if(l.color){var H=av(e);return H?{name:t,value:H,pfValue:H,strValue:"rgb("+H[0]+","+H[1]+","+H[2]+")",bypass:r}:null}else if(l.regex||l.regexes){if(l.enums){var Q=C();if(Q)return Q}for(var U=l.regexes?l.regexes:[l.regex],W=0;W<U.length;W++){var X=new RegExp(U[W]).exec(e);if(X)return{name:t,value:l.singleRegexMatchValue?X[1]:X,strValue:""+e,bypass:r}}return null}else return l.string?{name:t,value:""+e,strValue:""+e,bypass:r}:l.enums?C():null};var nt=v(function(e){if(!(this instanceof nt))return new nt(e);if(!Ko(e)){He("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},"Style"),dt=nt.prototype;dt.instanceString=function(){return"style"};dt.clear=function(){for(var t=this._private,e=t.cy.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(e,!0),e.forEach(function(a){var n=a[0]._private;n.styleDirty=!0,n.appliedInitStyle=!1}),this};dt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};dt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};dt.selector=function(t){var e=t==="core"?null:new or(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};dt.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],a=0;a<t.properties.length;a++){var n=t.properties[a],i=r[n.name];i===void 0&&(i=r[An(n.name)]),i!==void 0&&this.cssRule(n.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};dt.style=dt.css;dt.cssRule=function(t,e){var r=this.parse(t,e);if(r){var a=this.length-1;this[a].properties.push(r),this[a].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.name.match(/stripe-(\d+)-background-size/)&&r.value&&(this._private.hasStripe=!0),r.mapped&&this[a].mappedProperties.push(r),this[a].selector||(this._private.coreStyle[r.name]=r)}return this};dt.append=function(t){return ev(t)?t.appendToStyle(this):Fe(t)?this.appendFromJson(t):de(t)&&this.appendFromString(t),this};nt.fromJson=function(t,e){var r=new nt(t);return r.fromJson(e),r};nt.fromString=function(t,e){return new nt(t).fromString(e)};[it,za,ls,Vt,Gn,vs,Ze,Hn].forEach(function(t){pe(dt,t)});nt.types=dt.types;nt.properties=dt.properties;nt.propertyGroups=dt.propertyGroups;nt.propertyGroupNames=dt.propertyGroupNames;nt.propertyGroupKeys=dt.propertyGroupKeys;var op={style:v(function(e){return e&&this.setStyle(e).update(),this._private.style},"style"),setStyle:v(function(e){var r=this._private;return ev(e)?r.style=e.generateStyle(this):Fe(e)?r.style=nt.fromJson(this,e):de(e)?r.style=nt.fromString(this,e):r.style=nt(this),r.style},"setStyle"),updateStyle:v(function(){this.mutableElements().updateStyle()},"updateStyle")},sp="single",Sr={autolock:v(function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},"autolock"),autoungrabify:v(function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},"autoungrabify"),autounselectify:v(function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},"autounselectify"),selectionType:v(function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=sp),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},"selectionType"),panningEnabled:v(function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},"panningEnabled"),userPanningEnabled:v(function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},"userPanningEnabled"),zoomingEnabled:v(function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},"zoomingEnabled"),userZoomingEnabled:v(function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},"userZoomingEnabled"),boxSelectionEnabled:v(function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},"boxSelectionEnabled"),pan:v(function(){var e=arguments,r=this._private.pan,a,n,i,o,s;switch(e.length){case 0:return r;case 1:if(de(e[0]))return a=e[0],r[a];if(Re(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,ae(o)&&(r.x=o),ae(s)&&(r.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[0],n=e[1],(a==="x"||a==="y")&&ae(n)&&(r[a]=n),this.emit("pan viewport")}return this.notify("viewport"),this},"pan"),panBy:v(function(e,r){var a=arguments,n=this._private.pan,i,o,s,u,l;if(!this._private.panningEnabled)return this;switch(a.length){case 1:Re(e)&&(s=a[0],u=s.x,l=s.y,ae(u)&&(n.x+=u),ae(l)&&(n.y+=l),this.emit("pan viewport"));break;case 2:i=e,o=r,(i==="x"||i==="y")&&ae(o)&&(n[i]+=o),this.emit("pan viewport")}return this.notify("viewport"),this},"panBy"),gc:v(function(){this.notify("gc")},"gc"),fit:v(function(e,r){var a=this.getFitViewport(e,r);if(a){var n=this._private;n.zoom=a.zoom,n.pan=a.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},"fit"),getFitViewport:v(function(e,r){if(ae(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var a;if(de(e)){var n=e;e=this.$(n)}else if(dc(e)){var i=e;a={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},a.w=a.x2-a.x1,a.h=a.y2-a.y1}else Tt(e)||(e=this.mutableElements());if(!(Tt(e)&&e.empty())){a=a||e.boundingBox();var o=this.width(),s=this.height(),u;if(r=ae(r)?r:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((o-2*r)/a.w,(s-2*r)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(o-u*(a.x1+a.x2))/2,y:(s-u*(a.y1+a.y2))/2};return{zoom:u,pan:l}}}}},"getFitViewport"),zoomRange:v(function(e,r){var a=this._private;if(r==null){var n=e;e=n.min,r=n.max}return ae(e)&&ae(r)&&e<=r?(a.minZoom=e,a.maxZoom=r):ae(e)&&r===void 0&&e<=a.maxZoom?a.minZoom=e:ae(r)&&e===void 0&&r>=a.minZoom&&(a.maxZoom=r),this},"zoomRange"),minZoom:v(function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},"minZoom"),maxZoom:v(function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},"maxZoom"),getZoomedViewport:v(function(e){var r=this._private,a=r.pan,n=r.zoom,i,o,s=!1;if(r.zoomingEnabled||(s=!0),ae(e)?o=e:Re(e)&&(o=e.level,e.position!=null?i=Ln(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(s=!0)),o=o>r.maxZoom?r.maxZoom:o,o=o<r.minZoom?r.minZoom:o,s||!ae(o)||o===n||i!=null&&(!ae(i.x)||!ae(i.y)))return null;if(i!=null){var u=a,l=n,f=o;return{zoomed:!0,panned:!0,zoom:f,pan:{x:-f/l*(i.x-u.x)+i.x,y:-f/l*(i.y-u.y)+i.y}}}else return{zoomed:!0,panned:!1,zoom:o,pan:a}},"getZoomedViewport"),zoom:v(function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),a=this._private;return r==null||!r.zoomed?this:(a.zoom=r.zoom,r.panned&&(a.pan.x=r.pan.x,a.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},"zoom"),viewport:v(function(e){var r=this._private,a=!0,n=!0,i=[],o=!1,s=!1;if(!e)return this;if(ae(e.zoom)||(a=!1),Re(e.pan)||(n=!1),!a&&!n)return this;if(a){var u=e.zoom;u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=u,i.push("zoom"))}if(n&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var l=e.pan;ae(l.x)&&(r.pan.x=l.x,s=!1),ae(l.y)&&(r.pan.y=l.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},"viewport"),center:v(function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},"center"),getCenterPan:v(function(e,r){if(this._private.panningEnabled){if(de(e)){var a=e;e=this.mutableElements().filter(a)}else Tt(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),o=this.height();return r=r===void 0?this._private.zoom:r,{x:(i-r*(n.x1+n.x2))/2,y:(o-r*(n.y1+n.y2))/2}}}},"getCenterPan"),reset:v(function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},"reset"),invalidateSize:v(function(){this._private.sizeCache=null},"invalidateSize"),size:v(function(){var e=this._private,r=e.container,a=this;return e.sizeCache=e.sizeCache||(r?(function(){var n=a.window().getComputedStyle(r),i=v(function(s){return parseFloat(n.getPropertyValue(s))},"val");return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},"size"),width:v(function(){return this.size().width},"width"),height:v(function(){return this.size().height},"height"),extent:v(function(){var e=this._private.pan,r=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/r,x2:(a.x2-e.x)/r,y1:(a.y1-e.y)/r,y2:(a.y2-e.y)/r};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},"extent"),renderedExtent:v(function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},"renderedExtent"),multiClickDebounceTime:v(function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this},"multiClickDebounceTime")};Sr.centre=Sr.center;Sr.autolockNodes=Sr.autolock;Sr.autoungrabifyNodes=Sr.autoungrabify;var Da={data:Ie.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ie.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ie.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ie.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Da.attr=Da.data;Da.removeAttr=Da.removeData;var Ba=v(function(e){var r=this;e=pe({},e);var a=e.container;a&&!gn(a)&&gn(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=r;var o=Je!==void 0&&a!==void 0&&!e.headless,s=e;s.layout=pe({name:o?"grid":"null"},s.layout),s.renderer=pe({name:o?"canvas":"null"},s.renderer);var u=v(function(d,p,y){return p!==void 0?p:y!==void 0?y:d},"defVal"),l=this._private={container:a,ready:!1,options:s,elements:new lt(this),listeners:[],aniEles:new lt(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,s.zoomingEnabled),userZoomingEnabled:u(!0,s.userZoomingEnabled),panningEnabled:u(!0,s.panningEnabled),userPanningEnabled:u(!0,s.userPanningEnabled),boxSelectionEnabled:u(!0,s.boxSelectionEnabled),autolock:u(!1,s.autolock,s.autolockNodes),autoungrabify:u(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:u(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:ae(s.zoom)?s.zoom:1,pan:{x:Re(s.pan)&&ae(s.pan.x)?s.pan.x:0,y:Re(s.pan)&&ae(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var f=v(function(d,p){if(d.some(gc))return ea.all(d).then(p);p(d)},"loadExtData");l.styleEnabled&&r.setStyle([]);var c=pe({},s,s.renderer);r.initRenderer(c);var h=v(function(d,p,y){r.notifications(!1);var m=r.mutableElements();m.length>0&&m.remove(),d!=null&&(Re(d)||Fe(d))&&r.add(d),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",p),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var w=pe({},r._private.options.layout);w.eles=r.elements(),r.layout(w).run()},"setElesAndLayout");f([s.style,s.elements],function(g){var d=g[0],p=g[1];l.styleEnabled&&r.style().append(d),h(p,function(){r.startAnimationLoop(),l.ready=!0,We(s.ready)&&r.on("ready",s.ready);for(var y=0;y<i.length;y++){var m=i[y];r.on("ready",m)}n&&(n.readies=[]),r.emit("ready")},s.done)})},"Core"),Tn=Ba.prototype;pe(Tn,{instanceString:v(function(){return"core"},"instanceString"),isReady:v(function(){return this._private.ready},"isReady"),destroyed:v(function(){return this._private.destroyed},"destroyed"),ready:v(function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},"ready"),destroy:v(function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},"destroy"),hasElementWithId:v(function(e){return this._private.elements.hasElementWithId(e)},"hasElementWithId"),getElementById:v(function(e){return this._private.elements.getElementById(e)},"getElementById"),hasCompoundNodes:v(function(){return this._private.hasCompoundNodes},"hasCompoundNodes"),headless:v(function(){return this._private.renderer.isHeadless()},"headless"),styleEnabled:v(function(){return this._private.styleEnabled},"styleEnabled"),addToPool:v(function(e){return this._private.elements.merge(e),this},"addToPool"),removeFromPool:v(function(e){return this._private.elements.unmerge(e),this},"removeFromPool"),container:v(function(){return this._private.container||null},"container"),window:v(function(){if(this._private.container==null)return Je;var e=this._private.container.ownerDocument;return e===void 0||e==null?Je:e.defaultView||Je},"window"),mount:v(function(e){if(e!=null){var r=this,a=r._private,n=a.options;return!gn(e)&&gn(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),a.container=e,a.styleEnabled=!0,r.invalidateSize(),r.initRenderer(pe({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),r.startAnimationLoop(),r.style(n.style),r.emit("mount"),r}},"mount"),unmount:v(function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},"unmount"),options:v(function(){return Ft(this._private.options)},"options"),json:v(function(e){var r=this,a=r._private,n=r.mutableElements(),i=v(function(x){return r.getElementById(x.id())},"getFreshRef");if(Re(e)){if(r.startBatch(),e.elements){var o={},s=v(function(x,S){for(var T=[],E=[],D=0;D<x.length;D++){var B=x[D];if(!B.data.id){Oe("cy.json() cannot handle elements without an ID attribute");continue}var C=""+B.data.id,P=r.getElementById(C);o[C]=!0,P.length!==0?E.push({ele:P,json:B}):(S&&(B.group=S),T.push(B))}r.add(T);for(var R=0;R<E.length;R++){var A=E[R],L=A.ele,M=A.json;L.json(M)}},"updateEles");if(Fe(e.elements))s(e.elements);else for(var u=["nodes","edges"],l=0;l<u.length;l++){var f=u[l],c=e.elements[f];Fe(c)&&s(c,f)}var h=r.collection();n.filter(function(b){return!o[b.id()]}).forEach(function(b){b.isParent()?h.merge(b):b.remove()}),h.forEach(function(b){return b.children().move({parent:null})}),h.forEach(function(b){return i(b).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==a.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var g=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],d=0;d<g.length;d++){var p=g[d];e[p]!=null&&r[p](e[p])}return r.endBatch(),this}else{var y=!!e,m={};y?m.elements=this.elements().map(function(b){return b.json()}):(m.elements={},n.forEach(function(b){var x=b.group();m.elements[x]||(m.elements[x]=[]),m.elements[x].push(b.json())})),this._private.styleEnabled&&(m.style=r.style().json()),m.data=Ft(r.data());var w=a.options;return m.zoomingEnabled=a.zoomingEnabled,m.userZoomingEnabled=a.userZoomingEnabled,m.zoom=a.zoom,m.minZoom=a.minZoom,m.maxZoom=a.maxZoom,m.panningEnabled=a.panningEnabled,m.userPanningEnabled=a.userPanningEnabled,m.pan=Ft(a.pan),m.boxSelectionEnabled=a.boxSelectionEnabled,m.renderer=Ft(w.renderer),m.hideEdgesOnViewport=w.hideEdgesOnViewport,m.textureOnViewport=w.textureOnViewport,m.wheelSensitivity=w.wheelSensitivity,m.motionBlur=w.motionBlur,m.multiClickDebounceTime=w.multiClickDebounceTime,m}},"json")});Tn.$id=Tn.getElementById;[Zg,tp,tf,Oo,ln,ap,No,vn,op,Sr,Da].forEach(function(t){pe(Tn,t)});var up={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:v(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:v(function(e,r){return r},"transform")},lp={maximal:!1,acyclic:!1},Ir=v(function(e){return e.scratch("breadthfirst")},"getInfo"),xl=v(function(e,r){return e.scratch("breadthfirst",r)},"setInfo");function rf(t){this.options=pe({},up,lp,t)}v(rf,"BreadthFirstLayout");rf.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=r.nodes().filter(function(ve){return ve.isChildless()}),n=r,i=t.directed,o=t.acyclic||t.maximal||t.maximalAdjustments>0,s=!!t.boundingBox,u=mt(s?t.boundingBox:structuredClone(e.extent())),l;if(Tt(t.roots))l=t.roots;else if(Fe(t.roots)){for(var f=[],c=0;c<t.roots.length;c++){var h=t.roots[c],g=e.getElementById(h);f.push(g)}l=e.collection(f)}else if(de(t.roots))l=e.$(t.roots);else if(i)l=a.roots();else{var d=r.components();l=e.collection();for(var p=v(function(){var ne=d[y],he=ne.maxDegree(!1),ye=ne.filter(function(me){return me.degree(!1)===he});l=l.add(ye)},"_loop"),y=0;y<d.length;y++)p()}var m=[],w={},b=v(function(ne,he){m[he]==null&&(m[he]=[]);var ye=m[he].length;m[he].push(ne),xl(ne,{index:ye,depth:he})},"addToDepth"),x=v(function(ne,he){var ye=Ir(ne),me=ye.depth,ge=ye.index;m[me][ge]=null,ne.isChildless()&&b(ne,he)},"changeDepth");n.bfs({roots:l,directed:t.directed,visit:v(function(ne,he,ye,me,ge){var Se=ne[0],Be=Se.id();Se.isChildless()&&b(Se,ge),w[Be]=!0},"visit")});for(var S=[],T=0;T<a.length;T++){var E=a[T];w[E.id()]||S.push(E)}var D=v(function(ne){for(var he=m[ne],ye=0;ye<he.length;ye++){var me=he[ye];if(me==null){he.splice(ye,1),ye--;continue}xl(me,{depth:ne,index:ye})}},"assignDepthsAt"),B=v(function(ne,he){for(var ye=Ir(ne),me=ne.incomers().filter(function(ie){return ie.isNode()&&r.has(ie)}),ge=-1,Se=ne.id(),Be=0;Be<me.length;Be++){var ke=me[Be],Ve=Ir(ke);ge=Math.max(ge,Ve.depth)}if(ye.depth<=ge){if(!t.acyclic&&he[Se])return null;var we=ge+1;return x(ne,we),he[Se]=we,!0}return!1},"adjustMaximally");if(i&&o){var C=[],P={},R=v(function(ne){return C.push(ne)},"enqueue"),A=v(function(){return C.shift()},"dequeue");for(a.forEach(function(ve){return C.push(ve)});C.length>0;){var L=A(),M=B(L,P);if(M)L.outgoers().filter(function(ve){return ve.isNode()&&r.has(ve)}).forEach(R);else if(M===null){Oe("Detected double maximal shift for node `"+L.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var I=0;if(t.avoidOverlap)for(var O=0;O<a.length;O++){var V=a[O].layoutDimensions(t),q=V.w,F=V.h;I=Math.max(I,q,F)}var H={},Q=v(function(ne){if(H[ne.id()])return H[ne.id()];for(var he=Ir(ne).depth,ye=ne.neighborhood(),me=0,ge=0,Se=0;Se<ye.length;Se++){var Be=ye[Se];if(!(Be.isEdge()||Be.isParent()||!a.has(Be))){var ke=Ir(Be);if(ke!=null){var Ve=ke.index,we=ke.depth;if(!(Ve==null||we==null)){var ie=m[we].length;we<he&&(me+=Ve/ie,ge++)}}}}return ge=Math.max(1,ge),me=me/ge,ge===0&&(me=0),H[ne.id()]=me,me},"getWeightedPercent"),U=v(function(ne,he){var ye=Q(ne)-Q(he);return ye===0?rv(ne.id(),he.id()):ye},"sortFn");t.depthSort!==void 0&&(U=t.depthSort);for(var W=m.length,X=0;X<W;X++)m[X].sort(U),D(X);for(var re=[],j=0;j<S.length;j++)re.push(S[j]);var Z=v(function(){for(var ne=0;ne<W;ne++)D(ne)},"assignDepths");re.length&&(m.unshift(re),W=m.length,Z());for(var N=0,_=0;_<W;_++)N=Math.max(m[_].length,N);var G={x:u.x1+u.w/2,y:u.y1+u.h/2},te=a.reduce(function(ve,ne){return(function(he){return{w:ve.w===-1?he.w:(ve.w+he.w)/2,h:ve.h===-1?he.h:(ve.h+he.h)/2}})(ne.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),le=Math.max(W===1?0:s?(u.h-t.padding*2-te.h)/(W-1):(u.h-t.padding*2-te.h)/(W+1),I),xe=m.reduce(function(ve,ne){return Math.max(ve,ne.length)},0),be=v(function(ne){var he=Ir(ne),ye=he.depth,me=he.index;if(t.circle){var ge=Math.min(u.w/2/W,u.h/2/W);ge=Math.max(ge,I);var Se=ge*ye+ge-(W>0&&m[0].length<=3?ge/2:0),Be=2*Math.PI/m[ye].length*me;return ye===0&&m[0].length===1&&(Se=1),{x:G.x+Se*Math.cos(Be),y:G.y+Se*Math.sin(Be)}}else{var ke=m[ye].length,Ve=Math.max(ke===1?0:s?(u.w-t.padding*2-te.w)/((t.grid?xe:ke)-1):(u.w-t.padding*2-te.w)/((t.grid?xe:ke)+1),I);return{x:G.x+(me+1-(ke+1)/2)*Ve,y:G.y+(ye+1-(W+1)/2)*le}}},"getPositionTopBottom"),De={downward:0,leftward:90,upward:180,rightward:-90};return Object.keys(De).indexOf(t.direction)===-1&&He("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(De).join(", "))),r.nodes().layoutPositions(this,t,v(function(ne){return Hc(be(ne),u,De[t.direction])},"getPosition")),this};var vp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:v(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:v(function(e,r){return r},"transform")};function af(t){this.options=pe({},vp,t)}v(af,"CircleLayout");af.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=mt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=(e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep)/Math.max(1,i.length-1),l,f=0,c=0;c<i.length;c++){var h=i[c].layoutDimensions(e),g=h.w,d=h.h;f=Math.max(f,g,d)}if(ae(e.radius)?l=e.radius:i.length<=1?l=0:l=Math.min(o.h,o.w)/2-f,i.length>1&&e.avoidOverlap){f*=1.75;var p=Math.cos(u)-Math.cos(0),y=Math.sin(u)-Math.sin(0),m=Math.sqrt(f*f/(p*p+y*y));l=Math.max(m,l)}return a.nodes().layoutPositions(this,e,v(function(b,x){var S=e.startAngle+x*u*(n?1:-1),T=l*Math.cos(S),E=l*Math.sin(S);return{x:s.x+T,y:s.y+E}},"getPos")),this};var fp={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:v(function(e){return e.degree()},"concentric"),levelWidth:v(function(e){return e.maxDegree()/4},"levelWidth"),animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:v(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:v(function(e,r){return r},"transform")};function nf(t){this.options=pe({},fp,t)}v(nf,"ConcentricLayout");nf.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=t.cy,n=e.eles,i=n.nodes().not(":parent"),o=mt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=[],l=0,f=0;f<i.length;f++){var c=i[f],h=void 0;h=e.concentric(c),u.push({value:h,node:c}),c._private.scratch.concentric=h}i.updateStyle();for(var g=0;g<i.length;g++){var d=i[g].layoutDimensions(e);l=Math.max(l,d.w,d.h)}u.sort(function(N,_){return _.value-N.value});for(var p=e.levelWidth(i),y=[[]],m=y[0],w=0;w<u.length;w++){var b=u[w];m.length>0&&Math.abs(m[0].value-b.value)>=p&&(m=[],y.push(m)),m.push(b)}var x=l+e.minNodeSpacing;if(!e.avoidOverlap){var S=y.length>0&&y[0].length>1,T=(Math.min(o.w,o.h)/2-x)/(y.length+S?1:0);x=Math.min(x,T)}for(var E=0,D=0;D<y.length;D++){var B=y[D],C=B.dTheta=(e.sweep===void 0?2*Math.PI-2*Math.PI/B.length:e.sweep)/Math.max(1,B.length-1);if(B.length>1&&e.avoidOverlap){var P=Math.cos(C)-Math.cos(0),R=Math.sin(C)-Math.sin(0),A=Math.sqrt(x*x/(P*P+R*R));E=Math.max(A,E)}B.r=E,E+=x}if(e.equidistant){for(var L=0,M=0,I=0;I<y.length;I++){var O=y[I].r-M;L=Math.max(L,O)}M=0;for(var V=0;V<y.length;V++){var q=y[V];V===0&&(M=q.r),q.r=M,M+=L}}for(var F={},H=0;H<y.length;H++)for(var Q=y[H],U=Q.dTheta,W=Q.r,X=0;X<Q.length;X++){var re=Q[X],j=e.startAngle+(r?1:-1)*U*X,Z={x:s.x+W*Math.cos(j),y:s.y+W*Math.sin(j)};F[re.node.id()]=Z}return n.nodes().layoutPositions(this,e,function(N){return F[N.id()]}),this};var yo,cp={ready:v(function(){},"ready"),stop:v(function(){},"stop"),animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:v(function(e,r){return!0},"animateFilter"),animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:v(function(e){return 2048},"nodeRepulsion"),nodeOverlap:4,idealEdgeLength:v(function(e){return 32},"idealEdgeLength"),edgeElasticity:v(function(e){return 32},"edgeElasticity"),nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function $n(t){this.options=pe({},cp,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges().filter(function(a){var n=a.source().data("id"),i=a.target().data("id"),o=e.some(function(u){return u.data("id")===n}),s=e.some(function(u){return u.data("id")===i});return!o||!s});this.options.eles=this.options.eles.not(r)}v($n,"CoseLayout");$n.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?yo=!0:yo=!1;var a=hp(e,r,t);yo&&gp(a),t.randomize&&pp(a);var n=$t(),i=v(function(){yp(a,e,t),t.fit===!0&&e.fit(t.padding)},"refresh"),o=v(function(h){return!(r.stopped||h>=t.numIter||(mp(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature<t.minTemp))},"mainLoop"),s=v(function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var h=t.eles.nodes(),g=sf(a,t,h);h.layoutPositions(r,t,g)}},"done"),u=0,l=!0;if(t.animate===!0){var f=v(function(){for(var h=0;l&&h<t.refresh;)l=o(u),u++,h++;l?($t()-n>=t.animationThreshold&&i(),pn(f)):(Cl(a,t),s())},"frame");f()}else{for(;l;)l=o(u),u++;Cl(a,t),s()}return this};$n.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};$n.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var hp=v(function(e,r,a){for(var n=a.eles.edges(),i=a.eles.nodes(),o=mt(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},u=a.eles.components(),l={},f=0;f<u.length;f++)for(var c=u[f],h=0;h<c.length;h++){var g=c[h];l[g.id()]=f}for(var f=0;f<s.nodeSize;f++){var d=i[f],p=d.layoutDimensions(a),y={};y.isLocked=d.locked(),y.id=d.data("id"),y.parentId=d.data("parent"),y.cmptId=l[d.id()],y.children=[],y.positionX=d.position("x"),y.positionY=d.position("y"),y.offsetX=0,y.offsetY=0,y.height=p.w,y.width=p.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(d.style("padding")),y.padRight=parseFloat(d.style("padding")),y.padTop=parseFloat(d.style("padding")),y.padBottom=parseFloat(d.style("padding")),y.nodeRepulsion=We(a.nodeRepulsion)?a.nodeRepulsion(d):a.nodeRepulsion,s.layoutNodes.push(y),s.idToIndex[y.id]=f}for(var m=[],w=0,b=-1,x=[],f=0;f<s.nodeSize;f++){var d=s.layoutNodes[f],S=d.parentId;S!=null?s.layoutNodes[s.idToIndex[S]].children.push(d.id):(m[++b]=d.id,x.push(d.id))}for(s.graphSet.push(x);w<=b;){var T=m[w++],E=s.idToIndex[T],g=s.layoutNodes[E],D=g.children;if(D.length>0){s.graphSet.push(D);for(var f=0;f<D.length;f++)m[++b]=D[f]}}for(var f=0;f<s.graphSet.length;f++)for(var B=s.graphSet[f],h=0;h<B.length;h++){var C=s.idToIndex[B[h]];s.indexToGraph[C]=f}for(var f=0;f<s.edgeSize;f++){var P=n[f],R={};R.id=P.data("id"),R.sourceId=P.data("source"),R.targetId=P.data("target");var A=We(a.idealEdgeLength)?a.idealEdgeLength(P):a.idealEdgeLength,L=We(a.edgeElasticity)?a.edgeElasticity(P):a.edgeElasticity,M=s.idToIndex[R.sourceId],I=s.idToIndex[R.targetId];if(s.indexToGraph[M]!=s.indexToGraph[I]){for(var O=dp(R.sourceId,R.targetId,s),V=s.graphSet[O],q=0,y=s.layoutNodes[M];V.indexOf(y.id)===-1;)y=s.layoutNodes[s.idToIndex[y.parentId]],q++;for(y=s.layoutNodes[I];V.indexOf(y.id)===-1;)y=s.layoutNodes[s.idToIndex[y.parentId]],q++;A*=q*a.nestingFactor}R.idealLength=A,R.elasticity=L,s.layoutEdges.push(R)}return s},"createLayoutInfo"),dp=v(function(e,r,a){var n=of(e,r,0,a);return 2>n.count?0:n.graph},"findLCA"),of=v(function(e,r,a,n){var i=n.graphSet[a];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:a};for(var o=0,s=0;s<i.length;s++){var u=i[s],l=n.idToIndex[u],f=n.layoutNodes[l].children;if(f.length!==0){var c=n.indexToGraph[n.idToIndex[f[0]]],h=of(e,r,c,n);if(h.count!==0)if(h.count===1){if(o++,o===2)break}else return h}}return{count:o,graph:a}},"findLCA_aux"),gp,pp=v(function(e,r){for(var a=e.clientWidth,n=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*a,o.positionY=Math.random()*n)}},"randomizePositions"),sf=v(function(e,r,a){var n=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(a.forEach(function(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var u=e.layoutNodes[e.idToIndex[o.data("id")]];if(r.boundingBox){var l=i.w===0?.5:(u.positionX-i.x1)/i.w,f=i.h===0?.5:(u.positionY-i.y1)/i.h;return{x:n.x1+l*n.w,y:n.y1+f*n.h}}else return{x:u.positionX,y:u.positionY}}},"getScaleInBoundsFn"),yp=v(function(e,r,a){var n=a.layout,i=a.eles.nodes(),o=sf(e,a,i);i.positions(o),e.ready!==!0&&(e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this}))},"refreshPositions"),mp=v(function(e,r,a){bp(e,r),Ep(e),Cp(e,r),Tp(e),Sp(e)},"step"),bp=v(function(e,r){for(var a=0;a<e.graphSet.length;a++)for(var n=e.graphSet[a],i=n.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[n[o]]],u=o+1;u<i;u++){var l=e.layoutNodes[e.idToIndex[n[u]]];wp(s,l,e,r)}},"calculateNodeForces"),El=v(function(e){return-e+2*e*Math.random()},"randomDistance"),wp=v(function(e,r,a,n){if(!(e.cmptId!==r.cmptId&&!a.isCompound)){var i=r.positionX-e.positionX,o=r.positionY-e.positionY,s=1;i===0&&o===0&&(i=El(s),o=El(s));var u=xp(e,r,i,o);if(u>0)var l=n.nodeOverlap*u,f=Math.sqrt(i*i+o*o),c=l*i/f,h=l*o/f;else var g=Sn(e,i,o),d=Sn(r,-1*i,-1*o),p=d.x-g.x,y=d.y-g.y,m=p*p+y*y,f=Math.sqrt(m),l=(e.nodeRepulsion+r.nodeRepulsion)/m,c=l*p/f,h=l*y/f;e.isLocked||(e.offsetX-=c,e.offsetY-=h),r.isLocked||(r.offsetX+=c,r.offsetY+=h)}},"nodeRepulsion"),xp=v(function(e,r,a,n){if(a>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(n>0)var o=e.maxY-r.minY;else var o=r.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},"nodesOverlap"),Sn=v(function(e,r,a){var n=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,u=a/r,l=o/s,f={};return r===0&&0<a||r===0&&0>a?(f.x=n,f.y=i+o/2,f):0<r&&-1*l<=u&&u<=l?(f.x=n+s/2,f.y=i+s*a/2/r,f):0>r&&-1*l<=u&&u<=l?(f.x=n-s/2,f.y=i-s*a/2/r,f):0<a&&(u<=-1*l||u>=l)?(f.x=n+o*r/2/a,f.y=i+o/2,f):(0>a&&(u<=-1*l||u>=l)&&(f.x=n-o*r/2/a,f.y=i-o/2),f)},"findClippingPoint"),Ep=v(function(e,r){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],i=e.idToIndex[n.sourceId],o=e.layoutNodes[i],s=e.idToIndex[n.targetId],u=e.layoutNodes[s],l=u.positionX-o.positionX,f=u.positionY-o.positionY;if(!(l===0&&f===0)){var c=Sn(o,l,f),h=Sn(u,-1*l,-1*f),g=h.x-c.x,d=h.y-c.y,p=Math.sqrt(g*g+d*d),y=Math.pow(n.idealLength-p,2)/n.elasticity;if(p!==0)var m=y*g/p,w=y*d/p;else var m=0,w=0;o.isLocked||(o.offsetX+=m,o.offsetY+=w),u.isLocked||(u.offsetX-=m,u.offsetY-=w)}}},"calculateEdgeForces"),Cp=v(function(e,r){if(r.gravity!==0)for(var a=1,n=0;n<e.graphSet.length;n++){var i=e.graphSet[n],o=i.length;if(n===0)var s=e.clientHeight/2,u=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[l.parentId]],s=f.positionX,u=f.positionY;for(var c=0;c<o;c++){var h=e.layoutNodes[e.idToIndex[i[c]]];if(!h.isLocked){var g=s-h.positionX,d=u-h.positionY,p=Math.sqrt(g*g+d*d);if(p>a){var y=r.gravity*g/p,m=r.gravity*d/p;h.offsetX+=y,h.offsetY+=m}}}}},"calculateGravityForces"),Tp=v(function(e,r){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var o=a[n++],s=e.idToIndex[o],u=e.layoutNodes[s],l=u.children;if(0<l.length&&!u.isLocked){for(var f=u.offsetX,c=u.offsetY,h=0;h<l.length;h++){var g=e.layoutNodes[e.idToIndex[l[h]]];g.offsetX+=f,g.offsetY+=c,a[++i]=l[h]}u.offsetX=0,u.offsetY=0}}},"propagateForces"),Sp=v(function(e,r){for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&(n.maxX=void 0,n.minX=void 0,n.maxY=void 0,n.minY=void 0)}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(!(0<n.children.length||n.isLocked)){var i=Dp(n.offsetX,n.offsetY,e.temperature);n.positionX+=i.x,n.positionY+=i.y,n.offsetX=0,n.offsetY=0,n.minX=n.positionX-n.width,n.maxX=n.positionX+n.width,n.minY=n.positionY-n.height,n.maxY=n.positionY+n.height,uf(n,e)}}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&!n.isLocked&&(n.positionX=(n.maxX+n.minX)/2,n.positionY=(n.maxY+n.minY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY)}},"updatePositions"),Dp=v(function(e,r,a){var n=Math.sqrt(e*e+r*r);if(n>a)var i={x:a*e/n,y:a*r/n};else var i={x:e,y:r};return i},"limitForce"),uf=v(function(e,r){var a=e.parentId;if(a!=null){var n=r.layoutNodes[r.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeft<n.minX)&&(n.minX=e.minX-n.padLeft,i=!0),(n.maxY==null||e.maxY+n.padBottom>n.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTop<n.minY)&&(n.minY=e.minY-n.padTop,i=!0),i)return uf(n,r)}},"updateAncestryBoundaries"),Cl=v(function(e,r){for(var a=e.layoutNodes,n=[],i=0;i<a.length;i++){var o=a[i],s=o.cmptId;(n[s]=n[s]||[]).push(o)}for(var u=0,i=0;i<n.length;i++){var l=n[i];if(l){l.x1=1/0,l.x2=-1/0,l.y1=1/0,l.y2=-1/0;for(var f=0;f<l.length;f++){var c=l[f];l.x1=Math.min(l.x1,c.positionX-c.width/2),l.x2=Math.max(l.x2,c.positionX+c.width/2),l.y1=Math.min(l.y1,c.positionY-c.height/2),l.y2=Math.max(l.y2,c.positionY+c.height/2)}l.w=l.x2-l.x1,l.h=l.y2-l.y1,u+=l.w*l.h}}n.sort(function(m,w){return w.w*w.h-m.w*m.h});for(var h=0,g=0,d=0,p=0,y=Math.sqrt(u)*e.clientWidth/e.clientHeight,i=0;i<n.length;i++){var l=n[i];if(l){for(var f=0;f<l.length;f++){var c=l[f];c.isLocked||(c.positionX+=h-l.x1,c.positionY+=g-l.y1)}h+=l.w+r.componentSpacing,d+=l.w+r.componentSpacing,p=Math.max(p,l.h),d>y&&(g+=p+r.componentSpacing,h=0,d=0,p=0)}}},"separateComponents"),Bp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:v(function(e){},"position"),sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:v(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:v(function(e,r){return r},"transform")};function lf(t){this.options=pe({},Bp,t)}v(lf,"GridLayout");lf.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=mt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(Q){return{x:i.x1,y:i.y1}});else{var o=n.size(),s=Math.sqrt(o*i.h/i.w),u=Math.round(s),l=Math.round(i.w/i.h*s),f=v(function(U){if(U==null)return Math.min(u,l);Math.min(u,l)==u?u=U:l=U},"small"),c=v(function(U){if(U==null)return Math.max(u,l);Math.max(u,l)==u?u=U:l=U},"large"),h=e.rows,g=e.cols!=null?e.cols:e.columns;if(h!=null&&g!=null)u=h,l=g;else if(h!=null&&g==null)u=h,l=Math.ceil(o/u);else if(h==null&&g!=null)l=g,u=Math.ceil(o/l);else if(l*u>o){var d=f(),p=c();(d-1)*p>=o?f(d-1):(p-1)*d>=o&&c(p-1)}else for(;l*u<o;){var y=f(),m=c();(m+1)*y>=o?c(m+1):f(y+1)}var w=i.w/l,b=i.h/u;if(e.condense&&(w=0,b=0),e.avoidOverlap)for(var x=0;x<n.length;x++){var S=n[x],T=S._private.position;(T.x==null||T.y==null)&&(T.x=0,T.y=0);var E=S.layoutDimensions(e),D=e.avoidOverlapPadding,B=E.w+D,C=E.h+D;w=Math.max(w,B),b=Math.max(b,C)}for(var P={},R=v(function(U,W){return!!P["c-"+U+"-"+W]},"used"),A=v(function(U,W){P["c-"+U+"-"+W]=!0},"use"),L=0,M=0,I=v(function(){M++,M>=l&&(M=0,L++)},"moveToNextCell"),O={},V=0;V<n.length;V++){var q=n[V],F=e.position(q);if(F&&(F.row!==void 0||F.col!==void 0)){var H={row:F.row,col:F.col};if(H.col===void 0)for(H.col=0;R(H.row,H.col);)H.col++;else if(H.row===void 0)for(H.row=0;R(H.row,H.col);)H.row++;O[q.id()]=H,A(H.row,H.col)}}n.layoutPositions(this,e,v(function(U,W){var X,re;if(U.locked()||U.isParent())return!1;var j=O[U.id()];if(j)X=j.col*w+w/2+i.x1,re=j.row*b+b/2+i.y1;else{for(;R(L,M);)I();X=M*w+w/2+i.x1,re=L*b+b/2+i.y1,A(L,M),I()}return{x:X,y:re}},"getPos"))}return this};var kp={ready:v(function(){},"ready"),stop:v(function(){},"stop")};function fs(t){this.options=pe({},kp,t)}v(fs,"NullLayout");fs.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};fs.prototype.stop=function(){return this};var Pp={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:v(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:v(function(e,r){return r},"transform")};function vf(t){this.options=pe({},Pp,t)}v(vf,"PresetLayout");vf.prototype.run=function(){var t=this.options,e=t.eles.nodes(),r=We(t.positions);function a(n){if(t.positions==null)return hh(n.position());if(r)return t.positions(n);var i=t.positions[n._private.data.id];return i??null}return v(a,"getPosition"),e.layoutPositions(this,t,function(n,i){var o=a(n);return n.locked()||o==null?!1:o}),this};var Ap={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:v(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:v(function(e,r){return r},"transform")};function ff(t){this.options=pe({},Ap,t)}v(ff,"RandomLayout");ff.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=mt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()});return r.nodes().layoutPositions(this,t,v(function(i,o){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}},"getPos")),this};var Rp=[{name:"breadthfirst",impl:rf},{name:"circle",impl:af},{name:"concentric",impl:nf},{name:"cose",impl:$n},{name:"grid",impl:lf},{name:"null",impl:fs},{name:"preset",impl:vf},{name:"random",impl:ff}];function cf(t){this.options=t,this.notifications=0}v(cf,"NullRenderer");var Tl=v(function(){},"noop"),Sl=v(function(){throw new Error("A headless instance can not render images")},"throwImgErr");cf.prototype={recalculateRenderedStyle:Tl,notify:v(function(){this.notifications++},"notify"),init:Tl,isHeadless:v(function(){return!0},"isHeadless"),png:Sl,jpg:Sl};var cs={};cs.arrowShapeWidth=.3;cs.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=v(function(l,f,c,h,g,d,p){var y=g.x-c/2-p,m=g.x+c/2+p,w=g.y-c/2-p,b=g.y+c/2+p;return y<=l&&l<=m&&w<=f&&f<=b},"bbCollide"),a=v(function(l,f,c,h,g){var d=l*Math.cos(h)-f*Math.sin(h),p=l*Math.sin(h)+f*Math.cos(h),y=d*c,m=p*c;return{x:y+g.x,y:m+g.y}},"transform"),n=v(function(l,f,c,h){for(var g=[],d=0;d<l.length;d+=2){var p=l[d],y=l[d+1];g.push(a(p,y,f,c,h))}return g},"transformPoints"),i=v(function(l){for(var f=[],c=0;c<l.length;c++){var h=l[c];f.push(h.x,h.y)}return f},"pointsToArr"),o=v(function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").pfValue*2},"standardGap"),s=v(function(l,f){de(f)&&(f=t[f]),t[l]=pe({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:v(function(h,g,d,p,y,m){return Et(h,g,i(n(this.points,d+2*m,p,y)))},"collide"),roughCollide:r,draw:v(function(h,g,d,p){var y=n(this.points,g,d,p);e.arrowShapeImpl("polygon")(h,y)},"draw"),spacing:v(function(h){return 0},"spacing"),gap:o},f)},"defineArrowShape");s("none",{collide:yn,roughCollide:yn,draw:Qo,spacing:Vs,gap:Vs}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:v(function(l,f,c,h,g){var d=n(this.points,f,c,h),p=this.controlPoint,y=a(p[0],p[1],f,c,h);e.arrowShapeImpl(this.name)(l,d,y)},"draw"),gap:v(function(l){return o(l)*.8},"gap")}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:v(function(l,f,c,h,g,d,p){var y=i(n(this.points,c+2*p,h,g)),m=i(n(this.pointsTee,c+2*p,h,g));return Et(l,f,y)||Et(l,f,m)},"collide"),draw:v(function(l,f,c,h,g){var d=n(this.points,f,c,h),p=n(this.pointsTee,f,c,h);e.arrowShapeImpl(this.name)(l,d,p)},"draw")}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:v(function(l,f,c,h,g,d,p){var y=g,m=Math.pow(y.x-l,2)+Math.pow(y.y-f,2)<=Math.pow((c+2*p)*this.radius,2);return Et(l,f,i(n(this.points,c+2*p,h,g)))||m},"collide"),draw:v(function(l,f,c,h,g){var d=n(this.pointsTr,f,c,h);e.arrowShapeImpl(this.name)(l,d,h.x,h.y,this.radius*f)},"draw"),spacing:v(function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius},"spacing")}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:v(function(l,f){var c=this.baseCrossLinePts.slice(),h=f/l,g=3,d=5;return c[g]=c[g]-h,c[d]=c[d]-h,c},"crossLinePts"),collide:v(function(l,f,c,h,g,d,p){var y=i(n(this.points,c+2*p,h,g)),m=i(n(this.crossLinePts(c,d),c+2*p,h,g));return Et(l,f,y)||Et(l,f,m)},"collide"),draw:v(function(l,f,c,h,g){var d=n(this.points,f,c,h),p=n(this.crossLinePts(f,g),f,c,h);e.arrowShapeImpl(this.name)(l,d,p)},"draw")}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:v(function(l){return o(l)*.525},"gap")}),s("circle",{radius:.15,collide:v(function(l,f,c,h,g,d,p){var y=g;return Math.pow(y.x-l,2)+Math.pow(y.y-f,2)<=Math.pow((c+2*p)*this.radius,2)},"collide"),draw:v(function(l,f,c,h,g){e.arrowShapeImpl(this.name)(l,h.x,h.y,this.radius*f)},"draw"),spacing:v(function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius},"spacing")}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:v(function(l){return 1},"spacing"),gap:v(function(l){return 1},"gap")}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:v(function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").value},"gap")}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:v(function(l){return .95*l.pstyle("width").pfValue*l.pstyle("arrow-scale").value},"gap")})};var Br={};Br.projectIntoViewport=function(t,e){var r=this.cy,a=this.findContainerClientCoords(),n=a[0],i=a[1],o=a[4],s=r.pan(),u=r.zoom();return[((t-n)/o-s.x)/u,((e-i)/o-s.y)/u]};Br.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),a=v(function(m){return parseFloat(r.getPropertyValue(m))},"styleValue"),n={left:a("padding-left"),right:a("padding-right"),top:a("padding-top"),bottom:a("padding-bottom")},i={left:a("border-left-width"),right:a("border-right-width"),top:a("border-top-width"),bottom:a("border-bottom-width")},o=t.clientWidth,s=t.clientHeight,u=n.left+n.right,l=n.top+n.bottom,f=i.left+i.right,c=e.width/(o+f),h=o-u,g=s-l,d=e.left+n.left+i.left,p=e.top+n.top+i.top;return this.containerBB=[d,p,h,g,c]};Br.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Br.findNearestElement=function(t,e,r,a){return this.findNearestElements(t,e,r,a)[0]};Br.findNearestElements=function(t,e,r,a){var n=this,i=this,o=i.getCachedZSortedEles(),s=[],u=i.cy.zoom(),l=i.cy.hasCompoundNodes(),f=(a?24:8)/u,c=(a?8:2)/u,h=(a?8:2)/u,g=1/0,d,p;r&&(o=o.interactive);function y(E,D){if(E.isNode()){if(p)return;p=E,s.push(E)}if(E.isEdge()&&(D==null||D<g))if(d){if(d.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value&&d.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value){for(var B=0;B<s.length;B++)if(s[B].isEdge()){s[B]=E,d=E,g=D??g;break}}}else s.push(E),d=E,g=D??g}v(y,"addEle");function m(E){var D=E.outerWidth()+2*c,B=E.outerHeight()+2*c,C=D/2,P=B/2,R=E.position(),A=E.pstyle("corner-radius").value==="auto"?"auto":E.pstyle("corner-radius").pfValue,L=E._private.rscratch;if(R.x-C<=t&&t<=R.x+C&&R.y-P<=e&&e<=R.y+P&&i.nodeShapes[n.getNodeShape(E)].checkPoint(t,e,0,D,B,R.x,R.y,A,L))return y(E,0),!0}v(m,"checkNode");function w(E){var D=E._private,B=D.rscratch,C=E.pstyle("width").pfValue,P=E.pstyle("arrow-scale").value,R=C/2+f,A=R*R,L=R*2,V=D.source,q=D.target,M;if(B.edgeType==="segments"||B.edgeType==="straight"||B.edgeType==="haystack"){for(var I=B.allpts,O=0;O+3<I.length;O+=2)if(kh(t,e,I[O],I[O+1],I[O+2],I[O+3],L)&&A>(M=Lh(t,e,I[O],I[O+1],I[O+2],I[O+3])))return y(E,M),!0}else if(B.edgeType==="bezier"||B.edgeType==="multibezier"||B.edgeType==="self"||B.edgeType==="compound"){for(var I=B.allpts,O=0;O+5<B.allpts.length;O+=4)if(Ph(t,e,I[O],I[O+1],I[O+2],I[O+3],I[O+4],I[O+5],L)&&A>(M=Mh(t,e,I[O],I[O+1],I[O+2],I[O+3],I[O+4],I[O+5])))return y(E,M),!0}for(var V=V||D.source,q=q||D.target,F=n.getArrowWidth(C,P),H=[{name:"source",x:B.arrowStartX,y:B.arrowStartY,angle:B.srcArrowAngle},{name:"target",x:B.arrowEndX,y:B.arrowEndY,angle:B.tgtArrowAngle},{name:"mid-source",x:B.midX,y:B.midY,angle:B.midsrcArrowAngle},{name:"mid-target",x:B.midX,y:B.midY,angle:B.midtgtArrowAngle}],O=0;O<H.length;O++){var Q=H[O],U=i.arrowShapes[E.pstyle(Q.name+"-arrow-shape").value],W=E.pstyle("width").pfValue;if(U.roughCollide(t,e,F,Q.angle,{x:Q.x,y:Q.y},W,f)&&U.collide(t,e,F,Q.angle,{x:Q.x,y:Q.y},W,f))return y(E),!0}l&&s.length>0&&(m(V),m(q))}v(w,"checkEdge");function b(E,D,B){return yt(E,D,B)}v(b,"preprop");function x(E,D){var B=E._private,C=h,P;D?P=D+"-":P="",E.boundingBox();var R=B.labelBounds[D||"main"],A=E.pstyle(P+"label").value;if(!(E.pstyle("text-events").strValue!=="yes"||!A)){var L=b(B.rscratch,"labelX",D),M=b(B.rscratch,"labelY",D),I=b(B.rscratch,"labelAngle",D),O=E.pstyle(P+"text-margin-x").pfValue,V=E.pstyle(P+"text-margin-y").pfValue,q=R.x1-C-O,F=R.x2+C-O,H=R.y1-C-V,Q=R.y2+C-V;if(I){var U=Math.cos(I),W=Math.sin(I),X=v(function(G,te){return G=G-L,te=te-M,{x:G*U-te*W+L,y:G*W+te*U+M}},"rotate"),re=X(q,H),j=X(q,Q),Z=X(F,H),N=X(F,Q);if(Et(t,e,[re.x+O,re.y+V,Z.x+O,Z.y+V,N.x+O,N.y+V,j.x+O,j.y+V]))return y(E),!0}else if(jt(R,t,e))return y(E),!0}}v(x,"checkLabel");for(var S=o.length-1;S>=0;S--){var T=o[S];T.isNode()?m(T)||x(T):w(T)||x(T)||x(T,"source")||x(T,"target")}return s};Br.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,i=2/this.cy.zoom(),o=[],s=Math.min(t,r),u=Math.max(t,r),l=Math.min(e,a),f=Math.max(e,a);t=s,r=u,e=l,a=f;var c=mt({x1:t,y1:e,x2:r,y2:a}),h=[{x:c.x1,y:c.y1},{x:c.x2,y:c.y1},{x:c.x2,y:c.y2},{x:c.x1,y:c.y2}],g=[[h[0],h[1]],[h[1],h[2]],[h[2],h[3]],[h[3],h[0]]];function d(G,te,le){return yt(G,te,le)}v(d,"preprop");function p(G,te){var le=G._private,xe=i,be="";G.boundingBox();var De=le.labelBounds.main;if(!De)return null;var ve=d(le.rscratch,"labelX",te),ne=d(le.rscratch,"labelY",te),he=d(le.rscratch,"labelAngle",te),ye=G.pstyle(be+"text-margin-x").pfValue,me=G.pstyle(be+"text-margin-y").pfValue,ge=De.x1-xe-ye,Se=De.x2+xe-ye,Be=De.y1-xe-me,ke=De.y2+xe-me;if(he){var Ve=Math.cos(he),we=Math.sin(he),ie=v(function(k,z){return k=k-ve,z=z-ne,{x:k*Ve-z*we+ve,y:k*we+z*Ve+ne}},"rotate");return[ie(ge,Be),ie(Se,Be),ie(Se,ke),ie(ge,ke)]}else return[{x:ge,y:Be},{x:Se,y:Be},{x:Se,y:ke},{x:ge,y:ke}]}v(p,"getRotatedLabelBox");function y(G,te,le,xe){function be(De,ve,ne){return(ne.y-De.y)*(ve.x-De.x)>(ve.y-De.y)*(ne.x-De.x)}return v(be,"ccw"),be(G,le,xe)!==be(te,le,xe)&&be(G,te,le)!==be(G,te,xe)}v(y,"doLinesIntersect");for(var m=0;m<n.length;m++){var w=n[m];if(w.isNode()){var b=w,x=b.pstyle("text-events").strValue==="yes",S=b.pstyle("box-selection").strValue,T=b.pstyle("box-select-labels").strValue==="yes";if(S==="none")continue;var E=(S==="overlap"||T)&&x,D=b.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:E});if(S==="contain"){var B=!1;if(T&&x){var C=p(b);C&&di(C,h)&&(o.push(b),B=!0)}!B&&mv(c,D)&&o.push(b)}else if(S==="overlap"&&ts(c,D)){var P=b.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1});if(di([{x:P.x1,y:P.y1},{x:P.x2,y:P.y1},{x:P.x2,y:P.y2},{x:P.x1,y:P.y2}],h))o.push(b);else{var R=p(b);R&&di(R,h)&&o.push(b)}}}else{var A=w,L=A._private,M=L.rscratch,I=A.pstyle("box-selection").strValue;if(I==="none")continue;if(I==="contain"){if(M.startX!=null&&M.startY!=null&&!jt(c,M.startX,M.startY)||M.endX!=null&&M.endY!=null&&!jt(c,M.endX,M.endY))continue;if(M.edgeType==="bezier"||M.edgeType==="multibezier"||M.edgeType==="self"||M.edgeType==="compound"||M.edgeType==="segments"||M.edgeType==="haystack"){for(var O=L.rstyle.bezierPts||L.rstyle.linePts||L.rstyle.haystackPts,V=!0,q=0;q<O.length;q++)if(!$s(c,O[q])){V=!1;break}V&&o.push(A)}else M.edgeType==="straight"&&o.push(A)}else if(I==="overlap"){var F=!1;if(M.startX!=null&&M.startY!=null&&M.endX!=null&&M.endY!=null&&(jt(c,M.startX,M.startY)||jt(c,M.endX,M.endY)))o.push(A),F=!0;else if(!F&&M.edgeType==="haystack"){for(var H=L.rstyle.haystackPts,Q=0;Q<H.length;Q++)if($s(c,H[Q])){o.push(A),F=!0;break}}if(!F){var U=L.rstyle.bezierPts||L.rstyle.linePts||L.rstyle.haystackPts;if((!U||U.length<2)&&M.edgeType==="straight"&&M.startX!=null&&M.startY!=null&&M.endX!=null&&M.endY!=null&&(U=[{x:M.startX,y:M.startY},{x:M.endX,y:M.endY}]),!U||U.length<2)continue;for(var W=0;W<U.length-1;W++){for(var X=U[W],re=U[W+1],j=0;j<g.length;j++){var Z=Qe(g[j],2),N=Z[0],_=Z[1];if(y(X,re,N,_)){o.push(A),F=!0;break}}if(F)break}}}}}return o};var Dn={};Dn.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",u,l,f,c,h,g,m,w;if(r?(f=e.haystackPts[0],c=e.haystackPts[1],h=e.haystackPts[2],g=e.haystackPts[3]):(f=e.arrowStartX,c=e.arrowStartY,h=e.arrowEndX,g=e.arrowEndY),m=e.midX,w=e.midY,i)u=f-e.segpts[0],l=c-e.segpts[1];else if(n||o||s||a){var d=e.allpts,p=at(d[0],d[2],d[4],.1),y=at(d[1],d[3],d[5],.1);u=f-p,l=c-y}else u=f-m,l=c-w;e.srcArrowAngle=$a(u,l);var m=e.midX,w=e.midY;if(r&&(m=(f+h)/2,w=(c+g)/2),u=h-f,l=g-c,i){var d=e.allpts;if(d.length/2%2===0){var b=d.length/2,x=b-2;u=d[b]-d[x],l=d[b+1]-d[x+1]}else if(e.isRound)u=e.midVector[1],l=-e.midVector[0];else{var b=d.length/2-1,x=b-2;u=d[b]-d[x],l=d[b+1]-d[x+1]}}else if(n||o||s){var d=e.allpts,S=e.ctrlpts,T,E,D,B;if(S.length/2%2===0){var C=d.length/2-1,P=C+2,R=P+2;T=at(d[C],d[P],d[R],0),E=at(d[C+1],d[P+1],d[R+1],0),D=at(d[C],d[P],d[R],1e-4),B=at(d[C+1],d[P+1],d[R+1],1e-4)}else{var P=d.length/2-1,C=P-2,R=P+2;T=at(d[C],d[P],d[R],.4999),E=at(d[C+1],d[P+1],d[R+1],.4999),D=at(d[C],d[P],d[R],.5),B=at(d[C+1],d[P+1],d[R+1],.5)}u=D-T,l=B-E}if(e.midtgtArrowAngle=$a(u,l),e.midDispX=u,e.midDispY=l,u*=-1,l*=-1,i){var d=e.allpts;if(d.length/2%2!==0){if(!e.isRound){var b=d.length/2-1,A=b+2;u=-(d[A]-d[b]),l=-(d[A+1]-d[b+1])}}}if(e.midsrcArrowAngle=$a(u,l),i)u=h-e.segpts[e.segpts.length-2],l=g-e.segpts[e.segpts.length-1];else if(n||o||s||a){var d=e.allpts,L=d.length,p=at(d[L-6],d[L-4],d[L-2],.9),y=at(d[L-5],d[L-3],d[L-1],.9);u=h-p,l=g-y}else u=h-m,l=g-w;e.tgtArrowAngle=$a(u,l)};Dn.getArrowWidth=Dn.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},a=r[t+", "+e];return a||(a=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=a,a)};var zo,Fo,Nt={},Dt={},Dl,Bl,wr,fn,Gt,gr,mr,It,Or,ja,hf,df,Vo,qo,kl,Pl=v(function(e,r,a){a.x=r.x-e.x,a.y=r.y-e.y,a.len=Math.sqrt(a.x*a.x+a.y*a.y),a.nx=a.x/a.len,a.ny=a.y/a.len,a.ang=Math.atan2(a.ny,a.nx)},"asVec"),Mp=v(function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},"invertVec"),Lp=v(function(e,r,a,n,i){if(e!==kl?Pl(r,e,Nt):Mp(Dt,Nt),Pl(r,a,Dt),Dl=Nt.nx*Dt.ny-Nt.ny*Dt.nx,Bl=Nt.nx*Dt.nx-Nt.ny*-Dt.ny,Gt=Math.asin(Math.max(-1,Math.min(1,Dl))),Math.abs(Gt)<1e-6){zo=r.x,Fo=r.y,mr=Or=0;return}wr=1,fn=!1,Bl<0?Gt<0?Gt=Math.PI+Gt:(Gt=Math.PI-Gt,wr=-1,fn=!0):Gt>0&&(wr=-1,fn=!0),r.radius!==void 0?Or=r.radius:Or=n,gr=Gt/2,ja=Math.min(Nt.len/2,Dt.len/2),i?(It=Math.abs(Math.cos(gr)*Or/Math.sin(gr)),It>ja?(It=ja,mr=Math.abs(It*Math.sin(gr)/Math.cos(gr))):mr=Or):(It=Math.min(ja,Or),mr=Math.abs(It*Math.sin(gr)/Math.cos(gr))),Vo=r.x+Dt.nx*It,qo=r.y+Dt.ny*It,zo=Vo-Dt.ny*mr*wr,Fo=qo+Dt.nx*mr*wr,hf=r.x+Nt.nx*It,df=r.y+Nt.ny*It,kl=r},"calcCornerArc");function gf(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}v(gf,"drawPreparedRoundCorner");function hs(t,e,r,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(Lp(t,e,r,a,n),{cx:zo,cy:Fo,radius:mr,startX:hf,startY:df,stopX:Vo,stopY:qo,startAngle:Nt.ang+Math.PI/2*wr,endAngle:Dt.ang-Math.PI/2*wr,counterClockwise:fn})}v(hs,"getRoundCorner");var ka=.01,Ip=Math.sqrt(2*ka),gt={};gt.findMidptPtsEtc=function(t,e){var r=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,o=t.pstyle("source-endpoint"),s=t.pstyle("target-endpoint"),u=o.units!=null&&s.units!=null,l=v(function(w,b,x,S){var T=S-b,E=x-w,D=Math.sqrt(E*E+T*T);return{x:-T/D,y:E/D}},"recalcVectorNormInverse");switch(t.pstyle("edge-distances").value){case"node-position":i=r;break;case"intersection":i=a;break;case"endpoints":if(u){var f=Qe(this.manualEndptToPx(t.source()[0],o),2),c=f[0],h=f[1],g=Qe(this.manualEndptToPx(t.target()[0],s),2),d=g[0],p=g[1],y={x1:c,y1:h,x2:d,y2:p};n=l(c,h,d,p),i=y}else Oe("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a}return{midptPts:i,vectorNormInverse:n}};gt.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],a=r._private,n=a.rscratch;if(!n.haystack){var i=Math.random()*2*Math.PI;n.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,n.target={x:Math.cos(i),y:Math.sin(i)}}var o=a.source,s=a.target,u=o.position(),l=s.position(),f=o.width(),c=s.width(),h=o.height(),g=s.height(),d=r.pstyle("haystack-radius").value/2;n.haystackPts=n.allpts=[n.source.x*f*d+u.x,n.source.y*h*d+u.y,n.target.x*c*d+l.x,n.target.y*g*d+l.y],n.midX=(n.allpts[0]+n.allpts[2])/2,n.midY=(n.allpts[1]+n.allpts[3])/2,n.edgeType="haystack",n.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};gt.findSegmentsPoints=function(t,e){var r=t._private.rscratch,a=t.pstyle("segment-weights"),n=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),o=t.pstyle("radius-type"),s=Math.min(a.pfValue.length,n.pfValue.length),u=i.pfValue[i.pfValue.length-1],l=o.pfValue[o.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var f=0;f<s;f++){var c=a.pfValue[f],h=n.pfValue[f],g=1-c,d=c,p=this.findMidptPtsEtc(t,e),y=p.midptPts,m=p.vectorNormInverse,w={x:y.x1*g+y.x2*d,y:y.y1*g+y.y2*d};r.segpts.push(w.x+m.x*h,w.y+m.y*h),r.radii.push(i.pfValue[f]!==void 0?i.pfValue[f]:u),r.isArcRadius.push((o.pfValue[f]!==void 0?o.pfValue[f]:l)==="arc-radius")}};gt.findLoopPoints=function(t,e,r,a){var n=t._private.rscratch,i=e.dirCounts,o=e.srcPos,s=t.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,l=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,c=t.pstyle("control-point-step-size").pfValue;n.edgeType="self";var h=r,g=c;a&&(h=0,g=u);var d=l-Math.PI/2,p=d-f/2,y=d+f/2,m=l+"_"+f;h=i[m]===void 0?i[m]=0:++i[m],n.ctrlpts=[o.x+Math.cos(p)*1.4*g*(h/3+1),o.y+Math.sin(p)*1.4*g*(h/3+1),o.x+Math.cos(y)*1.4*g*(h/3+1),o.y+Math.sin(y)*1.4*g*(h/3+1)]};gt.findCompoundLoopPoints=function(t,e,r,a){var n=t._private.rscratch;n.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,u=e.srcH,l=e.tgtW,f=e.tgtH,c=t.pstyle("control-point-step-size").pfValue,h=t.pstyle("control-point-distances"),g=h?h.pfValue[0]:void 0,d=r,p=c;a&&(d=0,p=g);var y=50,m={x:i.x-s/2,y:i.y-u/2},w={x:o.x-l/2,y:o.y-f/2},b={x:Math.min(m.x,w.x),y:Math.min(m.y,w.y)},x=.5,S=Math.max(x,Math.log(s*ka)),T=Math.max(x,Math.log(l*ka));n.ctrlpts=[b.x,b.y-(1+Math.pow(y,1.12)/100)*p*(d/3+1)*S,b.x-(1+Math.pow(y,1.12)/100)*p*(d/3+1)*T,b.y]};gt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};gt.findBezierPoints=function(t,e,r,a,n){var i=t._private.rscratch,o=t.pstyle("control-point-step-size").pfValue,s=t.pstyle("control-point-distances"),u=t.pstyle("control-point-weights"),l=s&&u?Math.min(s.value.length,u.value.length):1,f=s?s.pfValue[0]:void 0,c=u.value[0],h=a;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var g=0;g<l;g++){var d=(.5-e.eles.length/2+r)*o*(n?-1:1),p=void 0,y=es(d);h&&(f=s?s.pfValue[g]:o,c=u.value[g]),a?p=f:p=f!==void 0?y*f:void 0;var m=p!==void 0?p:d,w=1-c,b=c,x=this.findMidptPtsEtc(t,e),S=x.midptPts,T=x.vectorNormInverse,E={x:S.x1*w+S.x2*b,y:S.y1*w+S.y2*b};i.ctrlpts.push(E.x+T.x*m,E.y+T.y*m)}};gt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var a="vertical",n="horizontal",i="leftward",o="rightward",s="downward",u="upward",l="auto",f=e.posPts,c=e.srcW,h=e.srcH,g=e.tgtW,d=e.tgtH,p=t.pstyle("edge-distances").value!=="node-position",y=t.pstyle("taxi-direction").value,m=y,w=t.pstyle("taxi-turn"),b=w.units==="%",x=w.pfValue,S=x<0,T=t.pstyle("taxi-turn-min-distance").pfValue,E=p?(c+g)/2:0,D=p?(h+d)/2:0,B=f.x2-f.x1,C=f.y2-f.y1,P=v(function(ve,ne){return ve>0?Math.max(ve-ne,0):Math.min(ve+ne,0)},"subDWH"),R=P(B,E),A=P(C,D),L=!1;m===l?y=Math.abs(R)>Math.abs(A)?n:a:m===u||m===s?(y=a,L=!0):(m===i||m===o)&&(y=n,L=!0);var M=y===a,I=M?A:R,O=M?C:B,V=es(O),q=!1;!(L&&(b||S))&&(m===s&&O<0||m===u&&O>0||m===i&&O>0||m===o&&O<0)&&(V*=-1,I=V*Math.abs(I),q=!0);var F;b?F=(x<0?1+x:x)*I:F=(x<0?I:0)+x*V;var H=v(function(ve){return Math.abs(ve)<T||Math.abs(ve)>=Math.abs(I)},"getIsTooClose"),Q=H(F),U=H(Math.abs(I)-Math.abs(F));if((Q||U)&&!q)if(M){var W=Math.abs(O)<=h/2,X=Math.abs(B)<=g/2;if(W){var re=(f.x1+f.x2)/2;r.segpts=[re,f.y1,re,f.y2]}else if(X){var j=(f.y1+f.y2)/2;r.segpts=[f.x1,j,f.x2,j]}else r.segpts=[f.x1,f.y2]}else{var Z=Math.abs(O)<=c/2,N=Math.abs(C)<=d/2;if(Z){var _=(f.y1+f.y2)/2;r.segpts=[f.x1,_,f.x2,_]}else if(N){var G=(f.x1+f.x2)/2;r.segpts=[G,f.y1,G,f.y2]}else r.segpts=[f.x2,f.y1]}else if(M){var te=f.y1+F+(p?h/2*V:0);r.segpts=[f.x1,te,f.x2,te]}else{var le=f.x1+F+(p?c/2*V:0);r.segpts=[le,f.y1,le,f.y2]}if(r.isRound){var xe=t.pstyle("taxi-radius").value,be=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(xe),r.isArcRadius=new Array(r.segpts.length/2).fill(be)}};gt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,u=e.tgtH,l=e.srcShape,f=e.tgtShape,c=e.srcCornerRadius,h=e.tgtCornerRadius,g=e.srcRs,d=e.tgtRs,p=!ae(r.startX)||!ae(r.startY),y=!ae(r.arrowStartX)||!ae(r.arrowStartY),m=!ae(r.endX)||!ae(r.endY),w=!ae(r.arrowEndX)||!ae(r.arrowEndY),b=3*(this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth),x=Cr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),S=x<b,T=Cr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),E=T<b,D=!1;if(p||y||S){D=!0;var B={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},C=Math.sqrt(B.x*B.x+B.y*B.y),P={x:B.x/C,y:B.y/C},R=Math.max(i,o),A={x:r.ctrlpts[0]+P.x*2*R,y:r.ctrlpts[1]+P.y*2*R},L=l.intersectLine(a.x,a.y,i,o,A.x,A.y,0,c,g);S?(r.ctrlpts[0]=r.ctrlpts[0]+P.x*(b-x),r.ctrlpts[1]=r.ctrlpts[1]+P.y*(b-x)):(r.ctrlpts[0]=L[0]+P.x*b,r.ctrlpts[1]=L[1]+P.y*b)}if(m||w||E){D=!0;var M={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},I=Math.sqrt(M.x*M.x+M.y*M.y),O={x:M.x/I,y:M.y/I},V=Math.max(i,o),q={x:r.ctrlpts[0]+O.x*2*V,y:r.ctrlpts[1]+O.y*2*V},F=f.intersectLine(n.x,n.y,s,u,q.x,q.y,0,h,d);E?(r.ctrlpts[0]=r.ctrlpts[0]+O.x*(b-T),r.ctrlpts[1]=r.ctrlpts[1]+O.y*(b-T)):(r.ctrlpts[0]=F[0]+O.x*b,r.ctrlpts[1]=F[1]+O.y*b)}D&&this.findEndpoints(t)}};gt.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var a,n;e.ctrlpts.length/2%2===0?(a=e.allpts.length/2-1,e.midX=e.allpts[a],e.midY=e.allpts[a+1]):(a=e.allpts.length/2-3,n=.5,e.midX=at(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=at(e.allpts[a+1],e.allpts[a+3],e.allpts[a+5],n))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var o=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(hs({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,s))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,l=u-2;e.midX=(e.segpts[l]+e.segpts[u])/2,e.midY=(e.segpts[l+1]+e.segpts[u+1])/2}else{var f=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[f],e.midY=e.segpts[f+1];else{var c={x:e.segpts[f],y:e.segpts[f+1]},h=e.roundCorners[f/2];if(h.radius===0){var g={x:e.segpts[f+2],y:e.segpts[f+3]};e.midX=c.x,e.midY=c.y,e.midVector=[c.y-g.y,g.x-c.x]}else{var d=[c.x-h.cx,c.y-h.cy],p=h.radius/Math.sqrt(Math.pow(d[0],2)+Math.pow(d[1],2));d=d.map(function(y){return y*p}),e.midX=h.cx+d[0],e.midY=h.cy+d[1],e.midVector=d}}}}};gt.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||ae(e.startX)&&ae(e.startY)&&ae(e.endX)&&ae(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Oe("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};gt.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,a=r.cy.hasCompoundNodes(),n=new Ht,i=v(function(T,E){return[].concat(dn(T),[E?1:0]).join("-")},"getKey"),o=[],s=[],u=0;u<t.length;u++){var l=t[u],f=l._private,c=l.pstyle("curve-style").value;if(!(l.removed()||!l.takesUpSpace())){if(c==="haystack"){s.push(l);continue}var h=c==="unbundled-bezier"||Jt(c,"segments")||c==="straight"||c==="straight-triangle"||Jt(c,"taxi"),g=c==="unbundled-bezier"||c==="bezier",d=f.source,p=f.target,y=[d.poolIndex(),p.poolIndex()].sort(),m=i(y,h),w=n.get(m);w==null&&(w={eles:[]},o.push({pairId:y,edgeIsUnbundled:h}),n.set(m,w)),w.eles.push(l),h&&(w.hasUnbundled=!0),g&&(w.hasBezier=!0)}}for(var b=v(function(){var T=o[x],E=T.pairId,D=T.edgeIsUnbundled,B=i(E,D),C=n.get(B),P;if(!C.hasUnbundled){var R=C.eles[0].parallelEdges().filter(function(ie){return ie.isBundledBezier()});Jo(C.eles),R.forEach(function(ie){return C.eles.push(ie)}),C.eles.sort(function(ie,K){return ie.poolIndex()-K.poolIndex()})}var A=C.eles[0],L=A.source(),M=A.target();if(L.poolIndex()>M.poolIndex()){var I=L;L=M,M=I}var O=C.srcPos=L.position(),V=C.tgtPos=M.position(),q=C.srcW=L.outerWidth(),F=C.srcH=L.outerHeight(),H=C.tgtW=M.outerWidth(),Q=C.tgtH=M.outerHeight(),U=C.srcShape=r.nodeShapes[e.getNodeShape(L)],W=C.tgtShape=r.nodeShapes[e.getNodeShape(M)],X=C.srcCornerRadius=L.pstyle("corner-radius").value==="auto"?"auto":L.pstyle("corner-radius").pfValue,re=C.tgtCornerRadius=M.pstyle("corner-radius").value==="auto"?"auto":M.pstyle("corner-radius").pfValue,j=C.tgtRs=M._private.rscratch,Z=C.srcRs=L._private.rscratch;C.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var N=0;N<C.eles.length;N++){var _=C.eles[N],G=_[0]._private.rscratch,te=_.pstyle("curve-style").value,le=te==="unbundled-bezier"||Jt(te,"segments")||Jt(te,"taxi"),xe=!L.same(_.source());if(!C.calculatedIntersection&&L!==M&&(C.hasBezier||C.hasUnbundled)){C.calculatedIntersection=!0;var be=U.intersectLine(O.x,O.y,q,F,V.x,V.y,0,X,Z),De=C.srcIntn=be,ve=W.intersectLine(V.x,V.y,H,Q,O.x,O.y,0,re,j),ne=C.tgtIntn=ve,he=C.intersectionPts={x1:be[0],x2:ve[0],y1:be[1],y2:ve[1]},ye=C.posPts={x1:O.x,x2:V.x,y1:O.y,y2:V.y},me=ve[1]-be[1],ge=ve[0]-be[0],Se=Math.sqrt(ge*ge+me*me);ae(Se)&&Se>=Ip||(Se=Math.sqrt(Math.max(ge*ge,ka)+Math.max(me*me,ka)));var Be=C.vector={x:ge,y:me},ke=C.vectorNorm={x:Be.x/Se,y:Be.y/Se},Ve={x:-ke.y,y:ke.x};C.nodesOverlap=!ae(Se)||W.checkPoint(be[0],be[1],0,H,Q,V.x,V.y,re,j)||U.checkPoint(ve[0],ve[1],0,q,F,O.x,O.y,X,Z),C.vectorNormInverse=Ve,P={nodesOverlap:C.nodesOverlap,dirCounts:C.dirCounts,calculatedIntersection:!0,hasBezier:C.hasBezier,hasUnbundled:C.hasUnbundled,eles:C.eles,srcPos:V,srcRs:j,tgtPos:O,tgtRs:Z,srcW:H,srcH:Q,tgtW:q,tgtH:F,srcIntn:ne,tgtIntn:De,srcShape:W,tgtShape:U,posPts:{x1:ye.x2,y1:ye.y2,x2:ye.x1,y2:ye.y1},intersectionPts:{x1:he.x2,y1:he.y2,x2:he.x1,y2:he.y1},vector:{x:-Be.x,y:-Be.y},vectorNorm:{x:-ke.x,y:-ke.y},vectorNormInverse:{x:-Ve.x,y:-Ve.y}}}var we=xe?P:C;G.nodesOverlap=we.nodesOverlap,G.srcIntn=we.srcIntn,G.tgtIntn=we.tgtIntn,G.isRound=te.startsWith("round"),a&&(L.isParent()||L.isChild()||M.isParent()||M.isChild())&&(L.parents().anySame(M)||M.parents().anySame(L)||L.same(M)&&L.isParent())?e.findCompoundLoopPoints(_,we,N,le):L===M?e.findLoopPoints(_,we,N,le):te.endsWith("segments")?e.findSegmentsPoints(_,we):te.endsWith("taxi")?e.findTaxiPoints(_,we):te==="straight"||!le&&C.eles.length%2===1&&N===Math.floor(C.eles.length/2)?e.findStraightEdgePoints(_):e.findBezierPoints(_,we,N,le,xe),e.findEndpoints(_),e.tryToCorrectInvalidPoints(_,we),e.checkForInvalidEdgeWarning(_),e.storeAllpts(_),e.storeEdgeProjections(_),e.calculateArrowAngles(_),e.recalculateEdgeLabelProjections(_),e.calculateLabelAngles(_)}},"_loop"),x=0;x<o.length;x++)b();this.findHaystackPoints(s)}};function pf(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var a=t[r],n=t[r+1];e.push({x:a,y:n})}return e}}v(pf,"getPts");gt.getSegmentPoints=function(t){var e=t[0]._private.rscratch;if(this.recalculateRenderedStyle(t),e.edgeType==="segments")return pf(e.segpts)};gt.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return pf(e.ctrlpts)};gt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var Fa={};Fa.manualEndptToPx=function(t,e){var r=this,a=t.position(),n=t.outerWidth(),i=t.outerHeight(),o=t._private.rscratch;if(e.value.length===2){var s=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(s[0]=s[0]*n),e.units[1]==="%"&&(s[1]=s[1]*i),s[0]+=a.x,s[1]+=a.y,s}else{var u=e.pfValue[0];u=-Math.PI/2+u;var l=2*Math.max(n,i),f=[a.x+Math.cos(u)*l,a.y+Math.sin(u)*l];return r.nodeShapes[this.getNodeShape(t)].intersectLine(a.x,a.y,n,i,f[0],f[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,o)}};Fa.findEndpoints=function(t){var e,r,a,n,i=this,o,s=t.source()[0],u=t.target()[0],l=s.position(),f=u.position(),c=t.pstyle("target-arrow-shape").value,h=t.pstyle("source-arrow-shape").value,g=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,p=s._private.rscratch,y=u._private.rscratch,m=t.pstyle("curve-style").value,w=t._private.rscratch,b=w.edgeType,x=Jt(m,"taxi"),S=b==="self"||b==="compound",T=b==="bezier"||b==="multibezier"||S,E=b!=="bezier",D=b==="straight"||b==="segments",B=b==="segments",C=T||E||D,P=S||x,R=t.pstyle("source-endpoint"),A=P?"outside-to-node":R.value,L=s.pstyle("corner-radius").value==="auto"?"auto":s.pstyle("corner-radius").pfValue,M=t.pstyle("target-endpoint"),I=P?"outside-to-node":M.value,O=u.pstyle("corner-radius").value==="auto"?"auto":u.pstyle("corner-radius").pfValue;w.srcManEndpt=R,w.tgtManEndpt=M;var V,q,F,H,Q=(e=(M==null||(r=M.pfValue)===null||r===void 0?void 0:r.length)===2?M.pfValue:null)!==null&&e!==void 0?e:[0,0],U=(a=(R==null||(n=R.pfValue)===null||n===void 0?void 0:n.length)===2?R.pfValue:null)!==null&&a!==void 0?a:[0,0];if(T){var W=[w.ctrlpts[0],w.ctrlpts[1]];V=E?[w.ctrlpts[w.ctrlpts.length-2],w.ctrlpts[w.ctrlpts.length-1]]:W,q=W}else if(D){var X=B?w.segpts.slice(0,2):[f.x+Q[0],f.y+Q[1]];V=B?w.segpts.slice(w.segpts.length-2):[l.x+U[0],l.y+U[1]],q=X}if(I==="inside-to-node")o=[f.x,f.y];else if(M.units)o=this.manualEndptToPx(u,M);else if(I==="outside-to-line")o=w.tgtIntn;else if(I==="outside-to-node"||I==="outside-to-node-or-label"?F=V:(I==="outside-to-line"||I==="outside-to-line-or-label")&&(F=[l.x,l.y]),o=i.nodeShapes[this.getNodeShape(u)].intersectLine(f.x,f.y,u.outerWidth(),u.outerHeight(),F[0],F[1],0,O,y),I==="outside-to-node-or-label"||I==="outside-to-line-or-label"){var re=u._private.rscratch,j=re.labelWidth,Z=re.labelHeight,N=re.labelX,_=re.labelY,G=j/2,te=Z/2,le=u.pstyle("text-valign").value;le=Qr(le),le==="top"?_-=te:le==="bottom"&&(_+=te);var xe=u.pstyle("text-halign").value;xe=Zr(xe),xe==="left"?N-=G:xe==="right"&&(N+=G);var be=Ta(F[0],F[1],[N-G,_-te,N+G,_-te,N+G,_+te,N-G,_+te],f.x,f.y);if(be.length>0){var De=l,ve=yr(De,qr(o)),ne=yr(De,qr(be)),he=ve;ne<ve&&(o=be,he=ne),be.length>2&&yr(De,{x:be[2],y:be[3]})<he&&(o=[be[2],be[3]])}}var ye=Wa(o,V,i.arrowShapes[c].spacing(t)+g),me=Wa(o,V,i.arrowShapes[c].gap(t)+g);if(w.endX=me[0],w.endY=me[1],w.arrowEndX=ye[0],w.arrowEndY=ye[1],A==="inside-to-node")o=[l.x,l.y];else if(R.units)o=this.manualEndptToPx(s,R);else if(A==="outside-to-line")o=w.srcIntn;else if(A==="outside-to-node"||A==="outside-to-node-or-label"?H=q:(A==="outside-to-line"||A==="outside-to-line-or-label")&&(H=[f.x,f.y]),o=i.nodeShapes[this.getNodeShape(s)].intersectLine(l.x,l.y,s.outerWidth(),s.outerHeight(),H[0],H[1],0,L,p),A==="outside-to-node-or-label"||A==="outside-to-line-or-label"){var ge=s._private.rscratch,Se=ge.labelWidth,Be=ge.labelHeight,ke=ge.labelX,Ve=ge.labelY,we=Se/2,ie=Be/2,K=s.pstyle("text-valign").value;K=Qr(K),K==="top"?Ve-=ie:K==="bottom"&&(Ve+=ie);var k=s.pstyle("text-halign").value;k=Zr(k),k==="left"?ke-=we:k==="right"&&(ke+=we);var z=Ta(H[0],H[1],[ke-we,Ve-ie,ke+we,Ve-ie,ke+we,Ve+ie,ke-we,Ve+ie],l.x,l.y);if(z.length>0){var $=f,J=yr($,qr(o)),Y=yr($,qr(z)),ee=J;Y<J&&(o=[z[0],z[1]],ee=Y),z.length>2&&yr($,{x:z[2],y:z[3]})<ee&&(o=[z[2],z[3]])}}var oe=Wa(o,q,i.arrowShapes[h].spacing(t)+d),fe=Wa(o,q,i.arrowShapes[h].gap(t)+d);w.startX=fe[0],w.startY=fe[1],w.arrowStartX=oe[0],w.arrowStartY=oe[1],C&&(!ae(w.startX)||!ae(w.startY)||!ae(w.endX)||!ae(w.endY)?w.badLine=!0:w.badLine=!1)};Fa.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),e.edgeType==="haystack"?{x:e.haystackPts[0],y:e.haystackPts[1]}:{x:e.arrowStartX,y:e.arrowStartY}};Fa.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),e.edgeType==="haystack"?{x:e.haystackPts[2],y:e.haystackPts[3]}:{x:e.arrowEndX,y:e.arrowEndY}};var ds={};function Op(t,e,r){for(var a=v(function(u,l,f,c){return at(u,l,f,c)},"qbezierAt$1"),n=e._private.rstyle.bezierPts,i=0;i<t.bezierProjPcts.length;i++){var o=t.bezierProjPcts[i];n.push({x:a(r[0],r[2],r[4],o),y:a(r[1],r[3],r[5],o)})}}v(Op,"pushBezierPts");ds.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,a=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,a==="multibezier"||a==="bezier"||a==="self"||a==="compound"){e.rstyle.bezierPts=[];for(var n=0;n+5<r.allpts.length;n+=4)Op(this,t,r.allpts.slice(n,n+6))}else if(a==="segments")for(var i=e.rstyle.linePts=[],n=0;n+1<r.allpts.length;n+=2)i.push({x:r.allpts[n],y:r.allpts[n+1]});else if(a==="haystack"){var o=r.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};ds.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var qt={};qt.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!ar(e)){var r,a,n=t._private,i=t.width(),o=t.height(),s=t.padding(),u=t.position(),l=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,c=n.rscratch,h=n.rstyle;switch(l){case"left":r=u.x-i/2-s;break;case"left-inside":r=u.x-i/2+s;break;case"right":r=u.x+i/2+s;break;case"right-inside":r=u.x+i/2-s;break;default:r=u.x}switch(f){case"top":a=u.y-o/2-s;break;case"top-inside":a=u.y-o/2+s;break;case"bottom":a=u.y+o/2+s;break;case"bottom-inside":a=u.y+o/2-s;break;default:a=u.y}c.labelX=r,c.labelY=a,h.labelX=r,h.labelY=a,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var yf=v(function(e,r){var a=Math.atan(r/e);return e===0&&a<0&&(a=a*-1),a},"lineAngleFromDelta"),mf=v(function(e,r){return yf(r.x-e.x,r.y-e.y)},"lineAngle"),Np=v(function(e,r,a,n){var i=Ca(0,n-.001,1),o=Ca(0,n+.001,1);return mf(Hr(e,r,a,i),Hr(e,r,a,o))},"bezierAngle");qt.recalculateEdgeLabelProjections=function(t){var e,r=t._private,a=r.rscratch,n=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:a.midX,y:a.midY};var o=v(function(f,c,h){zt(r.rscratch,f,c,h),zt(r.rstyle,f,c,h)},"setRs");o("labelX",null,e.x),o("labelY",null,e.y),o("labelAutoAngle",null,yf(a.midDispX,a.midDispY));var s=v(function(){if(s.cache)return s.cache;for(var f=[],c=0;c+5<a.allpts.length;c+=4){var h={x:a.allpts[c],y:a.allpts[c+1]},g={x:a.allpts[c+2],y:a.allpts[c+3]},d={x:a.allpts[c+4],y:a.allpts[c+5]};f.push({p0:h,p1:g,p2:d,startDist:0,length:0,segments:[]})}var p=r.rstyle.bezierPts,y=n.bezierProjPcts.length;function m(T,E,D,B,C){var P=Cr(E,D),R=T.segments[T.segments.length-1],A={p0:E,p1:D,t0:B,t1:C,startDist:R?R.startDist+R.length:0,length:P};T.segments.push(A),T.length+=P}v(m,"addSegment");for(var w=0;w<f.length;w++){var b=f[w],x=f[w-1];x&&(b.startDist=x.startDist+x.length),m(b,b.p0,p[w*y],0,n.bezierProjPcts[0]);for(var S=0;S<y-1;S++)m(b,p[w*y+S],p[w*y+S+1],n.bezierProjPcts[S],n.bezierProjPcts[S+1]);m(b,p[w*y+y-1],b.p2,n.bezierProjPcts[y-1],1)}return s.cache=f},"createControlPointInfo"),u=v(function(f){var c,h=f==="source";if(i[f]){var g=t.pstyle(f+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var d=s(),p,y=0,m=0,w=0;w<d.length;w++){for(var b=d[h?w:d.length-1-w],x=0;x<b.segments.length;x++){var S=b.segments[h?x:b.segments.length-1-x],T=w===d.length-1&&x===b.segments.length-1;if(y=m,m+=S.length,m>=g||T){p={cp:b,segment:S};break}}if(p)break}var E=p.cp,D=p.segment,B=(g-y)/D.length,C=D.t1-D.t0,P=h?D.t0+C*B:D.t1-C*B;P=Ca(0,P,1),e=Hr(E.p0,E.p1,E.p2,P),c=Np(E.p0,E.p1,E.p2,P);break;case"straight":case"segments":case"haystack":for(var R=0,A,L,M,I,O=a.allpts.length,V=0;V+3<O&&(h?(M={x:a.allpts[V],y:a.allpts[V+1]},I={x:a.allpts[V+2],y:a.allpts[V+3]}):(M={x:a.allpts[O-2-V],y:a.allpts[O-1-V]},I={x:a.allpts[O-4-V],y:a.allpts[O-3-V]}),A=Cr(M,I),L=R,R+=A,!(R>=g));V+=2);var q=(g-L)/A;q=Ca(0,q,1),e=xh(M,I,q),c=mf(M,I)}o("labelX",f,e.x),o("labelY",f,e.y),o("labelAutoAngle",f,c)}},"calculateEndProjection");u("source"),u("target"),this.applyLabelDimensions(t)}};qt.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};qt.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=Er(a,t._private.labelDimsKey);if(yt(r.rscratch,"prefixedLabelDimsKey",e)!==n){zt(r.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(t,a),o=t.pstyle("line-height").pfValue,s=t.pstyle("font-size").pfValue,u=t.pstyle("text-wrap").strValue,l=yt(r.rscratch,"labelWrapCachedLines",e)||[],f=u!=="wrap"?1:Math.max(l.length,1),c=s*o,h=i.width,g=i.height+(f-1)*(o-1)*s;zt(r.rstyle,"labelWidth",e,h),zt(r.rscratch,"labelWidth",e,h),zt(r.rstyle,"labelHeight",e,g),zt(r.rscratch,"labelHeight",e,g),zt(r.rscratch,"labelLineHeight",e,c),zt(r.rscratch,"labelActualDescent",e,i.labelActualDescent)}};qt.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,i=t.pstyle("text-transform").value,o=v(function(O,V){return V?(zt(r.rscratch,O,e,V),V):yt(r.rscratch,O,e)},"rscratch");if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var s=t.pstyle("text-wrap").value;if(s==="wrap"){var u=o("labelKey");if(u!=null&&o("labelWrapKey")===u)return o("labelWrapCachedText");for(var l="",f=n.split(`
|
|
5
|
+
`),c=t.pstyle("text-max-width").pfValue,h=t.pstyle("text-overflow-wrap").value==="anywhere",g=[],d=/[\s\u200b]+|$/g,p=0;p<f.length;p++){var y=f[p],m=this.calculateLabelDimensions(t,y).width;if(h&&(y=y.split("").join(l)),m>c){var w=y.matchAll(d),b="",x=0,S=Ct(w),T;try{for(S.s();!(T=S.n()).done;){var E=T.value,D=E[0],B=y.substring(x,E.index);x=E.index+D.length;var C=b.length===0?B:b+B+D;this.calculateLabelDimensions(t,C).width<=c?b+=B+D:(b&&g.push(b),b=B+D)}}catch(I){S.e(I)}finally{S.f()}b.match(/^[\s\u200b]+$/)||g.push(b)}else g.push(y)}o("labelWrapCachedLines",g),n=o("labelWrapCachedText",g.join(`
|
|
6
|
+
`)),o("labelWrapKey",u)}else if(s==="ellipsis"){var P=t.pstyle("text-max-width").pfValue,R="",A="…",L=!1;if(this.calculateLabelDimensions(t,n).width<P)return n;for(var M=0;M<n.length&&!(this.calculateLabelDimensions(t,R+n[M]+A).width>P);M++)R+=n[M],M===n.length-1&&(L=!0);return L||(R+=A),R}return n};qt.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?Ig(r):"center":e};qt.calculateLabelDimensions=function(t,e){var r=this.cy.window().document,a=0,n=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue,o=t.pstyle("font-family").strValue,s=t.pstyle("font-weight").strValue,u=t.pstyle("text-metrics").strValue||"font",l=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!l){l=this.labelCalcCanvas=r.createElement("canvas"),f=this.labelCalcCanvasContext=l.getContext("2d");var c=l.style;c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none"}f.font="".concat(n," ").concat(s," ").concat(i,"px ").concat(o);for(var h=0,g=0,d=e.split(`
|
|
7
|
+
`),p=d.length,y=0,m=0,w=0;w<p;w++){var b=d[w],x=f.measureText(b),S=Math.ceil(x.width),T=i;u==="glyph"&&(w===0&&(m=x.actualBoundingBoxAscent),w===p-1&&(y=x.actualBoundingBoxDescent)),h=Math.max(S,h),g+=T}return u==="glyph"&&(g-=i-m-y),h+=a,g+=a,{width:h,height:g,labelActualAscent:m,labelActualDescent:y}};qt.calculateLabelAngle=function(t,e){var r=t._private.rscratch,a=t.isEdge(),n=e?e+"-":"",i=t.pstyle(n+"text-rotation"),o=i.strValue;return o==="none"?0:a&&o==="autorotate"?r.labelAutoAngle:o==="autorotate"?0:i.pfValue};qt.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),a=t._private.rscratch;a.labelAngle=e.calculateLabelAngle(t),r&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var bf={},Al=28,Rl=!1;bf.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<Al||t.height()<Al))return Rl||(Oe("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Rl=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var a=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return r};var Wn={};Wn.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,a=v(function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var u=0;u<o.length;u++){var l=o[u]._private.rstyle;l.clean=!1,l.cleanConnected=!1}},"enqueue");r.binder(t).on("bounds.* dirty.*",v(function(o){var s=o.target;a(s)},"onDirtyBounds")).on("style.* background.*",v(function(o){var s=o.target;a(s,!1)},"onDirtyStyle"));var n=v(function(o){if(o){var s=r.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],f=l._private.rstyle;l.isNode()&&!f.cleanConnected&&(a(l.connectedEdges()),f.cleanConnected=!0)}if(s)for(var c=0;c<s.length;c++){var h=s[c];h(o,e)}r.recalculateRenderedStyle(e),e=t.collection()}},"updateEleCalcs");r.flushRenderedStyleQueue=function(){n(!0)},r.beforeRender(n,r.beforeRenderPriorities.eleCalcs)};Wn.onUpdateEleCalcs=function(t){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(t)};Wn.recalculateRenderedStyle=function(t,e){var r=v(function(w){return w._private.rstyle.cleanConnected},"isCleanConnected");if(t.length!==0){var a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var o=t[i],s=o._private,u=s.rstyle;o.isEdge()&&(!r(o.source())||!r(o.target()))&&(u.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(m){return!m._private.rstyle.clean&&m.isBundledBezier()})&&(u.clean=!1),!(e&&u.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?n.push(o):a.push(o),u.clean=!0)}for(var l=0;l<n.length;l++){var f=n[l],c=f._private.rstyle,h=f.position();this.recalculateNodeLabelProjection(f),c.nodeX=h.x,c.nodeY=h.y,c.nodeW=f.pstyle("width").pfValue,c.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var g=0;g<a.length;g++){var d=a[g]._private,p=d.rstyle,y=d.rscratch;p.srcX=y.arrowStartX,p.srcY=y.arrowStartY,p.tgtX=y.arrowEndX,p.tgtY=y.arrowEndY,p.midX=y.midX,p.midY=y.midY,p.labelAngle=y.labelAngle,p.sourceLabelAngle=y.sourceLabelAngle,p.targetLabelAngle=y.targetLabelAngle}}}};var Un={};Un.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var a=t[r],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?t.drag.push(a):t.nondrag.push(a)}for(var r=0;r<e.length;r++){var a=e[r];t.drag.push(a)}}};Un.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Un.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(jv),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var wf={};[Br,Dn,gt,Fa,ds,qt,bf,Wn,Un].forEach(function(t){pe(wf,t)});var xf={};xf.getCachedImage=function(t,e,r){var a=this,n=a.imageCache=a.imageCache||{},i=n[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=n[t]=n[t]||{};var o=i.image=new Image;o.addEventListener("load",r),o.addEventListener("error",function(){o.error=!0});var s="data:";return t.substring(0,s.length).toLowerCase()!==s&&(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var Ef=v(function(e,r){var a=e[0];!a||a._private.grabbed===r||(a._private.grabbed=r,e.updateStyle(!1))},"setGrabState"),zp=v(function(e){Ef(e,!0)},"setGrabbed"),Fp=v(function(e){Ef(e,!1)},"setFreed"),ra={};ra.registerBinding=function(t,e,r,a){var n=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var i=[],o=0;o<t.length;o++){var s=t[o];if(s!==void 0){var u=this.binder(s);i.push(u.on.apply(u,n))}}return i}var u=this.binder(t);return u.on.apply(u,n)};ra.binder=function(t){var e=this,r=e.cy.window(),a=t===r||t===r.document||t===r.document.body||hc(t);if(e.supportsPassiveEvents==null){var n=!1;try{var i=Object.defineProperty({},"passive",{get:v(function(){return n=!0,!0},"get")});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=n}var o=v(function(u,l,f){var c=Array.prototype.slice.call(arguments);return a&&e.supportsPassiveEvents&&(c[2]={capture:f??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:c}),(t.addEventListener||t.on).apply(t,c),this},"on");return{on:o,addEventListener:o,addListener:o,bind:o}};ra.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};ra.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};ra.load=function(){var t=this,e=t.cy.window(),r=v(function(k){return k.selected()},"isSelected"),a=v(function(k){var z=k.getRootNode();if(z&&z.nodeType===11&&z.host!==void 0)return z},"getShadowRoot"),n=v(function(k,z,$,J){k==null&&(k=t.cy);for(var Y=0;Y<z.length;Y++){var ee=z[Y];k.emit({originalEvent:$,type:ee,position:J})}},"triggerEvents"),i=v(function(k){return k.shiftKey||k.metaKey||k.ctrlKey},"isMultSelKeyDown"),o=v(function(k,z){var $=!0;if(t.cy.hasCompoundNodes()&&k&&k.pannable())for(var J=0;z&&J<z.length;J++){var k=z[J];if(k.isNode()&&k.isParent()&&!k.pannable()){$=!1;break}}else $=!0;return $},"allowPanningPassthrough"),s=v(function(k){k[0]._private.rscratch.inDragLayer=!0},"setInDragLayer"),u=v(function(k){k[0]._private.rscratch.inDragLayer=!1},"setOutDragLayer"),l=v(function(k){k[0]._private.rscratch.isGrabTarget=!0},"setGrabTarget"),f=v(function(k){k[0]._private.rscratch.isGrabTarget=!1},"removeGrabTarget"),c=v(function(k,z){var $=z.addToList;!$.has(k)&&k.grabbable()&&!k.locked()&&($.merge(k),zp(k))},"addToDragList"),h=v(function(k,z){if(k.cy().hasCompoundNodes()&&!(z.inDragLayer==null&&z.addToList==null)){var $=k.descendants();z.inDragLayer&&($.forEach(s),$.connectedEdges().forEach(s)),z.addToList&&c($,z)}},"addDescendantsToDrag"),g=v(function(k,z){z=z||{};var $=k.cy().hasCompoundNodes();z.inDragLayer&&(k.forEach(s),k.neighborhood().stdFilter(function(J){return!$||J.isEdge()}).forEach(s)),z.addToList&&k.forEach(function(J){c(J,z)}),h(k,z),y(k,{inDragLayer:z.inDragLayer}),t.updateCachedGrabbedEles()},"addNodesToDrag"),d=g,p=v(function(k){k&&(t.getCachedZSortedEles().forEach(function(z){Fp(z),u(z),f(z)}),t.updateCachedGrabbedEles())},"freeDraggedElements"),y=v(function(k,z){if(!(z.inDragLayer==null&&z.addToList==null)&&k.cy().hasCompoundNodes()){var $=k.ancestors().orphans();if(!$.same(k)){var J=$.descendants().spawnSelf().merge($).unmerge(k).unmerge(k.descendants()),Y=J.connectedEdges();z.inDragLayer&&(Y.forEach(s),J.forEach(s)),z.addToList&&J.forEach(function(ee){c(ee,z)})}}},"updateAncestorsInDragLayer"),m=v(function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},"blurActiveDomElement"),w=typeof MutationObserver<"u",b=typeof ResizeObserver<"u";w?(t.removeObserver=new MutationObserver(function(K){for(var k=0;k<K.length;k++){var z=K[k].removedNodes;if(z){for(var $=0;$<z.length;$++)if(z[$]===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(K){t.destroy()});var x=Ia(function(){t.cy.resize()},100);w&&(t.styleObserver=new MutationObserver(x),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",x),b&&(t.resizeObserver=new ResizeObserver(x),t.resizeObserver.observe(t.container));var S=v(function(k,z){for(;k!=null;)z(k),k=k.parentNode},"forEachUp"),T=v(function(){t.invalidateContainerClientCoordsCache()},"invalidateCoords");S(t.container,function(K){t.registerBinding(K,"transitionend",T),t.registerBinding(K,"animationend",T),t.registerBinding(K,"scroll",T)}),t.registerBinding(t.container,"contextmenu",function(K){K.preventDefault()});var E=v(function(){return t.selection[4]!==0},"inBoxSelection"),D=v(function(k){for(var z=t.findContainerClientCoords(),$=z[0],J=z[1],Y=z[2],ee=z[3],oe=k.touches?k.touches:[k],fe=!1,se=0;se<oe.length;se++){var Ce=oe[se];if($<=Ce.clientX&&Ce.clientX<=$+Y&&J<=Ce.clientY&&Ce.clientY<=J+ee){fe=!0;break}}if(!fe)return!1;for(var Le=t.container,ce=k.target.parentNode,Ee=!1;ce;){if(ce===Le){Ee=!0;break}ce=ce.parentNode}return!!Ee},"eventInContainer");t.registerBinding(t.container,"mousedown",v(function(k){if(D(k)&&!(t.hoverData.which===1&&k.which!==1)){k.preventDefault(),m(),t.hoverData.capture=!0,t.hoverData.which=k.which;var z=t.cy,$=[k.clientX,k.clientY],J=t.projectIntoViewport($[0],$[1]),Y=t.selection,ee=t.findNearestElements(J[0],J[1],!0,!1),oe=ee[0],fe=t.dragData.possibleDragElements;t.hoverData.mdownPos=J,t.hoverData.mdownGPos=$;var se=v(function(Pe){return{originalEvent:k,type:Pe,position:{x:J[0],y:J[1]}}},"makeEvent"),Ce=v(function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Pe=t.hoverData.down;Pe?Pe.emit(se("taphold")):z.emit(se("taphold"))}},t.tapholdDuration)},"checkForTaphold");if(k.which==3){t.hoverData.cxtStarted=!0;var Le={originalEvent:k,type:"cxttapstart",position:{x:J[0],y:J[1]}};oe?(oe.activate(),oe.emit(Le),t.hoverData.down=oe):z.emit(Le),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(k.which==1){if(oe&&oe.activate(),oe!=null&&t.nodeIsGrabbable(oe)){var ce=v(function(Pe){Pe.emit(se("grab"))},"triggerGrab");if(l(oe),!oe.selected())fe=t.dragData.possibleDragElements=z.collection(),d(oe,{addToList:fe}),oe.emit(se("grabon")).emit(se("grab"));else{fe=t.dragData.possibleDragElements=z.collection();var Ee=z.$(function(Ne){return Ne.isNode()&&Ne.selected()&&t.nodeIsGrabbable(Ne)});g(Ee,{addToList:fe}),oe.emit(se("grabon")),Ee.forEach(ce)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=oe,t.hoverData.downs=ee,t.hoverData.downTime=new Date().getTime(),n(oe,["mousedown","tapstart","vmousedown"],k,{x:J[0],y:J[1]}),oe==null?(Y[4]=1,t.data.bgActivePosistion={x:J[0],y:J[1]},t.redrawHint("select",!0),t.redraw()):oe.pannable()&&(Y[4]=1),Ce()}Y[0]=Y[2]=J[0],Y[1]=Y[3]=J[1]}},"mousedownHandler"),!1);var B=a(t.container);t.registerBinding([e,B],"mousemove",v(function(k){if(!(!t.hoverData.capture&&!D(k))){var z=!1,$=t.cy,J=$.zoom(),Y=[k.clientX,k.clientY],ee=t.projectIntoViewport(Y[0],Y[1]),oe=t.hoverData.mdownPos,fe=t.hoverData.mdownGPos,se=t.selection,Ce=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(Ce=t.findNearestElement(ee[0],ee[1],!0,!1));var Le=t.hoverData.last,ce=t.hoverData.down,Ee=[ee[0]-se[2],ee[1]-se[3]],Ne=t.dragData.possibleDragElements,Pe;if(fe){var Ue=Y[0]-fe[0],Ke=Ue*Ue,ct=Y[1]-fe[1],$e=Ke+ct*ct;t.hoverData.isOverThresholdDrag=Pe=$e>=t.desktopTapThreshold2}var ot=i(k);Pe&&(t.hoverData.tapholdCancelled=!0);var Xe=v(function(){var St=t.hoverData.dragDelta=t.hoverData.dragDelta||[];St.length===0?(St.push(Ee[0]),St.push(Ee[1])):(St[0]+=Ee[0],St[1]+=Ee[1])},"updateDragDelta");z=!0,n(Ce,["mousemove","vmousemove","tapdrag"],k,{x:ee[0],y:ee[1]});var st=v(function(St){return{originalEvent:k,type:St,position:{x:ee[0],y:ee[1]}}},"makeEvent"),dr=v(function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||$.emit(st("boxstart")),se[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()},"goIntoBoxMode");if(t.hoverData.which===3){if(Pe){var Pr=st("cxtdrag");ce?ce.emit(Pr):$.emit(Pr),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Ce!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(st("cxtdragout")),t.hoverData.cxtOver=Ce,Ce&&Ce.emit(st("cxtdragover")))}}else if(t.hoverData.dragging){if(z=!0,$.panningEnabled()&&$.userPanningEnabled()){var Ar;if(t.hoverData.justStartedPan){var Yt=t.hoverData.mdownPos;Ar={x:(ee[0]-Yt[0])*J,y:(ee[1]-Yt[1])*J},t.hoverData.justStartedPan=!1}else Ar={x:Ee[0]*J,y:Ee[1]*J};$.panBy(Ar),$.emit(st("dragpan")),t.hoverData.dragged=!0}ee=t.projectIntoViewport(k.clientX,k.clientY)}else if(se[4]==1&&(ce==null||ce.pannable()))Pe&&(!t.hoverData.dragging&&$.boxSelectionEnabled()&&(ot||!$.panningEnabled()||!$.userPanningEnabled())?dr():!t.hoverData.selecting&&$.panningEnabled()&&$.userPanningEnabled()&&o(ce,t.hoverData.downs)&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,se[4]=0,t.data.bgActivePosistion=qr(oe),t.redrawHint("select",!0),t.redraw()),ce&&ce.pannable()&&ce.active()&&ce.unactivate());else{if(ce&&ce.pannable()&&ce.active()&&ce.unactivate(),(!ce||!ce.grabbed())&&Ce!=Le&&(Le&&n(Le,["mouseout","tapdragout"],k,{x:ee[0],y:ee[1]}),Ce&&n(Ce,["mouseover","tapdragover"],k,{x:ee[0],y:ee[1]}),t.hoverData.last=Ce),ce)if(Pe){if($.boxSelectionEnabled()&&ot)ce&&ce.grabbed()&&(p(Ne),ce.emit(st("freeon")),Ne.emit(st("free")),t.dragData.didDrag&&(ce.emit(st("dragfreeon")),Ne.emit(st("dragfree")))),dr();else if(ce&&ce.grabbed()&&t.nodeIsDraggable(ce)){var wt=!t.dragData.didDrag;wt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||g(Ne,{inDragLayer:!0});var rt={x:0,y:0};if(ae(Ee[0])&&ae(Ee[1])&&(rt.x+=Ee[0],rt.y+=Ee[1],wt)){var xt=t.hoverData.dragDelta;xt&&ae(xt[0])&&ae(xt[1])&&(rt.x+=xt[0],rt.y+=xt[1])}t.hoverData.draggingEles=!0,Ne.silentShift(rt).emit(st("position")).emit(st("drag")),t.redrawHint("drag",!0),t.redraw()}}else Xe();z=!0}if(se[2]=ee[0],se[3]=ee[1],z)return k.stopPropagation&&k.stopPropagation(),k.preventDefault&&k.preventDefault(),!1}},"mousemoveHandler"),!1);var C,P,R;t.registerBinding(e,"mouseup",v(function(k){if(!(t.hoverData.which===1&&k.which!==1&&t.hoverData.capture)&&t.hoverData.capture){t.hoverData.capture=!1;var z=t.cy,$=t.projectIntoViewport(k.clientX,k.clientY),J=t.selection,Y=t.findNearestElement($[0],$[1],!0,!1),ee=t.dragData.possibleDragElements,oe=t.hoverData.down,fe=i(k);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,oe&&oe.unactivate();var se=v(function(Ue){return{originalEvent:k,type:Ue,position:{x:$[0],y:$[1]}}},"makeEvent");if(t.hoverData.which===3){var Ce=se("cxttapend");if(oe?oe.emit(Ce):z.emit(Ce),!t.hoverData.cxtDragged){var Le=se("cxttap");oe?oe.emit(Le):z.emit(Le)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(Y,["mouseup","tapend","vmouseup"],k,{x:$[0],y:$[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(oe,["click","tap","vclick"],k,{x:$[0],y:$[1]}),P=!1,k.timeStamp-R<=z.multiClickDebounceTime()?(C&&clearTimeout(C),P=!0,R=null,n(oe,["dblclick","dbltap","vdblclick"],k,{x:$[0],y:$[1]})):(C=setTimeout(function(){P||n(oe,["oneclick","onetap","voneclick"],k,{x:$[0],y:$[1]})},z.multiClickDebounceTime()),R=k.timeStamp)),oe==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(k)&&(z.$(r).unselect(["tapunselect"]),ee.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ee=z.collection()),Y==oe&&!t.dragData.didDrag&&!t.hoverData.selecting&&Y!=null&&Y._private.selectable&&(t.hoverData.dragging||(z.selectionType()==="additive"||fe?Y.selected()?Y.unselect(["tapunselect"]):Y.select(["tapselect"]):fe||(z.$(r).unmerge(Y).unselect(["tapunselect"]),Y.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var ce=z.collection(t.getAllInBox(J[0],J[1],J[2],J[3]));t.redrawHint("select",!0),ce.length>0&&t.redrawHint("eles",!0),z.emit(se("boxend"));var Ee=v(function(Ue){return Ue.selectable()&&!Ue.selected()},"eleWouldBeSelected");z.selectionType()==="additive"||fe||z.$(r).unmerge(ce).unselect(),ce.emit(se("box")).stdFilter(Ee).select().emit(se("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!J[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ne=oe&&oe.grabbed();p(ee),Ne&&(oe.emit(se("freeon")),ee.emit(se("free")),t.dragData.didDrag&&(oe.emit(se("dragfreeon")),ee.emit(se("dragfree"))))}}J[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}},"mouseupHandler"),!1);var A=[],L=4,M,I=1e5,O=v(function(k){for(var z=Math.abs(k[0]),$=1;$<k.length;$++)if(Math.abs(k[$])!==z)return!1;return!0},"allAreSameMagnitude"),V=v(function(k){var z=!1,$=k.deltaY;if($==null&&(k.wheelDeltaY!=null?$=k.wheelDeltaY/4:k.wheelDelta!=null&&($=k.wheelDelta/4)),$!==0){if(M==null)if(A.length>=L){M=!1;var J=A;if(J[0]>=5){var Y;O(J)?Y=J[0]:Y=mh(J),Y>1&&(M=!0,I=Y)}}else A.push(Math.abs($)),z=!0;else M&&(I=Math.min(Math.abs($),I));if(!t.scrollingPage){var ee=t.cy,oe=ee.zoom(),fe=ee.pan(),se=t.projectIntoViewport(k.clientX,k.clientY),Ce=[se[0]*oe+fe.x,se[1]*oe+fe.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||E()){k.preventDefault();return}if(ee.panningEnabled()&&ee.userPanningEnabled()&&ee.zoomingEnabled()&&ee.userZoomingEnabled()){k.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Le;z&&Math.abs($)>5&&($=es($)*5),Le=$/-250,M&&(Le/=I,Le*=3),Le=Le*t.wheelSensitivity,k.deltaMode===1&&(Le*=33);var ce=ee.zoom()*Math.pow(10,Le);k.type==="gesturechange"&&(ce=t.gestureStartZoom*k.scale),ee.zoom({level:ce,renderedPosition:{x:Ce[0],y:Ce[1]}}),ee.emit({type:k.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:k,position:{x:se[0],y:se[1]}})}}}},"wheelHandler");t.registerBinding(t.container,"wheel",V,!0),t.registerBinding(e,"scroll",v(function(k){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},"scrollHandler"),!0),t.registerBinding(t.container,"gesturestart",v(function(k){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||k.preventDefault()},"gestureStartHandler"),!0),t.registerBinding(t.container,"gesturechange",function(K){t.hasTouchStarted||V(K)},!0),t.registerBinding(t.container,"mouseout",v(function(k){var z=t.projectIntoViewport(k.clientX,k.clientY);t.cy.emit({originalEvent:k,type:"mouseout",position:{x:z[0],y:z[1]}})},"mouseOutHandler"),!1),t.registerBinding(t.container,"mouseover",v(function(k){var z=t.projectIntoViewport(k.clientX,k.clientY);t.cy.emit({originalEvent:k,type:"mouseover",position:{x:z[0],y:z[1]}})},"mouseOverHandler"),!1);var q,F,H,Q,U,W,X,re,j,Z,N,_,G,te=v(function(k,z,$,J){return Math.sqrt(($-k)*($-k)+(J-z)*(J-z))},"distance"),le=v(function(k,z,$,J){return($-k)*($-k)+(J-z)*(J-z)},"distanceSq"),xe;t.registerBinding(t.container,"touchstart",xe=v(function(k){if(t.hasTouchStarted=!0,!!D(k)){m(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var z=t.cy,$=t.touchData.now,J=t.touchData.earlier;if(k.touches[0]){var Y=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);$[0]=Y[0],$[1]=Y[1]}if(k.touches[1]){var Y=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);$[2]=Y[0],$[3]=Y[1]}if(k.touches[2]){var Y=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);$[4]=Y[0],$[5]=Y[1]}var ee=v(function(st){return{originalEvent:k,type:st,position:{x:$[0],y:$[1]}}},"makeEvent");if(k.touches[1]){t.touchData.singleTouchMoved=!0,p(t.dragData.touchDragEles);var oe=t.findContainerClientCoords();j=oe[0],Z=oe[1],N=oe[2],_=oe[3],q=k.touches[0].clientX-j,F=k.touches[0].clientY-Z,H=k.touches[1].clientX-j,Q=k.touches[1].clientY-Z,G=0<=q&&q<=N&&0<=H&&H<=N&&0<=F&&F<=_&&0<=Q&&Q<=_;var fe=z.pan(),se=z.zoom();U=te(q,F,H,Q),W=le(q,F,H,Q),X=[(q+H)/2,(F+Q)/2],re=[(X[0]-fe.x)/se,(X[1]-fe.y)/se];var Ce=200,Le=Ce*Ce;if(W<Le&&!k.touches[2]){var ce=t.findNearestElement($[0],$[1],!0,!0),Ee=t.findNearestElement($[2],$[3],!0,!0);ce&&ce.isNode()?(ce.activate().emit(ee("cxttapstart")),t.touchData.start=ce):Ee&&Ee.isNode()?(Ee.activate().emit(ee("cxttapstart")),t.touchData.start=Ee):z.emit(ee("cxttapstart")),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(k.touches[2])z.boxSelectionEnabled()&&k.preventDefault();else if(!k.touches[1]){if(k.touches[0]){var Ne=t.findNearestElements($[0],$[1],!0,!0),Pe=Ne[0];if(Pe!=null&&(Pe.activate(),t.touchData.start=Pe,t.touchData.starts=Ne,t.nodeIsGrabbable(Pe))){var Ue=t.dragData.touchDragEles=z.collection(),Ke=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Pe.selected()?(Ke=z.$(function(Xe){return Xe.selected()&&t.nodeIsGrabbable(Xe)}),g(Ke,{addToList:Ue})):d(Pe,{addToList:Ue}),l(Pe),Pe.emit(ee("grabon")),Ke?Ke.forEach(function(Xe){Xe.emit(ee("grab"))}):Pe.emit(ee("grab"))}n(Pe,["touchstart","tapstart","vmousedown"],k,{x:$[0],y:$[1]}),Pe==null&&(t.data.bgActivePosistion={x:Y[0],y:Y[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&n(t.touchData.start,["taphold"],k,{x:$[0],y:$[1]})},t.tapholdDuration)}}if(k.touches.length>=1){for(var ct=t.touchData.startPosition=[null,null,null,null,null,null],$e=0;$e<$.length;$e++)ct[$e]=J[$e]=$[$e];var ot=k.touches[0];t.touchData.startGPosition=[ot.clientX,ot.clientY]}}},"touchstartHandler"),!1);var be;t.registerBinding(e,"touchmove",be=v(function(k){var z=t.touchData.capture;if(!(!z&&!D(k))){var $=t.selection,J=t.cy,Y=t.touchData.now,ee=t.touchData.earlier,oe=J.zoom();if(k.touches[0]){var fe=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);Y[0]=fe[0],Y[1]=fe[1]}if(k.touches[1]){var fe=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);Y[2]=fe[0],Y[3]=fe[1]}if(k.touches[2]){var fe=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);Y[4]=fe[0],Y[5]=fe[1]}var se=v(function(Jf){return{originalEvent:k,type:Jf,position:{x:Y[0],y:Y[1]}}},"makeEvent"),Ce=t.touchData.startGPosition,Le;if(z&&k.touches[0]&&Ce){for(var ce=[],Ee=0;Ee<Y.length;Ee++)ce[Ee]=Y[Ee]-ee[Ee];var Ne=k.touches[0].clientX-Ce[0],Pe=Ne*Ne,Ue=k.touches[0].clientY-Ce[1];Le=Pe+Ue*Ue>=t.touchTapThreshold2}if(z&&t.touchData.cxt){k.preventDefault();var Ke=k.touches[0].clientX-j,ct=k.touches[0].clientY-Z,$e=k.touches[1].clientX-j,ot=k.touches[1].clientY-Z,Xe=le(Ke,ct,$e,ot),st=Xe/W,dr=150,Pr=dr*dr,Ar=1.5;if(st>=Ar*Ar||Xe>=Pr){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Yt=se("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Yt),t.touchData.start=null):J.emit(Yt)}}if(z&&t.touchData.cxt){var Yt=se("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Yt):J.emit(Yt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var wt=t.findNearestElement(Y[0],Y[1],!0,!0);(!t.touchData.cxtOver||wt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(se("cxtdragout")),t.touchData.cxtOver=wt,wt&&wt.emit(se("cxtdragover")))}else if(z&&k.touches[2]&&J.boxSelectionEnabled())k.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||J.emit(se("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,$[4]=1,!$||$.length===0||$[0]===void 0?($[0]=(Y[0]+Y[2]+Y[4])/3,$[1]=(Y[1]+Y[3]+Y[5])/3,$[2]=(Y[0]+Y[2]+Y[4])/3+1,$[3]=(Y[1]+Y[3]+Y[5])/3+1):($[2]=(Y[0]+Y[2]+Y[4])/3,$[3]=(Y[1]+Y[3]+Y[5])/3),t.redrawHint("select",!0),t.redraw();else if(z&&k.touches[1]&&!t.touchData.didSelect&&J.zoomingEnabled()&&J.panningEnabled()&&J.userZoomingEnabled()&&J.userPanningEnabled()){k.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var rt=t.dragData.touchDragEles;if(rt){t.redrawHint("drag",!0);for(var xt=0;xt<rt.length;xt++){var na=rt[xt]._private;na.grabbed=!1,na.rscratch.inDragLayer=!1}}var St=t.touchData.start,Ke=k.touches[0].clientX-j,ct=k.touches[0].clientY-Z,$e=k.touches[1].clientX-j,ot=k.touches[1].clientY-Z,ys=te(Ke,ct,$e,ot),$f=ys/U;if(G){var Wf=Ke-q,Uf=ct-F,Kf=$e-H,Yf=ot-Q,Xf=(Wf+Kf)/2,Zf=(Uf+Yf)/2,ia=J.zoom(),Kn=ia*$f,_a=J.pan(),ms=re[0]*ia+_a.x,bs=re[1]*ia+_a.y,Qf={x:-Kn/ia*(ms-_a.x-Xf)+ms,y:-Kn/ia*(bs-_a.y-Zf)+bs};if(St&&St.active()){var rt=t.dragData.touchDragEles;p(rt),t.redrawHint("drag",!0),t.redrawHint("eles",!0),St.unactivate().emit(se("freeon")),rt&&rt.emit(se("free")),t.dragData.didDrag&&(St.emit(se("dragfreeon")),rt&&rt.emit(se("dragfree")))}J.viewport({zoom:Kn,pan:Qf,cancelOnFailedZoom:!0}),J.emit(se("pinchzoom")),U=ys,q=Ke,F=ct,H=$e,Q=ot,t.pinching=!0}if(k.touches[0]){var fe=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);Y[0]=fe[0],Y[1]=fe[1]}if(k.touches[1]){var fe=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);Y[2]=fe[0],Y[3]=fe[1]}if(k.touches[2]){var fe=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);Y[4]=fe[0],Y[5]=fe[1]}}else if(k.touches[0]&&!t.touchData.didSelect){var Pt=t.touchData.start,Yn=t.touchData.last,wt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(wt=t.findNearestElement(Y[0],Y[1],!0,!0)),z&&Pt!=null&&k.preventDefault(),z&&Pt!=null&&t.nodeIsDraggable(Pt))if(Le){var rt=t.dragData.touchDragEles,ws=!t.dragData.didDrag;ws&&g(rt,{inDragLayer:!0}),t.dragData.didDrag=!0;var oa={x:0,y:0};if(ae(ce[0])&&ae(ce[1])&&(oa.x+=ce[0],oa.y+=ce[1],ws)){t.redrawHint("eles",!0);var At=t.touchData.dragDelta;At&&ae(At[0])&&ae(At[1])&&(oa.x+=At[0],oa.y+=At[1])}t.hoverData.draggingEles=!0,rt.silentShift(oa).emit(se("position")).emit(se("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==ee[0]&&t.touchData.startPosition[1]==ee[1]&&t.redrawHint("eles",!0),t.redraw()}else{var At=t.touchData.dragDelta=t.touchData.dragDelta||[];At.length===0?(At.push(ce[0]),At.push(ce[1])):(At[0]+=ce[0],At[1]+=ce[1])}if(n(Pt||wt,["touchmove","tapdrag","vmousemove"],k,{x:Y[0],y:Y[1]}),(!Pt||!Pt.grabbed())&&wt!=Yn&&(Yn&&Yn.emit(se("tapdragout")),wt&&wt.emit(se("tapdragover"))),t.touchData.last=wt,z)for(var xt=0;xt<Y.length;xt++)Y[xt]&&t.touchData.startPosition[xt]&&Le&&(t.touchData.singleTouchMoved=!0);if(z&&(Pt==null||Pt.pannable())&&J.panningEnabled()&&J.userPanningEnabled()){o(Pt,t.touchData.starts)&&(k.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=qr(t.touchData.startPosition)),t.swipePanning?(J.panBy({x:ce[0]*oe,y:ce[1]*oe}),J.emit(se("dragpan"))):Le&&(t.swipePanning=!0,J.panBy({x:Ne*oe,y:Ue*oe}),J.emit(se("dragpan")),Pt&&(Pt.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var fe=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);Y[0]=fe[0],Y[1]=fe[1]}}for(var Ee=0;Ee<Y.length;Ee++)ee[Ee]=Y[Ee];z&&k.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},"touchmoveHandler"),!1);var De;t.registerBinding(e,"touchcancel",De=v(function(k){var z=t.touchData.start;t.touchData.capture=!1,z&&z.unactivate()},"touchcancelHandler"));var ve,ne,he,ye;if(t.registerBinding(e,"touchend",ve=v(function(k){var z=t.touchData.start;if(t.touchData.capture)k.touches.length===0&&(t.touchData.capture=!1),k.preventDefault();else return;var $=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var J=t.cy,Y=J.zoom(),ee=t.touchData.now,oe=t.touchData.earlier;if(k.touches[0]){var fe=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);ee[0]=fe[0],ee[1]=fe[1]}if(k.touches[1]){var fe=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);ee[2]=fe[0],ee[3]=fe[1]}if(k.touches[2]){var fe=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);ee[4]=fe[0],ee[5]=fe[1]}var se=v(function(Xe){return{originalEvent:k,type:Xe,position:{x:ee[0],y:ee[1]}}},"makeEvent");z&&z.unactivate();var Ce;if(t.touchData.cxt){if(Ce=se("cxttapend"),z?z.emit(Ce):J.emit(Ce),!t.touchData.cxtDragged){var Le=se("cxttap");z?z.emit(Le):J.emit(Le)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!k.touches[2]&&J.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var ce=J.collection(t.getAllInBox($[0],$[1],$[2],$[3]));$[0]=void 0,$[1]=void 0,$[2]=void 0,$[3]=void 0,$[4]=0,t.redrawHint("select",!0),J.emit(se("boxend")),ce.emit(se("box")).stdFilter(v(function(Xe){return Xe.selectable()&&!Xe.selected()},"eleWouldBeSelected")).select().emit(se("boxselect")),ce.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(z?.unactivate(),k.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!k.touches[1]){if(!k.touches[0]){if(!k.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ee=t.dragData.touchDragEles;if(z!=null){var Ne=z._private.grabbed;p(Ee),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ne&&(z.emit(se("freeon")),Ee.emit(se("free")),t.dragData.didDrag&&(z.emit(se("dragfreeon")),Ee.emit(se("dragfree")))),n(z,["touchend","tapend","vmouseup","tapdragout"],k,{x:ee[0],y:ee[1]}),z.unactivate(),t.touchData.start=null}else n(t.findNearestElement(ee[0],ee[1],!0,!0),["touchend","tapend","vmouseup","tapdragout"],k,{x:ee[0],y:ee[1]});var Pe=t.touchData.startPosition[0]-ee[0],Ue=Pe*Pe,Ke=t.touchData.startPosition[1]-ee[1],ct=(Ue+Ke*Ke)*Y*Y;t.touchData.singleTouchMoved||(z||J.$(":selected").unselect(["tapunselect"]),n(z,["tap","vclick"],k,{x:ee[0],y:ee[1]}),ne=!1,k.timeStamp-ye<=J.multiClickDebounceTime()?(he&&clearTimeout(he),ne=!0,ye=null,n(z,["dbltap","vdblclick"],k,{x:ee[0],y:ee[1]})):(he=setTimeout(function(){ne||n(z,["onetap","voneclick"],k,{x:ee[0],y:ee[1]})},J.multiClickDebounceTime()),ye=k.timeStamp)),z!=null&&!t.dragData.didDrag&&z._private.selectable&&ct<t.touchTapThreshold2&&!t.pinching&&(J.selectionType()==="single"?(J.$(r).unmerge(z).unselect(["tapunselect"]),z.select(["tapselect"])):z.selected()?z.unselect(["tapunselect"]):z.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var $e=0;$e<ee.length;$e++)oe[$e]=ee[$e];t.dragData.didDrag=!1,k.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),k.touches.length<2&&(k.touches.length===1&&(t.touchData.startGPosition=[k.touches[0].clientX,k.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},"touchendHandler"),!1),typeof TouchEvent>"u"){var me=[],ge=v(function(k){return{clientX:k.clientX,clientY:k.clientY,force:1,identifier:k.pointerId,pageX:k.pageX,pageY:k.pageY,radiusX:k.width/2,radiusY:k.height/2,screenX:k.screenX,screenY:k.screenY,target:k.target}},"makeTouch"),Se=v(function(k){return{event:k,touch:ge(k)}},"makePointer"),Be=v(function(k){me.push(Se(k))},"addPointer"),ke=v(function(k){for(var z=0;z<me.length;z++)if(me[z].event.pointerId===k.pointerId){me.splice(z,1);return}},"removePointer"),Ve=v(function(k){var z=me.filter(function($){return $.event.pointerId===k.pointerId})[0];z.event=k,z.touch=ge(k)},"updatePointer"),we=v(function(k){k.touches=me.map(function(z){return z.touch})},"addTouchesToEvent"),ie=v(function(k){return k.pointerType==="mouse"||k.pointerType===4},"pointerIsMouse");t.registerBinding(t.container,"pointerdown",function(K){ie(K)||(K.preventDefault(),Be(K),we(K),xe(K))}),t.registerBinding(t.container,"pointerup",function(K){ie(K)||(ke(K),we(K),ve(K))}),t.registerBinding(t.container,"pointercancel",function(K){ie(K)||(ke(K),we(K),De(K))}),t.registerBinding(t.container,"pointermove",function(K){ie(K)||(K.preventDefault(),Ve(K),we(K),be(K))})}};var Ut={};Ut.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:v(function(a,n,i,o,s,u){this.renderer.nodeShapeImpl("polygon",a,n,i,o,s,this.points)},"draw"),intersectLine:v(function(a,n,i,o,s,u,l,f){return Ta(s,u,this.points,a,n,i/2,o/2,l)},"intersectLine"),checkPoint:v(function(a,n,i,o,s,u,l,f){return Wt(a,n,this.points,u,l,o,s,[0,-1],i)},"checkPoint"),hasMiterBounds:t!=="rectangle",miterBounds:v(function(a,n,i,o,s,u){return Bh(this.points,a,n,i,o,s)},"miterBounds")}};Ut.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:v(function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},"draw"),intersectLine:v(function(e,r,a,n,i,o,s,u){return Oh(i,o,e,r,a/2+s,n/2+s)},"intersectLine"),checkPoint:v(function(e,r,a,n,i,o,s,u){return xr(e,r,n,i,o,s,a)},"checkPoint")}};Ut.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:v(function(a,n,i,o,s,u,l){if(u[l]!==void 0&&u[l+"-cx"]===a&&u[l+"-cy"]===n&&u[l+"-w"]===i&&u[l+"-h"]===o&&u[l+"-corner-radius"]===s)return u[l];u[l]=new Array(e.length/2),u[l+"-cx"]=a,u[l+"-cy"]=n,u[l+"-w"]=i,u[l+"-h"]=o,u[l+"-corner-radius"]=s;var f=i/2,c=o/2;s=s==="auto"?xv(i,o):s;for(var h=new Array(e.length/2),g=0;g<e.length/2;g++)h[g]={x:a+f*e[g*2],y:n+c*e[g*2+1]};var d,p,y,m,w=h.length;for(p=h[w-1],d=0;d<w;d++)y=h[d%w],m=h[(d+1)%w],u[l][d]=hs(p,y,m,s),p=y,y=m;return u[l]},"getOrCreateCorners"),draw:v(function(a,n,i,o,s,u,l){this.renderer.nodeShapeImpl("round-polygon",a,n,i,o,s,this.points,this.getOrCreateCorners(n,i,o,s,u,l,"drawCorners"))},"draw"),intersectLine:v(function(a,n,i,o,s,u,l,f,c){return zh(s,u,this.points,a,n,i,o,l,this.getOrCreateCorners(a,n,i,o,f,c,"corners"))},"intersectLine"),checkPoint:v(function(a,n,i,o,s,u,l,f,c){return Ih(a,n,this.points,u,l,o,s,this.getOrCreateCorners(u,l,o,s,f,c,"corners"))},"checkPoint")}};Ut.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:pt(4,0),draw:v(function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,o)},"draw"),intersectLine:v(function(e,r,a,n,i,o,s,u){return bv(i,o,e,r,a,n,s,u)},"intersectLine"),checkPoint:v(function(e,r,a,n,i,o,s,u){var l=n/2,f=i/2;u=u==="auto"?ir(n,i):u,u=Math.min(l,f,u);var c=u*2;return!!(Wt(e,r,this.points,o,s,n,i-c,[0,-1],a)||Wt(e,r,this.points,o,s,n-c,i,[0,-1],a)||xr(e,r,c,c,o-l+u,s-f+u,a)||xr(e,r,c,c,o+l-u,s-f+u,a)||xr(e,r,c,c,o+l-u,s+f-u,a)||xr(e,r,c,c,o-l+u,s+f-u,a))},"checkPoint")}};Ut.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:rs(),points:pt(4,0),draw:v(function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,null,o)},"draw"),generateCutTrianglePts:v(function(e,r,a,n,i){var o=i==="auto"?this.cornerLength:i,s=r/2,u=e/2,l=a-u,f=a+u,c=n-s,h=n+s;return{topLeft:[l,c+o,l+o,c,l+o,c+o],topRight:[f-o,c,f,c+o,f-o,c+o],bottomRight:[f,h-o,f-o,h,f-o,h-o],bottomLeft:[l+o,h,l,h-o,l+o,h-o]}},"generateCutTrianglePts"),intersectLine:v(function(e,r,a,n,i,o,s,u){var l=this.generateCutTrianglePts(a+2*s,n+2*s,e,r,u);return Ta(i,o,[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]),e,r)},"intersectLine"),checkPoint:v(function(e,r,a,n,i,o,s,u){var l=u==="auto"?this.cornerLength:u;if(Wt(e,r,this.points,o,s,n,i-2*l,[0,-1],a)||Wt(e,r,this.points,o,s,n-2*l,i,[0,-1],a))return!0;var f=this.generateCutTrianglePts(n,i,o,s);return Et(e,r,f.topLeft)||Et(e,r,f.topRight)||Et(e,r,f.bottomRight)||Et(e,r,f.bottomLeft)},"checkPoint")}};Ut.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:pt(4,0),draw:v(function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},"draw"),intersectLine:v(function(e,r,a,n,i,o,s,u){var l=.15,f=.5,c=.85,h=this.generateBarrelBezierPts(a+2*s,n+2*s,e,r),g=v(function(p){var y=Hr({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},l),m=Hr({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},f),w=Hr({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},c);return[p[0],p[1],y.x,y.y,m.x,m.y,w.x,w.y,p[4],p[5]]},"approximateBarrelCurvePts");return Ta(i,o,[].concat(g(h.topLeft),g(h.topRight),g(h.bottomRight),g(h.bottomLeft)),e,r)},"intersectLine"),generateBarrelBezierPts:v(function(e,r,a,n){var i=r/2,o=e/2,s=a-o,u=a+o,l=n-i,f=n+i,c=ko(e,r),h=c.heightOffset,g=c.widthOffset,d=c.ctrlPtOffsetPct*e,p={topLeft:[s,l+h,s+d,l,s+g,l],topRight:[u-g,l,u-d,l,u,l+h],bottomRight:[u,f-h,u-d,f,u-g,f],bottomLeft:[s+g,f,s+d,f,s,f-h]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},"generateBarrelBezierPts"),checkPoint:v(function(e,r,a,n,i,o,s,u){var l=ko(n,i),f=l.heightOffset,c=l.widthOffset;if(Wt(e,r,this.points,o,s,n,i-2*f,[0,-1],a)||Wt(e,r,this.points,o,s,n-2*c,i,[0,-1],a))return!0;for(var h=this.generateBarrelBezierPts(n,i,o,s),g=v(function(E,D,B){var C=B[4],P=B[2],R=B[0],A=B[5],L=B[1];if(Math.min(C,R)<=E&&E<=Math.max(C,R)&&Math.min(A,L)<=D&&D<=Math.max(A,L)){var M=Fh(C,P,R),I=Ah(M[0],M[1],M[2],E).filter(function(O){return 0<=O&&O<=1});if(I.length>0)return I[0]}return null},"getCurveT"),d=Object.keys(h),p=0;p<d.length;p++){var y=h[d[p]],m=g(e,r,y);if(m!=null){var w=y[5],b=y[3],x=y[1],S=at(w,b,x,m);if(y.isTop&&S<=r||y.isBottom&&r<=S)return!0}}return!1},"checkPoint")}};Ut.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:pt(4,0),draw:v(function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,o)},"draw"),intersectLine:v(function(e,r,a,n,i,o,s,u){var l=e-(a/2+s),f=r-(n/2+s),c=f,h=er(i,o,e,r,l,f,e+(a/2+s),c,!1);return h.length>0?h:bv(i,o,e,r,a,n,s,u)},"intersectLine"),checkPoint:v(function(e,r,a,n,i,o,s,u){u=u==="auto"?ir(n,i):u;var l=2*u;if(Wt(e,r,this.points,o,s,n,i-l,[0,-1],a)||Wt(e,r,this.points,o,s,n-l,i,[0,-1],a))return!0;var f=n/2+2*a,c=i/2+2*a;return!!(Et(e,r,[o-f,s-c,o-f,s,o+f,s,o+f,s-c])||xr(e,r,l,l,o+n/2-u,s+i/2-u,a)||xr(e,r,l,l,o-n/2+u,s+i/2-u,a))},"checkPoint")}};Ut.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",pt(3,0)),this.generateRoundPolygon("round-triangle",pt(3,0)),this.generatePolygon("rectangle",pt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r),this.generatePolygon("pentagon",pt(5,0)),this.generateRoundPolygon("round-pentagon",pt(5,0)),this.generatePolygon("hexagon",pt(6,0)),this.generateRoundPolygon("round-hexagon",pt(6,0)),this.generatePolygon("heptagon",pt(7,0)),this.generateRoundPolygon("round-heptagon",pt(7,0)),this.generatePolygon("octagon",pt(8,0)),this.generateRoundPolygon("round-octagon",pt(8,0));var a=new Array(20),n=Bo(5,0),i=Bo(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<5;s++)a[s*4]=n[s*2],a[s*4+1]=n[s*2+1],a[s*4+2]=i[s*2],a[s*4+3]=i[s*2+1];a=wv(a),this.generatePolygon("star",a),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u),t.makePolygon=function(l){var f="polygon-"+l.join("$"),c;return(c=this[f])?c:e.generatePolygon(f,l)}};var Va={};Va.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Va.redraw=function(t){t=t||dv();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};Va.beforeRender=function(t,e){if(!this.destroyed){e==null&&He("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(a,n){return n.priority-a.priority})}};var Ml=v(function(e,r,a){for(var n=e.beforeRenderCallbacks,i=0;i<n.length;i++)n[i].fn(r,a)},"beforeRenderCallbacks");Va.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=v(function(n){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){Ml(t,!0,n);var i=$t();t.render(t.renderOptions);var o=t.lastDrawTime=$t();t.averageRedrawTime===void 0&&(t.averageRedrawTime=o-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var s=o-i;t.redrawTotalTime+=s,t.lastRedrawTime=s,t.averageRedrawTime=t.averageRedrawTime/2+s/2,t.requestedFrame=!1}else Ml(t,!1,n);t.skipFrame=!1,pn(r)}},"renderFn");pn(r)}};var Cf=v(function(e){this.init(e)},"BaseRenderer"),aa=Cf.prototype;aa.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];aa.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),a=e.cy.window();if(a){var n=a.document,i=n.head,o="__________cytoscape_stylesheet",s="__________cytoscape_container",u=n.getElementById(o)!=null;if(r.className.indexOf(s)<0&&(r.className=(r.className||"")+" "+s),!u){var l=n.createElement("style");l.id=o,l.textContent="."+s+" { position: relative; }",i.insertBefore(l,i.children[0])}a.getComputedStyle(r).getPropertyValue("position")==="static"&&Oe("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=ae(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};aa.notify=function(t,e){var r=this,a=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&a.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),t==="gc"&&r.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};aa.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],a=r.target;(a.off||a.removeEventListener).apply(a,r.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};aa.isHeadless=function(){return!1};[cs,wf,xf,ra,Ut,Va].forEach(function(t){pe(aa,t)});var mo=1e3/60,Tf={setupDequeueing:v(function(e){return v(function(){var a=this,n=this.renderer;if(!a.dequeueingSetup){a.dequeueingSetup=!0;var i=Ia(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),o=v(function(l,f){var c=$t(),h=n.averageRedrawTime,g=n.lastRedrawTime,d=[],p=n.cy.extent(),y=n.getPixelRatio();for(l||n.flushRenderedStyleQueue();;){var m=$t(),w=m-c,b=m-f;if(g<mo){var x=mo-(l?h:0);if(b>=e.deqFastCost*x)break}else if(l){if(w>=e.deqCost*g||w>=e.deqAvgCost*h)break}else if(b>=e.deqNoDrawCost*mo)break;var S=e.deq(a,y,p);if(S.length>0)for(var T=0;T<S.length;T++)d.push(S[T]);else break}d.length>0&&(e.onDeqd(a,d),!l&&e.shouldRedraw(a,d,y,p)&&i())},"dequeue"),s=e.priority||Qo;n.beforeRender(o,s(a))}},"setupDequeueingImpl")},"setupDequeueing")},Vp=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yn;lr(this,t),this.idsByKey=new Ht,this.keyForId=new Ht,this.cachesByLvl=new Ht,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return v(t,"ElementTextureCacheLookup"),vr(t,[{key:"getIdsFor",value:v(function(r){r==null&&He("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);return n||(n=new jr,a.set(r,n)),n},"getIdsFor")},{key:"addIdForKey",value:v(function(r,a){r!=null&&this.getIdsFor(r).add(a)},"addIdForKey")},{key:"deleteIdForKey",value:v(function(r,a){r!=null&&this.getIdsFor(r).delete(a)},"deleteIdForKey")},{key:"getNumberOfIdsForKey",value:v(function(r){return r==null?0:this.getIdsFor(r).size},"getNumberOfIdsForKey")},{key:"updateKeyMappingFor",value:v(function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)},"updateKeyMappingFor")},{key:"deleteKeyMappingFor",value:v(function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)},"deleteKeyMappingFor")},{key:"keyHasChangedFor",value:v(function(r){var a=r.id();return this.keyForId.get(a)!==this.getKey(r)},"keyHasChangedFor")},{key:"isInvalid",value:v(function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)},"isInvalid")},{key:"getCachesAt",value:v(function(r){var a=this.cachesByLvl,n=this.lvls,i=a.get(r);return i||(i=new Ht,a.set(r,i),n.push(r)),i},"getCachesAt")},{key:"getCache",value:v(function(r,a){return this.getCachesAt(a).get(r)},"getCache")},{key:"get",value:v(function(r,a){var n=this.getKey(r),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(r),i},"get")},{key:"getForCachedKey",value:v(function(r,a){var n=this.keyForId.get(r.id());return this.getCache(n,a)},"getForCachedKey")},{key:"hasCache",value:v(function(r,a){return this.getCachesAt(a).has(r)},"hasCache")},{key:"has",value:v(function(r,a){var n=this.getKey(r);return this.hasCache(n,a)},"has")},{key:"setCache",value:v(function(r,a,n){n.key=r,this.getCachesAt(a).set(r,n)},"setCache")},{key:"set",value:v(function(r,a,n){var i=this.getKey(r);this.setCache(i,a,n),this.updateKeyMappingFor(r)},"set")},{key:"deleteCache",value:v(function(r,a){this.getCachesAt(a).delete(r)},"deleteCache")},{key:"delete",value:v(function(r,a){var n=this.getKey(r);this.deleteCache(n,a)},"_delete")},{key:"invalidateKey",value:v(function(r){var a=this;this.lvls.forEach(function(n){return a.deleteCache(r,n)})},"invalidateKey")},{key:"invalidate",value:v(function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0},"invalidate")}])})(),Ll=25,en=50,cn=-4,_o=3,Sf=7.99,qp=8,_p=1024,Gp=1024,Hp=1024,$p=.2,Wp=.8,Up=10,Kp=.15,Yp=.1,Xp=.9,Zp=.9,Qp=100,Jp=1,Gr={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},jp=vt({getKey:null,doesEleInvalidateKey:yn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:fv,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ga=v(function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=jp(r);pe(a,n),a.lookup=new Vp(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},"ElementTextureCache"),tt=ga.prototype;tt.reasons=Gr;tt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};tt.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{};return r[t]=r[t]||[]};tt.getElementQueue=function(){var t=this;return t.eleCacheQueue=t.eleCacheQueue||new Oa(function(e,r){return r.reqs-e.reqs})};tt.getElementKeyToQueue=function(){var t=this;return t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{}};tt.getElement=function(t,e,r,a,n){var i=this,o=this.renderer,s=o.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(a==null&&(a=Math.ceil(jo(s*r))),a<cn)a=cn;else if(s>=Sf||a>_o)return null;var l=Math.pow(2,a),f=e.h*l,c=e.w*l,h=o.eleTextBiggerThanMin(t,l);if(!this.isVisible(t,h))return null;var g=u.get(t,a);if(g&&g.invalidated&&(g.invalidated=!1,g.texture.invalidatedWidth-=g.width),g)return g;var d;if(f<=Ll?d=Ll:f<=en?d=en:d=Math.ceil(f/en)*en,f>Hp||c>Gp)return null;var p=i.getTextureQueue(d),y=p[p.length-2],m=v(function(){return i.recycleTexture(d,c)||i.addTexture(d,c)},"addNewTxr");y||(y=p[p.length-1]),y||(y=m()),y.width-y.usedWidth<c&&(y=m());for(var w=v(function(I){return I&&I.scaledLabelShown===h},"scalableFrom"),b=n&&n===Gr.dequeue,x=n&&n===Gr.highQuality,S=n&&n===Gr.downscale,T,E=a+1;E<=_o;E++){var D=u.get(t,E);if(D){T=D;break}}var B=T&&T.level===a+1?T:null,C=v(function(){y.context.drawImage(B.texture.canvas,B.x,0,B.width,B.height,y.usedWidth,0,c,f)},"downscale");if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,c,d),w(B))C();else if(w(T))if(x){for(var P=T.level;P>a;P--)B=i.getElement(t,e,r,P,Gr.downscale);C()}else return i.queueElement(t,T.level-1),T;else{var R;if(!b&&!x&&!S)for(var A=a-1;A>=cn;A--){var L=u.get(t,A);if(L){R=L;break}}if(w(R))return i.queueElement(t,a),R;y.context.translate(y.usedWidth,0),y.context.scale(l,l),this.drawElement(y.context,t,e,h,!1),y.context.scale(1/l,1/l),y.context.translate(-y.usedWidth,0)}return g={x:y.usedWidth,texture:y,level:a,scale:l,width:c,height:f,scaledLabelShown:h},y.usedWidth+=Math.ceil(c+qp),y.eleCaches.push(g),u.set(t,a,g),i.checkTextureFullness(y),g};tt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};tt.invalidateElement=function(t){var e=this,r=e.lookup,a=[];if(r.isInvalid(t)){for(var n=cn;n<=_o;n++){var i=r.getForCachedKey(t,n);i&&a.push(i)}if(r.invalidate(t))for(var o=0;o<a.length;o++){var s=a[o],u=s.texture;u.invalidatedWidth+=s.width,s.invalidated=!0,e.checkTextureUtility(u)}e.removeFromQueue(t)}};tt.checkTextureUtility=function(t){t.invalidatedWidth>=$p*t.width&&this.retireTexture(t)};tt.checkTextureFullness=function(t){var e=this.getTextureQueue(t.height);t.usedWidth/t.width>Wp&&t.fullnessChecks>=Up?nr(e,t):t.fullnessChecks++};tt.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;nr(a,t),t.retired=!0;for(var i=t.eleCaches,o=0;o<i.length;o++){var s=i[o];n.deleteCache(s.key,s.level)}Jo(i),e.getRetiredTextureQueue(r).push(t)};tt.addTexture=function(t,e){var r=this,a=r.getTextureQueue(t),n={};return a.push(n),n.eleCaches=[],n.height=t,n.width=Math.max(_p,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=r.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n};tt.recycleTexture=function(t,e){for(var r=this,a=r.getTextureQueue(t),n=r.getRetiredTextureQueue(t),i=0;i<n.length;i++){var o=n[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Jo(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),nr(n,o),a.push(o),o}};tt.queueElement=function(t,e){var r=this,a=r.getElementQueue(),n=r.getElementKeyToQueue(),i=this.getKey(t),o=n[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,a.updateItem(o);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:i};a.push(s),n[i]=s}};tt.dequeue=function(t){for(var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,o=0;o<Jp&&r.size()>0;o++){var s=r.pop(),u=s.key,l=s.eles[0],f=i.hasCache(l,s.level);if(a[u]=null,f)continue;n.push(s);var c=e.getBoundingBox(l);e.getElement(l,c,t,s.level,Gr.dequeue)}return n};tt.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(t),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=Zo,r.updateItem(i),r.pop(),a[n]=null):i.eles.unmerge(t))};tt.onDequeue=function(t){this.onDequeues.push(t)};tt.offDequeue=function(t){nr(this.onDequeues,t)};tt.setupDequeueing=Tf.setupDequeueing({deqRedrawThreshold:Qp,deqCost:Kp,deqAvgCost:Yp,deqNoDrawCost:Xp,deqFastCost:Zp,deq:v(function(e,r,a){return e.dequeue(r,a)},"deq"),onDeqd:v(function(e,r){for(var a=0;a<e.onDequeues.length;a++){var n=e.onDequeues[a];n(r)}},"onDeqd"),shouldRedraw:v(function(e,r,a,n){for(var i=0;i<r.length;i++)for(var o=r[i].eles,s=0;s<o.length;s++)if(ts(o[s].boundingBox(),n))return!0;return!1},"shouldRedraw"),priority:v(function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq},"priority")});var ey=1,ma=-4,Bn=2,ty=3.99,ry=50,ay=50,ny=.15,iy=.1,oy=.9,sy=.9,uy=1,Il=250,ly=16e6,Ol=32767,vy=!0,Df=v(function(e){var r=this,a=r.renderer=e,n=a.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=$t()-2*Il,r.skipping=!1,r.eleTxrDeqs=n.collection(),r.scheduleElementRefinement=Ia(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},ay),a.beforeRender(function(i,o){o-r.lastInvalidationTime<=Il?r.skipping=!0:r.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip),r.layersQueue=new Oa(v(function(o,s){return s.reqs-o.reqs},"qSort")),r.setupDequeueing()},"LayeredTextureCache"),ft=Df.prototype,Nl=0,fy=Math.pow(2,53)-1;ft.makeLayer=function(t,e){var r=Math.pow(2,e),a=Math.ceil(t.w*r),n=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(a,n),o={id:Nl=++Nl%fy,bb:t,level:e,width:a,height:n,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,u=-o.bb.x1,l=-o.bb.y1;return s.scale(r,r),s.translate(u,l),o};ft.getLayers=function(t,e,r){var a=this,n=a.renderer.cy.zoom(),i=a.firstGet;if(a.firstGet=!1,r==null){if(r=Math.ceil(jo(n*e)),r<ma)r=ma;else if(n>=ty||r>Bn)return null}a.validateLayersElesOrdering(r,t);var o=a.layersByLevel,s=Math.pow(2,r),u=o[r]=o[r]||[],l,f=a.levelIsComplete(r,t),c,h=v(function(){var D=v(function(A){if(a.validateLayersElesOrdering(A,t),a.levelIsComplete(A,t))return c=o[A],!0},"canUseAsTmpLvl"),B=v(function(A){if(!c)for(var L=r+A;ma<=L&&L<=Bn&&!D(L);L+=A);},"checkLvls");B(1),B(-1);for(var C=u.length-1;C>=0;C--){var P=u[C];P.invalid&&nr(u,P)}},"checkTempLevels");if(!f)h();else return u;var g=v(function(){if(!l){l=mt();for(var D=0;D<t.length;D++)Th(l,t[D].boundingBox())}return l},"getBb"),d=v(function(D){D=D||{};var B=D.after;g();var C=Math.ceil(l.w*s),P=Math.ceil(l.h*s);if(C>Ol||P>Ol||C*P>ly)return null;var R=a.makeLayer(l,r);if(B!=null){var A=u.indexOf(B)+1;u.splice(A,0,R)}else(D.insert===void 0||D.insert)&&u.unshift(R);return R},"makeLayer");if(a.skipping&&!i)return null;for(var p=null,y=t.length/ey,m=!i,w=0;w<t.length;w++){var b=t[w],x=b._private.rscratch,S=x.imgLayerCaches=x.imgLayerCaches||{},T=S[r];if(T){p=T;continue}if((!p||p.eles.length>=y||!mv(p.bb,b.boundingBox()))&&(p=d({insert:!0,after:p}),!p))return null;c||m?a.queueLayer(p,b):a.drawEleInLayer(p,b,r,e),p.eles.push(b),S[r]=p}return c||(m?null:u)};ft.getEleLevelForLayerLevel=function(t,e){return t};ft.drawEleInLayer=function(t,e,r,a){var n=this,i=this.renderer,o=t.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(r=n.getEleLevelForLayerLevel(r,a),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,r,vy),i.setImgSmoothing(o,!0))};ft.levelIsComplete=function(t,e){var r=this.layersByLevel[t];if(!r||r.length===0)return!1;for(var a=0,n=0;n<r.length;n++){var i=r[n];if(i.reqs>0||i.invalid)return!1;a+=i.eles.length}return a===e.length};ft.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var a=0;a<r.length;a++){for(var n=r[a],i=-1,o=0;o<e.length;o++)if(n.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(n);continue}for(var s=i,o=0;o<n.eles.length;o++)if(n.eles[o]!==e[s+o]){this.invalidateLayer(n);break}}};ft.updateElementsInLayers=function(t,e){for(var r=this,a=Aa(t[0]),n=0;n<t.length;n++)for(var i=a?null:t[n],o=a?t[n]:t[n].ele,s=o._private.rscratch,u=s.imgLayerCaches=s.imgLayerCaches||{},l=ma;l<=Bn;l++){var f=u[l];f&&(i&&r.getEleLevelForLayerLevel(f.level)!==i.level||e(f,o,i))}};ft.haveLayers=function(){for(var t=this,e=!1,r=ma;r<=Bn;r++){var a=t.layersByLevel[r];if(a&&a.length>0){e=!0;break}}return e};ft.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=$t(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,v(function(a,n,i){e.invalidateLayer(a)},"invalAssocLayers")))};ft.invalidateLayer=function(t){if(this.lastInvalidationTime=$t(),!t.invalid){var e=t.level,r=t.eles,a=this.layersByLevel[e];nr(a,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var n=0;n<r.length;n++){var i=r[n]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}};ft.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,v(function(a,n,i){var o=a.replacement;if(o||(o=a.replacement=e.makeLayer(a.bb,a.level),o.replaces=a,o.eles=a.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])},"refineEachEle"))};ft.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};ft.queueLayer=function(t,e){var r=this.layersQueue,a=t.elesQueue,n=a.hasId=a.hasId||{};if(!t.replacement){if(e){if(n[e.id()])return;a.push(e),n[e.id()]=!0}t.reqs?(t.reqs++,r.updateItem(t)):(t.reqs=1,r.push(t))}};ft.dequeue=function(t){for(var e=this,r=e.layersQueue,a=[],n=0;n<uy&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,t),n++),a.length===0&&a.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return a};ft.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],a=t.replaces,n=r.indexOf(a);if(!(n<0||a.invalid)){r[n]=t;for(var i=0;i<t.eles.length;i++){var o=t.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[t.level]=t)}e.requestRedraw()}};ft.requestRedraw=Ia(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);ft.setupDequeueing=Tf.setupDequeueing({deqRedrawThreshold:ry,deqCost:ny,deqAvgCost:iy,deqNoDrawCost:oy,deqFastCost:sy,deq:v(function(e,r){return e.dequeue(r)},"deq"),onDeqd:Qo,shouldRedraw:fv,priority:v(function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq},"priority")});var Bf={},zl;function cy(t,e){for(var r=0;r<e.length;r++){var a=e[r];t.lineTo(a.x,a.y)}}v(cy,"polygon");function hy(t,e,r){for(var a,n=0;n<e.length;n++){var i=e[n];n===0&&(a=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,a.x,a.y)}v(hy,"triangleBackcurve");function Fl(t,e,r){t.beginPath&&t.beginPath();for(var a=e,n=0;n<a.length;n++){var i=a[n];t.lineTo(i.x,i.y)}var o=r,s=r[0];t.moveTo(s.x,s.y);for(var n=1;n<o.length;n++){var i=o[n];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}v(Fl,"triangleTee");function dy(t,e,r,a,n){t.beginPath&&t.beginPath(),t.arc(r,a,n,0,Math.PI*2,!1);var i=e,o=i[0];t.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var u=i[s];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}v(dy,"circleTriangle");function gy(t,e,r,a){t.arc(e,r,a,0,Math.PI*2,!1)}v(gy,"circle$1");Bf.arrowShapeImpl=function(t){return(zl||(zl={polygon:cy,"triangle-backcurve":hy,"triangle-tee":Fl,"circle-triangle":dy,"triangle-cross":Fl,circle:gy}))[t]};var _t={};_t.drawElement=function(t,e,r,a,n,i){var o=this;e.isNode()?o.drawNode(t,e,r,a,n,i):o.drawEdge(t,e,r,a,n,i)};_t.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};_t.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};_t.drawCachedElementPortion=function(t,e,r,a,n,i,o,s){var u=this,l=r.getBoundingBox(e);if(!(l.w===0||l.h===0)){var f=r.getElement(e,l,a,n,i);if(f!=null){var c=s(u,e);if(c===0)return;var h=o(u,e),g=l.x1,d=l.y1,p=l.w,y=l.h,m,w,b,x,S;if(h!==0){var T=r.getRotationPoint(e);b=T.x,x=T.y,t.translate(b,x),t.rotate(h),S=u.getImgSmoothing(t),S||u.setImgSmoothing(t,!0);var E=r.getRotationOffset(e);m=E.x,w=E.y}else m=g,w=d;var D;c!==1&&(D=t.globalAlpha,t.globalAlpha=D*c),t.drawImage(f.texture.canvas,f.x,0,f.width,f.height,m,w,p,y),c!==1&&(t.globalAlpha=D),h!==0&&(t.rotate(-h),t.translate(-b,-x),S||u.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var py=v(function(){return 0},"getZeroRotation"),yy=v(function(e,r){return e.getTextAngle(r,null)},"getLabelRotation"),my=v(function(e,r){return e.getTextAngle(r,"source")},"getSourceLabelRotation"),by=v(function(e,r){return e.getTextAngle(r,"target")},"getTargetLabelRotation"),wy=v(function(e,r){return r.effectiveOpacity()},"getOpacity"),bo=v(function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()},"getTextOpacity");_t.drawCachedElement=function(t,e,r,a,n,i){var o=this,s=o.data,u=s.eleTxrCache,l=s.lblTxrCache,f=s.slbTxrCache,c=s.tlbTxrCache,h=e.boundingBox(),g=i===!0?u.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!a||ts(h,a))){var d=e.isEdge(),p=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,u,r,n,g,py,wy),(!d||!p)&&o.drawCachedElementPortion(t,e,l,r,n,g,yy,bo),d&&!p&&(o.drawCachedElementPortion(t,e,f,r,n,g,my,bo),o.drawCachedElementPortion(t,e,c,r,n,g,by,bo)),o.drawElementOverlay(t,e)}};_t.drawElements=function(t,e){for(var r=this,a=0;a<e.length;a++){var n=e[a];r.drawElement(t,n)}};_t.drawCachedElements=function(t,e,r,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];n.drawCachedElement(t,o,r,a)}};_t.drawCachedNodes=function(t,e,r,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&n.drawCachedElement(t,o,r,a)}};_t.drawLayeredElements=function(t,e,r,a){var n=this,i=n.data.lyrTxrCache.getLayers(e,r);if(i)for(var o=0;o<i.length;o++){var s=i[o],u=s.bb;u.w===0||u.h===0||t.drawImage(s.canvas,u.x1,u.y1,u.w,u.h)}else n.drawCachedElements(t,e,r,a)};var Kt={};Kt.drawEdge=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var u;r&&(u=r,t.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,c=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,g=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,p=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,m=l*f,w=l*f,b=v(function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;c==="straight-triangle"?(o.eleStrokeStyle(t,e,A),o.drawEdgeTrianglePath(e,t,s.allpts)):(t.lineWidth=g,t.lineCap=d,o.eleStrokeStyle(t,e,A),o.drawEdgePath(e,t,s.allpts,h),t.lineCap="butt")},"drawLine"),x=v(function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;if(t.lineWidth=g+p,t.lineCap=d,p>0)o.colorStrokeStyle(t,y[0],y[1],y[2],A);else{t.lineCap="butt";return}c==="straight-triangle"?o.drawEdgeTrianglePath(e,t,s.allpts):(o.drawEdgePath(e,t,s.allpts,h),t.lineCap="butt")},"drawLineOutline"),S=v(function(){n&&o.drawEdgeOverlay(t,e)},"drawOverlay"),T=v(function(){n&&o.drawEdgeUnderlay(t,e)},"drawUnderlay"),E=v(function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;o.drawArrowheads(t,e,A)},"drawArrows"),D=v(function(){o.drawElementText(t,e,null,a)},"drawText");if(t.lineJoin="round",e.pstyle("ghost").value==="yes"){var B=e.pstyle("ghost-offset-x").pfValue,C=e.pstyle("ghost-offset-y").pfValue,P=m*e.pstyle("ghost-opacity").value;t.translate(B,C),b(P),E(P),t.translate(-B,-C)}else x();T(),b(),E(),S(),D(),r&&t.translate(u.x1,u.y1)}};var kf=v(function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,o=i.usePaths(),s=a._private.rscratch,u=2*a.pstyle("".concat(e,"-padding")).pfValue,l=a.pstyle("".concat(e,"-color")).value;r.lineWidth=u,s.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,l[0],l[1],l[2],n),i.drawEdgePath(a,r,s.allpts,"solid")}}}},"drawEdgeOverlayUnderlay");Kt.drawEdgeOverlay=kf("overlay");Kt.drawEdgeUnderlay=kf("underlay");Kt.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,i=e,o,s=!1,u=this.usePaths(),l=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(u){var c=r.join("$");n.pathCacheKey&&n.pathCacheKey===c?(o=e=n.pathCache,s=!0):(o=e=new Path2D,n.pathCacheKey=c,n.pathCache=o)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=f;break;case"solid":i.setLineDash([])}if(!s&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+3<r.length;h+=4)e.quadraticCurveTo(r[h],r[h+1],r[h+2],r[h+3]);break;case"straight":case"haystack":for(var g=2;g+1<r.length;g+=2)e.lineTo(r[g],r[g+1]);break;case"segments":if(n.isRound){var d=Ct(n.roundCorners),p;try{for(d.s();!(p=d.n()).done;){var y=p.value;gf(e,y)}}catch(w){d.e(w)}finally{d.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var m=2;m+1<r.length;m+=2)e.lineTo(r[m],r[m+1])}e=i,u?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};Kt.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var a=t.pstyle("width").pfValue,n=0;n+1<r.length;n+=2){var i=[r[n+2]-r[n],r[n+3]-r[n+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],u=[s[0]*a/2,s[1]*a/2];e.beginPath(),e.moveTo(r[n]-u[0],r[n+1]-u[1]),e.lineTo(r[n]+u[0],r[n+1]+u[1]),e.lineTo(r[n+2],r[n+3]),e.closePath(),e.fill()}};Kt.drawArrowheads=function(t,e,r){var a=e._private.rscratch,n=a.edgeType==="haystack";n||this.drawArrowhead(t,e,"source",a.arrowStartX,a.arrowStartY,a.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",a.midX,a.midY,a.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",a.midX,a.midY,a.midsrcArrowAngle,r),n||this.drawArrowhead(t,e,"target",a.arrowEndX,a.arrowEndY,a.tgtArrowAngle,r)};Kt.drawArrowhead=function(t,e,r,a,n,i,o){if(!(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(i)||i==null)){var s=this,u=e.pstyle(r+"-arrow-shape").value;if(u!=="none"){var l=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(r+"-arrow-fill").value,c=e.pstyle("width").pfValue,h=e.pstyle(r+"-arrow-width"),g=h.value==="match-line"?c:h.pfValue;h.units==="%"&&(g*=c);var d=e.pstyle("opacity").value;o===void 0&&(o=d);var p=t.globalCompositeOperation;(o!==1||f==="hollow")&&(t.globalCompositeOperation="destination-out",s.colorFillStyle(t,255,255,255,1),s.colorStrokeStyle(t,255,255,255,1),s.drawArrowShape(e,t,l,c,u,g,a,n,i),t.globalCompositeOperation=p);var y=e.pstyle(r+"-arrow-color").value;s.colorFillStyle(t,y[0],y[1],y[2],o),s.colorStrokeStyle(t,y[0],y[1],y[2],o),s.drawArrowShape(e,t,f,c,u,g,a,n,i)}}};Kt.drawArrowShape=function(t,e,r,a,n,i,o,s,u){var l=this,f=this.usePaths()&&n!=="triangle-cross",c=!1,h,g=e,d={x:o,y:s},p=t.pstyle("arrow-scale").value,y=this.getArrowWidth(a,p),m=l.arrowShapes[n];if(f){var w=l.arrowPathCache=l.arrowPathCache||[],b=Er(n),x=w[b];x!=null?(h=e=x,c=!0):(h=e=new Path2D,w[b]=h)}c||(e.beginPath&&e.beginPath(),f?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,y,u,d,a),e.closePath&&e.closePath()),e=g,f&&(e.translate(o,s),e.rotate(u),e.scale(y,y)),(r==="filled"||r==="both")&&(f?e.fill(h):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(f?y:1),e.lineJoin="miter",f?e.stroke(h):e.stroke()),f&&(e.scale(1/y,1/y),e.rotate(-u),e.translate(-o,-s))};var gs={};gs.safeDrawImage=function(t,e,r,a,n,i,o,s,u,l){if(!(n<=0||i<=0||u<=0||l<=0))try{t.drawImage(e,r,a,n,i,o,s,u,l)}catch(f){Oe(f)}};gs.drawInscribedImage=function(t,e,r,a,n){var i=this,o=r.position(),s=o.x,u=o.y,l=r.cy().style(),f=l.getIndexedStyle.bind(l),c=f(r,"background-fit","value",a),h=f(r,"background-repeat","value",a),g=r.width(),d=r.height(),p=r.padding()*2,y=g+(f(r,"background-width-relative-to","value",a)==="inner"?0:p),m=d+(f(r,"background-height-relative-to","value",a)==="inner"?0:p),w=r._private.rscratch,b=f(r,"background-clip","value",a)==="node",x=f(r,"background-image-opacity","value",a)*n,S=f(r,"background-image-smoothing","value",a),T=r.pstyle("corner-radius").value;T!=="auto"&&(T=r.pstyle("corner-radius").pfValue);var E=e.width||e.cachedW,D=e.height||e.cachedH;(E==null||D==null)&&(document.body.appendChild(e),E=e.cachedW=e.width||e.offsetWidth,D=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var B=E,C=D;if(f(r,"background-width","value",a)!=="auto"&&(f(r,"background-width","units",a)==="%"?B=f(r,"background-width","pfValue",a)*y:B=f(r,"background-width","pfValue",a)),f(r,"background-height","value",a)!=="auto"&&(f(r,"background-height","units",a)==="%"?C=f(r,"background-height","pfValue",a)*m:C=f(r,"background-height","pfValue",a)),!(B===0||C===0)){if(c==="contain"){var P=Math.min(y/B,m/C);B*=P,C*=P}else if(c==="cover"){var P=Math.max(y/B,m/C);B*=P,C*=P}var R=s-y/2,A=f(r,"background-position-x","units",a),L=f(r,"background-position-x","pfValue",a);A==="%"?R+=(y-B)*L:R+=L;var M=f(r,"background-offset-x","units",a),I=f(r,"background-offset-x","pfValue",a);M==="%"?R+=(y-B)*I:R+=I;var O=u-m/2,V=f(r,"background-position-y","units",a),q=f(r,"background-position-y","pfValue",a);V==="%"?O+=(m-C)*q:O+=q;var F=f(r,"background-offset-y","units",a),H=f(r,"background-offset-y","pfValue",a);F==="%"?O+=(m-C)*H:O+=H,w.pathCache&&(R-=s,O-=u,s=0,u=0);var Q=t.globalAlpha;t.globalAlpha=x;var U=i.getImgSmoothing(t),W=!1;S==="no"&&U?(i.setImgSmoothing(t,!1),W=!0):S==="yes"&&!U&&(i.setImgSmoothing(t,!0),W=!0),h==="no-repeat"?(b&&(t.save(),w.pathCache?t.clip(w.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,s,u,y,m,T,w),t.clip())),i.safeDrawImage(t,e,0,0,E,D,R,O,B,C),b&&t.restore()):(t.fillStyle=t.createPattern(e,h),i.nodeShapes[i.getNodeShape(r)].draw(t,s,u,y,m,T,w),t.translate(R,O),t.fill(),t.translate(-R,-O)),t.globalAlpha=Q,W&&i.setImgSmoothing(t,U)}};var kr={};kr.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(jo(r*a));e=Math.pow(2,n)}return!(t.pstyle("font-size").pfValue*e<t.pstyle("min-zoomed-font-size").pfValue)};kr.drawElementText=function(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(a==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var u=o.getLabelJustification(e),l=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=u,t.textBaseline=l?"alphabetic":"bottom"}else{var f=e.element()._private.rscratch.badLine,c=e.pstyle("label"),h=e.pstyle("source-label"),g=e.pstyle("target-label");if(f||(!c||!c.value)&&(!h||!h.value)&&(!g||!g.value))return;t.textAlign="center",t.textBaseline="bottom"}var d=!r,p;r&&(p=r,t.translate(-p.x1,-p.y1)),n==null?(o.drawText(t,e,null,d,i),e.isEdge()&&(o.drawText(t,e,"source",d,i),o.drawText(t,e,"target",d,i))):o.drawText(t,e,n,d,i),r&&t.translate(p.x1,p.y1)};kr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};kr.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*s,l=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=a+" "+o+" "+n+" "+i,t.lineJoin="round",this.colorFillStyle(t,l[0],l[1],l[2],s),this.colorStrokeStyle(t,f[0],f[1],f[2],u)};function xy(t,e,r,a,n){var i=Math.min(a,n)/2,o=e+a/2,s=r+n/2;t.beginPath(),t.arc(o,s,i,0,Math.PI*2),t.closePath()}v(xy,"circle");function Vl(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(i,a/2,n/2);t.beginPath(),t.moveTo(e+o,r),t.lineTo(e+a-o,r),t.quadraticCurveTo(e+a,r,e+a,r+o),t.lineTo(e+a,r+n-o),t.quadraticCurveTo(e+a,r+n,e+a-o,r+n),t.lineTo(e+o,r+n),t.quadraticCurveTo(e,r+n,e,r+n-o),t.lineTo(e,r+o),t.quadraticCurveTo(e,r,e+o,r),t.closePath()}v(Vl,"roundRect");kr.getTextAngle=function(t,e){var r,a=t._private.rscratch,n=e?e+"-":"",i=t.pstyle(n+"text-rotation");if(i.strValue==="autorotate"){var o=yt(a,"labelAngle",e);r=t.isEdge()?o:0}else i.strValue==="none"?r=0:r=i.pfValue;return r};kr.drawText=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private.rscratch,o=n?e.effectiveOpacity():1;if(!(n&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var s=yt(i,"labelX",r),u=yt(i,"labelY",r),l,f,c=this.getLabelText(e,r);if(c!=null&&c!==""&&!isNaN(s)&&!isNaN(u)){this.setupTextStyle(t,e,n);var h=r?r+"-":"",g=yt(i,"labelWidth",r),d=yt(i,"labelHeight",r),p=yt(i,"labelActualDescent",r),y=e.pstyle(h+"text-margin-x").pfValue,m=e.pstyle(h+"text-margin-y").pfValue,w=e.isEdge(),b=e.pstyle("text-halign").value,x=e.pstyle("text-valign").value;w&&(b="center",x="center"),s+=y,u+=m;var S;a?S=this.getTextAngle(e,r):S=0,S!==0&&(l=s,f=u,t.translate(l,f),t.rotate(S),s=0,u=0);var T=Zr(b),E=Qr(x);switch(E){case"top":break;case"center":u+=d/2;break;case"bottom":u+=d}var D=e.pstyle("text-background-opacity").value,B=e.pstyle("text-border-opacity").value,C=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,R=e.pstyle("text-background-shape").strValue,A=R==="round-rectangle"||R==="roundrectangle",L=R==="circle",M=2;if(D>0||C>0&&B>0){var I=t.fillStyle,O=t.strokeStyle,V=t.lineWidth,q=e.pstyle("text-background-color").value,F=e.pstyle("text-border-color").value,H=e.pstyle("text-border-style").value,Q=D>0,U=C>0&&B>0,W=s-P;switch(T){case"left":W-=g;break;case"center":W-=g/2}var X=u-d-P,re=g+2*P,j=d+2*P;if(Q&&(t.fillStyle="rgba(".concat(q[0],",").concat(q[1],",").concat(q[2],",").concat(D*o,")")),U&&(t.strokeStyle="rgba(".concat(F[0],",").concat(F[1],",").concat(F[2],",").concat(B*o,")"),t.lineWidth=C,t.setLineDash))switch(H){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=C/4,t.setLineDash([]);break;default:t.setLineDash([])}if(A?(t.beginPath(),Vl(t,W,X,re,j,M)):L?(t.beginPath(),xy(t,W,X,re,j)):(t.beginPath(),t.rect(W,X,re,j)),Q&&t.fill(),U&&t.stroke(),U&&H==="double"){var Z=C/2;t.beginPath(),A?Vl(t,W+Z,X+Z,re-2*Z,j-2*Z,M):t.rect(W+Z,X+Z,re-2*Z,j-2*Z),t.stroke()}t.fillStyle=I,t.strokeStyle=O,t.lineWidth=V,t.setLineDash&&t.setLineDash([])}var N=2*e.pstyle("text-outline-width").pfValue;if(N>0&&(t.lineWidth=N),u-=p,e.pstyle("text-wrap").value==="wrap"){var _=yt(i,"labelWrapCachedLines",r),G=yt(i,"labelLineHeight",r),te=g/2,le=this.getLabelJustification(e);switch(le==="auto"||(T==="left"?le==="left"?s+=-g:le==="center"&&(s+=-te):T==="center"?le==="left"?s+=-te:le==="right"&&(s+=te):T==="right"&&(le==="center"?s+=te:le==="right"&&(s+=g))),E){case"top":u-=(_.length-1)*G;break;case"center":case"bottom":u-=(_.length-1)*G}for(var xe=0;xe<_.length;xe++)N>0&&t.strokeText(_[xe],s,u),t.fillText(_[xe],s,u),u+=G}else N>0&&t.strokeText(c,s,u),t.fillText(c,s,u);S!==0&&(t.rotate(-S),t.translate(-l,-f))}}};var cr={};cr.drawNode=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,u,l=e._private,f=l.rscratch,c=e.position();if(!(!ae(c.x)||!ae(c.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,g=o.usePaths(),d,p=!1,y=e.padding();s=e.width()+2*y,u=e.height()+2*y;var m;r&&(m=r,t.translate(-m.x1,-m.y1));for(var w=e.pstyle("background-image").value,b=new Array(w.length),x=new Array(w.length),S=0,T=0;T<w.length;T++){var E=w[T];if(b[T]=E!=null&&E!=="none"){var D=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",T);S++,x[T]=o.getCachedImage(E,D,function(){l.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var B=e.pstyle("background-blacken").value,C=e.pstyle("border-width").pfValue,P=e.pstyle("background-opacity").value*h,R=e.pstyle("border-color").value,A=e.pstyle("border-style").value,L=e.pstyle("border-join").value,M=e.pstyle("border-cap").value,I=e.pstyle("border-position").value,O=e.pstyle("border-dash-pattern").pfValue,V=e.pstyle("border-dash-offset").pfValue,q=e.pstyle("border-opacity").value*h,F=e.pstyle("outline-width").pfValue,H=e.pstyle("outline-color").value,Q=e.pstyle("outline-style").value,U=e.pstyle("outline-opacity").value*h,W=e.pstyle("outline-offset").value,X=e.pstyle("corner-radius").value;X!=="auto"&&(X=e.pstyle("corner-radius").pfValue);var re=v(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;o.eleFillStyle(t,e,ie)},"setupShapeColor"),j=v(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;o.colorStrokeStyle(t,R[0],R[1],R[2],ie)},"setupBorderColor"),Z=v(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U;o.colorStrokeStyle(t,H[0],H[1],H[2],ie)},"setupOutlineColor"),N=v(function(ie,K,k,z){var $=o.nodePathCache=o.nodePathCache||[],J=vv(k==="polygon"?k+","+z.join(","):k,""+K,""+ie,""+X),Y=$[J],ee,oe=!1;return Y!=null?(ee=Y,oe=!0,f.pathCache=ee):(ee=new Path2D,$[J]=f.pathCache=ee),{path:ee,cacheHit:oe}},"getPath"),_=e.pstyle("shape").strValue,G=e.pstyle("shape-polygon-points").pfValue;if(g){t.translate(c.x,c.y);var te=N(s,u,_,G);d=te.path,p=te.cacheHit}var le=v(function(){if(!p){var ie=c;g&&(ie={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(d||t,ie.x,ie.y,s,u,X,f)}g?t.fill(d):t.fill()},"drawShape"),xe=v(function(){for(var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,k=l.backgrounding,z=0,$=0;$<x.length;$++){var J=e.cy().style().getIndexedStyle(e,"background-image-containment","value",$);if(K&&J==="over"||!K&&J==="inside"){z++;continue}b[$]&&x[$].complete&&!x[$].error&&(z++,o.drawInscribedImage(t,x[$],e,$,ie))}l.backgrounding=z!==S,k!==l.backgrounding&&e.updateStyle(!1)},"drawImages"),be=v(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasPie(e)&&(o.drawPie(t,e,K),ie&&(g||o.nodeShapes[o.getNodeShape(e)].draw(t,c.x,c.y,s,u,X,f)))},"drawPie"),De=v(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasStripe(e)&&(t.save(),g?t.clip(f.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(t,c.x,c.y,s,u,X,f),t.clip()),o.drawStripe(t,e,K),t.restore(),ie&&(g||o.nodeShapes[o.getNodeShape(e)].draw(t,c.x,c.y,s,u,X,f)))},"drawStripe"),ve=v(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,K=(B>0?B:-B)*ie,k=B>0?0:255;B!==0&&(o.colorFillStyle(t,k,k,k,K),g?t.fill(d):t.fill())},"darken"),ne=v(function(){if(C>0){if(t.lineWidth=C,t.lineCap=M,t.lineJoin=L,t.setLineDash)switch(A){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(O),t.lineDashOffset=V;break;case"solid":case"double":t.setLineDash([])}if(I!=="center"){if(t.save(),t.lineWidth*=2,I==="inside")g?t.clip(d):t.clip();else{var ie=new Path2D;ie.rect(-s/2-C,-u/2-C,s+2*C,u+2*C),ie.addPath(d),t.clip(ie,"evenodd")}g?t.stroke(d):t.stroke(),t.restore()}else g?t.stroke(d):t.stroke();if(A==="double"){t.lineWidth=C/3;var K=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",g?t.stroke(d):t.stroke(),t.globalCompositeOperation=K}t.setLineDash&&t.setLineDash([])}},"drawBorder"),he=v(function(){if(F>0){if(t.lineWidth=F,t.lineCap="butt",t.setLineDash)switch(Q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([])}var ie=c;g&&(ie={x:0,y:0});var K=o.getNodeShape(e),k=C;I==="inside"&&(k=0),I==="outside"&&(k*=2);var z=(s+k+(F+W))/s,$=(u+k+(F+W))/u,J=s*z,Y=u*$,ee=o.nodeShapes[K].points,oe;if(g&&(oe=N(J,Y,K,ee).path),K==="ellipse")o.drawEllipsePath(oe||t,ie.x,ie.y,J,Y);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(K)){var fe=0,se=0,Ce=0;K==="round-diamond"?fe=(k+W+F)*1.4:K==="round-heptagon"?(fe=(k+W+F)*1.075,Ce=-(k/2+W+F)/35):K==="round-hexagon"?fe=(k+W+F)*1.12:K==="round-pentagon"?(fe=(k+W+F)*1.13,Ce=-(k/2+W+F)/15):K==="round-tag"?(fe=(k+W+F)*1.12,se=(k/2+F+W)*.07):K==="round-triangle"&&(fe=(k+W+F)*(Math.PI/2),Ce=-(k+W/2+F)/Math.PI),fe!==0&&(z=(s+fe)/s,J=s*z,["round-hexagon","round-tag"].includes(K)||($=(u+fe)/u,Y=u*$)),X=X==="auto"?xv(J,Y):X;for(var Le=J/2,ce=Y/2,Ee=X+(k+F+W)/2,Ne=new Array(ee.length/2),Pe=new Array(ee.length/2),Ue=0;Ue<ee.length/2;Ue++)Ne[Ue]={x:ie.x+se+Le*ee[Ue*2],y:ie.y+Ce+ce*ee[Ue*2+1]};var Ke,ct,$e,ot,Xe=Ne.length;for(ct=Ne[Xe-1],Ke=0;Ke<Xe;Ke++)$e=Ne[Ke%Xe],ot=Ne[(Ke+1)%Xe],Pe[Ke]=hs(ct,$e,ot,Ee),ct=$e,$e=ot;o.drawRoundPolygonPath(oe||t,ie.x+se,ie.y+Ce,s*z,u*$,ee,Pe)}else if(["roundrectangle","round-rectangle"].includes(K))X=X==="auto"?ir(J,Y):X,o.drawRoundRectanglePath(oe||t,ie.x,ie.y,J,Y,X+(k+F+W)/2);else if(["cutrectangle","cut-rectangle"].includes(K))X=X==="auto"?rs():X,o.drawCutRectanglePath(oe||t,ie.x,ie.y,J,Y,null,X+(k+F+W)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(K))X=X==="auto"?ir(J,Y):X,o.drawBottomRoundRectanglePath(oe||t,ie.x,ie.y,J,Y,X+(k+F+W)/2);else if(K==="barrel")o.drawBarrelPath(oe||t,ie.x,ie.y,J,Y);else if(K.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(K)){var st=(k+F+W)/s;ee=mn(bn(ee,st)),o.drawPolygonPath(oe||t,ie.x,ie.y,s,u,ee)}else{var dr=(k+F+W)/s;ee=mn(bn(ee,-dr)),o.drawPolygonPath(oe||t,ie.x,ie.y,s,u,ee)}if(g?t.stroke(oe):t.stroke(),Q==="double"){t.lineWidth=k/3;var Pr=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",g?t.stroke(oe):t.stroke(),t.globalCompositeOperation=Pr}t.setLineDash&&t.setLineDash([])}},"drawOutline"),ye=v(function(){n&&o.drawNodeOverlay(t,e,c,s,u)},"drawOverlay"),me=v(function(){n&&o.drawNodeUnderlay(t,e,c,s,u)},"drawUnderlay"),ge=v(function(){o.drawElementText(t,e,null,a)},"drawText");if(e.pstyle("ghost").value==="yes"){var Se=e.pstyle("ghost-offset-x").pfValue,Be=e.pstyle("ghost-offset-y").pfValue,ke=e.pstyle("ghost-opacity").value,Ve=ke*h;t.translate(Se,Be),Z(),he(),re(ke*P),le(),xe(Ve,!0),j(ke*q),ne(),be(B!==0||C!==0),De(B!==0||C!==0),xe(Ve,!1),ve(Ve),t.translate(-Se,-Be)}g&&t.translate(-c.x,-c.y),me(),g&&t.translate(c.x,c.y),Z(),he(),re(),le(),xe(h,!0),j(),ne(),be(B!==0||C!==0),De(B!==0||C!==0),xe(h,!1),ve(),g&&t.translate(-c.x,-c.y),ge(),ye(),r&&t.translate(m.x1,m.y1)}};var Pf=v(function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a,n,i,o){var s=this;if(a.visible()){var u=a.pstyle("".concat(e,"-padding")).pfValue,l=a.pstyle("".concat(e,"-opacity")).value,f=a.pstyle("".concat(e,"-color")).value,c=a.pstyle("".concat(e,"-shape")).value,h=a.pstyle("".concat(e,"-corner-radius")).value;if(l>0){if(n=n||a.position(),i==null||o==null){var g=a.padding();i=a.width()+2*g,o=a.height()+2*g}s.colorFillStyle(r,f[0],f[1],f[2],l),s.nodeShapes[c].draw(r,n.x,n.y,i+u*2,o+u*2,h),r.fill()}}}},"drawNodeOverlayUnderlay");cr.drawNodeOverlay=Pf("overlay");cr.drawNodeUnderlay=Pf("underlay");cr.hasPie=function(t){return t=t[0],t._private.hasPie};cr.hasStripe=function(t){return t=t[0],t._private.hasStripe};cr.drawPie=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),s=e.pstyle("pie-start-angle").pfValue,u=a.x,l=a.y,f=e.width(),c=e.height(),h=Math.min(f,c)/2,g,d=0;if(this.usePaths()&&(u=0,l=0),i.units==="%"?h=h*i.pfValue:i.pfValue!==void 0&&(h=i.pfValue/2),o.units==="%"?g=h*o.pfValue:o.pfValue!==void 0&&(g=o.pfValue/2),!(g>=h))for(var p=1;p<=n.pieBackgroundN;p++){var y=e.pstyle("pie-"+p+"-background-size").value,m=e.pstyle("pie-"+p+"-background-color").value,w=e.pstyle("pie-"+p+"-background-opacity").value*r,b=y/100;b+d>1&&(b=1-d);var x=1.5*Math.PI+2*Math.PI*d;x+=s;var S=2*Math.PI*b,T=x+S;y===0||d>=1||d+b>1||(g===0?(t.beginPath(),t.moveTo(u,l),t.arc(u,l,h,x,T),t.closePath()):(t.beginPath(),t.arc(u,l,h,x,T),t.arc(u,l,g,T,x,!0),t.closePath()),this.colorFillStyle(t,m[0],m[1],m[2],w),t.fill(),d+=b)}};cr.drawStripe=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,o=a.y,s=e.width(),u=e.height(),l=0,f=this.usePaths();t.save();var c=e.pstyle("stripe-direction").value,h=e.pstyle("stripe-size");switch(c){case"vertical":break;case"righward":t.rotate(-Math.PI/2)}var g=s,d=u;h.units==="%"?(g=g*h.pfValue,d=d*h.pfValue):h.pfValue!==void 0&&(g=h.pfValue,d=h.pfValue),f&&(i=0,o=0),o-=g/2,i-=d/2;for(var p=1;p<=n.stripeBackgroundN;p++){var y=e.pstyle("stripe-"+p+"-background-size").value,m=e.pstyle("stripe-"+p+"-background-color").value,w=e.pstyle("stripe-"+p+"-background-opacity").value*r,b=y/100;b+l>1&&(b=1-l),!(y===0||l>=1||l+b>1)&&(t.beginPath(),t.rect(i,o+d*l,g,d*b),t.closePath(),this.colorFillStyle(t,m[0],m[1],m[2],w),t.fill(),l+=b)}t.restore()};var bt={},Ey=100;bt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};bt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,a,n=0;n<e.length;n++)if(a=e[n],a.context===t){r=!1;break}return r&&(a={context:t},e.push(a)),a};bt.createGradientStyleFor=function(t,e,r,a,n){var i,o=this.usePaths(),s=r.pstyle(e+"-gradient-stop-colors").value,u=r.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(r.isEdge()){var l=r.sourceEndpoint(),f=r.targetEndpoint(),c=r.midpoint(),h=Cr(l,c),g=Cr(f,c);i=t.createRadialGradient(c.x,c.y,0,c.x,c.y,Math.max(h,g))}else{var d=o?{x:0,y:0}:r.position(),p=r.paddedWidth(),y=r.paddedHeight();i=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(p,y))}else if(r.isEdge()){var m=r.sourceEndpoint(),w=r.targetEndpoint();i=t.createLinearGradient(m.x,m.y,w.x,w.y)}else{var b=o?{x:0,y:0}:r.position(),x=r.paddedWidth(),S=r.paddedHeight(),T=x/2,E=S/2;switch(r.pstyle("background-gradient-direction").value){case"to-bottom":i=t.createLinearGradient(b.x,b.y-E,b.x,b.y+E);break;case"to-top":i=t.createLinearGradient(b.x,b.y+E,b.x,b.y-E);break;case"to-left":i=t.createLinearGradient(b.x+T,b.y,b.x-T,b.y);break;case"to-right":i=t.createLinearGradient(b.x-T,b.y,b.x+T,b.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(b.x-T,b.y-E,b.x+T,b.y+E);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(b.x-T,b.y+E,b.x+T,b.y-E);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(b.x+T,b.y-E,b.x-T,b.y+E);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(b.x+T,b.y+E,b.x-T,b.y-E)}}if(!i)return null;for(var D=u.length===s.length,B=s.length,C=0;C<B;C++)i.addColorStop(D?u[C]:C/(B-1),"rgba("+s[C][0]+","+s[C][1]+","+s[C][2]+","+n+")");return i};bt.gradientFillStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"background",e,r,a);if(!n)return null;t.fillStyle=n};bt.colorFillStyle=function(t,e,r,a,n){t.fillStyle="rgba("+e+","+r+","+a+","+n+")"};bt.eleFillStyle=function(t,e,r){var a=e.pstyle("background-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientFillStyle(t,e,a,r);else{var n=e.pstyle("background-color").value;this.colorFillStyle(t,n[0],n[1],n[2],r)}};bt.gradientStrokeStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"line",e,r,a);if(!n)return null;t.strokeStyle=n};bt.colorStrokeStyle=function(t,e,r,a,n){t.strokeStyle="rgba("+e+","+r+","+a+","+n+")"};bt.eleStrokeStyle=function(t,e,r){var a=e.pstyle("line-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientStrokeStyle(t,e,a,r);else{var n=e.pstyle("line-color").value;this.colorStrokeStyle(t,n[0],n[1],n[2],r)}};bt.matchCanvasSize=function(t){var e=this,r=e.data,a=e.findContainerClientCoords(),n=a[2],i=a[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var u=n*o,l=i*o,f;if(!(u===e.canvasWidth&&l===e.canvasHeight)){e.fontCaches=null;var c=r.canvasContainer;c.style.width=n+"px",c.style.height=i+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)f=r.canvases[h],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)f=r.bufferCanvases[h],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";e.textureMult=1,o<=1&&(f=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=u*e.textureMult,f.height=l*e.textureMult),e.canvasWidth=u,e.canvasHeight=l,e.pixelRatio=o}};bt.renderTo=function(t,e,r,a){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:a})};bt.clearCanvas=function(){var t=this,e=t.data;function r(a){a.clearRect(0,0,t.canvasWidth,t.canvasHeight)}v(r,"clear"),r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])};bt.render=function(t){var e=this;t=t||dv();var r=e.cy,a=t.forcedContext,n=t.drawAllLayers,i=t.drawOnlyNodeLayer,o=t.forcedZoom,s=t.forcedPan,u=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,l=e.data,f=l.canvasNeedsRedraw,c=e.textureOnViewport&&!a&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),h=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,g=e.motionBlurPxRatio,d=r.hasCompoundNodes(),p=e.hoverData.draggingEles,y=!!(e.hoverData.selecting||e.touchData.selecting);h=h&&!a&&e.motionBlurEnabled&&!y;var m=h;a||(e.prevPxRatio!==u&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=u),!a&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),h&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(m=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!c&&(f[e.NODE]=!0,f[e.SELECT_BOX]=!0);var w=r.style(),b=r.zoom(),x=o!==void 0?o:b,S=r.pan(),T={x:S.x,y:S.y},E={zoom:b,pan:{x:S.x,y:S.y}},D=e.prevViewport;!(D===void 0||E.zoom!==D.zoom||E.pan.x!==D.pan.x||E.pan.y!==D.pan.y)&&!(p&&!d)&&(e.motionBlurPxRatio=1),s&&(T=s),x*=u,T.x*=u,T.y*=u;var B=e.getCachedZSortedEles();function C(j,Z,N,_,G){var te=j.globalCompositeOperation;j.globalCompositeOperation="destination-out",e.colorFillStyle(j,255,255,255,e.motionBlurTransparency),j.fillRect(Z,N,_,G),j.globalCompositeOperation=te}v(C,"mbclear");function P(j,Z){var N,_,G,te;!e.clearingMotionBlur&&(j===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||j===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(N={x:S.x*g,y:S.y*g},_=b*g,G=e.canvasWidth*g,te=e.canvasHeight*g):(N=T,_=x,G=e.canvasWidth,te=e.canvasHeight),j.setTransform(1,0,0,1,0,0),Z==="motionBlur"?C(j,0,0,G,te):!a&&(Z===void 0||Z)&&j.clearRect(0,0,G,te),n||(j.translate(N.x,N.y),j.scale(_,_)),s&&j.translate(s.x,s.y),o&&j.scale(o,o)}if(v(P,"setContextTransform"),c||(e.textureDrawLastFrame=!1),c){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var R=e.data.bufferContexts[e.TEXTURE_BUFFER];R.setTransform(1,0,0,1,0,0),R.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:R,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var E=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}f[e.DRAG]=!1,f[e.NODE]=!1;var A=l.contexts[e.NODE],L=e.textureCache.texture,E=e.textureCache.viewport;A.setTransform(1,0,0,1,0,0),h?C(A,0,0,E.width,E.height):A.clearRect(0,0,E.width,E.height);var M=w.core("outside-texture-bg-color").value,I=w.core("outside-texture-bg-opacity").value;e.colorFillStyle(A,M[0],M[1],M[2],I),A.fillRect(0,0,E.width,E.height);var b=r.zoom();P(A,!1),A.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/u,E.height/E.zoom/u),A.drawImage(L,E.mpan.x,E.mpan.y,E.width/E.zoom/u,E.height/E.zoom/u)}else e.textureOnViewport&&!a&&(e.textureCache=null);var O=r.extent(),V=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),q=e.hideEdgesOnViewport&&V,F=[];if(F[e.NODE]=!f[e.NODE]&&h&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,F[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),F[e.DRAG]=!f[e.DRAG]&&h&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,F[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),f[e.NODE]||n||i||F[e.NODE]){var H=h&&!F[e.NODE]&&g!==1,A=a||(H?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]);P(A,h&&!H?"motionBlur":void 0),q?e.drawCachedNodes(A,B.nondrag,u,O):e.drawLayeredElements(A,B.nondrag,u,O),e.debug&&e.drawDebugPoints(A,B.nondrag),!n&&!h&&(f[e.NODE]=!1)}if(!i&&(f[e.DRAG]||n||F[e.DRAG])){var H=h&&!F[e.DRAG]&&g!==1,A=a||(H?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);P(A,h&&!H?"motionBlur":void 0),q?e.drawCachedNodes(A,B.drag,u,O):e.drawCachedElements(A,B.drag,u,O),e.debug&&e.drawDebugPoints(A,B.drag),!n&&!h&&(f[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),h&&g!==1){var Q=l.contexts[e.NODE],U=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],W=l.contexts[e.DRAG],X=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],re=v(function(Z,N,_){Z.setTransform(1,0,0,1,0,0),_||!m?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):C(Z,0,0,e.canvasWidth,e.canvasHeight);var G=g;Z.drawImage(N,0,0,e.canvasWidth*G,e.canvasHeight*G,0,0,e.canvasWidth,e.canvasHeight)},"drawMotionBlur");(f[e.NODE]||F[e.NODE])&&(re(Q,U,F[e.NODE]),f[e.NODE]=!1),(f[e.DRAG]||F[e.DRAG])&&(re(W,X,F[e.DRAG]),f[e.DRAG]=!1)}e.prevViewport=E,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),h&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!c,e.mbFrames=0,f[e.NODE]=!0,f[e.DRAG]=!0,e.redraw()},Ey)),a||r.emit("render")};var fa;bt.drawSelectionRectangle=function(t,e){var r=this,a=r.cy,n=r.data,i=a.style(),o=t.drawOnlyNodeLayer,s=t.drawAllLayers,u=n.canvasNeedsRedraw,l=t.forcedContext;if(r.showFps||!o&&u[r.SELECT_BOX]&&!s){var f=l||n.contexts[r.SELECT_BOX];if(e(f),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var c=r.cy.zoom(),h=i.core("selection-box-border-width").value/c;f.lineWidth=h,f.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",f.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),h>0&&(f.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",f.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(n.bgActivePosistion&&!r.hoverData.selecting){var c=r.cy.zoom(),g=n.bgActivePosistion;f.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",f.beginPath(),f.arc(g.x,g.y,i.core("active-bg-size").pfValue/c,0,2*Math.PI),f.fill()}var d=r.lastRedrawTime;if(r.showFps&&d){d=Math.round(d);var p=Math.round(1e3/d),y="1 frame = "+d+" ms = "+p+" fps";f.setTransform(1,0,0,1,0,0),f.fillStyle="rgba(255, 0, 0, 0.75)",f.strokeStyle="rgba(255, 0, 0, 0.75)",f.font="30px Arial",fa||(fa=f.measureText(y).actualBoundingBoxAscent),f.fillText(y,0,fa);var m=60;f.strokeRect(0,fa+10,250,20),f.fillRect(0,fa+10,250*Math.min(p/m,1),20)}s||(u[r.SELECT_BOX]=!1)}};function ql(t,e,r){var a=t.createShader(e);if(t.shaderSource(a,r),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(a));return a}v(ql,"compileShader");function Cy(t,e,r){var a=ql(t,t.VERTEX_SHADER,e),n=ql(t,t.FRAGMENT_SHADER,r),i=t.createProgram();if(t.attachShader(i,a),t.attachShader(i,n),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))throw new Error("Could not initialize shaders");return i}v(Cy,"createProgram");function Ty(t,e,r){r===void 0&&(r=e);var a=t.makeOffscreenCanvas(e,r),n=a.context=a.getContext("2d");return a.clear=function(){return n.clearRect(0,0,a.width,a.height)},a.clear(),a}v(Ty,"createTextureCanvas");function ps(t){var e=t.pixelRatio,r=t.cy.zoom(),a=t.cy.pan();return{zoom:r*e,pan:{x:a.x*e,y:a.y*e}}}v(ps,"getEffectivePanZoom");function Sy(t){var e=t.pixelRatio;return t.cy.zoom()*e}v(Sy,"getEffectiveZoom");function Dy(t,e,r,a,n){var i=a*r+e.x,o=n*r+e.y;return o=Math.round(t.canvasHeight-o),[i,o]}v(Dy,"modelToRenderedPosition");function By(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}v(By,"isSimpleShape");function ky(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}v(ky,"arrayEqual");function pr(t,e,r){var a=t[0]/255,n=t[1]/255,i=t[2]/255,o=e,s=r||new Array(4);return s[0]=a*o,s[1]=n*o,s[2]=i*o,s[3]=o,s}v(pr,"toWebGLColor");function Nr(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}v(Nr,"indexToVec4");function Py(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}v(Py,"vec4ToIndex");function Ay(t,e){var r=t.createTexture();return r.buffer=function(a){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}v(Ay,"createTexture");function Af(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}v(Af,"getTypeInfo");function Rf(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}v(Rf,"createTypedArray");function Ry(t,e,r,a,n,i){switch(e){case t.FLOAT:return new Float32Array(r.buffer,i*a,n);case t.INT:return new Int32Array(r.buffer,i*a,n)}}v(Ry,"createTypedArrayView");function My(t,e,r,a){var n=Qe(Af(t,e),2),i=n[0],o=n[1],s=Rf(t,o,a),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,s,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,i,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,i,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}v(My,"createBufferStaticDraw");function Ot(t,e,r,a){var n=Qe(Af(t,r),3),i=n[0],o=n[1],s=n[2],u=Rf(t,o,e*i),l=i*s,f=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,f),t.bufferData(t.ARRAY_BUFFER,e*l,t.DYNAMIC_DRAW),t.enableVertexAttribArray(a),o===t.FLOAT?t.vertexAttribPointer(a,i,o,!1,l,0):o===t.INT&&t.vertexAttribIPointer(a,i,o,l,0),t.vertexAttribDivisor(a,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var c=new Array(e),h=0;h<e;h++)c[h]=Ry(t,o,u,l,i,h);return f.dataArray=u,f.stride=l,f.size=i,f.getView=function(g){return c[g]},f.setPoint=function(g,d,p){var y=c[g];y[0]=d,y[1]=p},f.bufferSubData=function(g){t.bindBuffer(t.ARRAY_BUFFER,f),g?t.bufferSubData(t.ARRAY_BUFFER,0,u,0,g*i):t.bufferSubData(t.ARRAY_BUFFER,0,u)},f}v(Ot,"createBufferDynamicDraw");function Ly(t,e,r){for(var a=9,n=new Float32Array(e*a),i=new Array(e),o=0;o<e;o++){var s=o*a*4;i[o]=new Float32Array(n.buffer,s,a)}var u=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,n.byteLength,t.DYNAMIC_DRAW);for(var l=0;l<3;l++){var f=r+l;t.enableVertexAttribArray(f),t.vertexAttribPointer(f,3,t.FLOAT,!1,36,l*12),t.vertexAttribDivisor(f,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),u.getMatrixView=function(c){return i[c]},u.setData=function(c,h){i[h].set(c,0)},u.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferSubData(t.ARRAY_BUFFER,0,n)},u}v(Ly,"create3x3MatrixBufferDynamicDraw");function Iy(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(a,n){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,a,n,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}v(Iy,"createPickingFrameBuffer");var _l=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function wo(){var t=new _l(9);return _l!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}v(wo,"create");function Gl(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}v(Gl,"identity");function Oy(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],c=e[8],h=r[0],g=r[1],d=r[2],p=r[3],y=r[4],m=r[5],w=r[6],b=r[7],x=r[8];return t[0]=h*a+g*o+d*l,t[1]=h*n+g*s+d*f,t[2]=h*i+g*u+d*c,t[3]=p*a+y*o+m*l,t[4]=p*n+y*s+m*f,t[5]=p*i+y*u+m*c,t[6]=w*a+b*o+x*l,t[7]=w*n+b*s+x*f,t[8]=w*i+b*u+x*c,t}v(Oy,"multiply");function hn(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],c=e[8],h=r[0],g=r[1];return t[0]=a,t[1]=n,t[2]=i,t[3]=o,t[4]=s,t[5]=u,t[6]=h*a+g*o+l,t[7]=h*n+g*s+f,t[8]=h*i+g*u+c,t}v(hn,"translate");function Hl(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],c=e[8],h=Math.sin(r),g=Math.cos(r);return t[0]=g*a+h*o,t[1]=g*n+h*s,t[2]=g*i+h*u,t[3]=g*o-h*a,t[4]=g*s-h*n,t[5]=g*u-h*i,t[6]=l,t[7]=f,t[8]=c,t}v(Hl,"rotate");function Go(t,e,r){var a=r[0],n=r[1];return t[0]=a*e[0],t[1]=a*e[1],t[2]=a*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}v(Go,"scale");function Ny(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}v(Ny,"projection");var zy=(function(){function t(e,r,a,n){lr(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=r,this.texRows=a,this.texHeight=Math.floor(r/a),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=n(e,r,r),this.scratch=n(e,r,this.texHeight,"scratch")}return v(t,"Atlas"),vr(t,[{key:"lock",value:v(function(){this.locked=!0},"lock")},{key:"getKeys",value:v(function(){return new Set(this.keyToLocation.keys())},"getKeys")},{key:"getScale",value:v(function(r){var a=r.w,n=r.h,i=this.texHeight,o=this.texSize,s=i/n,u=a*s,l=n*s;return u>o&&(s=o/a,u=a*s,l=n*s),{scale:s,texW:u,texH:l}},"getScale")},{key:"draw",value:v(function(r,a,n){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var o=this.texSize,s=this.texRows,u=this.texHeight,l=this.getScale(a),f=l.scale,c=l.texW,h=l.texH,g=v(function(b,x){if(n&&x){var S=x.context,T=b.x,E=b.row,D=T,B=u*E;S.save(),S.translate(D,B),S.scale(f,f),n(S,a),S.restore()}},"drawAt"),d=[null,null],p=v(function(){g(i.freePointer,i.canvas),d[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:c,h},d[1]={x:i.freePointer.x+c,y:i.freePointer.row*u,w:0,h},i.freePointer.x+=c,i.freePointer.x==o&&(i.freePointer.x=0,i.freePointer.row++)},"drawNormal"),y=v(function(){var b=i.scratch,x=i.canvas;b.clear(),g({x:0,row:0},b);var S=o-i.freePointer.x,T=c-S,E=u,D=i.freePointer.x,B=i.freePointer.row*u,C=S;x.context.drawImage(b,0,0,C,E,D,B,C,E),d[0]={x:D,y:B,w:C,h};var P=S,R=(i.freePointer.row+1)*u,A=T;x&&x.context.drawImage(b,P,0,A,E,0,R,A,E),d[1]={x:0,y:R,w:A,h},i.freePointer.x=T,i.freePointer.row++},"drawWrapped"),m=v(function(){i.freePointer.x=0,i.freePointer.row++},"moveToStartOfNextRow");if(this.freePointer.x+c<=o)p();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(m(),p()):this.enableWrapping?y():(m(),p())}return this.keyToLocation.set(r,d),this.needsBuffer=!0,d},"draw")},{key:"getOffsets",value:v(function(r){return this.keyToLocation.get(r)},"getOffsets")},{key:"isEmpty",value:v(function(){return this.freePointer.x===0&&this.freePointer.row===0},"isEmpty")},{key:"canFit",value:v(function(r){if(this.locked)return!1;var a=this.texSize,n=this.texRows,i=this.getScale(r).texW;return this.freePointer.x+i>a?this.freePointer.row<n-1:!0},"canFit")},{key:"bufferIfNeeded",value:v(function(r){this.texture||(this.texture=Ay(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))},"bufferIfNeeded")},{key:"dispose",value:v(function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0},"dispose")}])})(),Fy=(function(){function t(e,r,a,n){lr(this,t),this.r=e,this.texSize=r,this.texRows=a,this.createTextureCanvas=n,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return v(t,"AtlasCollection"),vr(t,[{key:"getKeys",value:v(function(){return new Set(this.styleKeyToAtlas.keys())},"getKeys")},{key:"_createAtlas",value:v(function(){var r=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas;return new zy(r,a,n,i)},"_createAtlas")},{key:"_getScratchCanvas",value:v(function(){if(!this.scratch){var r=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas,o=Math.floor(a/n);this.scratch=i(r,a,o,"scratch")}return this.scratch},"_getScratchCanvas")},{key:"draw",value:v(function(r,a,n){var i=this.styleKeyToAtlas.get(r);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(a))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(r,a,n),this.styleKeyToAtlas.set(r,i)),i},"draw")},{key:"getAtlas",value:v(function(r){return this.styleKeyToAtlas.get(r)},"getAtlas")},{key:"hasAtlas",value:v(function(r){return this.styleKeyToAtlas.has(r)},"hasAtlas")},{key:"markKeyForGC",value:v(function(r){this.markedKeys.add(r)},"markKeyForGC")},{key:"gc",value:v(function(){var r=this,a=this.markedKeys;if(a.size!==0){var n=[],i=new Map,o=null,s=Ct(this.atlases),u;try{var l=v(function(){var c=u.value,h=c.getKeys(),g=Vy(a,h);if(g.size===0)return n.push(c),h.forEach(function(x){return i.set(x,c)}),1;o||(o=r._createAtlas(),n.push(o));var d=Ct(h),p;try{for(d.s();!(p=d.n()).done;){var y=p.value;if(!g.has(y)){var m=Qe(c.getOffsets(y),2),w=m[0],b=m[1];o.canFit({w:w.w+b.w,h:w.h})||(o.lock(),o=r._createAtlas(),n.push(o)),c.canvas&&(r._copyTextureToNewAtlas(y,c,o),i.set(y,o))}}}catch(x){d.e(x)}finally{d.f()}c.dispose()},"_loop");for(s.s();!(u=s.n()).done;)l()}catch(f){s.e(f)}finally{s.f()}this.atlases=n,this.styleKeyToAtlas=i,this.markedKeys=new Set}},"gc")},{key:"_copyTextureToNewAtlas",value:v(function(r,a,n){var i=Qe(a.getOffsets(r),2),o=i[0],s=i[1];if(s.w===0)n.draw(r,o,function(c){c.drawImage(a.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(a.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),u.context.drawImage(a.canvas,s.x,s.y,s.w,s.h,o.w,0,s.w,s.h);var l=o.w+s.w,f=o.h;n.draw(r,{w:l,h:f},function(c){c.drawImage(u,0,0,l,f,0,0,l,f)})}},"_copyTextureToNewAtlas")},{key:"getCounts",value:v(function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}},"getCounts")}])})();function Vy(t,e){return t.intersection?t.intersection(e):new Set(dn(t).filter(function(r){return e.has(r)}))}v(Vy,"intersection");var qy=(function(){function t(e,r){lr(this,t),this.r=e,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return v(t,"AtlasManager"),vr(t,[{key:"getAtlasSize",value:v(function(){return this.atlasSize},"getAtlasSize")},{key:"addAtlasCollection",value:v(function(r,a){var n=this.globalOptions,i=n.webglTexSize,o=n.createTextureCanvas,s=a.texRows,u=this._cacheScratchCanvas(o),l=new Fy(this.r,i,s,u);this.collections.set(r,l)},"addAtlasCollection")},{key:"addRenderType",value:v(function(r,a){var n=a.collection;if(!this.collections.has(n))throw new Error("invalid atlas collection name '".concat(n,"'"));var i=pe({type:r,atlasCollection:this.collections.get(n)},a);this.renderTypes.set(r,i)},"addRenderType")},{key:"getRenderTypeOpts",value:v(function(r){return this.renderTypes.get(r)},"getRenderTypeOpts")},{key:"getAtlasCollection",value:v(function(r){return this.collections.get(r)},"getAtlasCollection")},{key:"_cacheScratchCanvas",value:v(function(r){var a=-1,n=-1,i=null;return function(o,s,u,l){return l?((!i||s!=a||u!=n)&&(a=s,n=u,i=r(o,s,u)),i):r(o,s,u)}},"_cacheScratchCanvas")},{key:"_key",value:v(function(r,a){return"".concat(r,"-").concat(a)},"_key")},{key:"invalidate",value:v(function(r){var a=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.forceRedraw,o=i===void 0?!1:i,s=n.filterEle,u=s===void 0?function(){return!0}:s,l=n.filterType,f=l===void 0?function(){return!0}:l,c=!1,h=!1,g=Ct(r),d;try{for(g.s();!(d=g.n()).done;){var p=d.value;if(u(p)){var y=Ct(this.renderTypes.values()),m;try{var w=v(function(){var x=m.value,S=x.type;if(f(S)){var T=a.collections.get(x.collection),E=x.getKey(p),D=Array.isArray(E)?E:[E];if(o)D.forEach(function(R){return T.markKeyForGC(R)}),h=!0;else{var B=x.getID?x.getID(p):p.id(),C=a._key(S,B),P=a.typeAndIdToKey.get(C);P!==void 0&&!ky(D,P)&&(c=!0,a.typeAndIdToKey.delete(C),P.forEach(function(R){return T.markKeyForGC(R)}))}}},"_loop2");for(y.s();!(m=y.n()).done;)w()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){g.e(b)}finally{g.f()}return h&&(this.gc(),c=!1),c},"invalidate")},{key:"gc",value:v(function(){var r=Ct(this.collections.values()),a;try{for(r.s();!(a=r.n()).done;)a.value.gc()}catch(n){r.e(n)}finally{r.f()}},"gc")},{key:"getOrCreateAtlas",value:v(function(r,a,n,i){var o=this.renderTypes.get(a),s=this.collections.get(o.collection),u=!1,l=s.draw(i,n,function(h){o.drawClipped?(h.save(),h.beginPath(),h.rect(0,0,n.w,n.h),h.clip(),o.drawElement(h,r,n,!0,!0),h.restore()):o.drawElement(h,r,n,!0,!0),u=!0});if(u){var f=o.getID?o.getID(r):r.id(),c=this._key(a,f);this.typeAndIdToKey.has(c)?this.typeAndIdToKey.get(c).push(i):this.typeAndIdToKey.set(c,[i])}return l},"getOrCreateAtlas")},{key:"getAtlasInfo",value:v(function(r,a){var n=this,i=this.renderTypes.get(a),o=i.getKey(r);return(Array.isArray(o)?o:[o]).map(function(s){var u=i.getBoundingBox(r,s),l=n.getOrCreateAtlas(r,a,u,s),f=Qe(l.getOffsets(s),2),c=f[0];return{atlas:l,tex:c,tex1:c,tex2:f[1],bb:u}})},"getAtlasInfo")},{key:"getDebugInfo",value:v(function(){var r=[],a=Ct(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=Qe(n.value,2),o=i[0],s=i[1].getCounts(),u=s.keyCount,l=s.atlasCount;r.push({type:o,keyCount:u,atlasCount:l})}}catch(f){a.e(f)}finally{a.f()}return r},"getDebugInfo")}])})(),_y=(function(){function t(e){lr(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return v(t,"AtlasBatchManager"),vr(t,[{key:"getMaxAtlasesPerBatch",value:v(function(){return this.maxAtlasesPerBatch},"getMaxAtlasesPerBatch")},{key:"getAtlasSize",value:v(function(){return this.atlasSize},"getAtlasSize")},{key:"getIndexArray",value:v(function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,a){return a})},"getIndexArray")},{key:"startBatch",value:v(function(){this.batchAtlases=[]},"startBatch")},{key:"getAtlasCount",value:v(function(){return this.batchAtlases.length},"getAtlasCount")},{key:"getAtlases",value:v(function(){return this.batchAtlases},"getAtlases")},{key:"canAddToCurrentBatch",value:v(function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0},"canAddToCurrentBatch")},{key:"getAtlasIndexForBatch",value:v(function(r){var a=this.batchAtlases.indexOf(r);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),a=this.batchAtlases.length-1}return a},"getAtlasIndexForBatch")}])})(),Gy=`
|
|
8
|
+
float circleSD(vec2 p, float r) {
|
|
9
|
+
return distance(vec2(0), p) - r; // signed distance
|
|
10
|
+
}
|
|
11
|
+
`,Hy=`
|
|
12
|
+
float rectangleSD(vec2 p, vec2 b) {
|
|
13
|
+
vec2 d = abs(p)-b;
|
|
14
|
+
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
15
|
+
}
|
|
16
|
+
`,$y=`
|
|
17
|
+
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
18
|
+
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
19
|
+
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
20
|
+
vec2 q = abs(p) - b + cr.x;
|
|
21
|
+
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
22
|
+
}
|
|
23
|
+
`,Wy=`
|
|
24
|
+
float ellipseSD(vec2 p, vec2 ab) {
|
|
25
|
+
p = abs( p ); // symmetry
|
|
26
|
+
|
|
27
|
+
// find root with Newton solver
|
|
28
|
+
vec2 q = ab*(p-ab);
|
|
29
|
+
float w = (q.x<q.y)? 1.570796327 : 0.0;
|
|
30
|
+
for( int i=0; i<5; i++ ) {
|
|
31
|
+
vec2 cs = vec2(cos(w),sin(w));
|
|
32
|
+
vec2 u = ab*vec2( cs.x,cs.y);
|
|
33
|
+
vec2 v = ab*vec2(-cs.y,cs.x);
|
|
34
|
+
w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// compute final point and distance
|
|
38
|
+
float d = length(p-ab*vec2(cos(w),sin(w)));
|
|
39
|
+
|
|
40
|
+
// return signed distance
|
|
41
|
+
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
42
|
+
}
|
|
43
|
+
`,ba={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},kn={IGNORE:1,USE_BB:2},xo=0,$l=1,Wl=2,Eo=3,zr=4,tn=5,ca=6,ha=7,Uy=(function(){function t(e,r,a){lr(this,t),this.r=e,this.gl=r,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=Ty,this.atlasManager=new qy(e,a),this.batchManager=new _y(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(ba.SCREEN),this.pickingProgram=this._createShaderProgram(ba.PICKING),this.vao=this._createVAO()}return v(t,"ElementDrawingWebGL"),vr(t,[{key:"addAtlasCollection",value:v(function(r,a){this.atlasManager.addAtlasCollection(r,a)},"addAtlasCollection")},{key:"addTextureAtlasRenderType",value:v(function(r,a){this.atlasManager.addRenderType(r,a)},"addTextureAtlasRenderType")},{key:"addSimpleShapeRenderType",value:v(function(r,a){this.simpleShapeOptions.set(r,a)},"addSimpleShapeRenderType")},{key:"invalidate",value:v(function(r){var a=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,n=this.atlasManager;return a?n.invalidate(r,{filterType:v(function(o){return o===a},"filterType"),forceRedraw:!0}):n.invalidate(r)},"invalidate")},{key:"gc",value:v(function(){this.atlasManager.gc()},"gc")},{key:"_createShaderProgram",value:v(function(r){var a=this.gl,n=`#version 300 es
|
|
44
|
+
precision highp float;
|
|
45
|
+
|
|
46
|
+
uniform mat3 uPanZoomMatrix;
|
|
47
|
+
uniform int uAtlasSize;
|
|
48
|
+
|
|
49
|
+
// instanced
|
|
50
|
+
in vec2 aPosition; // a vertex from the unit square
|
|
51
|
+
|
|
52
|
+
in mat3 aTransform; // used to transform verticies, eg into a bounding box
|
|
53
|
+
in int aVertType; // the type of thing we are rendering
|
|
54
|
+
|
|
55
|
+
// the z-index that is output when using picking mode
|
|
56
|
+
in vec4 aIndex;
|
|
57
|
+
|
|
58
|
+
// For textures
|
|
59
|
+
in int aAtlasId; // which shader unit/atlas to use
|
|
60
|
+
in vec4 aTex; // x/y/w/h of texture in atlas
|
|
61
|
+
|
|
62
|
+
// for edges
|
|
63
|
+
in vec4 aPointAPointB;
|
|
64
|
+
in vec4 aPointCPointD;
|
|
65
|
+
in vec2 aLineWidth; // also used for node border width
|
|
66
|
+
|
|
67
|
+
// simple shapes
|
|
68
|
+
in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
|
|
69
|
+
in vec4 aColor; // also used for edges
|
|
70
|
+
in vec4 aBorderColor; // aLineWidth is used for border width
|
|
71
|
+
|
|
72
|
+
// output values passed to the fragment shader
|
|
73
|
+
out vec2 vTexCoord;
|
|
74
|
+
out vec4 vColor;
|
|
75
|
+
out vec2 vPosition;
|
|
76
|
+
// flat values are not interpolated
|
|
77
|
+
flat out int vAtlasId;
|
|
78
|
+
flat out int vVertType;
|
|
79
|
+
flat out vec2 vTopRight;
|
|
80
|
+
flat out vec2 vBotLeft;
|
|
81
|
+
flat out vec4 vCornerRadius;
|
|
82
|
+
flat out vec4 vBorderColor;
|
|
83
|
+
flat out vec2 vBorderWidth;
|
|
84
|
+
flat out vec4 vIndex;
|
|
85
|
+
|
|
86
|
+
void main(void) {
|
|
87
|
+
int vid = gl_VertexID;
|
|
88
|
+
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
|
|
89
|
+
|
|
90
|
+
if(aVertType == `.concat(xo,`) {
|
|
91
|
+
float texX = aTex.x; // texture coordinates
|
|
92
|
+
float texY = aTex.y;
|
|
93
|
+
float texW = aTex.z;
|
|
94
|
+
float texH = aTex.w;
|
|
95
|
+
|
|
96
|
+
if(vid == 1 || vid == 2 || vid == 4) {
|
|
97
|
+
texX += texW;
|
|
98
|
+
}
|
|
99
|
+
if(vid == 2 || vid == 4 || vid == 5) {
|
|
100
|
+
texY += texH;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
float d = float(uAtlasSize);
|
|
104
|
+
vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
|
|
105
|
+
|
|
106
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
107
|
+
}
|
|
108
|
+
else if(aVertType == `).concat(zr," || aVertType == ").concat(ha,`
|
|
109
|
+
|| aVertType == `).concat(tn," || aVertType == ").concat(ca,`) { // simple shapes
|
|
110
|
+
|
|
111
|
+
// the bounding box is needed by the fragment shader
|
|
112
|
+
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
113
|
+
vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
|
|
114
|
+
vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
|
|
115
|
+
|
|
116
|
+
// calculations are done in the fragment shader, just pass these along
|
|
117
|
+
vColor = aColor;
|
|
118
|
+
vCornerRadius = aCornerRadius;
|
|
119
|
+
vBorderColor = aBorderColor;
|
|
120
|
+
vBorderWidth = aLineWidth;
|
|
121
|
+
|
|
122
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
123
|
+
}
|
|
124
|
+
else if(aVertType == `).concat($l,`) {
|
|
125
|
+
vec2 source = aPointAPointB.xy;
|
|
126
|
+
vec2 target = aPointAPointB.zw;
|
|
127
|
+
|
|
128
|
+
// adjust the geometry so that the line is centered on the edge
|
|
129
|
+
position.y = position.y - 0.5;
|
|
130
|
+
|
|
131
|
+
// stretch the unit square into a long skinny rectangle
|
|
132
|
+
vec2 xBasis = target - source;
|
|
133
|
+
vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
|
|
134
|
+
vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
|
|
135
|
+
|
|
136
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
137
|
+
vColor = aColor;
|
|
138
|
+
}
|
|
139
|
+
else if(aVertType == `).concat(Wl,`) {
|
|
140
|
+
vec2 pointA = aPointAPointB.xy;
|
|
141
|
+
vec2 pointB = aPointAPointB.zw;
|
|
142
|
+
vec2 pointC = aPointCPointD.xy;
|
|
143
|
+
vec2 pointD = aPointCPointD.zw;
|
|
144
|
+
|
|
145
|
+
// adjust the geometry so that the line is centered on the edge
|
|
146
|
+
position.y = position.y - 0.5;
|
|
147
|
+
|
|
148
|
+
vec2 p0, p1, p2, pos;
|
|
149
|
+
if(position.x == 0.0) { // The left side of the unit square
|
|
150
|
+
p0 = pointA;
|
|
151
|
+
p1 = pointB;
|
|
152
|
+
p2 = pointC;
|
|
153
|
+
pos = position;
|
|
154
|
+
} else { // The right side of the unit square, use same approach but flip the geometry upside down
|
|
155
|
+
p0 = pointD;
|
|
156
|
+
p1 = pointC;
|
|
157
|
+
p2 = pointB;
|
|
158
|
+
pos = vec2(0.0, -position.y);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
vec2 p01 = p1 - p0;
|
|
162
|
+
vec2 p12 = p2 - p1;
|
|
163
|
+
vec2 p21 = p1 - p2;
|
|
164
|
+
|
|
165
|
+
// Find the normal vector.
|
|
166
|
+
vec2 tangent = normalize(normalize(p12) + normalize(p01));
|
|
167
|
+
vec2 normal = vec2(-tangent.y, tangent.x);
|
|
168
|
+
|
|
169
|
+
// Find the vector perpendicular to p0 -> p1.
|
|
170
|
+
vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
|
|
171
|
+
|
|
172
|
+
// Determine the bend direction.
|
|
173
|
+
float sigma = sign(dot(p01 + p21, normal));
|
|
174
|
+
float width = aLineWidth[0];
|
|
175
|
+
|
|
176
|
+
if(sign(pos.y) == -sigma) {
|
|
177
|
+
// This is an intersecting vertex. Adjust the position so that there's no overlap.
|
|
178
|
+
vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
|
|
179
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
180
|
+
} else {
|
|
181
|
+
// This is a non-intersecting vertex. Treat it like a mitre join.
|
|
182
|
+
vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
|
|
183
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
vColor = aColor;
|
|
187
|
+
}
|
|
188
|
+
else if(aVertType == `).concat(Eo,` && vid < 3) {
|
|
189
|
+
// massage the first triangle into an edge arrow
|
|
190
|
+
if(vid == 0)
|
|
191
|
+
position = vec2(-0.15, -0.3);
|
|
192
|
+
if(vid == 1)
|
|
193
|
+
position = vec2( 0.0, 0.0);
|
|
194
|
+
if(vid == 2)
|
|
195
|
+
position = vec2( 0.15, -0.3);
|
|
196
|
+
|
|
197
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
198
|
+
vColor = aColor;
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
vAtlasId = aAtlasId;
|
|
205
|
+
vVertType = aVertType;
|
|
206
|
+
vIndex = aIndex;
|
|
207
|
+
}
|
|
208
|
+
`),i=this.batchManager.getIndexArray(),o=Cy(a,n,`#version 300 es
|
|
209
|
+
precision highp float;
|
|
210
|
+
|
|
211
|
+
// declare texture unit for each texture atlas in the batch
|
|
212
|
+
`.concat(i.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join(`
|
|
213
|
+
`),`
|
|
214
|
+
|
|
215
|
+
uniform vec4 uBGColor;
|
|
216
|
+
uniform float uZoom;
|
|
217
|
+
|
|
218
|
+
in vec2 vTexCoord;
|
|
219
|
+
in vec4 vColor;
|
|
220
|
+
in vec2 vPosition; // model coordinates
|
|
221
|
+
|
|
222
|
+
flat in int vAtlasId;
|
|
223
|
+
flat in vec4 vIndex;
|
|
224
|
+
flat in int vVertType;
|
|
225
|
+
flat in vec2 vTopRight;
|
|
226
|
+
flat in vec2 vBotLeft;
|
|
227
|
+
flat in vec4 vCornerRadius;
|
|
228
|
+
flat in vec4 vBorderColor;
|
|
229
|
+
flat in vec2 vBorderWidth;
|
|
230
|
+
|
|
231
|
+
out vec4 outColor;
|
|
232
|
+
|
|
233
|
+
`).concat(Gy,`
|
|
234
|
+
`).concat(Hy,`
|
|
235
|
+
`).concat($y,`
|
|
236
|
+
`).concat(Wy,`
|
|
237
|
+
|
|
238
|
+
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
239
|
+
return vec4(
|
|
240
|
+
top.rgb + (bot.rgb * (1.0 - top.a)),
|
|
241
|
+
top.a + (bot.a * (1.0 - top.a))
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
|
|
246
|
+
// scale to the zoom level so that borders don't look blurry when zoomed in
|
|
247
|
+
// note 1.5 is an aribitrary value chosen because it looks good
|
|
248
|
+
return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
void main(void) {
|
|
252
|
+
if(vVertType == `).concat(xo,`) {
|
|
253
|
+
// look up the texel from the texture unit
|
|
254
|
+
`).concat(i.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(`
|
|
255
|
+
else `),`
|
|
256
|
+
}
|
|
257
|
+
else if(vVertType == `).concat(Eo,`) {
|
|
258
|
+
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
259
|
+
outColor = blend(vColor, uBGColor);
|
|
260
|
+
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
261
|
+
}
|
|
262
|
+
else if(vVertType == `).concat(zr,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
263
|
+
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
264
|
+
}
|
|
265
|
+
else if(vVertType == `).concat(zr," || vVertType == ").concat(ha,`
|
|
266
|
+
|| vVertType == `).concat(tn," || vVertType == ").concat(ca,`) { // use SDF
|
|
267
|
+
|
|
268
|
+
float outerBorder = vBorderWidth[0];
|
|
269
|
+
float innerBorder = vBorderWidth[1];
|
|
270
|
+
float borderPadding = outerBorder * 2.0;
|
|
271
|
+
float w = vTopRight.x - vBotLeft.x - borderPadding;
|
|
272
|
+
float h = vTopRight.y - vBotLeft.y - borderPadding;
|
|
273
|
+
vec2 b = vec2(w/2.0, h/2.0); // half width, half height
|
|
274
|
+
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
275
|
+
|
|
276
|
+
float d; // signed distance
|
|
277
|
+
if(vVertType == `).concat(zr,`) {
|
|
278
|
+
d = rectangleSD(p, b);
|
|
279
|
+
} else if(vVertType == `).concat(ha,` && w == h) {
|
|
280
|
+
d = circleSD(p, b.x); // faster than ellipse
|
|
281
|
+
} else if(vVertType == `).concat(ha,`) {
|
|
282
|
+
d = ellipseSD(p, b);
|
|
283
|
+
} else {
|
|
284
|
+
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
|
|
288
|
+
// we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
|
|
289
|
+
if(d > 0.0) {
|
|
290
|
+
if(d > outerBorder) {
|
|
291
|
+
discard;
|
|
292
|
+
} else {
|
|
293
|
+
outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
|
|
294
|
+
}
|
|
295
|
+
} else {
|
|
296
|
+
if(d > innerBorder) {
|
|
297
|
+
vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
|
|
298
|
+
vec4 innerBorderColor = blend(vBorderColor, vColor);
|
|
299
|
+
outColor = distInterp(innerBorderColor, outerColor, d);
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
vec4 outerColor;
|
|
303
|
+
if(innerBorder == 0.0 && outerBorder == 0.0) {
|
|
304
|
+
outerColor = vec4(0);
|
|
305
|
+
} else if(innerBorder == 0.0) {
|
|
306
|
+
outerColor = vBorderColor;
|
|
307
|
+
} else {
|
|
308
|
+
outerColor = blend(vBorderColor, vColor);
|
|
309
|
+
}
|
|
310
|
+
outColor = distInterp(vColor, outerColor, d - innerBorder);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
outColor = vColor;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
`).concat(r.picking?`if(outColor.a == 0.0) discard;
|
|
319
|
+
else outColor = vIndex;`:"",`
|
|
320
|
+
}
|
|
321
|
+
`));o.aPosition=a.getAttribLocation(o,"aPosition"),o.aIndex=a.getAttribLocation(o,"aIndex"),o.aVertType=a.getAttribLocation(o,"aVertType"),o.aTransform=a.getAttribLocation(o,"aTransform"),o.aAtlasId=a.getAttribLocation(o,"aAtlasId"),o.aTex=a.getAttribLocation(o,"aTex"),o.aPointAPointB=a.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=a.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=a.getAttribLocation(o,"aLineWidth"),o.aColor=a.getAttribLocation(o,"aColor"),o.aCornerRadius=a.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=a.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=a.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=a.getUniformLocation(o,"uAtlasSize"),o.uBGColor=a.getUniformLocation(o,"uBGColor"),o.uZoom=a.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var s=0;s<this.batchManager.getMaxAtlasesPerBatch();s++)o.uTextures.push(a.getUniformLocation(o,"uTexture".concat(s)));return o},"_createShaderProgram")},{key:"_createVAO",value:v(function(){var r=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=r.length/2;var a=this.maxInstances,n=this.gl,i=this.program,o=n.createVertexArray();return n.bindVertexArray(o),My(n,"vec2",i.aPosition,r),this.transformBuffer=Ly(n,a,i.aTransform),this.indexBuffer=Ot(n,a,"vec4",i.aIndex),this.vertTypeBuffer=Ot(n,a,"int",i.aVertType),this.atlasIdBuffer=Ot(n,a,"int",i.aAtlasId),this.texBuffer=Ot(n,a,"vec4",i.aTex),this.pointAPointBBuffer=Ot(n,a,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Ot(n,a,"vec4",i.aPointCPointD),this.lineWidthBuffer=Ot(n,a,"vec2",i.aLineWidth),this.colorBuffer=Ot(n,a,"vec4",i.aColor),this.cornerRadiusBuffer=Ot(n,a,"vec4",i.aCornerRadius),this.borderColorBuffer=Ot(n,a,"vec4",i.aBorderColor),n.bindVertexArray(null),o},"_createVAO")},{key:"buffers",get:v(function(){var r=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(a){return Jt(a,"Buffer")}).map(function(a){return r[a]})),this._buffers},"get")},{key:"startFrame",value:v(function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ba.SCREEN;this.panZoomMatrix=r,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()},"startFrame")},{key:"startBatch",value:v(function(){this.instanceCount=0,this.batchManager.startBatch()},"startBatch")},{key:"endFrame",value:v(function(){this.endBatch()},"endFrame")},{key:"_isVisible",value:v(function(r,a){return r.visible()?a&&a.isVisible?a.isVisible(r):!0:!1},"_isVisible")},{key:"drawTexture",value:v(function(r,a,n){var i=this.atlasManager,o=this.batchManager,s=i.getRenderTypeOpts(n);if(this._isVisible(r,s)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&s.getTexPickingMode){var u=s.getTexPickingMode(r);if(u===kn.IGNORE)return;if(u==kn.USE_BB){this.drawPickingRectangle(r,a,n);return}}var l=Ct(i.getAtlasInfo(r,n)),f;try{for(l.s();!(f=l.n()).done;){var c=f.value,h=c.atlas,g=c.tex1,d=c.tex2;o.canAddToCurrentBatch(h)||this.endBatch();for(var p=o.getAtlasIndexForBatch(h),y=0,m=[[g,!0],[d,!1]];y<m.length;y++){var w=Qe(m[y],2),b=w[0],x=w[1];if(b.w!=0){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=xo,Nr(a,this.indexBuffer.getView(S));var T=this.atlasIdBuffer.getView(S);T[0]=p;var E=this.texBuffer.getView(S);E[0]=b.x,E[1]=b.y,E[2]=b.w,E[3]=b.h;var D=this.transformBuffer.getMatrixView(S);this.setTransformMatrix(r,D,s,c,x),this.instanceCount++,x||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(B){l.e(B)}finally{l.f()}}},"drawTexture")},{key:"setTransformMatrix",value:v(function(r,a,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(n.shapeProps&&n.shapeProps.padding&&(s=r.pstyle(n.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,f=i.tex2,c=l.w/(l.w+f.w);o||(c=1-c);var h=this._getAdjustedBB(u,s,o,c);this._applyTransformMatrix(a,h,n,r)}else{var g=n.getBoundingBox(r),d=this._getAdjustedBB(g,s,!0,1);this._applyTransformMatrix(a,d,n,r)}},"setTransformMatrix")},{key:"_applyTransformMatrix",value:v(function(r,a,n,i){var o,s;Gl(r);var u=n.getRotation?n.getRotation(i):0;if(u!==0){var l=n.getRotationPoint(i),f=l.x,c=l.y;hn(r,r,[f,c]),Hl(r,r,u);var h=n.getRotationOffset(i);o=h.x+(a.xOffset||0),s=h.y+(a.yOffset||0)}else o=a.x1,s=a.y1;hn(r,r,[o,s]),Go(r,r,[a.w,a.h])},"_applyTransformMatrix")},{key:"_getAdjustedBB",value:v(function(r,a,n,i){var o=r.x1,s=r.y1,u=r.w,l=r.h,f=r.yOffset;a&&(o-=a,s-=a,u+=2*a,l+=2*a);var c=0,h=u*i;return n&&i<1?u=h:!n&&i<1&&(c=u-h,o+=c,u=h),{x1:o,y1:s,w:u,h:l,xOffset:c,yOffset:f}},"_getAdjustedBB")},{key:"drawPickingRectangle",value:v(function(r,a,n){var i=this.atlasManager.getRenderTypeOpts(n),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=zr,Nr(a,this.indexBuffer.getView(o)),pr([0,0,0],1,this.colorBuffer.getView(o));var s=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(r,s,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()},"drawPickingRectangle")},{key:"drawNode",value:v(function(r,a,n){var i=this.simpleShapeOptions.get(n);if(this._isVisible(r,i)){var o=i.shapeProps,s=this._getVertTypeForShape(r,o.shape);if(s===void 0||i.isSimple&&!i.isSimple(r,this.renderTarget)){this.drawTexture(r,a,n);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=s,s===tn||s===ca){var l=i.getBoundingBox(r),f=this._getCornerRadius(r,o.radius,l),c=this.cornerRadiusBuffer.getView(u);c[0]=f,c[1]=f,c[2]=f,c[3]=f,s===ca&&(c[0]=0,c[2]=0)}Nr(a,this.indexBuffer.getView(u));var h=this.renderTarget.picking?1:n==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(o.opacity).value*h,d=r.pstyle(o.color).value;pr(d,g,this.colorBuffer.getView(u));var p=this.lineWidthBuffer.getView(u);if(p[0]=0,p[1]=0,o.border){var y=r.pstyle("border-width").value;if(y>0){var m=r.pstyle("border-color").value;pr(m,h*r.pstyle("border-opacity").value,this.borderColorBuffer.getView(u));var w=r.pstyle("border-position").value;if(w==="inside")p[0]=0,p[1]=-y;else if(w==="outside")p[0]=y,p[1]=0;else{var b=y/2;p[0]=b,p[1]=-b}}}var x=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(r,x,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},"drawNode")},{key:"_getVertTypeForShape",value:v(function(r,a){switch(r.pstyle(a).value){case"rectangle":return zr;case"ellipse":return ha;case"roundrectangle":case"round-rectangle":return tn;case"bottom-round-rectangle":return ca;default:return}},"_getVertTypeForShape")},{key:"_getCornerRadius",value:v(function(r,a,n){var i=n.w,o=n.h;if(r.pstyle(a).value==="auto")return ir(i,o);var s=r.pstyle(a).pfValue,u=i/2,l=o/2;return Math.min(s,l,u)},"_getCornerRadius")},{key:"drawEdgeArrow",value:v(function(r,a,n){if(r.visible()){var i=r._private.rscratch,o,s,u;if(n==="source"?(o=i.arrowStartX,s=i.arrowStartY,u=i.srcArrowAngle):(o=i.arrowEndX,s=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(u)||u==null)&&r.pstyle(n+"-arrow-shape").value!=="none"){var l=r.pstyle(n+"-arrow-color").value,f=r.pstyle("opacity").value*r.pstyle("line-opacity").value,c=r.pstyle("width").pfValue,h=r.pstyle("arrow-scale").value,g=this.r.getArrowWidth(c,h),d=this.instanceCount,p=this.transformBuffer.getMatrixView(d);Gl(p),hn(p,p,[o,s]),Go(p,p,[g,g]),Hl(p,p,u),this.vertTypeBuffer.getView(d)[0]=Eo,Nr(a,this.indexBuffer.getView(d)),pr(l,f,this.colorBuffer.getView(d)),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},"drawEdgeArrow")},{key:"drawEdgeLine",value:v(function(r,a){if(r.visible()){var n=this._getEdgePoints(r);if(n){var i=r.pstyle("opacity").value,o=r.pstyle("line-opacity").value,s=r.pstyle("width").pfValue,u=r.pstyle("line-color").value,l=i*o;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var f=this.instanceCount;this.vertTypeBuffer.getView(f)[0]=$l,Nr(a,this.indexBuffer.getView(f)),pr(u,l,this.colorBuffer.getView(f));var c=this.lineWidthBuffer.getView(f);c[0]=s;var h=this.pointAPointBBuffer.getView(f);h[0]=n[0],h[1]=n[1],h[2]=n[2],h[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var g=0;g<n.length-2;g+=2){var d=this.instanceCount;this.vertTypeBuffer.getView(d)[0]=Wl,Nr(a,this.indexBuffer.getView(d)),pr(u,l,this.colorBuffer.getView(d));var p=this.lineWidthBuffer.getView(d);p[0]=s;var y=n[g-2],m=n[g-1],w=n[g],b=n[g+1],x=n[g+2],S=n[g+3],T=n[g+4],E=n[g+5];g==0&&(y=2*w-x+.001,m=2*b-S+.001),g==n.length-4&&(T=2*x-w+.001,E=2*S-b+.001);var D=this.pointAPointBBuffer.getView(d);D[0]=y,D[1]=m,D[2]=w,D[3]=b;var B=this.pointCPointDBuffer.getView(d);B[0]=x,B[1]=S,B[2]=T,B[3]=E,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},"drawEdgeLine")},{key:"_isValidEdge",value:v(function(r){var a=r._private.rscratch;return!(a.badLine||a.allpts==null||isNaN(a.allpts[0]))},"_isValidEdge")},{key:"_getEdgePoints",value:v(function(r){var a=r._private.rscratch;if(this._isValidEdge(r)){var n=a.allpts;if(n.length==4)return n;var i=this._getNumSegments(r);return this._getCurveSegmentPoints(n,i)}},"_getEdgePoints")},{key:"_getNumSegments",value:v(function(r){return Math.min(Math.max(15,5),this.maxInstances)},"_getNumSegments")},{key:"_getCurveSegmentPoints",value:v(function(r,a){if(r.length==4)return r;for(var n=Array((a+1)*2),i=0;i<=a;i++)if(i==0)n[0]=r[0],n[1]=r[1];else if(i==a)n[i*2]=r[r.length-2],n[i*2+1]=r[r.length-1];else{var o=i/a;this._setCurvePoint(r,o,n,i*2)}return n},"_getCurveSegmentPoints")},{key:"_setCurvePoint",value:v(function(r,a,n,i){if(r.length<=2)n[i]=r[0],n[i+1]=r[1];else{for(var o=Array(r.length-2),s=0;s<o.length;s+=2){var u=(1-a)*r[s]+a*r[s+2],l=(1-a)*r[s+1]+a*r[s+3];o[s]=u,o[s+1]=l}return this._setCurvePoint(o,a,n,i)}},"_setCurvePoint")},{key:"endBatch",value:v(function(){var r=this.gl,a=this.vao,n=this.vertexCount,i=this.instanceCount;if(i!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;r.useProgram(o),r.bindVertexArray(a);var s=Ct(this.buffers),u;try{for(s.s();!(u=s.n()).done;)u.value.bufferSubData(i)}catch(g){s.e(g)}finally{s.f()}for(var l=this.batchManager.getAtlases(),f=0;f<l.length;f++)l[f].bufferIfNeeded(r);for(var c=0;c<l.length;c++)r.activeTexture(r.TEXTURE0+c),r.bindTexture(r.TEXTURE_2D,l[c].texture),r.uniform1i(o.uTextures[c],c);r.uniform1f(o.uZoom,Sy(this.r)),r.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var h=pr(this.bgColor,1);r.uniform4fv(o.uBGColor,h),r.drawArraysInstanced(r.TRIANGLES,0,n,i),r.bindVertexArray(null),r.bindTexture(r.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:l.length}),this.startBatch()}},"endBatch")},{key:"getDebugInfo",value:v(function(){var r=this.atlasManager.getDebugInfo(),a=r.reduce(function(o,s){return o+s.atlasCount},0),n=this.batchDebugInfo,i=n.reduce(function(o,s){return o+s.count},0);return{atlasInfo:r,totalAtlases:a,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:n.length,batchInfo:n,totalInstances:i}},"getDebugInfo")}])})(),Mf={};Mf.initWebgl=function(t,e){var r=this,a=r.data.contexts[r.WEBGL];t.bgColor=Ky(r),t.webglTexSize=Math.min(t.webglTexSize,a.getParameter(a.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglTexRowsNodes=Math.min(t.webglTexRowsNodes,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,r.pickingFrameBuffer=Iy(a),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new Uy(r,a,t);var n=v(function(c){return function(h){return r.getTextAngle(h,c)}},"getLabelRotation"),i=v(function(c){return function(h){var g=h.pstyle(c);return g&&g.value}},"isLabelVisible"),o=v(function(c){return function(h){return h.pstyle("".concat(c,"-opacity")).value>0}},"isLayerVisible"),s=v(function(c){return c.pstyle("text-events").strValue==="yes"?kn.USE_BB:kn.IGNORE},"getTexPickingMode"),u=v(function(c){var h=c.position(),g=h.x,d=h.y,p=c.outerWidth(),y=c.outerHeight();return{w:p,h:y,x1:g-p/2,y1:d-y/2}},"getBBForSimpleShape");r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:u,isSimple:By,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:u,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:u,isVisible:o("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:Co(e.getLabelKey,null),getBoundingBox:To(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:n(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:Co(e.getSourceLabelKey,"source"),getBoundingBox:To(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:n("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:Co(e.getTargetLabelKey,"target"),getBoundingBox:To(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=Ia(function(){r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(f,c){var h=!1;c&&c.length>0&&(h|=r.drawing.invalidate(c)),h&&l()}),Yy(r)};function Ky(t){var e=t.cy.container();return av(e&&e.style&&e.style.backgroundColor||"white")}v(Ky,"getBGColor");function Lf(t,e){var r=t._private.rscratch;return yt(r,"labelWrapCachedLines",e)||[]}v(Lf,"getLabelLines");var Co=v(function(e,r){return function(a){var n=e(a),i=Lf(a,r);return i.length>1?i.map(function(o,s){return"".concat(n,"_").concat(s)}):n}},"getStyleKeysForLabel"),To=v(function(e,r){return function(a,n){var i=e(a);if(typeof n=="string"){var o=n.indexOf("_");if(o>0){var s=Number(n.substring(o+1)),u=Lf(a,r),l=i.h/u.length,f=l*s,c=i.y1+f;return{x1:i.x1,w:i.w,y1:c,h:l,yOffset:f}}}return i}},"getBoundingBoxForLabel");function Yy(t){var e=t.render;t.render=function(i){i=i||{};var o=t.cy;t.webgl&&(o.zoom()>Sf?(Xy(t),e.call(t,i)):(Zy(t),Of(t,i,ba.SCREEN)))};var r=t.matchCanvasSize;t.matchCanvasSize=function(i){r.call(t,i),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0},t.findNearestElements=function(i,o,s,u){return rm(t,i,o)};var a=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){a.call(t),t.pickingFrameBuffer.needsDraw=!0};var n=t.notify;t.notify=function(i,o){n.call(t,i,o),i==="viewport"||i==="bounds"?t.pickingFrameBuffer.needsDraw=!0:i==="background"&&t.drawing.invalidate(o,{type:"node-body"})}}v(Yy,"overrideCanvasRendererFunctions");function Xy(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}v(Xy,"clearWebgl");function Zy(t){var e=v(function(a){a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,t.canvasWidth,t.canvasHeight),a.restore()},"clear");e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}v(Zy,"clearCanvas");function Qy(t){var e=t.canvasWidth,r=t.canvasHeight,a=ps(t),n=a.pan,i=a.zoom,o=wo();hn(o,o,[n.x,n.y]),Go(o,o,[i,i]);var s=wo();Ny(s,e,r);var u=wo();return Oy(u,s,o),u}v(Qy,"createPanZoomMatrix");function If(t,e){var r=t.canvasWidth,a=t.canvasHeight,n=ps(t),i=n.pan,o=n.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,a),e.translate(i.x,i.y),e.scale(o,o)}v(If,"setContextTransform");function Jy(t,e){t.drawSelectionRectangle(e,function(r){return If(t,r)})}v(Jy,"drawSelectionRectangle");function jy(t){var e=t.data.contexts[t.NODE];e.save(),If(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}v(jy,"drawAxes");function em(t){var e=v(function(n,i,o){for(var s=n.atlasManager.getAtlasCollection(i),u=t.data.contexts[t.NODE],l=s.atlases,f=0;f<l.length;f++){var c=l[f].canvas;if(c){var h=c.width,g=c.height,d=h*f,p=c.height*o,y=.4;u.save(),u.scale(y,y),u.drawImage(c,d,p),u.strokeStyle="black",u.rect(d,p,h,g),u.stroke(),u.restore()}}},"draw"),r=0;e(t.drawing,"node",r++),e(t.drawing,"label",r++)}v(em,"drawAtlases");function tm(t,e,r,a,n){var i,o,s,u,l=ps(t),f=l.pan,c=l.zoom,h=Qe(Dy(t,f,c,e,r),2),g=h[0],d=h[1],p=6;if(i=g-p/2,o=d-p/2,s=p,u=p,s===0||u===0)return[];var y=t.data.contexts[t.WEBGL];y.bindFramebuffer(y.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(y.viewport(0,0,y.canvas.width,y.canvas.height),Of(t,null,ba.PICKING),t.pickingFrameBuffer.needsDraw=!1);var m=s*u,w=new Uint8Array(m*4);y.readPixels(i,o,s,u,y.RGBA,y.UNSIGNED_BYTE,w),y.bindFramebuffer(y.FRAMEBUFFER,null);for(var b=new Set,x=0;x<m;x++){var S=Py(w.slice(x*4,x*4+4))-1;S>=0&&b.add(S)}return b}v(tm,"getPickingIndexes");function rm(t,e,r){var a=tm(t,e,r),n=t.getCachedZSortedEles(),i,o,s=Ct(a),u;try{for(s.s();!(u=s.n()).done;){var l=n[u.value];if(!i&&l.isNode()&&(i=l),!o&&l.isEdge()&&(o=l),i&&o)break}}catch(f){s.e(f)}finally{s.f()}return[i,o].filter(Boolean)}v(rm,"findNearestElementsWebgl");function So(t,e,r){var a=t.drawing;e+=1,r.isNode()?(a.drawNode(r,e,"node-underlay"),a.drawNode(r,e,"node-body"),a.drawTexture(r,e,"label"),a.drawNode(r,e,"node-overlay")):(a.drawEdgeLine(r,e),a.drawEdgeArrow(r,e,"source"),a.drawEdgeArrow(r,e,"target"),a.drawTexture(r,e,"label"),a.drawTexture(r,e,"edge-source-label"),a.drawTexture(r,e,"edge-target-label"))}v(So,"drawEle");function Of(t,e,r){var a;t.webglDebug&&(a=performance.now());var n=t.drawing,i=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&Jy(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var o=t.data.contexts[t.WEBGL];r.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=Qy(t),u=t.getCachedZSortedEles();if(i=u.length,n.startFrame(s,r),r.screen){for(var l=0;l<u.nondrag.length;l++)So(t,l,u.nondrag[l]);for(var f=0;f<u.drag.length;f++)So(t,f,u.drag[f])}else if(r.picking)for(var c=0;c<u.length;c++)So(t,c,u[c]);n.endFrame(),r.screen&&t.webglDebugShowAtlases&&(jy(t),em(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var h=performance.now(),g=!1,d=Math.ceil(h-a),p=n.getDebugInfo(),y=["".concat(i," elements"),"".concat(p.totalInstances," instances"),"".concat(p.batchCount," batches"),"".concat(p.totalAtlases," atlases"),"".concat(p.wrappedCount," wrapped textures"),"".concat(p.simpleCount," simple shapes")].join(", ");if(!g){var m=p.atlasInfo,w=Ct(m),b;try{for(w.s();!(b=w.n()).done;)var x=b.value}catch(S){w.e(S)}finally{w.f()}}}t.data.gc&&(t.data.gc=!1,n.gc())}v(Of,"renderWebgl");var hr={};hr.drawPolygonPath=function(t,e,r,a,n,i){var o=a/2,s=n/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*i[0],r+s*i[1]);for(var u=1;u<i.length/2;u++)t.lineTo(e+o*i[u*2],r+s*i[u*2+1]);t.closePath()};hr.drawRoundPolygonPath=function(t,e,r,a,n,i,o){o.forEach(function(s){return gf(t,s)}),t.closePath()};hr.drawRoundRectanglePath=function(t,e,r,a,n,i){var o=a/2,s=n/2,u=i==="auto"?ir(a,n):Math.min(i,s,o);t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.arcTo(e+o,r-s,e+o,r,u),t.arcTo(e+o,r+s,e,r+s,u),t.arcTo(e-o,r+s,e-o,r,u),t.arcTo(e-o,r-s,e,r-s,u),t.lineTo(e,r-s),t.closePath()};hr.drawBottomRoundRectanglePath=function(t,e,r,a,n,i){var o=a/2,s=n/2,u=i==="auto"?ir(a,n):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.lineTo(e+o,r-s),t.lineTo(e+o,r),t.arcTo(e+o,r+s,e,r+s,u),t.arcTo(e-o,r+s,e-o,r,u),t.lineTo(e-o,r-s),t.lineTo(e,r-s),t.closePath()};hr.drawCutRectanglePath=function(t,e,r,a,n,i,o){var s=a/2,u=n/2,l=o==="auto"?rs():o;t.beginPath&&t.beginPath(),t.moveTo(e-s+l,r-u),t.lineTo(e+s-l,r-u),t.lineTo(e+s,r-u+l),t.lineTo(e+s,r+u-l),t.lineTo(e+s-l,r+u),t.lineTo(e-s+l,r+u),t.lineTo(e-s,r+u-l),t.lineTo(e-s,r-u+l),t.closePath()};hr.drawBarrelPath=function(t,e,r,a,n){var i=a/2,o=n/2,s=e-i,u=e+i,l=r-o,f=r+o,c=ko(a,n),h=c.widthOffset,g=c.heightOffset,d=c.ctrlPtOffsetPct*h;t.beginPath&&t.beginPath(),t.moveTo(s,l+g),t.lineTo(s,f-g),t.quadraticCurveTo(s+d,f,s+h,f),t.lineTo(u-h,f),t.quadraticCurveTo(u-d,f,u,f-g),t.lineTo(u,l+g),t.quadraticCurveTo(u-d,l,u-h,l),t.lineTo(s+h,l),t.quadraticCurveTo(s+d,l,s,l+g),t.closePath()};var Ul=Math.sin(0),Kl=Math.cos(0),Ho={},$o={},Nf=Math.PI/40;for(var Fr=0*Math.PI;Fr<2*Math.PI;Fr+=Nf)Ho[Fr]=Math.sin(Fr),$o[Fr]=Math.cos(Fr);hr.drawEllipsePath=function(t,e,r,a,n){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,a/2,n/2,0,0,2*Math.PI);else for(var i,o,s=a/2,u=n/2,l=0*Math.PI;l<2*Math.PI;l+=Nf)i=e-s*Ho[l]*Ul+s*$o[l]*Kl,o=r+u*$o[l]*Ul+u*Ho[l]*Kl,l===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var qa={};qa.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};qa.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements().boundingBox(),a=this.findContainerClientCoords(),n=t.full?Math.ceil(r.w):a[2],i=t.full?Math.ceil(r.h):a[3],o=ae(t.maxWidth)||ae(t.maxHeight),s=this.getPixelRatio(),u=1;if(t.scale!==void 0)n*=t.scale,i*=t.scale,u=t.scale;else if(o){var l=1/0,f=1/0;ae(t.maxWidth)&&(l=u*t.maxWidth/n),ae(t.maxHeight)&&(f=u*t.maxHeight/i),u=Math.min(l,f),n*=u,i*=u}o||(n*=s,i*=s,u*=s);var c=document.createElement("canvas");c.width=n,c.height=i,c.style.width=n+"px",c.style.height=i+"px";var h=c.getContext("2d");if(n>0&&i>0){h.clearRect(0,0,n,i),h.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)h.translate(-r.x1*u,-r.y1*u),h.scale(u,u),this.drawElements(h,g),h.scale(1/u,1/u),h.translate(r.x1*u,r.y1*u);else{var d=e.pan(),p={x:d.x*u,y:d.y*u};u*=e.zoom(),h.translate(p.x,p.y),h.scale(u,u),this.drawElements(h,g),h.scale(1/u,1/u),h.translate(-p.x,-p.y)}t.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=t.bg,h.rect(0,0,n,i),h.fill())}return c};function am(t,e){for(var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a),i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return new Blob([a],{type:e})}v(am,"b64ToBlob");function Yl(t){var e=t.indexOf(",");return t.substr(e+1)}v(Yl,"b64UriToB64");function zf(t,e,r){var a=v(function(){return e.toDataURL(r,t.quality)},"getB64Uri");switch(t.output){case"blob-promise":return new ea(function(n,i){try{e.toBlob(function(o){o!=null?n(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(o){i(o)}});case"blob":return am(Yl(a()),r);case"base64":return Yl(a());default:return a()}}v(zf,"output");qa.png=function(t){return zf(t,this.bufferCanvasImage(t),"image/png")};qa.jpg=function(t){return zf(t,this.bufferCanvasImage(t),"image/jpeg")};var Ff={};Ff.nodeShapeImpl=function(t,e,r,a,n,i,o,s){switch(t){case"ellipse":return this.drawEllipsePath(e,r,a,n,i);case"polygon":return this.drawPolygonPath(e,r,a,n,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,r,a,n,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,a,n,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,a,n,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,a,n,i,s);case"barrel":return this.drawBarrelPath(e,r,a,n,i)}};var nm=Vf,Te=Vf.prototype;Te.CANVAS_LAYERS=3;Te.SELECT_BOX=0;Te.DRAG=1;Te.NODE=2;Te.WEBGL=3;Te.CANVAS_TYPES=["2d","2d","2d","webgl2"];Te.BUFFER_COUNT=3;Te.TEXTURE_BUFFER=0;Te.MOTIONBLUR_BUFFER_NODE=1;Te.MOTIONBLUR_BUFFER_DRAG=2;function Vf(t){var e=this,r=e.cy.window().document;t.webgl&&(Te.CANVAS_LAYERS=e.CANVAS_LAYERS=4),e.data={canvases:new Array(Te.CANVAS_LAYERS),contexts:new Array(Te.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Te.CANVAS_LAYERS),bufferCanvases:new Array(Te.BUFFER_COUNT),bufferContexts:new Array(Te.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",n="rgba(0,0,0,0)";e.data.canvasContainer=r.createElement("div");var i=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=n,i.position="relative",i.zIndex="0",i.overflow="hidden";var o=t.cy.container();o.appendChild(e.data.canvasContainer),o.style[a]=n;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};pc()&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var u=0;u<Te.CANVAS_LAYERS;u++){var l=e.data.canvases[u]=r.createElement("canvas"),f=Te.CANVAS_TYPES[u];e.data.contexts[u]=l.getContext(f),e.data.contexts[u]||He("Could not create canvas of type "+f),Object.keys(s).forEach(function(Z){l.style[Z]=s[Z]}),l.style.position="absolute",l.setAttribute("data-id","layer"+u),l.style.zIndex=String(Te.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(l),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Te.NODE].setAttribute("data-id","layer"+Te.NODE+"-node"),e.data.canvases[Te.SELECT_BOX].setAttribute("data-id","layer"+Te.SELECT_BOX+"-selectbox"),e.data.canvases[Te.DRAG].setAttribute("data-id","layer"+Te.DRAG+"-drag"),e.data.canvases[Te.WEBGL]&&e.data.canvases[Te.WEBGL].setAttribute("data-id","layer"+Te.WEBGL+"-webgl");for(var u=0;u<Te.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=r.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var c=mt(),h=v(function(N){return{x:(N.x1+N.x2)/2,y:(N.y1+N.y2)/2}},"getBoxCenter"),g=v(function(N){return{x:-N.w/2,y:-N.h/2}},"getCenterOffset"),d=v(function(N){var _=N[0]._private;return _.oldBackgroundTimestamp!==_.backgroundTimestamp},"backgroundTimestampHasChanged"),p=v(function(N){return N[0]._private.nodeKey},"getStyleKey"),y=v(function(N){return N[0]._private.labelStyleKey},"getLabelKey"),m=v(function(N){return N[0]._private.sourceLabelStyleKey},"getSourceLabelKey"),w=v(function(N){return N[0]._private.targetLabelStyleKey},"getTargetLabelKey"),b=v(function(N,_,G,te,le){return e.drawElement(N,_,G,!1,!1,le)},"drawElement"),x=v(function(N,_,G,te,le){return e.drawElementText(N,_,G,te,"main",le)},"drawLabel"),S=v(function(N,_,G,te,le){return e.drawElementText(N,_,G,te,"source",le)},"drawSourceLabel"),T=v(function(N,_,G,te,le){return e.drawElementText(N,_,G,te,"target",le)},"drawTargetLabel"),E=v(function(N){return N.boundingBox(),N[0]._private.bodyBounds},"getElementBox"),D=v(function(N){return N.boundingBox(),N[0]._private.labelBounds.main||c},"getLabelBox"),B=v(function(N){return N.boundingBox(),N[0]._private.labelBounds.source||c},"getSourceLabelBox"),C=v(function(N){return N.boundingBox(),N[0]._private.labelBounds.target||c},"getTargetLabelBox"),P=v(function(N,_){return _},"isLabelVisibleAtScale"),R=v(function(N){return h(E(N))},"getElementRotationPoint"),A=v(function(N,_,G){var te=N?N+"-":"";return{x:_.x+G.pstyle(te+"text-margin-x").pfValue,y:_.y+G.pstyle(te+"text-margin-y").pfValue}},"addTextMargin"),L=v(function(N,_,G){var te=N[0]._private.rscratch;return{x:te[_],y:te[G]}},"getRsPt"),M=v(function(N){return A("",L(N,"labelX","labelY"),N)},"getLabelRotationPoint"),I=v(function(N){return A("source",L(N,"sourceLabelX","sourceLabelY"),N)},"getSourceLabelRotationPoint"),O=v(function(N){return A("target",L(N,"targetLabelX","targetLabelY"),N)},"getTargetLabelRotationPoint"),V=v(function(N){return g(E(N))},"getElementRotationOffset"),q=v(function(N){return g(B(N))},"getSourceLabelRotationOffset"),F=v(function(N){return g(C(N))},"getTargetLabelRotationOffset"),H=v(function(N){var _=D(N),G=g(D(N));if(N.isNode()){switch(Zr(N.pstyle("text-halign").value)){case"left":G.x=-_.w-(_.leftPad||0);break;case"right":G.x=-(_.rightPad||0)}switch(Qr(N.pstyle("text-valign").value)){case"top":G.y=-_.h-(_.topPad||0);break;case"bottom":G.y=-(_.botPad||0)}}return G},"getLabelRotationOffset"),Q=e.data.eleTxrCache=new ga(e,{getKey:p,doesEleInvalidateKey:d,drawElement:b,getBoundingBox:E,getRotationPoint:R,getRotationOffset:V,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),U=e.data.lblTxrCache=new ga(e,{getKey:y,drawElement:x,getBoundingBox:D,getRotationPoint:M,getRotationOffset:H,isVisible:P}),W=e.data.slbTxrCache=new ga(e,{getKey:m,drawElement:S,getBoundingBox:B,getRotationPoint:I,getRotationOffset:q,isVisible:P}),X=e.data.tlbTxrCache=new ga(e,{getKey:w,drawElement:T,getBoundingBox:C,getRotationPoint:O,getRotationOffset:F,isVisible:P}),re=e.data.lyrTxrCache=new Df(e);e.onUpdateEleCalcs(v(function(N,_){Q.invalidateElements(_),U.invalidateElements(_),W.invalidateElements(_),X.invalidateElements(_),re.invalidateElements(_);for(var G=0;G<_.length;G++){var te=_[G]._private;te.oldBackgroundTimestamp=te.backgroundTimestamp}},"invalidateTextureCaches"));var j=v(function(N){for(var _=0;_<N.length;_++)re.enqueueElementRefinement(N[_].ele)},"refineInLayers");Q.onDequeue(j),U.onDequeue(j),W.onDequeue(j),X.onDequeue(j),t.webgl&&e.initWebgl(t,{getStyleKey:p,getLabelKey:y,getSourceLabelKey:m,getTargetLabelKey:w,drawElement:b,drawLabel:x,drawSourceLabel:S,drawTargetLabel:T,getElementBox:E,getLabelBox:D,getSourceLabelBox:B,getTargetLabelBox:C,getElementRotationPoint:R,getElementRotationOffset:V,getLabelRotationPoint:M,getSourceLabelRotationPoint:I,getTargetLabelRotationPoint:O,getLabelRotationOffset:H,getSourceLabelRotationOffset:q,getTargetLabelRotationOffset:F})}v(Vf,"CanvasRenderer");Te.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Te.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Te.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Te.SELECT_BOX]=e;break;case"gc":r.data.gc=!0}};var im=typeof Path2D<"u";Te.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Te.usePaths=function(){return im&&this.pathsEnabled};Te.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Te.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Te.makeOffscreenCanvas=function(t,e){var r;return(typeof OffscreenCanvas>"u"?"undefined":et(OffscreenCanvas))!=="undefined"?r=new OffscreenCanvas(t,e):(r=this.cy.window().document.createElement("canvas"),r.width=t,r.height=e),r};[Bf,_t,Kt,gs,kr,cr,bt,Mf,hr,qa,Ff].forEach(function(t){pe(Te,t)});var om=[{type:"layout",extensions:Rp},{type:"renderer",extensions:[{name:"null",impl:cf},{name:"base",impl:Cf},{name:"canvas",impl:nm}]}],qf={},_f={};function Gf(t,e,r){var a=r,n=v(function(E){Oe("Can not register `"+e+"` for `"+t+"` since `"+E+"` already exists in the prototype and can not be overridden")},"overrideErr");if(t==="core"){if(Ba.prototype[e])return n(e);Ba.prototype[e]=r}else if(t==="collection"){if(lt.prototype[e])return n(e);lt.prototype[e]=r}else if(t==="layout"){for(var i=v(function(E){this.options=E,r.call(this,E),Re(this._private)||(this._private={}),this._private.cy=E.cy,this._private.listeners=[],this.createEmitter()},"Layout"),o=i.prototype=Object.create(r.prototype),s=[],u=0;u<s.length;u++){var l=s[u];o[l]=o[l]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var f=r.prototype.stop;o.stop=function(){var T=this.options;if(T&&T.animate){var E=this.animations;if(E)for(var D=0;D<E.length;D++)E[D].stop()}return f?f.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var c=v(function(E){return E._private.cy},"getCy"),h={addEventFields:v(function(E,D){D.layout=E,D.cy=c(E),D.target=E},"addEventFields"),bubble:v(function(){return!0},"bubble"),parent:v(function(E){return c(E)},"parent")};pe(o,{createEmitter:v(function(){return this._private.emitter=new qn(h,this),this},"createEmitter"),emitter:v(function(){return this._private.emitter},"emitter"),on:v(function(E,D){return this.emitter().on(E,D),this},"on"),one:v(function(E,D){return this.emitter().one(E,D),this},"one"),once:v(function(E,D){return this.emitter().one(E,D),this},"once"),removeListener:v(function(E,D){return this.emitter().removeListener(E,D),this},"removeListener"),removeAllListeners:v(function(){return this.emitter().removeAllListeners(),this},"removeAllListeners"),emit:v(function(E,D){return this.emitter().emit(E,D),this},"emit")}),Ie.eventAliasesOn(o),a=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var g=Hf("renderer","base"),d=g.prototype,p=r,y=r.prototype,m=v(function(){g.apply(this,arguments),p.apply(this,arguments)},"Renderer"),w=m.prototype;for(var b in d){var x=d[b];if(y[b]!=null)return n(b);w[b]=x}for(var S in y)w[S]=y[S];d.clientFunctions.forEach(function(T){w[T]=w[T]||function(){He("Renderer does not implement `renderer."+T+"()` on its prototype")}}),a=m}else if(t==="__proto__"||t==="constructor"||t==="prototype")return He(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return nv({map:qf,keys:[t,e],value:a})}v(Gf,"setExtension");function Hf(t,e){return iv({map:qf,keys:[t,e]})}v(Hf,"getExtension");function sm(t,e,r,a,n){return nv({map:_f,keys:[t,e,r,a],value:n})}v(sm,"setModule");function um(t,e,r,a){return iv({map:_f,keys:[t,e,r,a]})}v(um,"getModule");var Wo=v(function(){if(arguments.length===2)return Hf.apply(null,arguments);if(arguments.length===3)return Gf.apply(null,arguments);if(arguments.length===4)return um.apply(null,arguments);if(arguments.length===5)return sm.apply(null,arguments);He("Invalid extension access syntax")},"extension");Ba.prototype.extension=Wo;om.forEach(function(t){t.extensions.forEach(function(e){Gf(t.type,e.name,e.impl)})});var Pn=v(function(){if(!(this instanceof Pn))return new Pn;this.length=0},"Stylesheet"),Dr=Pn.prototype;Dr.instanceString=function(){return"stylesheet"};Dr.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};Dr.css=function(t,e){var r=this.length-1;if(de(t))this[r].properties.push({name:t,value:e});else if(Re(t))for(var a=t,n=Object.keys(a),i=0;i<n.length;i++){var o=n[i],s=a[o];if(s!=null){var u=nt.properties[o]||nt.properties[An(o)];if(u!=null){var l=u.name,f=s;this[r].properties.push({name:l,value:f})}}}return this};Dr.style=Dr.css;Dr.generateStyle=function(t){var e=new nt(t);return this.appendToStyle(e)};Dr.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],a=r.selector,n=r.properties;t.selector(a);for(var i=0;i<n.length;i++){var o=n[i];t.css(o.name,o.value)}}return t};var lm="3.34.2",Jr=v(function(e){if(e===void 0&&(e={}),Re(e))return new Ba(e);if(de(e))return Wo.apply(Wo,arguments)},"cytoscape");Jr.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Jr),t.apply(null,e),this};Jr.warnings=function(t){return cv(t)};Jr.version=lm;Jr.stylesheet=Jr.Stylesheet=Pn;export{Jr as t};
|